- 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
{0, 1, 404} ?
Admin
But -1 is a valid bit value on systems where bits are signed - the range is -2^(1-1)..2^(1-1)-1 instead of 0..2^1-1. He should test to make sure they are between BIT_MIN and BIT_MAX.
Admin
There are exactly 10 types of people in the world. Those who know binary, and those who don't.
Admin
suppose you have 0000 1111 = 15 what about 0000 1112 ? I guess that would make it 16? If you can only read bytes, you will read 16 and think it's 0001 0000.
The whole point of the BitVerifier is to find the unusual case of non-bits, assuming a byte is made out of bits will defeat the purpose of the verification process.
Admin
Google for "Boolean lattice"
Admin
Admin
Admin
Admin
Admin
... I think this unit has a malfunctioning sarcasm unit.
Admin
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.
Admin
Hah! You young whippersnappers! Why in my day, we didn't have ones and zeroes! We had to use the lowercase L and uppercase o for our bits!!
Admin
Admin
Admin
Admin
two bits.
Admin
Yeah this guy will grow up into a beautiful flower that will never fix bugs and code around them. Kinda like these guys:
http://3laws.wordpress.com/2009/01/19/the-first-rule-of-fail-club-is/
Admin
The problem with the code is that hexadecimal doesn't include "10". 1,2,4,5,6,7,8,9,A,B,C,D,E, and F are the only valid hexadecimal numbers.
Admin
I, uh, think that was the point of saying that.
Admin
Yea; like the program I wrote to search for 8 1/2 bit bytes. ;->
His code does remind me, however, of a published "craps" program from some years ago that computed... sum = randomGen.nextInt(7) + randomGen.nextInt(7) and then tried again whenever 'sum < 2'.
The odds in that game were a bit off, making the game quite a bit less fun. :-[
Admin
[quote user="Craftsman"][quote user="Code Dependent"] Hah, you haven't been in computers long have you? They are Binary! So ranges are always some multiple of 2: {0, 1, FILE_NOT_FOUND, EOF}[/quote]
Actually, it's {0, 1, don't care} http://en.wikipedia.org/wiki/Content-addressable_memory#Ternary_CAMs
Admin
CAPTCHA: uxor - You XOR'd?
Admin
There are only 10 kinds of people - those who get binary numbers and those who don't...
Admin
You are leaving out many valid error values, including: COMPUTER_ON_FIRE, COMPUTER_OFF, CTHULU
Admin
darn, you bet me to it... and I too posted it before reading all other comments... ah, well ... shrug
;o)
Admin
You don't say...
Or perhaps my sarcasm detector needs some serious recalibration...
Admin
I heard they didn't even have bits back then...
Admin
Only if it is locked inside an opaque crate or cell and you haven't opened that yet... and it would not really be 0 and 1 at the same time, but more like "smeared out in equal parts", as Schrödinger put it.
Admin
But naturally it is not { 0, 1, Maybe }
Admin
Wait, what exactly does the length of HEX_STRING_VALUES have to do with the length of sb?
If HEX_STRING_VALUES happened to be the entire alphabet - 26 characters - then each character in sb will have 26 possible values...but sb should still contain exactly 6 of them, because the loop should always be executed exactly 6 times.
Or is my understanding of the code just plain wrong?
Admin
Bender: "Ahhh, what an awful dream. Ones and zeroes everywhere...[shudder] and I thought I saw a two." Fry: "It was just a dream, Bender. There's no such thing as two."
Admin
Did you really need to explain the problem to us?
Admin
Does no one remember the TMS34010?
Admin
Woah, I just got major flashbacks from my gradiuation a few years ago. I had the pleasure of working with the Virtex II (or something like that)
Admin
The real WTF is that people do not learn the basic language features/libraries.
It's all in the standard 'java.lang' package!
And to have the same formatting:
Admin
It's all in the standard 'java.lang' package!
or
/bored //so bored
Admin
No it is not.
is 2 ^ 24 or the upper value to have 6 hex digits. Integer.MAX_VALUE is 2 ^ 31 - 1, which is 0x7FFFFFFF (8 digits)
//annoyed by bored guy
Admin
Of course you can have many elements in your booleans, but the number must be a power of two!
So {0,1,FILE_NOT_FOUND} is evil and against the law of nature. Just add another 2*FILE_NOT_FOUND+1 elements and you're alright.
Captcha: illum, just what I need.
Admin
OMG go parse this string: F107C10
Admin
Whooosh
Admin
Admin
The correct sequence is 2, 4, 6, 8, motorway...
Admin
Just like four shaves and haircuts cost "two bits, four bits, six bits, a dollar; all for the [fill in favorite team here] stand up and holler."
Admin
Admin
Admin
His name is "Obvious". Recalibration indeed.
Admin
you forgot the duct tape
Admin
Addendum (2009-02-17 08:26): Of course, it would help his cause slightly if he'd included "3"...
Admin
Let me guess. Your job is probably not computer related, and if it is something computer related, it's something like unpacking the boxes in Best Buy's warehouse so the display shelves can be stocked, and sweeping the floor once the shelves are full. Am I right?
Admin