- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
I remember in my first job, I had to extend some SuperbaseV4 code. The entire codebase consisted of controls with names such as 'screen1' to 'screen15'. I had to extend this to 30.
Given two pathways, extending it as it was written, or trying to recode the entire program, I ended up writing a program which I called SpaghettiMaster, that let me GENERATE code like this using wildcards. I think it was written in VB2 or VB3.
This gave me much more time to play Wolf3D instead cut/pasting and typing in numbers at the end of of each each variable. I still have no regrets...
Admin
The homonym problem arises with Microsoft product keys. Q and 9 are hononyms in Japanese.
Admin
Admin
Admin
I'm afraid what the bit setting function would look like.
Admin
Admin
<screams><looks again> APL <screams><runs away>
Admin
This was certainly the most entertaining comments thread in a very long time. This shows why TDWTF comments need an upvote button.
Thanks everyone who participated (even those 1 out of 10 types who don't understand binary).
I vote for a new conventio where comments can be upvoted.
Admin
I couldn't disagree more with your method of counting (out loud) in binary.
Similar to your binary counting, I know it's really common for software developers to read hexadecimal numbers as if they were decimal: e.g. "0x20" is often read as "hex twenty". But in English, the word twenty has a definite meaning. It refers to the number that comes after nineteen, and it should have the same meaning regardless of the number system it's written in. After all, I'm pretty sure the words for numbers in English predate the Arabic numerals we use today.
To me, "twenty" can be written 20, XX, 0x14, etc., but not 0x20. IMO, 0x20 should be pronounced "thirty-two" or "hex two-zero", but not "hex twenty".
After all, you wouldn't pronounce the Roman numeral II as "roman eleven", would you?
I know I'm in the minority here, as pretty much every other software developer I know would pronounce "0x20" as "hex twenty". I still think it's wrong, and I think people do it because it's easier than saying "hex two-zero."
[/pedantic rant]
Admin
I disagree, 18, 1A and 1E are perfectly acceptable as they are. Pronounce them "ayteen", "atteen" and either "eeteen" or "etteen" and if the hearer misunderstands then it's their fault and they need to wash their ears out. Hearing the difference between twenty-A and twenty-eight, and indeed between twenty and twenty-E is merely another challenge of the Third Millennij.
Admin
Just to save a little memory I would prefer
long[] rules = new rules[8]
CAPTCHA: sino "Sì" (yes) or "no"?
Admin
There are 10 types of people: those who understand binary and those who don't.
Admin
The idea of language is communication. If "hex twenty" communicates the idea of number 32 written in hexadecimal notation faster than "hex two zero", and if it isn't ambiguous (which it isn't), then it is also not wrong.
I happily say "ef-thousands" (or its equivalent in my language) rather than "ef zero zero zero", because "ef-thousands" is both faster to say, and it is easier to comprehend how many zeros I meant there to be. In English there would be also "ef triple-zero" but that concept isn't there in my native language.
Admin
With a bit of concentration, you might get that actually right.
Hint: you probably did not intend to read inputInt bits 8 through 1 into rules[0] through rules[7], but rather bits 7 through 0. Or at least I hope so.
Admin
I wouldn't normally bother, but three pages of comments without a single correct replacement for the headline WTF is just too much.
Admin
Fuck off, this isn't facebook.
Admin
Fair enough. However, oftentimes people will drop the "hex" prefix and simply say "twenty", which is ambiguous. Of course, the context of the situation (i.e. reading a hex dump) will normally resolve the ambiguity, but not always. Also, consider that "twenty hex" is arguably more ambigous than "hex twenty", because "twenty hex" could plausibly mean "twenty written in hex" (0x14), or "0x20".
Going back to what you said about communication, oftentimes people will sacrifice precision for speed and efficiency. Another example is that developers (in conversation) will often assume that "100 KB" means "100,000 bytes", even when the context (size of a file as reported by Windows) clearly states otherwise.
Of course, natural language will always have ambiguities, so I guess it's silly for me to complain about this specific one.
Admin
Oh god.
Ponies...ponies everywhere...
Admin
You've got 99 problems, but the bits ain't one.
Admin
4GB on the other hand would have been unusually large amount of hard disk space; at the time, many BIOSes couldn't handle IDE drives of over about 500MB. (Don't ask me whether those are binary or decimal MB, I'm past caring.) SCSI drives were a little better catered for, as you could get up to 4GB or even 8GB boot partition on some controllers. (Once you had booted into Windows NT 3.51 you could of course proceed to access the rest of your SCSI disk.)
Admin
... and those that use trinary.
Admin
Bit late to the party. Here is my version (Perl):
Of course Remy left the following lines at the end of the code:
Admin
Like what? What you want to know is how well something will sell and how much money it will make you, but that can take years and doesn't tell you anything about the effect of any particular employee on the outcome. Figuring out who is doing productive work, who is doing work that will make the customers love the program, who is adding subsystems that no one will care about or use, and who is just plain slacking off is not a trivial problem.
Admin
This works pretty well under the right circumstances. At my last job, I was a project manager and could hire anyone I wanted over the internet, so I hired two teams from two different countries: a programming team and a testing team. The two teams never knew about each other so there was never any incentive to game the system.
Admin
There are actually several things wrong with your code.
Primarily you need std::back_inserter(out) to be able to write to your iterator
out
.out.begin()
in your main() is not a valid OutputIterator (because the vector is empty)vector<bool> is dodgy in the first place. Do not use.
boolify is a template but in your code you are using a std::string iterator so it will never be anything but a char.
The whole thing, i.e. converting to string then back to bool, is the real WTF.
If I still decided to employ to work in my team you'd better change your bracing style. I like readable code without hurting my eyes.
Admin
If you call A,B,C,D,E and F by their names Alpha, Bravo, Charlie, Delta, Echo and Foxtrot you don't get issue, Alphateen doesn't sound like Eighteen. And TwentyEcho doesn't sound like Twenty.
However I think hex powers should be given their own unique names. So 0x100 isn't called "one hundred" nor of course do we call it "two hundred and fifty six" or "hex one zero zero" but a proper new name.
Similarly a naming convention for 0x16 etc. Incidentally it's a WTF in English that the "teen" and "ty" suffixes sound so similar so you can't easily tell between 15 and 50. We'd fix that in our hexadecimal language.
Admin
It isn't StackOverflow.com either. But upvoting comments dates a lot further back than facebook (where liking is actually a rather annoying feature).
I think upvoting comments would be cool if that was the way comments were selected to be featured. (I did finally get 2 of my comments featured a few months ago after years of trying).
Admin
Yeah, sure :/
Admin
FTFY
Admin
Who says that "twenty" means this many: ||||| ||||| ||||| |||||, and not "the digit two followed by the digit zero"?
When a French person sees that number of objects and says "vingt", would you say that he is wrong becaue the correct word for that number is "twenty" and not "vingt"? If someone speaking in French may properly call this number of objects "vingt" rather than "twenty" because he is speaking a different language, then by the same reasoning, why may not a person speaking in hex properly call this number of objects "fourteen" rather than "twenty" because he is speaking a different base?
"0x20 should be pronounced 'thirty-two'". Hmm, let's think about this. Suppose that you and a friend are trying to solve some programming problem. At some point it proves useful for you to read some hex numbers off the screen so he can write them down to check on a calculation or some such.
So you see, let us say, "x10". You would then say "sixteen". You expect him to write "x10". Then you see "x92B4". You would say "thirty-seven thousand five hundred fifty-six". You then expect him to write "x92B4". And so on through the list.
This fails the "remotely resembling practical" test.
Excuse me sir, but you are insane.
Admin
There are two kinds of people in the world: those who divide people into two kinds, and those who don't.
Admin
Look buddy, I admitted it wasn't an entirely reasonable complaint, it's just my personal POV which I recognize is not shared by most. Not sure where you get off calling me "insane".
'Who says that "twenty" means this many: ||||| ||||| ||||| |||||, and not "the digit two followed by the digit zero"?'
Look up the etymology of twenty, and ask yourself which came first: the word "twenty", or its decimal representation in Arabic numerals "20". (Hint: Arabic numerals were invented around 500 AD and were only introduced in Europe around the 10th century). Are you telling me "twenty" used to have a different meaning just because people used to write it as "XX" and not "20"? Of course not!
"vingt" in French and "twenty" in English have the exact same meaning -- they both refer to number you get when you multiply two and ten (by "ten", I mean the total number of fingers, including thumbs, on both hands of a healthy human being.) "Vingt" and "twenty" have always referred to that number, regardless of how it was written down.
The problem (IMO) is that people usually don't distinguish between a number such as twenty/vingt (meaning this many things: ||||| ||||| ||||| |||||) and its written representation (20, 0x14, XX). Which is why when people see a hex number that looks like "20" -- 0x20 -- they think that they can read it as "twenty". But it isn't.
Can you explain why roman numerals are always pronounced as the number they represent and not how they're written down?
In other words "Super Bowl XLVII" is pronounced "Super Bowl Forty-Seven", and not "Super Bowl Exs El Vee Eye Eye".
So I'm crazy for wanting to pronounce 0x14 as twenty (although I admit this isn't optimal), but people aren't crazy for pronouncing "XLVII" as 47?
In fact, I think this definition of "twenty" rather proves my point: http://www.thefreedictionary.com/twenty
Notice that "XX" is an accepted representation of the number "twenty". And so is, I would argue "0x14" and 10100 (binary).
Now, I agree 100% that it's not practical to say "twenty" when reading "0x14". However, I still say it's wrong to read "0x14" as "fourteen", no matter how many people want to do it, out of laziness. My compromise is to say "hex one four". Just call me crazy.
Addendum (2012-12-06 15:31): Long story short: I think the word "twenty" (or "vignt") refers to a number, and not a particular representation of it (decimal, roman numerals, binary, hex).
Addendum (2012-12-06 15:44): I looked it up and Roman numerals were used until about the 14th century. So there was definitely a time when English-speaking people would write "twenty" (or its Old English equivalent) as "XX". Now we write it as "20". The meaning of "twenty" has not changed one bit, because its meaning has nothing to do with how it's written down.
So for people to now say that "twenty" can mean "0x20" or "020" (octal), or whatever, doesn't sit right with me. Yeah, I know in the real world, language is determined by usage and not definitions, but it's the same kind of mindset ("You know what I meant!") that created the "binary-vs-decimal ambiguity" with units of kilobytes, megabytes, gigabytes, etc.
Admin
To answer your question more succinctly, when a French person says "vingt" and an English person says "twenty", they are still referring to the same number. No meanings have been altered.
When a person "speaking in hex" says "fourteen" to mean 0x14, he is talking about a completely different number, and changing the accepted meaning of the word "fourteen", and introducing ambiguity for someone who is missing the context.
I have actually witnessed conversations which go: Engineer A: You were supposed to write "twenty" to that register. Engineer B: I did. Engineer A: No, I meant "hex twenty". Engineer B: Oops, I wrote "decimal twenty". No wonder it wasn't working.
But, I'm the crazy one, right?
Admin
No, I would say "one zero" and "nine two bee four". I would not say (as some would suggest) "ten" and "nine thousand two hundred BEE four" (the latter really doesn't make any sense to me.)
Thanks for snipping my quote to make me seem even stupider than I actually am. The original quote was: "0x20 should be pronounced "thirty-two" or "hex two-zero", but not "hex twenty"
To be fair, "thirty-two" is actually my (distant) second choice, and I'd probably only say it if the actual value is important (as opposed to the way it's displayed/typed.) So my original statement could've been better.
Admin
One last post on the subject and I'm out. If non-techie pointed at "0x10" on a computer screen and asked you what it meant, which explanation would make more sense (from an English language and common sense POV)?
A) "It's another way of writing the number 'sixteen', in a number system called 'hex'. You can pronounce it 'hex one zero'."
B) "It's 'hex ten', which is another way of writing 'sixteen' or what we would call 'decimal sixteen'. Sometimes people just say 'ten', when it's clear from context what they mean."
I would prefer A). Obviously most people prefer B), because it's easier for efficient communication (but with more room for ambiguity.)
Admin
Instead of such looking short cuts, one is better off, doing it right, by using true bit wise operations.
Admin
I think this is an awesome idea, actually. Too bad any proposed "spoken hexadecimal language" would never catch on, for the same reason that the proposed "binary prefixes" kibi-, mebi-, gibi-, tebi-, etc. will never be widely adopted.
I also want to point out to Jay and others, not all developers/engineers have the same standards when it comes to pronouncing hex and binary out loud. I don't know anyone at my company who pronounces binary as though it were decimal: e.g. none of my co-workers read "0100" as "one hundred binary". And I don't have any co-workers who would read "0xF001" as "eff thousand and one". This is despite the fact that they would all pronounce "0x20" as "twenty". Seems that not everyone draws the line for "acceptable pronunciations" at the same place.
I also think it's interesting that this makes at least two instances where engineers/software developers have taken English words/prefixes that were once unambiguous (kilo-, mega- etc. and all decimal numbers) and made them context-sensitive within our industry. No big deal, right? Tell that to Seagate, who lost a class-action lawsuit over "misleading hard drive capacities".
Admin
The "correct" way to refer to x20 is "hex two zero". Part of our schooling at a very young age was in number bases. The teachers were careful to emphasise that 20 is pronounced "Twenty" only when its base is 10. Otherwise it's "two zero base (n)" where n is whatever base it's in. Technically "x20" should be read "two zero base sixteen" but "hex two zero" beats it on many levels. Similarly "020" would be read as "oct two zero".
Your mythical engineers in an earlier conv reading out hex numbers to each other will, if they are sensible, read "x2000$ as "hex two zero zero zero" or (given that the context is clear) just "two zero zero zero" - the reason being that once you're in the groove of reading out hex numbers digit by digit, it confuses the hearer to suddenly get a reading for which he needs to mentally jump to a different paradigm. Following "nine ef ay eight" with "two thousand", for example, is as jarring as driving over a bump.
Admin
Not sure why you're responding to my comment, since I pretty much agree with everything you said. Maybe you should've replied to one of the other comments which said "language is about communication!", "I count binary like this: zero, ten, eleven, one hundred...", "eff thousands is easier to say than eff zero zero zero", or "Who says 'twenty' doesn't actually mean the digit 2 followed by the digit 0" (well it does, but only when "20" is actually meant to represent two times ten. Obviously 0x20 does not represent two times ten.)
Also, the earlier conv between "mythical" engineers was not my example. That was an example given by someone (Jay) who was trying to tell me how insane I was for thinking that it's incorrect to pronounce "F000" as "eff thousands" (for example.)
And just in case you were actually referring to the conversation I actually posted about the confusion between two engineers over "decimal 20" and "hex 20", that actually happened at my workplace. More than once.
Admin
Admin
It wouldn't be such a big deal to me except I've already personally witnessed cases where the ambiguity caused people to waste far more time than it would've taken to just say "hex two zero".
I don't really care whether the lawsuit and ruling were absurd or not (I'm leaning towards agreeing that they are, though). My point is it all stemmed from an abuse of language in the first place.People still complain that "OMG, the disk size Windows reports is different from the disk size specified by the manufacturer!", and I still know at least one IT admin who believes that the difference stems from "unformatted vs formatted capacity". He has no idea about binary vs. decimal prefixes for bits/bytes.
You say engineers used some slang which was never intended to become mainstream. Well, like I admitted before, meaning comes from usage and not what your teachers tell you or what the dictionary prescribes. I know it's futile to stop the meaning of the word "twenty" from changing or expanding, but that won't stop me from believing that "twenty" should only refer to the number you get when you multiply two by ten.
Admin
By the way, even my word "engineers" was too broad. This isn't rocket science. If this were rocket science, engineers would use kilo for 1000 not for 1024.
Yeah, twenty is the number of digits a person has. In other words, it varies from person to person. Some have six on each hand, and traditional Japanese gangsters still often have fewer than five.Admin
Overheard at work today:
This proves two of my points:
Ultimately it doesn't matter, though. People will say whatever they want to say.
Addendum (2012-12-10 15:07): (I write "in decimal" in quotes, because obviously the value of a number is the same whether you write it as 32, 0x20, XXXII, etc. Of course, when we say "thirty-two", we naturally think of the modern-day decimal Arabic numeral representation "32".)
Admin
You mean 8 problems, right?
Admin
Or if it really has to be 1/0:
Admin
OH GREAT. You just made me spit my coffee. :P
I'd love to see the code that interprets the rules array.
Admin
I have 1100011 problems, but bitmasks aint 1 of them.
Admin
I see what you did there!
Admin
I could never actually write code like this, even with copy and paste. Somewhere in the 256 entries, I would make a mistake in one of the ones or zeros, which would make for some rather obscure bugs. So if I had to do this, I would write a shell script to generate it, i.e: