- 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
Sure it did. Once, when I was 6 and still believed in ghosts and monsters, I heard about HEX NUMBERS and thought they cast a spell; I couldn't figure out how to make the right words to make it work right, though.
By the time I could actually get a job (at 12), I knew that the valid hex digits were only 0-F and did not include '10', 'G', or 'V8'.
Admin
"For "some crazy reason," the output could be up to twelve characters."
No, it could not? Always 6 unless the "10" is included, then 7...
Admin
Um, nope. Bits and bytes on disk too, I'm afraid, so just 1s and 0s.
Button up, now. It's cold out there.
Admin
Do you start "how to use common sense and thought to learn to grasp humor" in school soon? Like, maybe next year in third grade?
Admin
Admin
Why? So that when the programmer doing the compiling is done you can unplug the computer and plug in your vacuum?
Admin
Admin
What did you say the purpose of the BitVerifier app was in the helpfile? "To prevent Bender from having nightmares reading this program"?
my GOD, have you ever heard of a bitwise operator? I don't think you have. Or possibly you're just being extremely sarcastic and I missed it.
(assuming you read the whole file into a buffer large enough to fit it, not going to complicate things with a chunk based file reader...)
Admin
You do know that modern compilers will optimize that to ++16, don't you?
Admin
[quote user="Erik"][quote user="Someone"]The real WTF here is that you wrote a utility that looped though files checking if each Bit is a 1 or 0...
Am I missing something or is that kind of redundant? ]/quote]
Agreed. This story makes no sense. It would make sense if the author wrote a program to hash a file's contents and verify it against a list of pre-determined values. But to read a bit in memory and make sure it's 0 or 1. WTF? That's like checking batteries to make sure they only have positive and negative terminals.[/quote]
I've made an appointment at the shop for both of you to have those broken humor detectors repaired, although I'd suspect they're so badly damaged they'll require replacement instead. I hope your warranty is still good, although they've probably been broken so long that it's run out.
Admin
Gee, thanks! None of the other thousand readers would have been able to figure that out on their own, much less already have posted about it!
GUYS! We finally have a real genius among us! Who's buying the first round to celebrate?
Admin
Your understanding is plain wrong. The sb could contain 7 characters if one of the matches was the erroneous value "10", which is 2 characters long. Or it could be 12 characters wrong, if the "10" value was fetched each of the 6 times the array was read.
Admin
Unless the "10" comes up more than once, in which case it's more. What happens if "10" comes up all 6 times? Is "101010101010" 6 or 7?
If you're going to reply, think first. You don't look so foolish that way.
Admin
(And it'd help if I didn't wait so long before hitting 'Submit'.)
Admin
Try humming, or knocking, or honking "Shave and a haircut". Your "two" bit will soon follow.
Admin
Admin
No, the real WTF is that he didn't declare 0 and 1 as variables. What a poor programmer to hard code numeric values into their code.
#define BIT_ZERO 0 #define BIT_ONE 1
You know, in case they have to change in the future...
Admin
Admin
(inb4 "no u, pedant")
Admin
I think they have special code in tabkit to generate the most vile and unrestful colours possible. It's definitely not random across all values.
Admin
The desktop publishing software used by Wired Magazine?
Admin
The real WTF is that even after four pages of comments, nobody has noticed the typo in the original coder's comment.
Admin
Admin
Admin
Why do you think a random generator cannot generate the same number multiple times? A true random generator could generate 6 times "10" in a row, with a probability of 1/17^6. I'm pretty sure a pseudo-random generator would never do this, however to do it 2, or maybe 3 times (so having a length of 8 or 9), is possible.
Admin
Admin
Seriously though: if you find yourself writing a disclaimer that amounts to "Oh shit, I know I'm being gullible", you really ought to stop and think again before you hit "submit".
Admin
Then again, I know I'm being gullible.
Admin
The good thing about this wtf is that, unlike some of the previous ones with lots and lots of code, this one's easy to understand.
For people that don't ever do much/anything with hexadecimal, the initial mistake is almost excusable. That the person did not catch it upon testing, and that they chose to hack-fix it with the substring job is not excusable.
-- Furry cows moo and decompress.
Admin
But maybe I was too subtle.
Admin
Reminds me of when I was a kid and my first grade teacher was wondering what was wrong with my home life... when I counted in school it was like this: "... nine, ten, jack, queen, king..."
Admin
TRWTF is that setColor takes a string as an argument.
Admin
baker's hex
Admin
Admin
And er, zero as well perhaps?
Admin
I love how these things always say "this individual won't be writing code in this project anymore". So we fire someone when they do something wrong?
Admin
Sometimes there are reasons why some ppl NEVER should try to do programming...
I think this case is pretty clear on that.
Admin
Wouldn't the 'two' bit be the second least significant bit ?
Admin
Admin
WTF. Since when hex numbers started having "10" as valid value. The valid values should be 0-9 and A-F (representing the base 16). 0-10 and A-F will be 17 different numbers. Good that programmer is out of project.
Admin
No, I pad my 1s with 1s, and my 0s with 0s ... is that not right? On the upside, it does make them more easily recyclable ...
Admin
"2bit" is the value of your BitVerifier. :)