I don't think the Confucius quote is real, but there are a few relevant ones:
"Not being angry at someone who doesn't know, isn't this a Gentleman?" 人不知而不愠,不亦君子乎?
"Ji Wenzi thought three times before acting. Confucius heard this, and said 'twice is enough'." 季文子三思而后行。子闻之曰:“再,斯可矣。”
In the specific context of his student Zi Zhang asking Confucius about how to get an official salary, he responded: "Hear much and put aside the points of which you stand in doubt, while you speak cautiously at the same time of the others:—then you will afford few occasions for blame. See much and put aside the things which seem perilous, while you are cautious at the same time in carrying the others into practice:—then you will have few occasions for repentance. When one gives few occasions for blame in his words, and few occasions for repentance in his conduct, he is in the way to get emolument." (tr. Legge)
"Not being angry at someone who doesn't know, isn't this a Gentleman?" 人不知而不愠,不亦君子乎?
"Ji Wenzi thought three times before acting. Confucius heard this, and said 'twice is enough'." 季文子三思而后行。子闻之曰:“再,斯可矣。”
In the specific context of his student Zi Zhang asking Confucius about how to get an official salary, he responded: "Hear much and put aside the points of which you stand in doubt, while you speak cautiously at the same time of the others:—then you will afford few occasions for blame. See much and put aside the things which seem perilous, while you are cautious at the same time in carrying the others into practice:—then you will have few occasions for repentance. When one gives few occasions for blame in his words, and few occasions for repentance in his conduct, he is in the way to get emolument." (tr. Legge)