- 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 haven't done straight c in some years but I'm pretty sure that JimmyVile 's code won't even compile due to a typo. In addition I'm very suprised at the misdirected hostility towards the initial code bit. I've seen good coders make similar mistakes, for me the WTF isn't in the code that includes the 10 it's in the fix that simply truncates the result instead of fixing the original problem. It's quite apprent when they ran into the problem of the random extra character it never occured to them there was a problem in the function that generated the result instead opting for the quick fix that just truncated the result. WTF man?
Admin
Those colors won't be web safe!
Admin
I've worked on a system where I wrote code that was receiving an object with a hexadecimal id from another system. The developer of that system told me, "Best treat that id purely as a string and not try to parsing it as a hex-represented number. Sometimes as well as the usual 0-9 and A-F, just sometimes, you get a 'G'."
Admin
Bits are easy. Just try using a std_ulogic: {Uninitialized, Unknown, 0, 1, High Impedence, Weak Signal, Weak Low Signal, Weak High Signal, Don't Care}
FPGAs are fun!
Admin
The whole concept is flawed. Just generate a random number smaller than 0xffffff, and display its hex representation!
A warped mind cannot connect.
Admin
For security purposes, I usually write all the "1" bits to one file and all the "0" bits to another. That way I can just recombine the files when I need to use them.
Admin
or 0, 1 or NULL for those SQL programmers among us.
Admin
The bitchecker is not a WTF. He was just using a Setun. http://en.wikipedia.org/wiki/Setun
Admin
Somehow, I have a bit of a problem with the code given.
Admin
NO SHIT! are you sure?
captcha: transverbero - it's TRWTF
Admin
0x10 words to be exact.
Admin
I think you should count to 0x10 yourself. ;)
Admin
Then how can you afford a shave and a haircut?
Admin
Admin
I sometimes think my bits are in a superposition of both 1 and 0, but whenever I try and look I only see either 1 or 0.
What's up with that?
Admin
Admin
Bits are not addressable, however you can load a byte to read a bit within the byte...
Admin
potato potato
Admin
My goggles seem to do nothing as well. I still see the same unoriginal comment on each post.
Admin
Addendum (2009-02-16 13:52): ...allowing for inflation. Of course, when the barbershop ditty was first written, it would have been 0x0A cents.
Admin
I like shemales
Admin
Bender: Ahhh, what an awful dream. Ones and zeroes everywhere... and I thought I saw a two. Fry: Don't worry, Bender: there's no such thing as two.
Admin
Admin
Because it can!
Admin
Admin
Don't forget Schrodinger's bit - it can be 1 and 0 and the same time.
Admin
Admin
Admin
^^^ Not that one.
Admin
You're going to be in so much trouble if someone runs your program on his quantum computer 50 years from now.
Admin
[EDIT: Argh, he got me! It was a trap!]
Admin
+1. Cut the guy some slack.
Admin
Admin
To that C bunch of code, if I set c to 'a' (or 97 in decimal) I get lots of bit=2 errors, if I print it out what it is giving me, 97 decimal breaks into 01122221. Otherwise it compiles.
Of course, maybe the
is only appearing as ? (or not, as putting [ code ] around this sample seems to work fine...)Switching them from "bit >" to "bit >=" seems to make it work, or at least not print out errors....
Admin
thankyou cpt. obvious
Admin
I was about to point out how the program could be made much shorter and clearer with a loop, but then I saw that someone else had already made that point. Then it occurred to me that there is an even shorter and more efficient solution:
Admin
I don't mean "making a dumb typo or thinko". That has happened to me. I don't mean "staring at something and looking right past the problem". That has happened to me too. No, what I mean is ...
That never happened to me. I never saw a bug, and just gave up, created a crap workaround, swept it under the carpet and hoped it would all somehow be OK. To put it another way, seeing a problem with a piece of code like that, and not adding a line or two that said and making the most basic trivial effort to find out what the problem actually WAS, never happened to me. I think even a beginning programmer should understand the idea of printf-debugging. Hey, you can even single-step through the code in a modern debugger and look at the values of all the variables as they change. The point is, if something is wrong with your data and it doesn't occur to you to try and find out how it got that way, you aren't a programmer at all. You have to ask yourself: if this guy didn't try either of those two techniques, WTF was he doing? Just staring into space and hoping he'd guess the answer? And if he did try either of those two techniques, and didn't see where it went wrong, WTF is wrong with his eyesight?NB: I don't speak C# or Java so I used a C printf instead. Inb4 anyone misses the point by not just taking that as a generic illustration rather than an actual working code sample.
Admin
Bits are not addressable?
Okay, obsolete information time! I guess somebody forgot to tell BFEXTU + friends on the 68020 (and above). Essentially these instructions are able to address the entire[*] memory space as one long sequence of bits.
[*] "entire" on chips with a 24 bit address bus, less with a 32 bit one.
Admin
Bender: Ahhh, what an awful dream. Ones and zeroes everywhere... and I thought I saw a two.
Fry: It was just a dream, Bender. There's no such thing as two.
CPATCHA Tests discriminate against Robots. Robots have rights two!
Admin
It's called 16++
Admin
Not true. The smallest addressable space on noms is a nibble.
Admin
Admin
'For some crazy reason, this individual won't be writing code in this project anymore.'
Wow, have you listened to yourself recently? What do the people around you think of you?
Now, can we have the ball back please?
Admin
As if he could not read a byte and extract each bit?
Admin
I do that too ... did you remember to pad the 1s with 0s and the 0s with 1s so you can put them back together with the 1s and the 0s in the right positions?
Admin
I would. I'd eat it and then ask for seconds. And then polish it off with a tall cool Budweiser. I would do it. .... Hey! What about this?
Admin
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}
Admin
Yay! I made it through the captcha!
But, no no no, you misunderstand. Schrodinger's bit is not 0 and 1 at the same time. It is neither 0 nor 1, until you look at it with the bit verifier program. That's what the bit verifier is for! I question the thoroughness of said program though. Did it only test for 0, 1 and 2? So it would have missed bits with value -1, hm?
Admin
The most valuable bit: http://www.bitburger.com/bitburger_beers/index.html