- 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, Robot
Admin
Admin
Admin
Admin
Do we get to have a discussion about whether or not 1 is a prime number?
Admin
I keep thinking that that getSelf() method should be Private. After all, wouldn't you want to be private while doing some sort of self exam?
Admin
At last, the explanation to all the Bert Glanstrom comments!
Admin
Maybe that code path is only taken if 1 == 0?
Admin
Admin
And TRWTF is a triple-simul-post... or me just not refreshing in the few seconds it took to type my comment.
Admin
If by prime they mean divisible by itself, 1, and 5 then yes, 215 is a prime number.
Admin
"... 3. is for lucky :)"
priceless <3
Admin
Come on, who among us hasn't sat debugging something so long that the logical conclusion is a conspiracy? Paranoia is the natural mental state.
Admin
Fixed?
Admin
Well, it is only integer factorable to 1 and itself so, yes, 1 is prime.
However, random it is not.
Admin
I like the way there appears to be a dedicated error code for "not running in the correct Universe". I'd have gone for -42 instead of 17 but well done anyway. Wait, can you pass negative exit codes? I suppose it doesn't matter, if that error code ever gets returned we have to assume that the apocalypse is upon us.
Admin
Well itself 1, 5 and 43
Admin
Right. Because in your universe fprintf() doesn't need a file pointer.
Admin
I just got done refactoring all the references to logError to wtf and checking it into the application.
Admin
Here's another bit of code that I came across recently, taken from production code, of course!
Enjoy!
Captcha: feugiat - contrapuntal Fiat
Admin
Admin
The standard formulation of the Fundamental Theorem of Arithmetic requires that 1 not be considered a prime number.
Admin
I rolled a die while reading this
Admin
Somebody missed the day when they talked about variables having finite space in memory and not being drawn out of the ether.
Admin
For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says: <NoComment>For those unable to read this comment, it says:
Admin
Actually I think I know what the ISelfAware is trying to achieve - bypassing the proxy logic and pass a direct reference to the original java object when instantiated within the same JVM. Messy and badly named... but I worryingly believe I understand what they meant to achieve (i.e. a badly thought out early optimisation)
Admin
Admin
Dear cynical cinic,
In case you can’t tell, this is a meta-joke comment. The fact that you insist on bashing people who beat old memes clearly shows that you’re too mature and too intelligent to be posting on TDWTF.
Go back to your Starbucks.
Sincerely, Bert Glanstron
[Captcha: commoveo - The people's SUV!]
Admin
Admin
Admin
I think certain versions of Linux have included the line
if(false)panic();
just to verify that boolean logic is operating correctly.
Admin
ironically, your comment contains many comments.
Admin
No, because it's also divisible by 43 :)
Admin
Actually, no, it's bloody Akismet, which wouldn't let me post the source of the mangled link in the article because it looked spammy, but is perfectly happy to let me post this link http://pastebin.com/J5tAekpK to the post content instead.
Admin
Admin
OK, you out-nerded me there (that's not difficult, btw). You could also come up with some #define scenario that would allow that (or a user function prototype). However, snippets posted on TDWTF is supposed to be professional production code, so please don't mention Matlab. Additionally, those aren't Matlab comments, are they?
Admin
public static NOT_RANDOM_NOT_PRIME_BUT_PROBABLY_NOT_A_NUMBER = 215
Admin
Admin
Do we get to have a discussion about whether or not 1 is a number?
FTFY
Admin
(IV + I) - V = ?
Admin
And don't forget the code I found a very long time ago, in the Technical Reference manual for the IBM PC/XT (or maybe it was the PC/AT - I said it was a long time ago). This was the time when IBM published the assembly source of the BIOS in the Tech Ref manual, and the first few instructions executed after the escape from 0FFFFh:0000-land[1] consisted of stuffing a value into one of the machine's 16-bit registers and proving that it could be passed from register to register, hitting all of them. If the original value did not emerge at the other end, the BIOS panicked.
[1] All versions of the 8086 processor family start in something that approximates to the 8086's real mode (exception: the 80376 started in protected mode as it was an abortive attempt to get away from real mode. It failed in the market) at a 16:16 address of 0xFFFF:0x0000. They have 16 bytes to jump somewhere else before they fall off the end of the world and start executing the real-mode interrupt vector table. It is a really good idea to make sure that this part of the BIOS ROM contains just a far jump.
Admin
Also divisible by 43 - really a good example of a random prime number!
Admin
FTFY
Admin
All that, of course, does not change the fact that there is no way to use Roman number-recording-notation to write zero.
Admin
Really, some people know nothing about programming.
Admin
Do we get to have a discussion about whether or not I am a number?
FTFY
Admin
and now it is all clear. whew.
Admin
There is also a way of doing arithmetic with Roman numerals:
http://mathforum.org/dr.math/faq/faq.roman.html#calc
BTW Askimet is a fucking idiot - can't put URL tags round this^^
Admin