- 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
A similar issue ...
I'm configuring automatic regression tests, and am using Selenium. In order to test that a field holds today's date, I am attempting to store dd/mm/yyyy and dd-mm-yyyy (non-US system, bear with me) into variables in Selenium. But whatever I do, it automatically converts the numbers I enter as strings into integers, and evaluates the resulting integer so that, for example, 10-08-2012 becomes -2010. It then complains that the (correctly-filled) field containing "10-08-2012" does not match "-2010".
I have so far been unable to get anyone on any on the discussion forums at Selenium to acknowledge the bug.
Admin
Then be glad you aren't working for the major insurance company I'm at. Every money value is a double. EVERY. ONE.
Admin
Admin
I would have left my name off the receipt too if I was so cheap as to leave exactly 15%.
Admin
Admin
Money as a double can work well, and then you round off.
You have to pay interest at 0.3% this month on a debt you have, the debt being in dollars (or sterling/euros etc) and cents (pence etc.). So you're going to get fractions and then probably what you pay is rounded off to the nearest penny. Exact fractions are not really that importantly relevant.
Even when the amount is noticeable, if you are dealing with an amount like $10,000 you probably don't care about 10 cents above or below that amount so even float would be accurate enough.
It only looks silly when it gets printed out as an amount like $3.4899999995 instead of $3.49
But then if you are dealing with 1193406 hours you probably wouldn't care about 27 minutes either.
Admin
Here's a free tip for users of TDWTF: Try pressing left ALT when you use print screen.
Admin
I am going to start printing all of my checks that way :p
CAPTCHA: decet - the worst form of deception
Admin
Would you feel the same way if your bank treated your accounts that way?
Admin
Unfortunately, that doesn't work for everything. what about primary keys? Those aren't used in any mathematical manipulation, but is commonly an INT.
Admin
Someone whose total is, say, $51.98? $61.98? Wot-EVV-ah.
Admin
i dare you to choose the 136.102 year option and sit behind your screen to test if works correctly.
Admin
Yours Yazeran
Plsn: To go to Mars one day with a hammer
Admin
Admin
Agreed. When I was getting the value of my Miata last year it shows Premium Package 1 and Premium Package 2. Those were the actual names of the packages from Mazda.
Admin
I've seen this message on SunOS 4, so it's older than Linux.
Admin
Someone who is meticulous about only giving exactly 15%. You would think that they would take it off the pre-tax total if they were that anal though.
Admin
Same as regular toast. One reason to toast bread is because it's stale.
Admin
You don't exist is an old UNIX error message: http://www.seebs.net/ops/ibm/cranky37.html
Admin
And who would be there to click the Okay button?
Admin
Admin
Admin
I knew that Remy would contribute something good at some point.
Admin
There is a second problem with your theory as well. The problem that occurs with a lack of precision becomes is something like a plague. It doesn't grow incrementally, but instead proportionally. As the number of people infected with a plague increases, so does the rate at which people are infected. The same goes for code that cannot handle numbers precisely. We may be dealing with a few cents difference now, but over time a few cents difference can throw the ledger off by more than the $10,000 that you rounded up or down to.
Admin
One of the WTFs here is not pressing the spacebar after ⇧⌘4.
Admin
Admin
Admin
Apparently Y. Li does. Also apparently having a very short name is the same as being anonymous, at least here in WTFland.
Admin
Admin
You put a single quote in the cell before typing a number (or date). It will cause it to be treated as text and not changed to another format.
This isn't a hack; it's by design -- the single quote will not show up in the cell unless you click on it and look in the formula bar to see the underlying content of the cell.
Admin
I suppose "Chris" plans to say, "I think therefore I am."
Sorry but that's not evidence ... or proof. I think he's completely out of luck.
Admin
The last one, BadImageFormatException, can happen when an AnyCPU assembly / program attempts to load an x86 assembly / plugin. That's why the Visual Studio 2010 project templates default to x86 now rather than AnyCPU.
http://blogs.msdn.com/b/rmbyers/archive/2009/06/8/anycpu-exes-are-usually-more-trouble-then-they-re-worth.aspx
Admin
Admin
I know... but what I found interesting was the actual result of the conversion, not the fact that it happened.
Admin
though... 2010 has fixed that... so it isn't funky anymore. used to be... when you put it in... you would get some number that looked nothing like the number you originated with.
Admin
Oh, you tried so hard to be clever, but you failed. Don't feel too bad, you've gotta be used to it at this point.
PIDs, UIDs, GIDs, etc. are also not numbers. But they are also not text, so they do fall outside of the oversimplified statement I would make to aspiring programmers. You caught me out! I oversimplified something so that it was appropriate to the audience!
Anyway, these aren't numbers or text- they're unique identifiers. Their actual datatype is utterly irrelevant, since the only comparison you'll ever do is going to be one of equality. When data-type doesn't matter, integral types are the best choice since they allow good control of how much memory you use for them.
They are still not numbers, in any real sense.
Admin
Admin
Admin
me too.
Admin
Admin
That old "if we store it as an integer we can save one byte" optimization habit just won't go away, will it?
Admin
Actually, since "Y. Li" sounds Asian, my first thought was that they just added a couple of cents to change the last two digits. "44" is unlucky for Chinese because the word for 4 sounds similar to the word for death.
However, it's too close to an exact 15% to be cultural..and I guess they were too cheap to make it the lucky "88"
captcha: amet - the word to follow "lorem ipsum dolor sit"
Admin
You're not a real man if you didn't write one of these too.
Admin
Admin
Admin
Admin
Admin
Admin