- 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
Finally, a perfect way to detect JS.
And there I was being a pansy by using progressive enhancement :)
Admin
JS? Progressive enhancement? Pah! Java applets are where it's at!
Admin
Not a Javascript coder, but the original comment was about needing a few extra lines of code. Even with the extra Math.floor() call the code is still pretty easy.
Admin
Ya gotta watch for these things. They can get recursive on you.
Admin
Whoosh!
May want to get your humour detector calibrated...
Admin
That's not available in Javascript. It is, however, part of the Objectivist-C standard library.
Admin
Who knows what about what now?
Admin
Admin
Which I suppose, from an Objectivist point of view, is sort of the point.
Incidentally, there's a rather nauseating essay prize offered by the Ayn Rand Institute for college students who wish to become a future Chairman of the Federal Reserve. Something about Jesuits and young children springs to mind, here.
Admin
Actually I the other day I was using javascript's random function and noticed it's really badly implemented, or at least the seed is.
I was calling it twice in rapid succession, and they (the two calls) always gave the same number, ALWAYS. As if it was based on the current time, but in some kind of weird and wrong way.
I actually did replace that instance of generating a random number with one PHP function call (quite like the 'WTF') because it yielded better results. I have no idea if the PHP random is any better or if it's implementation is really rubbish, but at least two successive calls don't give the same number (and because it involved displaying images, the javascript one always displayed the same images).
So not really a WTF in my eyes.
Admin
at least he didn't use short open tags, right?
Admin
Now now, assuming makes out of you and me.
stop encouraging people to be smart, or else this site will run out of inspiration for articles... oh wait..
CAPTCHA: enim Who knew the captcha generator was capable of typos?
Admin
It's not failure.
It's deferred success now.
Admin
It's a WTF. Your eyes need testing.
Squint a bit at this.
Admin
64 comments and that Bim Job guy hasn't complained about PHP or the people who use it yet? It's even an article about PHP. What gives, dude?
Admin
Surely a server-side rand is a different animal from a client-side rand?
Admin
Because Javascript's Math.random() returns a float between 0 and 1. Obviously the person that did this didn't understand multiplication...
Admin
really? you find $5,000 nauseating?
Admin
Better stated, there's a rather nauseating essay contest run by the Ayn Rand Institute...
Third attempt
Admin
Praytell, why would the caching situation be any different if they were using Javascript for this?
Like, if you add a URL param in the JS, the browser, "hah! a URL param! That JS, always kidding around!" and loads the cached copy anyway?
Admin
If the value was intended for consumption by the SWF, it'd be in a FlashVar, not in a URL param. Unless the SWF IS looking at the URL param, in which case that's The Real WTF.
To me it's obviously a poorly-implemented cache-buster.
Admin
[quote user='elektronaut']Not to mention the fact that Flash has Math.random built in.[/quote] To you and others who said the same:
This is true, the current, and many recent, versions of flash have Math.random. However, I recall a time when there was no Math library (no library structure at all, it was entirely functional). I recall a before time when Flash had no random function anywhere.
Since the codebase referenced is old, likely the Flash is similarly old. And, unlike PHP/JavaScript, Flash is possibly unfixable since the source != the execution code.
Admin
"Michael was tasked with updating some of code"
Yeah, it's still there. Damn - you had my hopes up for a minute...
Admin
I just like the way Google translate says:
...there's something comforting in the fact that my appalling school boy efforts at Latin translation cannot be surpassed by a few million dollars of hardware and software.
If only I could have had that excuse for Mr Parr 20+ years ago.
Admin
this piece of code is to prevent ie from caching the flash movie and not initializing the flash behaviour
Admin
Admin
Well, you just can't trust the user's browser to be random these days. You could before, when all the browsers implemented their own random html, but now all browsers gots to be standardised, son. They ain't random no more.
Admin
Admin
Well, there is a significant difference: The user can disable JavaScript for security reasons - therefore it's safer to calculate the random number on the server side with PHP.
Admin
Admin
Admin
Admin
Adding the flash object in html makes IE asking the user to 'click to activate the control'. Added via JS this question does not occur. (Case of security by obscurity I guess).
Captcha: haero: Kind of hairy hero? - Try to enter Yeti?
Admin
Now, it's because of patent. Opera do it in similar way.
Admin
No, that's from Dilbert. https://mywebspace.wisc.edu/lnmaurer/web/minirng/Dilbert0001.jpg
You were thinking of myRandom = 4. http://xkcd.com/221/
Admin
Admin
I enjoyed it. You don't have to click, y'know?
Admin
Don't know about the other guy, but knowing that someone inevitably thinks such a fucking pretentious twat is clever enough to quote, that destroys my faith. And I don't need to click the link to see it festering with smug.
Admin
The weird thing is: if you type either my quotation or the original one into Google, there are 128 hits. The top one leads you to Pliny Epistulae 7 19, from which I'd imagine that it's fairly easy to retrieve a translation. After all, Google is close to replicating the Library of Alexandria, right?
I'm sure the concept of "captcha pass phrases" is the New Best Thing. Offers from VCs hereby solicited.
PS PHP is shit. There are people out there waiting for the other shoe to drop. Hey, it's Thanksgiving!
Enjoy your tryptophan, guys! (I'm just off to enjoy mine.)
Admin
I prefer the ayn.rand() function, which causes Atlas to shrug.
Admin
Admin
You cannot modify the HTTP headers for that SWF if it's loaded from another server where you cannot modify headers. (i.e.: not your own server)
In fact, this does not apply to the WTF above. But there are use cases ;-)
TRWTF is that i believe the programmer intended to generate some sort of unique request (for caching purposes) here but failed by using just an integer value between 100 and 999. (regardless the benefit of caching when you do it server-side)
The random value used in the WTF leaves way too much chance for repeating the same result. He could have been using microtime() [PHP] or Date.getTime() [JS] to generate a more unique request.
captcha: erat
Admin
Regardless of what i said, i still believe the programmer failed fairly in his intent to generate a unique request and get around any caching of the SWF.
captcha: wisi
Admin
It's not a WTF, it used to be common practice to avoid browser caching the swf file back in ... 2001? If you wanted to update the swf file a lot without changing HTML code (and the file name) it was the only way browsers would get that file again.
I know, today we've got headers, caching information, but back then there was IE 6.0 (or earlier) with all its quirks and glitches, nobody even dreamt about full HTML compliance.
Admin
I would much prefer that this be done server-side because JS would break caching. Also, I use NoScript, so I appreciate pages that don't require JS to be enabled.
Admin
Correct. That way, the user is guaranteed to disable a unique script each time.
Admin
Except nobody ever says that here. Which makes you look a bit of a fool, I fear.
Admin
FTFY
Admin
Sure. "This setence uses the word valetudo."
Admin
What's so wrong about Dilbert?