- 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
Jesus...
Admin
"// TODO: fix this before january 19th, 2038 at 03:14:08 UTC"
Thinking ahead!
Admin
Why, actually? AFAIK, parseInt is not limited to signed 32 bits, and 10 decimal digits will not overrun for many more years.
Also, what kind of name is PastorGL? Isn't that the Christian version of OpenGL?
Admin
/\s*(mon(day)?|tue(s?day)?|wed(nesday)?|thu((rs)?day)?|fri(day)?|sat(urday)?|sun(day)?)\s*/gi
Obviously matching the abbreviations as well as the full days, but I'm bothered by Tuesday and Thursday. I'm thinking the intention is to match Tue, Tues, or Tuesday, likewise to include Thurs. Reasonable. But unless I'm somewhat confused, it looks like it's actually matching Tueday and Thuday.
Admin
Tueday? Thuday?
Admin
Does pastorGL really really like The OpenGL Superbible?
Admin
I wouldn't desecrate so much that code. Smells like some poor bastard FE developer that had to deal with BE developers that couldn't care to agree to stick with a specific format.
Admin
Funny. The regex that removes "at" and "on" from the date string has no word boundaries (\b). The preceding \s* does not help since it will effectively match empty strings. The regex would end up chopping out "at" and "on" from the middle of words.
Then the weekday elimination regex would fail to get rid Mday and Surday =)
Admin
I thought the rule was: When you can't parse JSON, tell the server guys to bloody fix it.
Admin
Whenever I find code that redefines a variable and uses two different coding styles for the two definitions, I immediately flag it as needing rewrite.
Admin
It doesn't even handle the obvious
json.dumps(time.gmtime())
Which gives you the perfectly reasonable
[2017, 2, 20, 19, 26, 47, 0, 51, 0]
encoding of struct_time.Admin
PastorGL is much more forgiving of bad coding than regular OpenGL.
Admin
As an ISO-8601 formatted string, of course. Because in a text-based data interchange format, doing anything other than following the standard is a clear sign that you're an incompetent fuckwit who shouldn't be allowed near a keyboard.
Sadly, there are plenty of those around. :(
Admin
My old multilingual wristwatch would tell me "DIE" every Tuesday, but for the more agressive Frenchpeople, it could be switched to say "TUE" (which, if memory serves, is the imperative of "tuer", to kill).
Fun fact: the standard unix at daemon can take many date specs on the command line, including oddities like "teatime" and "midnight". It can also tell what it parsed the date as and will tell you "Tue Feb 21 23:00:00 2017" or whatever. Guess which format it will actually not take on the command line.
Admin
Nice use of a meme at the end
Admin
DIE, as in DIENSTAG? what would french be?
Admin
This code must die. A slow, painful death.
Admin
"DIE, as in DIENSTAG? what would french be?"
"Mardi", but of course "Tue" comes from English.
Admin
Not quite as brutal as "die", but then "mar" is redundant as the code is badly marred as it is.
Admin
Code sob.
Admin
Jason doesn't appreciate your insulting choice of date format. [Restore] [Restart] [Quit]
Admin
It's moments like these I like to use MomentJS, let them do all the heavy lifting for me :)
Admin
Nice one! And so the cycle completes, it's the ciiiiiiiiircle of strii-hi-hi-hife.
Admin
Nonono, this is german and means "The Bart, the".
Admin
TRWTF is why not just pass a date format mask along with the date string? Its all in-house code, no?