Slashdot Mirror


User: Chapter80

Chapter80's activity in the archive.

Stories
0
Comments
1,047
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 1,047

  1. Re:same thing happend to me on College Student Receives Email of the Lost · · Score: 1
    Smartass that I am, I signed up for a@nus.edu.sg..

    "smart ass" = "anus edu" ? very clever.

  2. Re:"null" (string) vs. null value? on College Student Receives Email of the Lost · · Score: 1
    It doesn't need to be as blatent of an error as that.

    In Python, for example, if you take in a number, and convert it to a string, it's something like this:

    >>>a=8675309
    >>>b=str(a)
    >>>print b
    '8675309'
    >>>a=None
    >>>print a
    (NOTHING PRINTED!)
    >>>b=str(a)
    >>>print b
    'None'

    Note that now b equals a sting holding 'None'. I think other languages will do something similar with "Null" or "NaN" (Not a number).

  3. Re:Future Global Conflict on Help Break Original Enigma Messages · · Score: 1
    I suspect this was a troll, or a comment from a person very ignorant of history.

    Some of the best troll comments simply weave in a comment like that just to watch people's blood boil. Don't feel obligated to reply! (I'm sure someone else will!)

  4. Re:Dvorak: wrong, again. on Apple to 'Switch' to Windows? · · Score: 1
    Dvorak: I'm convinced he may be right.

    Bold statement! I'm convinced he may be right too. I'm also convinced he may be wrong! Gee.

  5. WOXY Cincinnati-based??? OXFORD! on Internet Radio Failing to Find Support? · · Score: 1

    Silly me, I always thought the "OX" in WOXY stood for Oxford, Ohio, NOT Cincinnati. Since it could be picked up well in Oxford (Home of Miami University), but not in Cincinnati, I think that's accurate. Miami University, you know, the university that this year's Super Bowl Champion Quarterback went to... THE Miami University (not to be confused with the ficticious Miami "of Ohio", or the University of Miami down south.) I like to remind people that Miami was a University before Florida was a state (1809 vs. 1845). Likewise, don't call Oxford "Cincinnati"!

  6. Re:O, yeah? on Beginning Python: From Novice to Professional · · Score: 1
    Grrrr...

    Change
    assert undeclared(locals()) == None
    to
    assert not undeclared(locals())

  7. Re:Pennies are not copper anymore on Earth's Copper Supply Inadequate For Development? · · Score: 1
    One guy said that pennies made before 1971 are worth more than 1c in copper, and that the newer pennies might soon be worth much more than 1c due to their high zinc content.

    Is it possible for a one cent piece to be worth more than one cent?

    Just being philosophical here, but shouldn't that be "a penny will be worth more than 1/100th of a dollar" ?

    ... Sorry, I had to throw in my two cents worth.

  8. Re:O, yeah? on Beginning Python: From Novice to Professional · · Score: 1
    I took one more crack at it. It looks a little cleaner. I'm sure a Python Pro could write it even better (maybe trapping anytime locals() adds a key (meaning that you just added a new variable), so that you could trap that, and raise an exception if the variable being added isn't in the declarations list). But that's beyond my beginnner expertise.

    Here's my latest revision of a strict variable checker (released as free software; help yourself!)

    Two files: one a called strict.py, which you can import. Here is strict.py, a simple 3-line file:
    def declare(var): declarations.append(var)
    def undeclared(l):return [k for k in l.keys() if k not in declarations]
    declarations=["declarations"]+locals().keys()

    The other demonstrates how to use it:
    from strict import *

    declare("foo")
    declare("bar")


    foo=1
    bar=2
    fo0=3


    print undeclared(locals())
    assert undeclared(locals()) == None

    The output of the program is this:

    ['fo0']
    Traceback (most recent call last):
    File "C:\PythonProjects\junk\declare.py", line 12, in ?
    assert undeclared(locals()) == None
    AssertionError
    >>>

    As you can see, you can Print the undeclared local variables('fo0' is printed for you), and you can assert that there are no undeclared local variables (which will raise an exception, and potentially halt the program (if you want)).

    Pretty cool! OK, what other excuses are there not to try Python? ;)

  9. Re:O, yeah? on Beginning Python: From Novice to Professional · · Score: 1
    This is only my second python program, so excuse me if this is poor, but it seems like you could pretty easily force declarations as below. Not perfect (you need to assert any time you want to check to see what's not declared), but you can easily change the "assert not" to "print", and out spits your undeclared variables.

    Note, the Assert statement fails because "fo0" is not declared. 4 extra lines of code to handle the declaration set up, and one line to do your strict checking. As I said, I am a complete rookie, so no laughing.


    def declare(list):
    .... declarations.extend((list,)) #indent instead of periods
    declarations=["_[1]"]
    declarations.extend(locals().keys())


    declare("foo")
    declare("bar")


    foo=1
    bar=2
    fo0=3


    assert not [k for k in locals().keys() if k not in declarations]

  10. Re:Totally fresh in programming on Beginning Python: From Novice to Professional · · Score: 1
    You do realize Java 1.0 was released in May 1996? If "millions" >= 2,000,000 then you just said you have written well over 500 lines of Java every single day for almost ten years.

    Lots of comments and lots of blank lines. It was probably a "code" generator that cranked it out, and probably written in Python!

  11. Re:Devouring? on Beginning Python: From Novice to Professional · · Score: 1
    ...AND Google hired Guido (creator of Python) back in December (see earlier Slashdot story).

    Not sure it's significant, but it's on topic, so I thought I'd throw it in.

  12. Re:perl vs. python fight a classic example on Beginning Python: From Novice to Professional · · Score: 1
    I'm not disagreeing with you, there's something about the name. But what is it? Is C++ more charming in some way? Does the name need to be geekish? How is Java's name more attractive then Python?

    Is it just that Python is named after some comedians (who a lot of people frankly don't "get"), whereas Java is named after a beverage? Would a pun be better? Like C++ is to C and C was to B and Ruby is to Perl (take off on Pearl?)

    What's in a name?

  13. Re:whitespace (serious question, not troll, honest on Beginning Python: From Novice to Professional · · Score: 1

    No new line required on the IF statement in Python. So the colon is significant in that case. I'm sure there are cases where there would be syntactic confusion without it, where the IF statement is on the same line with the conditional clause.

  14. Re:whitespace (serious question, not troll, honest on Beginning Python: From Novice to Professional · · Score: 1
    You mean your editor doesn't allow you to highlight multiple lines, and change the indentation (indent more or indent less) with a simple keystroke?

    That was one error I consistently had, with C, C++, and Java was thinking something was conditional when it wasn't, and vice versa.

    I think significant indentation is a God-send.

    Now, for the colon.... I think it's just a delimiter - like "I'm done with the if condition". Like "Then" in Basic, or { in Java (with no } required).

  15. Re:the obligatory Python vs Perl post on Beginning Python: From Novice to Professional · · Score: 1
  16. Re:Python looks like a mess to me on Beginning Python: From Novice to Professional · · Score: 1
    My bad. Thanks. I like learning something new.

    See, I thought Haskell was the pesky neighbor kid on Leave it to Beaver.

  17. Re:Totally fresh in programming on Beginning Python: From Novice to Professional · · Score: 1
    Actually, Python has routines that allow you to build a path and file name so that it *is* platform independant.

    You can create your path, without concern for whether the machine uses forward slashes or back slashes as separators, without concern for case sensitivity, etc.

    The trick to making the software platform independent is to USE the routines. As an earlier post said, of course you *could* write software that is NOT platform independent, but Python has modules that help you make your program platform independent - it's just a matter of using them! And if you use them, then you don't even need to do the "tweaks" that you mention!

  18. Re:Totally fresh in programming on Beginning Python: From Novice to Professional · · Score: 1
    Actually, "self" is a convention. It could easily be called "self1" or "this" or some other name. But use "self". This is one of those conventions that you do NOT want to stray from.

    The instance is automatically passed to your class function (for your convenience) so that you can refer to it. The only way to "catch" that parameter is to list "self" (or similar) in the parameter list. That's why it's there. It's always passed, so you have to list it first.

  19. Re:Python looks like a mess to me on Beginning Python: From Novice to Professional · · Score: 1
    Pattern Matching is completely in place in Python, with the re.search module (and other re modules).

    And the best part is verbose mode on Reg Ex's. You can really make them readable.

    Can you guess what I think the __worst__ __thing__ about Python is?

  20. Re:Everybody knows that... on IP Attorney - Why SCO Has No Case · · Score: 2, Funny
    Is "SCO has no case" News for nerds?

    hint for moderators: I'm not bashing the editors - I'm bashing SCO!

  21. Re:Predictions on Technology Predictions for 2006? · · Score: 1
    I work at Radioshack and my entire district is sold out of all Sirius recievers and we have waiting lists. 75% of the customers say they are buying because they wanted Howard Stern.

    Are you sirius?

  22. It has to be said... on John Seigenthaler Sr. Criticises Wikipedia · · Score: 1
    I know we're all sick of this meme, but here's a scenario for you.
    Suppose Seigenthaler gets his way, and then ISPs are held accountable for the actions of their users.


    1. Be some "not sufficiently notable" person who has a wikipedia article written about them.
    2. Get a Bell South account
    3. Change your Wikipedia article to be laibelous
    4. Sue Bell South --- FINALLY, THE MISSING STEP!
    5. Profit

    Yeah, hold the ISP's accountable. That's a real good idea!

    (I'm aiming for INSIGHTFUL, not FUNNY, and not TROLL)

  23. under interogation? (the obvious post) on How to Write Comments · · Score: 1

    No comment.

  24. Re:eBay = permanent Beta (pig latin for the letter on Why Does Beta Last So Long? · · Score: 1
    i think it would be etaBay...
    Actually, no. That would be pig latin for "Beta", not "B".

    anyway, eBay comes from the name for an auctionhouse, or a "bay"
    Actually, no. It stands for Echo Bay, as Echo Bay was the original name of the Consulting Firm of the founder.

  25. eBay = permanent Beta (pig latin for the letter B) on Why Does Beta Last So Long? · · Score: 2, Interesting
    OK, so it's not Greek - but eBay is the pig latin equivalent of the English translation of the Greek letter Beta.

    is that off-topic or just [+0.5 mildly interesting] ?