- 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
Now there's a 'holisitic' approach to the problem. One which would make Douglas Adams proud!
------------------------------
If debugging is the process of removing errors,
programming must be the process of inserting them
Admin
This is similar to the choice I give many of my clients (particularly those who are impatiently pushing for shorter deadlines):
You can have it:
<FONT size=4> . Cheap</FONT>
<FONT size=4> . Fast</FONT>
<FONT size=4> . Right</FONT>
<FONT size=5> Choose any two.</FONT>
Admin
a wtf occurs when good engineering goes bad. not just bad engineering....
Admin
Admin
Reading through the comments, it's becoming clear that the programmer had remarkable forsight to use INT. It won't be long before one needs to represent over 256 values.
NULL - ?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
0 - Zero<o:p></o:p>
1 - Yes<o:p></o:p>
2 - No<o:p></o:p>
3 - Not Specified<o:p></o:p>
4 - NULL<o:p></o:p>
5 - NUL<o:p></o:p>
6 - There is NO Value #6<o:p></o:p>
7 - Blank<o:p></o:p>
8 - Empty<o:p></o:p>
9 - Nothing<o:p></o:p>
10 - Nil<o:p></o:p>
11 - Zip<o:p></o:p>
12 - Unassigned<o:p></o:p>
13 - Indeterminate<o:p></o:p>
14 - Unknown<o:p></o:p>
15 - Unknowable<o:p></o:p>
16 - Beyond human comprehension<o:p></o:p>
17 - Maybe<o:p></o:p>
18 - Partially<o:p></o:p>
19 - Sometimes<o:p></o:p>
20 - Yes and No<o:p></o:p>
21 - Says “no” but means “yes”<o:p></o:p>
22 - Quantum mechanical<o:p></o:p>
23 - Missing<o:p></o:p>
24 - Lost<o:p></o:p>
25 - File not found<o:p></o:p>
26 - No Carrier<o:p></o:p>
27 - I forgot<o:p></o:p>
28 - Didn't get the email<o:p></o:p>
29 - The dog ate it<o:p></o:p>
30 - Invalid value entered<o:p></o:p>
31 - Unrecognized value entered<o:p></o:p>
32 - Blatantly absurd value entered<o:p></o:p>
33 - User had head up his/her ass<o:p></o:p>
34 - Non-value<o:p></o:p>
35 - Imaginary value<o:p></o:p>
36 - Drug-induced hallucination<o:p></o:p>
37 - It’s a value, Captain, but not as we know it<o:p></o:p>
38 - This is not the value you are looking for<o:p></o:p>
39 - Value corrupted<o:p></o:p>
40 - Value corrupted absolutely<o:p></o:p>
41 - Untrustworthy value <o:p></o:p>
42 - Downright evil value<o:p></o:p>
43 - Worthless value<o:p></o:p>
44 - Invaluable value<o:p></o:p>
45 - Family value<o:p></o:p>
46 - This isn’t really a value<o:p></o:p>
47 - This isn’t really a field<o:p></o:p>
48 - This is not my beautiful house<o:p></o:p>
49 - This is not my beautiful wife<o:p></o:p>
50 - Error 50<o:p></o:p>
51 - Error 51<o:p></o:p>
52 - Etc.<o:p></o:p>
-1 - Not otherwise specified<o:p></o:p>
--Rank
Admin
It was probably a status so horrible they decided to remove it from their database. Something like "Budget Under Review" or "Flowers in May". So they deleted it, and didn't reseed their identity.
Admin
0 ----> 0000 0000 32 ----> 0001 0000
Just one bit of difference.
Admin
0 ----> 0000 0000 32 ----> 0001 0000
Just one bit of difference.
Admin
Yeah... was thinking one bit of difference must mean 00000000 to 00000001... Didn't really occur to me that it could be something other than the least significant bit...
Admin
00 ----> 0000 0000 32 ----> 0010 0000
Just one bit of difference.
Admin
ummm, your off by 1
0010 0000
Admin
3rd times the charm!!
Too bad your quotes don't work for you :(
Admin
Sorry, I'm a little drunk and seemed to have slurred my typing. I stand corrected. Cheers! [B]
Admin
I kept getting errors, but the answers got posted anyway. Even the wrong ones. :)
Did quoting work this time? Lessee.
Admin
Allow me to play Devil's Advocate, and claim this is actually an amazingly well modelled piece of fuzzy visibility that tells me everything I need to know about the input procedure.
Let's assume we closely modelling a boolean field that may, or may not, have been specified and if specified, may or may not have been specified in a parsable format.
Yes and No are obvious well-parsed cases and the only ones we can really reliably test for.
A case where the field is absent in the input is also modelled -- as Not Specified.
However, what if the parser can't parse the input?
Well, null tells us that the parser was invoked, but there was no data available -- somebody specified the field, but left it blank.
Other informs us we received a declared exception to the boolean case -- "Sometimes" or "Maybe" or some other case that's linguistically related to verity, but has no place in our system.
And Unknown...well, some joker saw the "Is Reportable" field and decided to enter his favorite goalie's name.
Given a reference to this lookup table, I can now report on how many records are true or false...and how many failed verification and why. Not clean, I admit, but powerful.
As for the null and -1 values? Sounds like a braindead contractor underestimating the power of our fuzzy boolean input field!
Admin
Why oh God? Why?
Admin
Pardon my alignment, but I hope it's 8 bytes. 64 bit/8 bits per byte...
Admin
Not to beat a dead horse (too late) but the difference between null and space in ASCII is 1 if you're referring to the Hamming Distance.
(Nobody had mentioned it by name yet.)
Admin
To all those who didn't get it: Zero (no matter how many bits or whether you mean binary zero or ASCII zero) is not NULL. However, many database systems use "is-NULL" bitfields to mark columns as NULL, so the difference between NULL and non-NULL is always the corresponding bit in this bitfield. Depending on the database the size of the row may shrink too, because some database may not allocate space for fields that are NULL. Others might still allocate the space, because when a (fixed-size) field starts on the same offset for every row, then some queries can be done faster, especially when a table-scan, sort or something similar is necessary.
Databases are fun.
Admin
Sir, I bow to your greatness, you got me rolling on the floor in real life
Admin
0 = no
1 = yes
Null = Unknown.
what's the big deal here? Some one just over engineered it. lol
Admin
p.s.: the ASCII 'NUL' also is not NULL -- e.g. I can store an ASCII 'NUL' into a char or varchar field. That field would NOT be NULL! And if you think you're smart, just try it.
Admin
My nomination for #6:
"The truth! You don't want to know the truth!"
Admin
Also, lots of databases use empty strings to store NULL's and a single space to store empty strings, by trimming trailing spaces whenever the value is retrieved. And of course a string is usually terminated by a 0 byte.
Admin
Actually, there are 10 types of people:
<font size=-1>Oh yeah -- self-introduction: been reading for a few months and posted anonymously a couple times; registered a few weeks ago, but didn't actually post until now. Is this where I'm supposed to make my obligatory complaint about the crappy forum software and its lack of a preview button?</font>
Admin
Great list, with plenty of room for expansion! I'm coopting that for my "InsightfulErrorMessages" module in my next Access project! But I have a couple observations. The value for NULL would be:
NULL - "This value intentionally left blank."
and as for 42,
42 - Downright evil value
How can this possibly be so?
That's a great site Stoffel!
You got an extra significant zero there buddy, that's a reverse quote (#96). But isn't that two bits different from a NUL?
Actually this whole table is a WTF! Why is there even a question? You always have to do your TPS Reports!! Didn't you get the memo?<o:p></o:p>
Admin
A bit overdesigned but not especially stupid. If the answer is not a boolean he could have written the text un the Cases table but this version is more secured because of the verification on the FK.
The only two things I don't understand is WTF there is a "NULL" line in the second table. It is a doubled bloom with the "Not Specified" one, and WTF he doesn't enforce the foreign key, since it cause funny things to happend (like the NULL and -1 line) .
I guess this is a lame trick to store an other information in this field, maybe. In conclusion the idea is not so bad but realisation sucks.
Admin
right... but in this 9-bit-per byte representation, the rightmost bit is the parity bit and therefore not significant (j/k)
The original quote was:
Admin
I prefer to give them : Expensive. Unhurried. Wrong. Exclude two.
Admin
let me guess... the contract was for a government agency?
Admin
And don't forget
<FONT face="Courier New" size=2>| 12 | Yuri |</FONT>
<FONT face="Courier New" size=2>(http://www.thedailywtf.com/forums/44872/ShowPost.aspx)</FONT>
Admin
Excellent.
And that's what you get for arguing WTFery with a Sicilian.
(I've gotta watch that again sometime soon)
Admin
I'm betting there's more than one TPS Report... and the field 'Is_TPS_Reportable' is really only *part* of a secret formula that when compared against the lookup, reveals the true business rule of TPS reports.
Also too coincidental - the 'Days Open' field could be resolved to a day-of-the week, which could point to one of options in the lookup table.
Besides, you can always add three to the 'Is_TPS_Reportable' value to fall safely with the range of lookup values, ( albeit you'll never get to 'Yes', probably a ruse ).
There's more here than meets the eye... this smacks of intrigue and secret agents.
Admin
or when bad engineering goes worse ...
Admin
I thought that was "There 11 kinds of people in the world, those that know how to count in binary and those that don't."
Admin
Yup, This could work... Let's first resolve the Days Open value to a day-of-the-week. Let's consider the -1 as a shift between date systems. Some systems starting Sunday, others Monday. With that, Monday(1) is always resolved to Sunday(0). So.. Is_TPS_Reportable will return a true TPS report *rule* when 1 is added at the end.
That could gives us the TPS report business rule:
Monday(1): always report.
Tuesday(2): no report.
Wednesday(3): one of the midweek reports (TBA).
Thursday(4): no report.
Friday(5): always the other report.
Saturday(6): never report. ( nobody does TPS on Saturday)
Sunday(7): waiting for direction from corporate.
Admin
I have a donut hole
Rumor has it quotes work in IE...
Admin
It's not a matter of comprehension, because if you can't comprehend something, it can hardly be said that you know it and, hence, it would be unknown, so that falls into the previous category.
The "not specified" to me clearly means that while the value is known, it's being kept secret. The reasons why this would be is numerous, and I would suggest that the designer refactor the design to include another column in the table (or whatever the "technical" DB term is) with another foregin key that indicates why it's being kept secret, be it national security reasons, being held for blackmail, etc.
(BTW, in addition to the more common WTFs mentioned about this forum software, does it strike anyone as odd that I can post with the name EvanED even when I'm not logged in (purely out of laziness) and despite being registered for a while?)
Admin
Not Specified - implies an option *is* available.
Unknown - implies an option *may* be available.
Null- implies *no* options are available.
Admin
or this:
Not Specified - implies an option *is* available.
Unknown - implies an option *may* be available.
False - implies *no* options are available.
Null - make no implication.
Admin
| 6 | Rows that magically disappear when inner-joined with YN_Lookups |
Admin
OK, this is F'd up, but its not really difficult - just take the rows where the value is 1 ('Yes") and ignore everything else. Sometimes a little judgement goes a long way, Paul! ;-)
Admin
Don't the other values make you the least bit curious?
Admin
To me, NULL is No.
i.e. . . . '\0' is the the same as 0
Hasn't failed me yet, in 20 years of C
"Not Specified" -- "Other" -- "Unknown" would all map to the same thing.
Maybe there should have been
| 8 | Remove from all further consideration
Admin
LOL
And a taxi chit for the printer, too
Admin
Old Printer's Joke.
Bin There. . . not BinLada
Admin
Yessssss Bit is on the bit.
three's a charm!
Admin
Oh Yeah? Tell it to the register!
Admin
Produce a report that will list the Case Number, Officer Name, and Days Open for all remote offices where the case is TPS Reportable. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
This is just a thought that I came up within 30 seconds when I first looked at the problem.<o:p></o:p>
SELECT * From OfficeDetails where Is_TPS_Reportable = 1; or<o:p></o:p>
SELECT * From OfficeDetails where Is_TPS_Reportable = "yes"; <o:p></o:p>
Depends on value that is actually stored there. Who cares if someone placed Null in text field in some other part of the data abase. If you think there is a problem, mention it to them but I fail to see how this is complicated. <o:p></o:p>
Admin
This software truly is a WTF