Something said in confidence that the one speaking doesn't want attributed to him/her. On Pins And Needles: Anxious or nervous, especially in anticipation of something. On The Fence: Undecided. On The Same Page: When multiple people all agree on the same thing. Out Of The Blue: Something that suddenly and unexpectedly occurs. Out On A Limb. You cannot justify doing something wrong or bad just because somebody else has done the same thing to you. Two wrongs don't make a right and just because the boy's friend was not punished for being late, this did not make it right for the boy to do the same thing. Variety is the spice of life.
That is someone criticizing another for an action that hehimself has done or for a characteristic that he himself shares. Itrefers a cooking container criticizing another cooking containerfor becoming blackened through use despite the first containerbeing equally blackened.
The phrase is used to point out somebody's hypocrisy.
On old wood stoves the pot and kettle were usually blackened fromsoot, therefor if the Pot were to insult the Kettle by calling itblack it would be insulting itself in the process since it was thesame.
Therefore when you accuse someone of doing something that you doyourself you are like the pot who calls the kettle black
This idiom refers to a hypocrite or accusing someone of beinghypocritical. If I am lying but call you a liar you could say,Isn't that the pot calling the kettle black. If you are overweightand yet tell me to watch what I eat, I could say, That's the potcalling the kettle black.
example citation:
'But how many conservatives who are targets of such slursknow these liberals are indulging in one of the greatestintellectual ruses in history? How many realize it's a matter ofthe red-faced pot calling the kettle black?'
When someone accuses another of a fault like lying, sloth or greedthis phrase is used to counter accuse. For example, if you werespying on your girlfriend's e-mails and she found out about itwhile she was spying on your e-mails her accusation that you didn'ttrust her could be countered with, isn't that the pot calling thekettle black, since she also has trust issues. This comes from aperiod when pots and kettles were both made out of cast iron, soboth the pot and the kettle were black.
The kettle calling the pot black, both are black, so it refers to aperson who is telling another person that they are doing somethingwrong when they are doing the same thing. for example a smokertelling another smoker that they shouldn't smoke. a thief callingsomeone else a thief. etc
The Pot and the Kettle are both black. Is often used by a personcondemning other people for something they do themselves. So if aperson (the pot) is accusing someone (the kettle) of doingsomething they actually do. They are both actually the same (black)therefore the pot has not right to condemn the kettle withoutactually condemning themselves.
What does thats the pot calling the kettle back mean?
Nothing. It's 'pot calling the kettle black.' That means that the black pot is trying to insult the black kettle by calling it black, when both cooking pots are the same color. This means that whatever the person just pointed out or commented about, the same thing can be said about them. Example: Bob just made fun of Sally being over-weight, if that isn't the pot calling the kettle black! Read More
What does 'don't let the pot call the kettle black' mean?
'The pot is calling the kettle black' is an expression used when the accuser is as guilty as the accused, referring to the fact that both pots and kettles are black. If a rigid person suggests that another person is being 'inflexible,' that is the pot calling the kettle black. Read More
What does pot and kettle mean?
This is a short way of saying the old proverb. The full proverb is 'That's the pot calling the kettle black.' It means someone is judging a person for something that they do themselves. Read More
What does it mean when you dream about a racist kettle?
This dream brings to mind the old saying about 'the pot calling the kettle black.' It suggests that the dreamer might be be seeing faults in others that the dreamer suffers but denies in him/herself. Read More
What does the phrase mean do not call the kettle black?
The 'kettle calling the pot black' refers to a time when kettles and pots were normally heated over an open flame. The smoke from the flames would blacken the bottom of whatever vessel was placed over the fire. Consequently, if a kettle was blackened on the bottom from the fire, any pot placed over the same fire would also be blackened on the bottom. Accordingly, to say that someone/thing is like 'the pot calling theā¦ Read More
Is black and white an idiom?
It depends on how you use it. If you mean literal colors, then it's not an idiom. If you say something like 'It's all there in black and white,' then it's an idiom meaning that something is printed. Read More
What does the idiom no point in mean?
To say that there is no point in doing something means you are calling it useless or wasted effort. Read More
What does the idiom looking as black as thunder mean?
What is the idiom for black?
There aren't any idioms that mean 'black' that I know of. There are plenty of similes, like 'black as the ace of spades.' Read More
What does the idiom get in touch mean?
'In touch' simply means to contact someone in some way - by calling them or writing or emailing or even going for a physical visit. Read More
What does the idiom A black day mean?
'A black day' is an idiom in contemporary English that is relatively uncommon but still quite useful. With 'black' referring primarily to darkness (of night, of a storm, etc.) when there ought to be light, its basic meaning is simply this: 'a bad or difficult day.' Read More
What does the idiom 'in the red' mean?
In debt. Its antithesis, 'in the black,' refers to having a balanced budget. Read More
What does the idiom as black as the ace of spades mean?
This is not an idiom. It is comparing one thing to another, so it is a simile. Remember: 'AS ___ AS___' means A Simile! It is just saying that something is very black. Read More
In cockney slang what does kettle mean?
What does the idiom 'black sheep' mean?
A black sheep is one which does not do what all the other 'sheep' (people) do - a person who does not follow cultural laws and morals, but does whatever they want. Read More
RFP responses idiom what does it mean?
RFP is not an idiom. It's an abbreviation. Read More
What does the idiom what you have in mind mean?
It's not really an idiom. It means 'what are you thinking about.' Read More
What does the idiom itchy nose mean?
It is not an idiom, it means your nose is itching. Read More
What does the idiom in the black mean?
Simply put, accountants record their numbers in different colored ink. Positive balances in black ink (good), and negative balances in red ink (bad). Read More
What does this idiom mean things people can agree on?
What is the origin of the idiom sink or swim?
the origin of this idiom mean fail or succeed Read More
What does this idiom mean tip of your nostrol?
It's not an idiom. It means the tip of your nostril. Read More
What does idiom mean in poetry?
idiom means expression like a page in a book Read More
What does the idiom a hundred thousand dollars mean?
This is not an idiom. It is a measurement. $100,000 is how you write it in numbers. Read More
What does the idiom a slap on the wrist mean?
The idiom a slap on the wrist refers to a trivial punishment. Read More
What does the idiom bird brain mean?
'Bird brain' implies that a person has a brain the size of a bird's (a really, really small one). It ultimately means the person using the term is calling another person stupid. Read More
What does the idiom badjohn mean?
What does the idiom give their all mean?
The idiom give their all means to do everything you can to accomplish a task. Read More
What does penniless the idiom mean?
'Penniless' is not an idiom. It means that you don't have a penny to spend. It's used as an exaggeration to mean that you don't have any money. Read More
Does cordless kettle mean that the heating element is not in cotact with water?
no. it means that the kettle can be unplugged from the electricity source. the heating source is in touch with water, as it is located inside the kettle :) Read More
What does the idiom hanging out mean?
How do you use eternal as an idiom?
Eternal isn't an idiom. It's a word. Idioms are phrases that seem to mean one thing but mean something else. Read More
What does idiom mean 'Suits his idiom'?
I think it means that that person agrees with that others persons idiom and that it fit that question that the teacher or whoever asked that question. Read More
What is the idiom for avoid?
An idiom is a saying or expression. There are many idioms that mean to stay away from, or avoid, someone. An example of such an idiom would be, 'to steer clear of' someone. Read More
What does the idiom nothing will come of nothing mean?
It's not an idiom - it means exactly what it says. If you do nothing, you get nothing. Read More
What does NME IN mean in turns of an idiom?
Nothing - it looks like some kind of abbreviation instead of an idiom. Read More
What does the idiom to take a six for a nine mean?
It is a Caribbean idiom meaning to be mislead and conned into a silly situation. Read More
What does the idiom 'monkey business' mean?
this idiom is similar to 'horsing around'- causing trouble Read More
What does the idiom dressed to kill mean?
The idiom 'dressed to kill' means selecting clothes that will help you get noticed. Read More
What does the idiom penny pincher mean?
penny pincher is an idiom that means a person who is unwilling to spend money. Read More
What does the idiom lost your hair mean?
It's not an idiom because you can figure it out by the context. It means they went bald. Read More
What does the idiom your are tied mean?
Nothing. You have left out part of the idiom. Perhaps you mean 'your hands are tied,' which means that you have no power to do anything in a given situation. Read More
What does heart and soul mean as an idiom?
It's not an idiom. It means what it seems to mean, that someone believes or supports something with all their heart and soul, or their entire being. Read More
What does the idiom fairplay mean?
Fair play is not an idiom - it means exactly what it says. Things are going along fairly. Read More
What does the idiom putting their hands in their pockets mean?
This is not an idiom. It means exactly what it says -- someone is putting their hands into their pockets. Read More
What does the idiom to stretch your arms and legs mean?
This is not an idiom. It actually means to stretch your arms and legs. To take a break. Read More
What does the idiom all future generations mean?
It's not an idiom. It means just what it says - every generation in the future. Read More
What does the idiom listen closely mean?
It's not an idiom. To listen closely means to pay attention and listen carefully. Read More
What do you mean by the idiom -a penny?
'A penny' isn't an idiom - it's just a one-cent American coin. Read More
What does shot full of holes mean in idiom?
The idiom usually refers to a suggestion against which many arguments were presented. Read More
Is there a common idiom for doing something twice, as in the following situation?
I have a feeling that there's a clearer way than introducing a new loop variable counting from 0 to 1, especially since it isn't used except for counting.
(Card
is just some class I made up and not relevant to the question.)
5 Answers
I've got a few suggestions. See the last for my recommendation:
In my opinion
insert(it,
N
, value)
beatsstd::fill_n
:If order isn't important, you could just generate the cards once, and duplicate after the fact
Using a dirty lambda and integer division trick. Warning this has the hallmark of a premature optimization: reduces readability for no good reason.
(assumes
Card
is default-constructible. If not, usecards.back_inserter()
)My recommendation
The following wins in both performance and expression of intent:
You probably want to use the fill_n
function in <algorithm>
Personally I would just leave it how it is. It looks clean, it's easy to understand, and it's quite readable. Just leave a comment mentioning why you do it twice (but you would do that no matter what).
You are right about using expanding the inner loop into statements as using another loop only 2 iterations is going to be bad for performance. Due of the frequent jumps
, the second one (nested loops) is going to perform slowly. Whether there will be any noticeable difference completely depends on the num_pairs
.
So the first one is better for performance(however marginal the gain might be). This sort of expanding loops is called loop unwinding/unrolling
in compiler's terminology. However, this term is not used at programming level as usually only compiler does that to make the code faster. Idioms
are certain design notions
that help programmers write better & efficient code and understand the language better.
If you want to do this very often, write a little utility function:
I wrote an example on Ideone.
Your first approach might be confusing to future readers of your code. They might think that the code was there twice by accident. Using a function like this avoids this confusing.
The performance hit would be very minimal, if even > 0, since the compiler is likely to inline the function and completely optimize out the loop for small times
'. If you're worried about performance, benchmark first.