• Harry Borlze (unregistered)

    I get $1.23459683 a year salary, but today I learned that I am the 1%!

  • Mike (unregistered)

    Odd way of doing boundry tests too, with overlapping values!

  • (cs) in reply to Mike
    Mike:
    Odd way of doing boundry tests too, with overlapping values!
    With the strict inequalities used, the ranges don't actually overlap.

    When the code says "IF a > 5000 AND a < 6001", it's equivalent to "IF a >= 5001 AND a <= 6000". Still, using strict inequalities for that is a weird way to do it.

  • gnasher729 (unregistered) in reply to Mike
    Mike:
    Odd way of doing boundry tests too, with overlapping values!
    Maybe the coder started with tests "income < 1000" and (income > 1000 && income < 2000), then figured out there was a bug when income = 1000, and took the first fix that he could think of. Maybe some weird coding standard that claims "<" is faster than "<=" (because < checks one condition only while <= checks two), and if your boss set up that kind of coding standard then he is not the kind of person you can convince its wrong. Maybe some weird thinking that the numbers involved might be floating point and you should always have some epsilon with floating point comparisons.
  • Herwig (unregistered)

    THIS is really worse than THAT

    and: no, it is no spam!

  • (cs)

    Reminds of that Cowboy Bebop episode with the 1.000,000 $ bounty.

  • foo AKA fooo (unregistered)

    TRWTF is entering your exact income on some news web site.

    While we're at it, what was your credit card number again?

  • faoileag (unregistered)

    Ok, let's see if I get this right:

    100% of all Indians earn less than 1001 rupees per month.

    But there are plenty of people livin in India and some of them earn more than 1000 rupees.

    So, 192.7% of all Indians earn less than 2001 rupees per month.

    // skip a few lines of the same

    So, 368.3% of all Indians earn less than 5001 rupees per month.

    Indeed. Plenty of people in India.

    The way the logic for claculating your income group is implemented is not only an antipattern, it is fundamentally flawed.

  • (cs) in reply to faoileag
    faoileag:
    Ok, let's see if I get this right:

    100% of all Indians earn less than 1001 rupees per month.

    No, you got it wrong. 100% of Indians earn more than less than 1001 rupees per month.

    92.7% earn more than 1000 rupees, and so on...

  • ahydra (unregistered)

    ...is this one:

    fmval = fmval.replace(' ','').replace(' ','').replace(' ','');

    You can imagine the code review:

    original code: fmval = fmval.replace(' ','');

    reviewer: Line xx: Good idea to filter whitespace from the number. But what if somebody enters two or three spaces?

    programmer: Oh, of course! Silly me.

  • faoileag (unregistered) in reply to foo AKA fooo
    foo AKA fooo:
    TRWTF is entering your exact income on some news web site.
    If you mean your actual income as e.g. stated in your contract: why? If it is only your income?

    If you mean down to two decimal places: some people confuse a higher number of decimal places with higher accurracy.

    A good example is climate change. Without taking a stand for or against climate change, calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.

    In college, one lab exercise we had to do involved measuring something then calculating something else from that data. But the main task of that exercise was to calculate the systematic margin of error in our result, and that sure was an eye-opener.

  • faoileag (unregistered) in reply to derari
    derari:
    faoileag:
    Ok, let's see if I get this right:

    100% of all Indians earn less than 1001 rupees per month.

    No, you got it wrong. 100% of Indians earn more than less than 1001 rupees per month.
    Hypothetical talk between worker and boss: "But a want a salary of 1,001 rupees per month!" "But you can't have that! Everyone earns either less than 1,001 rupees or more. It would ruin the statistic if you would get exactly 1,001. You can either have 1,000 rupees or 1,002."
  • (cs)

    Am I reading it right? If he entered "123..45" it would parse as "123.45"?

  • faoileag (unregistered) in reply to Harry Borlze
    Harry Borlze:
    I get $1.23459683 a year salary, but today I learned that I am the 1%!
    But that's below the minimum wage! Unless... wait, you only work 10 minutes per year???
  • faoileag (unregistered) in reply to Zemm
    Zemm:
    Am I reading it right? If he entered "123..45" it would parse as "123.45"?
    No. formval would be "123.45" but that string would parse as 123 since parseInt is used.

    But yes, the way the code deals with special characters is faulty, in that it does not take care of multiple special characters in a row.

  • Fritz, a.k.a. Fritzo (unregistered)

    The real WTF, of course, is Sarat. No-one without serious mental problems would ever even consider entering their income down to two decimals unless it's wages per hour.

  • Balu (unregistered) in reply to faoileag
    faoileag:
    A good example is climate change. Without taking a stand for or against climate change

    Oh, I didn't know that you could vote for or against climate change?! Would you please note my vote against it?

    (Sarcasm off: You are aware of the fact that there's nothing to discuss about climate change, right? It's a fact that it is happening)

    faoileag:
    calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.

    You can very well to that based on the information from previous recorded temperature changes. Just because you don't know how to do it doesn't make it ridiculous.

  • YellowOnline (unregistered)

    Why do people use regex when it isn't necessary but don't when it is? :s

  • Inno (unregistered) in reply to faoileag

    No 12345 ... the dots evaporate way before parseInt!

  • (cs) in reply to Balu
    Balu:
    faoileag:
    A good example is climate change. Without taking a stand for or against climate change

    Oh, I didn't know that you could vote for or against climate change?! Would you please note my vote against it?

    (Sarcasm off: You are aware of the fact that there's nothing to discuss about climate change, right? It's a fact that it is happening)

    faoileag:
    calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.

    You can very well to that based on the information from previous recorded temperature changes. Just because you don't know how to do it doesn't make it ridiculous.

    You really missed reading comprehension didn't you. I'm going top ignore your first comment because it can be taken to many ways.

    The second, yes, forecasting climate change till the end of the century down to a tenth of a degree is ridiculis. We have 86 years for that to happen and the margin of error is going to be greater then one percent, so if you are judging it on a tenth your margin of error already invalidates your prediction.

  • faoileag (unregistered) in reply to Balu
    Balu:
    faoileag:
    A good example is climate change. Without taking a stand for or against climate change
    Oh, I didn't know that you could vote for or against climate change?! Would you please note my vote against it?
    Just for your information: "taking a stand" is a synonym for taking one side in an argument. It has nothing to do with voting.

    Nor does it necessarily have to reflect your opinion on the matter. A good debater can argue for the opposite of what he wants to prove, and, by leading that argument ad absurdum, effectively prove his original stand.

    Balu:
    You are aware of the fact that there's nothing to discuss about climate change, right?
    There's nothing to discuss about climate change, as it has been happening for the past 4 billions years or so more or less continously.

    There can, and should be, a scientific discussion about whether or not current trends in climate change are man-made.

    Balu:
    It's a fact that it is happening
    Just declaring something to be a fact does not make it a fact. Just as denying a fact does not make it go away.
    Balu:
    faoileag:
    calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.
    You can very well to that based on the information from previous recorded temperature changes.
    You could possibly do that to some degree of accurracy if the data would be available. It isn't. Even the data we have collected for the past 100 or so years is flawed, since for measurements taken in once rural now built-up areas only very rough adjustments are make.

    Climate is a chaotic system. Yes, you can model it. But especially the longterm quality of the estimate is little more than a guess.

    Balu:
    Just because you don't know how to do it doesn't make it ridiculous.
    But I can judge what is possible and what is not. And I know at least some techniques for manipulation of your opponent: suggesting accurracy where there is none is one way of letting you appear "more informed".

    But even if we could predict accurately the climate on earth 90 years from now: evenn then that prediction is based on the assumption that no external influences change.

    Reduced activity in the sun can easily enough lead us back into a mini ice-age like it did 400 years ago. And Yosemite erupting would change everything anyway.

  • faoileag (unregistered) in reply to Inno
    Inno:
    No 12345 ... the dots evaporate way before parseInt!
    No, only the first dot is replaced by "". The second dot then slips into the index position of the first dot, but the loop loops and thus the second dot is skipped.
  • foo AKA fooo (unregistered) in reply to faoileag
    faoileag:
    foo AKA fooo:
    TRWTF is entering your exact income on some news web site.
    If you mean your actual income as e.g. stated in your contract: why? If it is only your income?
    And not other identifying information, such as your IP address (if not more)? Sure, if I browsed the site via Tor and didn't enter any other personal information, I might consider entering some personal data that, otherwise, are none of their business. (Or if I checked that the input was only used in a local calculator and not sent to the server.)
    If you mean down to two decimal places: some people confuse a higher number of decimal places with higher accurracy.

    A good example is climate change. Without taking a stand for or against climate change, calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.

    In college, one lab exercise we had to do involved measuring something then calculating something else from that data. But the main task of that exercise was to calculate the systematic margin of error in our result, and that sure was an eye-opener.

    Except the the change forecast is not computed by forecasting the global temperature in 100 years vs. the current global temperature (difference of two big numbers), but from the effects that cause the change, and with a projected change of 1-5K (depending on the assumptions made about emissions etc.), one decimal is not excessive; no decimal would mean a rounding error of 10-50%. (Which is alright for general reports in popular media, and indeed I usually see numbers without decimals there.)

    So it seems in this case, they actually use the right number of decimals, though of course, I've seen many cases of unncessary, redundant and superfluous decimals.

  • (cs) in reply to foo AKA fooo
    foo AKA fooo:
    (...) and with a projected change of 1-5K (depending on the assumptions made about emissions etc.), one decimal is not excessive; no decimal would mean a rounding error of 10-50%.
    Huh? If your forecast is somewhere in a region of 1-5K than that's your "rounding" error of 10-50% right there!

    One decimal suggests ten times more accuracy than you actually have.

    Addendum (2014-01-21 09:16): OK, of ocurse numbers used are not exact, more like magnitudes.

    And the last sentence should be "more than ten times of accuracy you actually have".

  • Inno (unregistered) in reply to faoileag
    faoileag:
    Inno:
    No 12345 ... the dots evaporate way before parseInt!
    No, only the first dot is replaced by "". The second dot then slips into the index position of the first dot, but the loop loops and thus the second dot is skipped.

    It's more WTFy than I thought. Subtle!

  • Sigh (unregistered) in reply to KattMan
    KattMan:
    The second, yes, forecasting climate change till the end of the century down to a tenth of a degree is ridiculis. We have 86 years for that to happen and the margin of error is going to be greater then one percent, so if you are judging it on a tenth your margin of error already invalidates your prediction.
    Have you actually seen a prediction given in a peer reviewed publication that was with a decimal place without a margin of error, and was anything other than average for the entire planet (or a sub-region) over a period of time? Or was it from a mainstream article that might have left that information off? As well as the obvious notation that it is based on 'if current trends continue' or the like?

    Would you feel better if they made the prediction in mC? It would look 1000 times as high but have none of those pesky decimals. Today it's a nice 19400 mC here.

  • faoileag (unregistered) in reply to Sigh
    Sigh:
    Would you feel better if they made the prediction in mC? It would look 1000 times as high but have none of those pesky decimals. Today it's a nice 19400 mC here.
    Ok, apart from the fact that there's no such thing as "milli degrees Celsius", it wouldn't change a thing. A margin of error is always linked to the unit in the calculation, so a prediction of "Tomorrow it will be a comfortable 20°C, (margin of error: 1°C)" would translate into "Tomorrow it will be a comfortable 20000mC, (margin of error: 1000mC)"

    The problem is that the margin of error can, if it becomes large enough to be in the same magnitude as the result, make any prediction completely pointless.

    But most people seem to be unhappy with a simple "we simply can't tell". They prefer numbers, even if those numbers have no real meaning.

  • (cs) in reply to derari
    derari:
    faoileag:
    Ok, let's see if I get this right:

    100% of all Indians earn less than 1001 rupees per month.

    No, you got it wrong. 100% of Indians earn more than less than 1001 rupees per month.

    92.7% earn more than 1000 rupees, and so on...

    Does that explain the difference between little Indians and big Indians?

  • ih8u (unregistered) in reply to faoileag
    faoileag:
    Sigh:
    Would you feel better if they made the prediction in mC? It would look 1000 times as high but have none of those pesky decimals. Today it's a nice 19400 mC here.
    Ok, apart from the fact that there's no such thing as "milli degrees Celsius", it wouldn't change a thing. A margin of error is always linked to the unit in the calculation, so a prediction of "Tomorrow it will be a comfortable 20°C, (margin of error: 1°C)" would translate into "Tomorrow it will be a comfortable 20000mC, (margin of error: 1000mC)"

    The problem is that the margin of error can, if it becomes large enough to be in the same magnitude as the result, make any prediction completely pointless.

    But most people seem to be unhappy with a simple "we simply can't tell". They prefer numbers, even if those numbers have no real meaning.

    Don't worry mainstream readers. I have meaningless numbers for the dumb masses.

    Based on current trends, we're looking at horrible ice death here. Two days ago, it was 40. Yesterday, it was 20's. Today, it's -5. Not only is the temp dropping, but the drop is accelerating.

    Tomorrow: -30 NextDay1: -55 NextDay2: -80 NextDay3:-105 NextDay4:-130

    We're all going to die. Spend like there's no few days from now (tomorrow still scheduled).

    Captcha: paratus -- kinda fitting

  • Kuli (unregistered) in reply to ochrist

    No, but this is easy:

    Even big Indians sometimes have little Indians.

  • Kuli (unregistered) in reply to Kuli
    Kuli:
    No, but this is easy:

    Even big Indians sometimes have little Indians.

    Sorry, I wanted to quote this:

    ochrist:
    derari:
    faoileag:
    Ok, let's see if I get this right:

    100% of all Indians earn less than 1001 rupees per month.

    No, you got it wrong. 100% of Indians earn more than less than 1001 rupees per month.

    92.7% earn more than 1000 rupees, and so on...

    Does that explain the difference between little Indians and big Indians?

  • foo AKA fooo (unregistered) in reply to no laughing matter
    no laughing matter:
    foo AKA fooo:
    (...) and with a projected change of 1-5K (depending on the assumptions made about emissions etc.), one decimal is not excessive; no decimal would mean a rounding error of 10-50%.
    Huh? If your forecast is somewhere in a region of 1-5K than that's your "rounding" error of 10-50% right there!

    One decimal suggests ten times more accuracy than you actually have.

    Addendum (2014-01-21 09:16): OK, of ocurse numbers used are not exact, more like magnitudes.

    And the last sentence should be "more than ten times of accuracy you actually have".

    Reading is hard? Of course, one can't predict e.g. human behaviour. Less pollution, less warming (like 1K). More pollution, more warming (5K) (to oversimplify things, of course). That's not a matter of accuracy, that's an input parameter.

    What you say is like, you can't state sqrt(2) to one decimal (1.4) because sqrt(10) is 3.2.

  • C-Derb (unregistered)

    TRWTF are the users of this income ranker.

    Clearly they are complete idiots if the programmer has to anticipate the possible use of ! or @ or # or $ or % or ^ or & or * or ( or ) or + or = or - or [ or ] or \ or ' or ; or / or { or } or | or " or : or < or > or ? in a field asking for monthly income.

    (Disclaimer: if any of those characters are commonly used in India when writing currency amounts, I apologize for my ignorance.)

  • Ozz (unregistered)

    In the 70s the "experts" were concerned about global cooling.

  • (cs) in reply to faoileag
    faoileag:
    Harry Borlze:
    I get $1.23459683 a year salary, but today I learned that I am the 1%!
    But that's below the minimum wage! Unless... wait, you only work 10 minutes per year???

    I saw a guy once who was a professional bull rider. He won $5,000 for successfully riding a bull. That's an 8 second ride. Figure it out -- $37,500 per minute, or $2,250,000 per hour.

  • Morplox (unregistered) in reply to Ozz

    Yes, as new "data" are revealed and gathered, "scientists" adjust their "hypotheses" and "models" to reflect their "deeper" understanding of the "truth."

  • (cs) in reply to Ozz
    Ozz:
    In the 70s the "experts" were concerned about global cooling.
    A) They weren't. The hypothesis had little support in the scientific community. 2) The believed cause (by those that believed in global cooling) was aerosols (by-products of fossil fuel combustion). However due to a switch to cleaner fuel burning this cause no longer applies.
  • I forget (unregistered)

    The real WTF is an Indian actually figuring out a bug.

  • (cs)
    The problem is that the margin of error can, if it becomes large enough to be in the same magnitude as the result, make any prediction completely pointless.

    Not necessarily. Given two estimates, even with large margins of error, there will still be regions at the extremes which only meet the condition of one of the estimates.

  • Ozz (unregistered) in reply to Morplox

    [quote user="faoileag"]calculating any forecast for temperature rise until the end of the century down to one decimal is ridiculus.[/quote] You can very well to that based on the information from previous recorded temperature changes. Just because you don't know how to do it doesn't make it ridiculous.[/quote] [quote user="Morplox"]Yes, as new "data" are revealed and gathered, "scientists" adjust their "hypotheses" and "models" to reflect their "deeper" understanding of the "truth."[/quote] Someone must be wrong...

  • Joe (unregistered)

    Michael: I must have put a decimal point in the wrong place or something. Shit, I always do that. I always mess up some mundane detail. Peter: Oh! Well, this is not a mundane detail, Michael!

    Michael gets down on himself for messing up another mundane detail. This, however, is a $305,326.13 detail.

  • Mason Wheeler (unregistered) in reply to Ozz
    Ozz:
    In the 70s the "experts" were concerned about global cooling.

    If by "the experts" you mean "two very minor articles in non-scientific popular news magazines,, which even the original authors believe has been over-politicized and blown way out of proportion," then yeah.

  • No idea. (unregistered) in reply to Morplox
    Morplox:
    Yes, as new "data" are revealed and gathered, "scientists" adjust their "hypotheses" and "models" to reflect their "deeper" understanding of the "truth."

    Not sure why all the quotes (which I can only assume are sarcastic quotes meant to belittle the work of scientists), but that sounds right to me: As people learn more, they improve their ideas. I write better code now than I did a year ago. To paraphrase you, as new "data" is revealed and gathered, I adjust my "models" to reflect my "deeper" understanding of the "truth".

  • (cs) in reply to DrPepper
    DrPepper:
    I saw a guy once who was a professional bull rider. He won $5,000 for successfully riding a bull. That's an 8 second ride. Figure it out -- $37,500 per minute, or $2,250,000 per hour.
    I suspect that in previous attempts he was unable to yield the 8 necessary seconds and got $0.00 for the effort. So, on average he makes MUCH less.

    Also: Have you tried to do it? I haven't, but it looks a bit duanting for my fragile body!

  • C-Derb (unregistered) in reply to I forget
    I forget:
    The real WTF is an Indian actually figuring out a bug.
    I'll admit it, I laughed a little bit at this.

    +1

  • (cs) in reply to No idea.
    No idea.:
    Morplox:
    Yes, as new "data" are revealed and gathered, "scientists" adjust their "hypotheses" and "models" to reflect their "deeper" understanding of the "truth."

    Not sure why all the quotes (which I can only assume are sarcastic quotes meant to belittle the work of scientists), but that sounds right to me: As people learn more, they improve their ideas. I write better code now than I did a year ago. To paraphrase you, as new "data" is revealed and gathered, I adjust my "models" to reflect my "deeper" understanding of the "truth".

    Consider the alternatives: As "new" data are gathered that contradict my models, I refuse to update my models.

    Or: As new "data" are gathered that contradict my hypotheses, I refuse to accept that "data".

    Never changing your opinions to account for new facts means you never have to admit being wrong. It's a win-win! And then you can settle into a career writing advert-widgets for web sites.

  • Paul Neumann (unregistered) in reply to foo AKA fooo
    foo AKA fooo:
    ...) and with a projected change of 1-5K (depending on the assumptions made about emissions etc.), one decimal is not excessive; no decimal would mean a rounding error of 10-50%.
    I'm sorry but 10-50% margin is incorrect. If the projection is 1-5 units, the margin of error will be 1/2 the projection scope: |1-5| = 4; 4/2 = 2. The margin of error is 2 or 200%.

    That being said, I could easily claim that it is projected to rise 3.01K with a margin of error of 2K and only be slightly off from the original statement of 1-5K.

    Finally, I can quite easily predict that the Democrats will win the next election with a 52% majority given a 7.5% margin of error and still be correct for nearly every election since the establishment of the Democrat party. The prediction may be incorrect as to the victor, but it is accurate because of the declared margin.

  • (cs)

    I was half expecting it to be this:

    http://www.marketplace.org/sites/default/iframes/income_upshot/

    Although it may only be Indian after anonymization.

  • Sigh (unregistered) in reply to faoileag
    faoileag:
    Sigh:
    Would you feel better if they made the prediction in mC? It would look 1000 times as high but have none of those pesky decimals. Today it's a nice 19400 mC here.
    Ok, apart from the fact that there's no such thing as "milli degrees Celsius", it wouldn't change a thing. A margin of error is always linked to the unit in the calculation, so a prediction of "Tomorrow it will be a comfortable 20°C, (margin of error: 1°C)" would translate into "Tomorrow it will be a comfortable 20000mC, (margin of error: 1000mC)"

    The problem is that the margin of error can, if it becomes large enough to be in the same magnitude as the result, make any prediction completely pointless.

    But most people seem to be unhappy with a simple "we simply can't tell". They prefer numbers, even if those numbers have no real meaning.

    Since you focused on the obvious nonsense (while missing the point of significant digits), I'm going to guess the answers to my questions were all "No": "Have you actually seen a prediction given in a peer reviewed publication that was with a decimal place without a margin of error, and was anything other than average for the entire planet (or a sub-region) over a period of time? Or was it from a mainstream article that might have left that information off? As well as the obvious notation that it is based on 'if current trends continue' or the like? "

    To hammer home my point: the fact that it is a decimal place is irrelevant to its accuracy, as that can be hand waved by units of measure. So I have no idea why you are fixated on it as if its presence alone negates whatever research and calculations went into producing that number.

  • foo AKA fooo (unregistered) in reply to Paul Neumann
    Paul Neumann:
    foo AKA fooo:
    ...) and with a projected change of 1-5K (depending on the assumptions made about emissions etc.), one decimal is not excessive; no decimal would mean a rounding error of 10-50%.
    I'm sorry but 10-50% margin is incorrect. If the projection is 1-5 units, the margin of error will be 1/2 the projection scope: |1-5| = 4; 4/2 = 2. The margin of error is 2 or 200%.
    Another case of reading comprehension failure. I don't need to repeat myself.
    Finally, I can quite easily predict that the Democrats will win the next election with a 52% majority given a 7.5% margin of error and still be correct for nearly every election since the establishment of the Democrat party. The prediction may be incorrect as to the victor, but it is accurate because of the declared margin.
    Indeed. That's why actual experts who know a little about math (e.g. Nate Silver) don't make predictions this early when error margins are necessarily so large (as opposed to popular media which need to fill their time slots and entertain people). It's really only in the last few weeks (months in clear cases) that margins become small enough so those predictions become meaningful.

Leave a comment on “Income”

Log In or post as a guest

Replying to comment #:

« Return to Article