Could someone with more computer-arithmetic clout than I, explain why, in BLOCKED SCRIPT
var pulse = 0.8;
var pulseComplement = 1 - pulse;
causes:
pulseComplement == 0.19999999999999995
Why does the thing treat 0.8 as 0.80000000000000005?
PS.
That's in IE. Firefox produces 0.1999999999999999[b]6[/b]
How hard is it to store 0.8? When did 8e-1 become irrational? What am I missing?
PSII
It's a tiny, tiny error, and doesn't cause much trouble in the way of pixel-precision, so the question is largely academic.
Posts made by dhromed
-
Bytes suck!
-
RE: Virus - Free Music
I'm thinking that if you embed a virus in an mp3, your player would
just play it as sound and your speakers would output peculiar-shaped
static. -
RE: The "I hate Java club"?
How about the "I hate Java desktop applications-club"?
I mean, nobody seems to like Oracle's installer, and JEdit is the
slowest texteditor around. I suppose the good thing is that it performs
equally bad on all platforms.
But I admit that that's all I got, and of course there's the wisdom of
there being bad programmers in all languages, and so it's not
necessarily the language's fault. -
RE: Deduplication Standards
The definition of 'duplicate' is not constant, but can change from system to system.
[code]<font face="Courier New">SELECT DISTINCT * INTO tmp FROM Contact;</font>[/code]
could delete data. -
RE: Wtf is up with the syntax highlighting?
http://www.toastforums.com/
But I'm not sure that's .Net
No clue as to the kudos or dankness of this Toast. -
RE: Wtf is up with the syntax highlighting?
Let's raise money so Mr Papidimalopudosopilusfrnssrgst... ---
Papadimoulis, ok, him, can install something like phpBB or VBulletin
or, as a last resort option, YaBBy.
Though, if you write plain text posts and don't use the previews and don't do anything fancy, this forum should work properly. -
RE: A whole database of WTF
This WTF is also a nice violation of the Magic Number principle. Or should I say 'adherence'?
-
RE: A whole database of WTF
@braindigitalis said:
note that the msgbox call doesnt actually TRIGGER anything, it just asks, and does nothing.
There was a dialogue box in SimCity 2000 that said:
"Are you sure you want to remove this bridge?"
[OK]
The Map24 java app, upon connection timeout, asks:
"Reconnect to server?"
[OK]
-
RE: Too much of a good thing?
I do not understand what the comments mean, so I consider them bad, and little more that 'warm bytes'.
My eye also tends to start twitching a bit when I see the use of 'we' in a comment. -
RE: Hotmail formatting WTF
@StillNotTere said:
I would be a plaintext email fan if all those mail readers wouldn't
insist on showing plaintext mail in a big ugly fixed-width font (on
Windows, usually some flavor of Courier). Outlook, Thunderbird, everybody does
this by default. I send HTML mail for that reason, even though I
don't use the formatting.
Take back control.
Change the font for plaintext display.
-
RE: Help: Asp loading time
@human said:
Thankx guys for your support.
I have gotten rid of the "SELECT *" most of the tables and the speed is wonderful. The tables were the main culprits, so now im using style sheets. Works fantastic.
Thanks again
Another victory for CSS.
-
RE: Help: Asp loading time
Slight error, the syntax is
LIMIT n1,n2
where n1 is the 0-based index of the first desired row, and n2 the amount of rows.
-
RE: Help: Asp loading time
@Drak said:
Does mySQL not have something akin to SELECT TOP 10 * FROM Table3 ORDER BY whatever ?
That way you only select 10 records for your top 10 (or hoewever many you need), instead of so very many more.
It may help a little bit.
Drak
MSSQL has TOP n
mySQL has LIMIT(n1,n2). Kind of like substr() for records.
Same idea, different functionality.
-
RE: Primary Key/Clustered Index
Second, fields do not exist in a relational database. Columns
do. There is a fundamental difference between the two terms. Ditto for
rows versus records. Usage of the proper ensures a strong mental model
of the domain; think mixing up your derivatives and integrals in
calculus.
I've never been formally schooled in databasing, nor have the kind of
in-depth knowledge displayed here so often, but in my experience I've
come to define Field as the intersection of a row and column in a
database, and a Record as a Row With Data. Synonyms mostly, but Field
and Record because it's a database table, not yer average table within
whatever context or environment.
The derivatives vs integrals comparisin means nothing to me. 8-|
-
RE: Help: Asp loading time
An issue could be (just guessing now) that your tables are top-heavy
and cramming 500 records in an inefficient table design may cause the
browser to choke.
Also 'loading time is not very bad'
still hints that the loading time is long. Maybe that's because you're
quering 900 records and throwing away 390, which means those records
shouldn't have been selected in the first place, and displaying 500
records on a page is a WTF in and of itself. With intelligend page
design, you can bring those queries down to a couple dozen records,
undoubtedly speeding up the page. -
RE: Now, THAT's design!
"All my friends have firefox, therefore I will show a blank page on any browser other than firefox."
ROCK! -
RE: How'd I get here?
Similar to a .txt with installation instructions that only appears after you install it.
"To get our phone number, you may call us." -
RE: Positive WTF
Maybe that time when...
no
Or when...
hm, no.
Perhaps...
oh wait.
no.
I'm sorry.
Currently all systems and conventions I work with have undergone revisions and upgrades from a state of Suck.
That in itself can be considered a positive WTF. Everything used to suck, but not anymore!