- 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
[quote user="anonymous hater"]
CYA
Admin
三池 崇史 - Miike Takashi Insert obligatory Mike reference here.
Admin
So you run and you run to catch up with the sun but it's sinking Racing around to come up behind you again. The sun is the same in a relative way but you're older, Shorter of breath and one day closer to death.
Admin
It's still a WTF, but I guess I can explain this. I think this is some kind of "setup procedure". The first time the application ran (meaning the runs table is either empty or has one element made through some installation procedure). it's set to 0. Then, if it is 0, some further installation processing is done (fixing tables or creating files or whatever you like). Then it's set to 1 (at a bad attempt to always make it stay at one) to avoid it from being done again.
Of course, it's still crazy, lousy, bad and whatnot. But at least it kind of makes sense.
Admin
It could be that it is used to test connections. Primrose connection pool has this kind of configuration option. Obviously since they added such feature in Primrose, it is useful to someone in some environment.
Admin
I like the test in that maybe the stupid database did something magical like use a byte instead of a bit and the original programmer was exploiting some undocumented feature of the database. This would then be a different WTF.
I remember when I was first starting to program that I felt like a real rebel using all kinds of undocumented features. Updates usually came along that unfeatured my code.
Admin
TRWTF is that the original author wrote:
"I consider myself to be a fairly inquisitive guy," Aaron writes, "I tend to not just dive in and start changing code without understanding the system architecture and a general understanding of the business rules."
Whereas everybody knows that big legacy applications are turing tarpits in themselves, and only understandable by geniouses who write malbolge with closed eyes.
Admin
See Bit Ran, Ran, Bit, Ran
Admin
Not sure if it's been mentioned but, if it's truly a single bit then bit+1 is the same as flipping it.
Admin
It's not a single bit. It's either 8 or 16 bits, depending on table structure. I read somewhere that the bit data type can be set to numbers other than 0 or 1, but the return value is always 0,1 or null. Which means that the stored value would probably never go above 2 for this code.
Admin
(unless "test" really is short for "test_that_something_worked": although that might be WTF worthy in its own right...!)
Admin
Admin
Admin
This perfectly explains why you can only go forward in that game... "Crap, if we let the player go back, they'll find our limitation!"
Admin
Admin
Admin
Damn! You beat me to it.
Admin
http://en.wikipedia.org/wiki/Null_%28SQL%29
So the creator of the relational database model himself supports a logic that contains "File not Found", as this indicates the reason why data is missing!
Admin
Admin
I've got it running in an endless loop now. I'll let you know.
Admin
Don't you mean "Float=double (precision), Real=single (precision)"? They're both floats, or reals, which is the whole point, Shirley?
The first WTF comes in calling your single-precision floating point type "float" or "real" - "no one could ever need more than 32-bit precision!"
Admin
Admin
Defining a bit as integer from 0 to 1 is definetely wrong, but I'm not surprised to learn that MS-SQL does it like that.
The difference is that if you add one to a bit that's already 1, you get zero (and overflow bit set), but that's not an error if you choose so.
I doubt MS-SQL could handle it like that and that's the error: They don't know or care enough about bit operations to make them work correctly.
Admin
So, to summarise, there are four states in tri-state logic: *Yes *No *Maybe *Null *File not found