- 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
Ummmm ... so it's submitting regular expression patterns to the server?! "Who knows what evils lurks beneath the javascripts?"
Admin
( ) the president's daugher is your ex-wife ( ) we have found two people, including your ex-wife ( ) the father of the president's daugher is your ex-wife
Please click the appropriate radio button.
Admin
To put this snippet in a form which more visitors of this site will understand:
Admin
Admin
And with client-side generated random ids and names for the radio buttons the server wouldn't know waht to to with the data anyway :-)
Admin
Admin
js is much better now then 10 year ago where each browser had his own little piece of code for everything. But even now, this is very unstable... look the amount of website with js error and bugs.
And how dare you talk again GW BASIC! Its like hitting your grand father in the face!
Admin
[quote user="Krunt"]I guess the general point I'm trying to convey is that javascript is a crap language.[/quote] Care to highlight just why you think it is?
I actually enjoy programming with it. Some bits annoy me, true, but some bits also delight me and the overall comfort-factor ist definitely higher than with C. Or the good ole line-number-based BASIC-dialects of the mid-80s.[/quote]
How dare you disregard the good ole line-number-based BASIC-dialects of the early-70s? Not to mention the line-number-based FORTRAN dialects, where the line numbers didn't even need to be in order?
Admin
I'm not saying you should tell them to fuck off... just that they can fuck off.
If you've got a pile of important work to do, and some of that work is made excruciating because of terrible bug reports, that work is going to get done after all the other stuff. The quicker a decent description comes in for that bug, the quicker it will get fixed... for reasons related both to the ease of fixing properly described bugs, and human nature.
Admin
Admin
js is much better now then 10 year ago where each browser had his own little piece of code for everything. [/quote] That's a browser issue, not a JAVASCRIPT issue. Please try not to confuse the language with the environment it is running in.
Admin
Sig Figs, man!
Admin
The real WTF is nobody else here caught that. As I was looking at the code I was thinking the same thing but your the only one who caught it.
Admin
Admin
Admin
Simple solution:
s/9999/999999/
That ought to make it better. Problem solved.
Admin
This article is about one of the most persistent anti-patterns I've seen. I can't even guess how many times I've seen algorithms built around random numbers or fractional parts of system time, or similar, and an assumption that somehow there will magically never be a collision.
A goodie from my current code base, repeated in multiple components: DB2 SQL offers timestamp resolution to the microsecond. So some lameoid takes that microsecond and turns it into a key; "After all, there's no chance that someone else will get the same microsecond value again...it's one in a million. Right?"
Admin
No idea why some comets are coming down heavily on radio buttons. I think rado buttons have a purpose like all UI element and it is important to know when to use what element.
Some time check box will do work sometime you need radio button. Just do some clear thinking on requirement and accomplish your goal.
Admin
I think you mean 'meteorites'.
Admin
Re: "the way radio-button sets work, only one option from each set can be selected at any time" -- thanks for the tip! as a professional software GUI and Web developer for the past 14 years I had yet to figure out how radio buttons work! /sarcasm
Admin
"replaced the prefix generator with a page-global counter"
Surely that means a per-page counter.
Admin
I think he means comments.
Admin
And how do you plan to fix it when you get a poor description, and are unable to reproduce?
Admin
Really?
Admin
I think he means plutoids
Admin
Admin
He has brain and he used it. Don't need too much brain cell to figure this out. More brain cell required for making pun like you are doing.
Admin
If this were really something where sigfigs mattered, and every number was in its correct precision, then the answer would be 3000: the "1" would only have 1 sigfig.
Admin
personally I like to generate two GUIDS and concatenate them, that way my identifiers are twice as unique.
Admin
It's simple, there's no room for confusion, and it works well with the mostly-typeless languages and mostly-clueless code I suffer through at work. Advanced users will appreciate the convention of having "Foo" functions which are secretly called by their "doFoo" brethren.
Admin
You don't even need a combo box - the first few digits of the card number will tell you the card type.
Admin
So much this.
I've long suspected that there might be something in the credit card merchant agreement that says "THOU MUST INCLUDE THE NAME OF $CC_COMPANY IN YOUR PROCESSING FORM" as a subtle form of advertising/brand recognition to remind people what card company they use (and therefore trust and like).
Admin
4111 1111 1111 1111 5555 5555 5555 4444 3782 8224 6310 005 6011 1111 1111 1117
Admin
It's a more profound error in reasoning than that. So many people have somehow acquired the idea that "unique values" and "random values" are synonymous. Because they never bother to check this theory, all else flows from this, in an Aristotelean cascade of wrongheadedness.
Admin
Most people are shit at mathematics. The same applies to computer program designers, although the ratio of shit to competent is marginally lower. So it goes.
The good news is that shit mathematicians program shit programs. The plan is therefore that people don't like shit programs and will use programs written by competent mathematicians. The latter programs will get the respect. To cut a long story short the shit mathematicians will die of starvation. Good riddance to them.
Admin
It's called Issue Identifier Numbers which are the first 6 digits of a card. And that link has a list of common ones.
Admin
You forgot one:
() The father of the president's daughter is also the father of your wife.
Admin
Admin
Make this featured, please.
Admin
Who died?
Admin
Users who think they understand stuff are far more dangerous than users who know their limitations.
HINT: When deleting Grand Prix, don't touch the file Drivers.ini in the Windows directory. It has nothing to do with your game.
Admin
Admin
Admin
I generated 1,000 pairs of random numbers and none of the pairs matched. Therefore, random numbers are never the same.
Excerpt:
Admin
It's not really a pun; radio buttons really do have that name because they resemble buttons found on radios.
Admin
Admin
The best form has two radio buttons and one combo box, and you press all of them.
Admin
Radio buttons and drop downs suck. You should be using jQuery UI and drag and drop all options. Just create a 'tag cloud' of options with a drop target. But for the sake of a clean design the tag cloud should be hidden from view and be available via edge actions.
Admin
It isn't a matter of pairs, necessarily. In the system I was taking as my primary example, it is 20 transactions per second, 2-4 minutes per transaction.
Assuming even flow, at any given time, the temporary table has around 60 active numbers. The probability of a collision is therefore 60/100000 every time a number is generated; 1 in 1667. My probability is not up to snuff, but I would expect 5 to 6 collisions per 8 hour day assuming (big if!) the numbers are evenly distributed. (I am very sure they are not, though I can't characterize it: It is clear that, for some reason, some microsecond values are much more common than others.)
The facility in question was protecting itself by locking; when a collision occurred one transaction would stop and wait for the other to finish. That was not deliberate design; that was an accident; that is, the algorithm, which was broken, worked by accident due to another consideration. So when someone inadvertently broke the locking strategy for the algorithm...Wham!...multiple failures (40+) during the next 5 hours of operation.
Admin
So the real WTF is that the programmer, having generated a random number for the ID of a radio button, didn't check to see he hadn't used that random number before?