- 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
For WTF completeness sake shouldn't it be TRUE,FALSE,FILE_NOT_FOUND,TRUE_NOT_FOUND,FALSE_NOT_FOUND ?
Admin
Admin
This is a pretty standard thing to do. I'll add the implicit values here:
enum TRI_STATE { TS_UNKNOWN = 0, TS_MORNING = 1, TS_EVENING = 2, TS_INTRADAY = 3, TS_NO = 4 };
const char* TRI_STATE_STRINGS[TS_NO] = { "Unknown", "Morning", "Evening", "Intraday" //wtf is an intraday? };
captcha: damnum - root of dayum
Admin
Be careful. Do not call up that which you cannot put back down.
Admin
Clearly this code was written by Ben Folds.
Admin
It's Fibonacci-driven.
Admin
What can I say? I just cannot remember names and titles. Numbers are fine.
Admin
Isn't that 'bleen'?
Admin
This ^. Seriously. Everybody is assuming TRI means three, but there is no reason to assume that without seeing it in context.
Admin
Admin
I thought the values of TRI_STATE where "New York", "New Jersey", and "Connecticut". Until I moved to Ohio, anyway, when I learned that the values are "Ohio", "Indiana", and "Kentucky".
I wonder if every place where three states meet, the people refer to it as "the tri-state area".
Admin
Admin
I wonder if "INTRADAY" was supposed to be "INTERDAY". Maybe this is the least of the nonsensical things here, but how is morning versus evening versus "within a day" a mutually-exclusive set?
It's like some of those slanted poll questions you here. Like I heard one not long ago where they asked, "Do you think Congress should pass the president's XYZ bill, or do you think this is not an important issue?" Like, there was no choice at all for, "I don't think it's particularly important but sure, this is a good bill." Or more likely, "I think this is a vitally important issue but the president's proposal is in the totally wrong direction and will make things worse". Or even "I think the file is not found."
Admin
CAPTCHA: nisl, which seems strangely appropriate.
Admin
Admin
Admin
What's so weird about a Trading Session Indicator type?
Admin
Admin
I think it's been influenced by Monty Python and the Holy Grail.
1, 2, 5!
Admin
It's not a bad practice to have UNKNOWN/NONE as first value in an enum and MAX/MAXIMUM/MAXVALUE as last value in an enum. Although in my language of choice (C#) you can have nullable enums so UNKNOWN/NONE becomes less necessary. Conclusion: not a WTF.
Admin
... intraday... no.
Admin
If you want to be extra clear, as many government and legal documents desire to be, use 12:01 and be done with it. If you want more on time, http://www.nist.gov has lots of information on time, as they are the keepers of the standard.
Admin
Admin
I'm thinking that needing to automatically calculate the number of values in a tri-state is still a little WTF-ish.
Admin
Unidentifiable to you != unidentifiable to somebody familiar with the system. It might be completely obvious in the context of the actual application.
Admin
Maybe, but for statistical analysis, makes sense to pass the data and range to a routine that can analyze the discrete values for the given data.
TS_UNKNOWN, // = not set, or legacy data TS_STATE_1, TS_STATE_2, TS_STATE_3, TS_COUNT // pass this value, along with results pointer to summarize
In some contexts, the above is entirely defensible design.
Admin
Admin
Admin
Admin
No, the enum holding all of the US states started as 13-state.
Admin
Ah, but Congress can't pass any President's bill, despite what popular media often says. The President can't introduce any bills.
So the poll is even more useless! (and I'm sure you're aware of the distinction, but often the folks taking such polls seriously aren't.)
Captcha: haero: Late at night I toss and turn and dream of what I need / I need a haero / I'm holding out for a hero 'til the end of the night / He's gotta be strong
Admin
For the same reason, when playing 20 questions, choose "The Mississippi River" so that when you are asked "Is it East of the Mississippi?" or "Is it West of the Mississippi?" you can answer "No" to either and really mess with their heads, especially since the asker usually only asks one of those. Bwa ha ha.
Admin
So, you're saying that it's an intentional minor inaccuracy (treating one single moment as P.M. when it's actually just M.) for the sake of allowing practical, convenient notation without being inaccurate about the remainder of the hour? I can buy that...
Or just use 24-hour time. I've been doing it for years, since I think it just makes more sense than 12-hour time, and the only difficulty has been keeping from being diverted by the 12-hour convention so many other people insist on using.(...that turn of phrase is a joke, by the way. I know it should be obvious, but if I don't say so explicitly, it's almost certain that someone is going to attack me as being even more arrogant than I actually am...)
Admin
You fool! You now have to kill not just the previous commenter, but everyone who's read this whole thread. You'd better get going or you'll never finish.
Admin
Admin
"Tri-State" isn't even a real word.
The correct term is "Troolean" where enum myTroolean { CAT_ALIVE, CAT_DEAD, CAT_UNKNOWN; }
Admin
I really like the TS_NO
Admin
Because you forgot the FILE_NOT_FOUND_NOT_FOUND
Admin
I see how this comes about really easily:
You're a developer. I've been asked to track appointments, or service requests or something. You generally only give out if it'll be in the morning or afternoon; and some customers don't care when it is. You create a default/unknown value to hold it in it's initial state, so you can check to see if it's not selected for any reason.
Then your application hits test, and the Director of Marketing asks what happens if the customer doesn't want to pick one. You, knowing you covered this, explain that it's easy to just pick the 'Whenever' option, and have done with it. But now that you've called the Director of Marketing out in your demo meeting on this, she will insist that you need a NOT SELECTED option. You rage, run back to your enum, slam some crazy value in there, associate a drop-down with it, and viola, a useless unused option.
Admin
Just as the name indicates. There is nothing better than self-documenting code.
CAPTCHA: dolor; that's just what I feel right now...
Admin
Well, in German it's relatively easy: you refer to 12 o'clock midday and 12 o'clock midnight.
CAPTCHA: secundum, now, do seconds count or not?
Admin
y = 2x -1 seems simpler
Admin
This in the Tri-State Area Dr. Doofenshmirtz wants to destroy.
Admin
A very nice thing for those of us lucky enough to get one.
;-)
Admin
It obviously means "during the day", so we got "in the morning", "in the evening" and "during the day".
Could also simply be "noon".
Admin
Admin
Admin
Ah, yes, I forgot that on thedailywtf.com the simplest method is always most common.
Admin
Woah, woah. IDDQD is degrelessness mode, aka god mode, taken from "Delta-Q-Delta". IDSPISPOPD was no clipping mode aka the ability to walk through walls, taken from "smashing pumpkins in to small piles of putrid debris". Of course, for Doom 2: Hell On Earth, the developers noticed that it was a really annoying cheat so they changed it to IDCLIP.
Admin
Curse you, Perry the... oh, hello, who are you?