• This is not my real name (unregistered) in reply to Matt Westwood
    Matt Westwood:
    This is not my real name:
    A Book on C by Kelley and Pohl has the following gem:

    "For example, in physics the letter c is often used to designate the speed of light, which is approximately 299792.458 km/sec. If we write

    #define C 299792.458

    and then use C to represent symbolically the constant 299792.458, it will be easy to change the code when a new physical experiment produces a better value for the speed of light."

    To which the sane reply would be: "You know what I mean, you pedantic pillocks!" The exercise is to show how constants are used to eliminate the use of magic numbers - the fact that the examples used aren't very good is an incidental detail.

    I'm not being pedantic at all. It's a good book, and the examples are decent. It just contains a major physics fail, which I found funny. And the silly use of a floating point for what is intrinsically an integer value makes it even funnier.

  • Lee (unregistered)

    ALTER TABLE Transactions ADD CostumerWasPhone varchar(255)

  • (cs) in reply to method1
    method1:
    The_Assimilator:
    Also I wish the idiots who program front-end validation on these sites would learn about regexes and \b instead of using string.Contains() for eveything.
    Yeah, its amazing that they're still doing it, even after its become a huge joke & a mark of incompetent programming/website design. How stupid do you have to be to not realise that many longer words contain "offensive" words & how can you be that dumb & be a programmer?

    I take it you're new to this field.

  • eVil (unregistered)

    How exactly does one "spatch"? What is capable of being "spatched"?

    Once we know these things, we will know what "despatched" means.

  • suspicit (unregistered) in reply to Troll
    Troll :
    QJo:
    Yes, but the value of pi changing? Oh, come on, Lewis!

    It did change it now =4!

    Now use this construct to define the derivative at 45 degrees.

  • He Can't Read Law (unregistered) in reply to hoodaticus
    hoodaticus:
    Dan:
    Sam:
    Apparently he's required to rename himself Nick Larooster.
    Nah, Laporksword will do.
    This reminds me of an argument I had with some so-called Constitutional Conservatives on Townhall. They insisted that the Constitution doesn't give the federal government the power to own land in a state. I attempted to post the following rejoinder from Article I:
    To exercise exclusive Legislation in all Cases whatsoever, over such District (not exceeding ten Miles square) as may, by Cession of particular States, and the acceptance of Congress, become the Seat of the Government of the United States, and to exercise like Authority over all Places purchased by the Consent of the Legislature of the State in which the Same shall be, for the Erection of Forts, Magazines, Arsenals, dock-Yards, and other needful Buildings;
    And of course Townhall blocked it because of the word "Erection". So I replaced it with "Boner" and it went right on through.

    Nope, gives Feds the (power strike) "ability" to purchase land from the States. It doesn't give them power to "own" land.

    As in, they can't just go to a state and say "This block now belongs to us".

    However they can purchase land.

    I know that's a little pedant in interpretation of the question at hand, but I find it very important that people are aware of that difference.

    Otherwise you'll have granny force to give up her land so the State can build an apartment complex because they'll earn more taxes from it, all in the name of imminent domain. (ID can only be used to sequester land for infrastructure, not to build a park, or reallocate land to business use).

  • alex n (unregistered) in reply to snoofle

    I think its better to send a check for 0.01, and then ask for a refund since you overpaid.

  • anonymous (unregistered) in reply to This is not my real name
    This is not my real name:
    QJo:
    I'm reporting this from memory so the details may be inaccurate. However, the gist is accurate enough.

    Deep in the depths of the FORTRAN documentation as issued by DEC VAX there exists an admonition warning against the practice of using "magic numbers" in your code. This is accompanied by an example of the use of a DATA statement to store pi:

    DATA PI /3.1415926536 /

    with suggesting that "If the value of pi changes, then it will be easy to amend the data statement."

    A Book on C by Kelley and Pohl has the following gem:

    "For example, in physics the letter c is often used to designate the speed of light, which is approximately 299792.458 km/sec. If we write

    #define C 299792.458

    and then use C to represent symbolically the constant 299792.458, it will be easy to change the code when a new physical experiment produces a better value for the speed of light."

    Some of the WTFs in this paragraph:

    • The speed of light is exactly 299792458 m/s, not "approximately".
    • No experiment will ever change the speed of light, as it is defined to be 299792458 m/s.
    • The constant doesn't fit in a floating point, it gets rounded to 299792.47. Even if they didn't know the speed of light was exact, at least they must've known it would never change that much.
    • If they had used a more sensible unit, like say, the SI unit of m/s, they wouldn't have needed a floating point anyway.
    In case you're too young to remember your history, that definition was adopted in October of 1983. The first edition of that book was published in 1984; they probably thought it was a rather apropos example of a physical constant that might need to be changed ... !

    If the argument is "yes, but it won't ever change again" - sure, we've all heard that one before, right?

Leave a comment on “Progree of enail Status”

Log In or post as a guest

Replying to comment #:

« Return to Article