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!)
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"!
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" ?
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 *
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?;)
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]
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!
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?)
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.
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!
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.
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.
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)
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.
"smart ass" = "anus edu" ? very clever.
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).
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!)
Bold statement! I'm convinced he may be right too. I'm also convinced he may be wrong! Gee.
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"!
Change
assert undeclared(locals()) == None
to
assert not undeclared(locals())
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.
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? ;)
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]
Lots of comments and lots of blank lines. It was probably a "code" generator that cranked it out, and probably written in Python!
Not sure it's significant, but it's on topic, so I thought I'd throw it in.
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?
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.
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).
http://web.archive.org/web/19991127200753/http://w ww.netfunny.com/rhf/jokes/99/Nov/perl.html
See, I thought Haskell was the pesky neighbor kid on Leave it to Beaver.
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!
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.
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?
hint for moderators: I'm not bashing the editors - I'm bashing SCO!
Are you sirius?
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)
No comment.
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.
is that off-topic or just [+0.5 mildly interesting] ?