[Tutor] python web development

2013-12-23 Thread Ismar Sehic
hello everyone, i just got myself a nice vps box, and i want to play
with it for a while, set it up for web development with python.i just
need few guidelines, what should i take care of, what packages to
install etc...
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Chutes & Ladders

2013-12-23 Thread Keith Winston
On Sun, Dec 22, 2013 at 3:04 PM,  wrote:

>
> games = [p1.gameset(gamecount) for _ in range(multicount)]


So Peter gave me a list of suggesttions, all of which I've incorporated and
gotten running, and it's been instructive.

But in my haste I included the line above, cut & pasted from his
suggestion, without understanding what the underscore is doing in there. I
think I understand that at the prompt of the interpreter the underscore
returns the last value returned... but I can't really figure out what it's
doing here.

Also: this statement worked fine:

for tmulti in games:
print("{moves:9.2f} {chutes:12.2f} {ladders:13.2f}".format(
moves=mean(tgset[1] for tgset in tmulti),
chutes=mean(tgset[2] for tgset in tmulti),
ladders=mean(tgset[3] for tgset in tmulti)
))

Which is sort of awesome to me, but in my efforts to riff on it I've been
stumped: if I want to further process the arrays/lists my list
comprehensions are generating, I sort of can't, since they're gone: that
is, if I wanted to use the entire len(tmulti) of them to determine grand
total averages and variances, I can't. And if my array is large, I woudn't
want to iterate over it over and over to do each of these steps, I think.
Anyway, I'm just goofing on all this, for the learning value, but I'll
appreciate any thoughts. Thanks.

I'm also trying to speed up the program at this point: the way I've set it
up now it builds a list of lists (of lists) of all the stats of all the
games of all the gamesets of all the multisets. I've visually  streamlined
it some, without any effect on performance I can detect. Would using
arrays, or tuples, or something else be likely to be faster? It's
interesting that running it on my 8 y.o. Core 2 Duo and my 2 y.o. Core I5
result in virtually exactly the same speed. Weird. Obviously, it's just
doing simple math, pretty much

-- 
Keith
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Chutes & Ladders

2013-12-23 Thread Peter Otten
Keith Winston wrote:

> On Sun, Dec 22, 2013 at 3:04 PM,  wrote:
> 
>> To sum it up: I like what you have, my hints are all about very minor
>> points
>> :)
>>
> 
> 
> Peter, that's a bunch of great suggestions, I knew there were a lot of
> places to streamline, make more readable, and probably make faster. Thank
> you.
> 
> I find that if I run it [1] [10] times, it takes about 20s on my
> machine, so I'm eventually going to take a little time seeing how fast I
> can get it, I think... maybe I'll learn decorators so I can time it/parts
> of it?
> 
> I'm really grateful for yours and everyone's help.

I don't expect any of my suggestions to have a significant impact on 
execution speed. If you are looking for a cheap way to make your script a 
bit faster try replacing

roll = random.randint(1,6)

with

roll = int(random.random() * 6) + 1

Further speedups may be gained from undoing (some of the) OO...

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Chutes & Ladders

2013-12-23 Thread Peter Otten
Keith Winston wrote:

> On Sun, Dec 22, 2013 at 3:04 PM,  wrote:
> 
>>
>> games = [p1.gameset(gamecount) for _ in range(multicount)]
> 
> 
> So Peter gave me a list of suggesttions, all of which I've incorporated
> and gotten running, and it's been instructive.
> 
> But in my haste I included the line above, cut & pasted from his
> suggestion, without understanding what the underscore is doing in there. I
> think I understand that at the prompt of the interpreter the underscore
> returns the last value returned... but I can't really figure out what it's
> doing here.

There is a convention (recognized by pylint) to have unused variables start 
with an underscore. The shortest of these names is just the underscore. I 
used it to indicate that the important thing is that gameset() is called, 
not whether it is the seventh or 42nd call. Following that convention a line 
counting script could look

linecount = 0
for _line in sys.stdin:
linecount += 1
print(linecount, "lines")

while a script for adding line numbers would be

lineno = 1
for line in sys.stdin
print("{:5}:".format(lineno), line, end="")
lineno += 1

> Also: this statement worked fine:
> 
> for tmulti in games:
> print("{moves:9.2f} {chutes:12.2f} {ladders:13.2f}".format(
> moves=mean(tgset[1] for tgset in tmulti),
> chutes=mean(tgset[2] for tgset in tmulti),
> ladders=mean(tgset[3] for tgset in tmulti)
> ))
> 
> Which is sort of awesome to me, but in my efforts to riff on it I've been
> stumped: if I want to further process the arrays/lists my list
> comprehensions are generating, I sort of can't, since they're gone: that
> is, if I wanted to use the entire len(tmulti) of them to determine grand
> total averages and variances, I can't. And if my array is large, I woudn't
> want to iterate over it over and over to do each of these steps, I think.
> Anyway, I'm just goofing on all this, for the learning value, but I'll
> appreciate any thoughts. Thanks.

You can modify the loop to

for tmulti in games:
moves = [tgset[1] for tgset in tmulti]
chutes = ...
ladders = ...
print("...".format(
moves=mean(moves),
chutes=mean(chutes),
ladders=mean(ladders)
))

> I'm also trying to speed up the program at this point: the way I've set it
> up now it builds a list of lists (of lists) of all the stats of all the
> games of all the gamesets of all the multisets. I've visually  streamlined
> it some, without any effect on performance I can detect. Would using
> arrays, or tuples, or something else be likely to be faster? It's
> interesting that running it on my 8 y.o. Core 2 Duo and my 2 y.o. Core I5
> result in virtually exactly the same speed. Weird. Obviously, it's just
> doing simple math, pretty much

"Simple math" is where the overhead of CPython over languages like C is most 
significant.

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] python web development

2013-12-23 Thread Alan Gauld

On 23/12/13 08:46, Ismar Sehic wrote:

hello everyone, i just got myself a nice vps box,


I'm not sure what a vps box is but...


with it for a while, set it up for web development with python.i just
need few guidelines, what should i take care of, what packages


There are many frameworks for web development in Python.
Some popular ones are Django, Pylons, Cherrypy.
But there are many others. Mostly they offer similar
features but with varying degrees of sophistication.

Thee is a good introduction to Python web development here:

http://docs.python.org/2/howto/webservers.html

There is a web page that discusses several of the Frameworks
here:

https://wiki.python.org/moin/WebFrameworks

You will need to decide which framework you want to use
then download the packages it requires.

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Chutes & Ladders

2013-12-23 Thread Mark Lawrence

On 23/12/2013 06:07, Keith Winston wrote:

On Sun, Dec 22, 2013 at 3:04 PM, mailto:tutor-requ...@python.org>> wrote:


games = [p1.gameset(gamecount) for _ in range(multicount)]


So Peter gave me a list of suggesttions, all of which I've incorporated
and gotten running, and it's been instructive.

But in my haste I included the line above, cut & pasted from his
suggestion, without understanding what the underscore is doing in there.
I think I understand that at the prompt of the interpreter the
underscore returns the last value returned... but I can't really figure
out what it's doing here.

Also: this statement worked fine:

for tmulti in games:
 print("{moves:9.2f} {chutes:12.2f} {ladders:13.2f}".format(
 moves=mean(tgset[1] for tgset in tmulti),
 chutes=mean(tgset[2] for tgset in tmulti),
 ladders=mean(tgset[3] for tgset in tmulti)
 ))

Which is sort of awesome to me, but in my efforts to riff on it I've
been stumped: if I want to further process the arrays/lists my list
comprehensions are generating, I sort of can't, since they're gone: that
is, if I wanted to use the entire len(tmulti) of them to determine grand
total averages and variances, I can't. And if my array is large, I
woudn't want to iterate over it over and over to do each of these steps,
I think. Anyway, I'm just goofing on all this, for the learning value,
but I'll appreciate any thoughts. Thanks.

I'm also trying to speed up the program at this point: the way I've set
it up now it builds a list of lists (of lists) of all the stats of all
the games of all the gamesets of all the multisets. I've visually
streamlined it some, without any effect on performance I can detect.
Would using arrays, or tuples, or something else be likely to be faster?
It's interesting that running it on my 8 y.o. Core 2 Duo and my 2 y.o.
Core I5 result in virtually exactly the same speed. Weird. Obviously,
it's just doing simple math, pretty much

--
Keith



Maybe this helps https://wiki.python.org/moin/PythonSpeed/PerformanceTips ?

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Chutes & Ladders

2013-12-23 Thread Steven D'Aprano
On Mon, Dec 23, 2013 at 01:07:15AM -0500, Keith Winston wrote:
> On Sun, Dec 22, 2013 at 3:04 PM,  wrote:
> 
> >
> > games = [p1.gameset(gamecount) for _ in range(multicount)]
[...]
> But in my haste I included the line above, cut & pasted from his
> suggestion, without understanding what the underscore is doing in there.

It's just a name. Names in Python can include alphanumeric characters 
and the underscore, and they can start with an underscore.

There is a convention to use _ as a "don't care" name for variables 
which aren't used. Some languages have a loop like:

repeat 5 times:
...

where there is no loop variable. Python isn't one of those languages, so 
the closest is to flag the loop variable as something we don't care 
about.


> I think I understand that at the prompt of the interpreter the underscore
> returns the last value returned... 

Correct. That's another convention for the single underscore. There's a 
third: _() as a function is used for translating strings from one 
language (say, English) to another language (say, German).



> but I can't really figure out what it's
> doing here.
> 
> Also: this statement worked fine:
> 
> for tmulti in games:
> print("{moves:9.2f} {chutes:12.2f} {ladders:13.2f}".format(
> moves=mean(tgset[1] for tgset in tmulti),
> chutes=mean(tgset[2] for tgset in tmulti),
> ladders=mean(tgset[3] for tgset in tmulti)
> ))
> 
> Which is sort of awesome to me, but in my efforts to riff on it I've been
> stumped: 

Break it up into pieces:

template = "{moves:9.2f} {chutes:12.2f} {ladders:13.2f}"
m = mean(tgset[1] for tgset in tmulti)
c = mean(tgset[2] for tgset in tmulti)
l = mean(tgset[3] for tgset in tmulti)
message = template.format(moves=m, chutes=c, ladders=l)
print(message)


> if I want to further process the arrays/lists my list
> comprehensions are generating, I sort of can't, since they're gone: that
> is, if I wanted to use the entire len(tmulti) of them to determine grand
> total averages and variances, I can't. 

I'm not entirely sure I understand what you are trying to say, but you 
can always save your list comprehension, then calculate with it:

moves = [tgset[1] for tgset in tmulti]
average_moves = mean(moves)
variance_moves = variance(moves)


> And if my array is large, I woudn't
> want to iterate over it over and over to do each of these steps, I think.

True, but I think that your idea of "large" is probably not so very 
large compared to what the computer considers large.

If speed is an issue, you can calculate both the mean and variance with 
a single pass over the data (although potentially with a loss of 
accuracy).


-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Using asyncio in event-driven network library

2013-12-23 Thread Tobias M.

On 22.12.2013 16:59, Tobias M. wrote:

On 12/22/2013 04:50 PM, Mark Lawrence wrote:


I'm sorry that I can't help directly, but the asyncio module is so 
new that I don't know if any of the other regulars here can help 
either :( I'd be inclined to wait for 24 hours from time of posting 
and if you don't get any positive responses, then ask again on the 
main Python mailing list/news group.  Note that personally I would 
not ask on stackoverflow, I've seen too many completely wrong answers 
there top voted.


Thanks for your advice. I actually wasn't sure which mailinglist is 
the best one for my question.

FYI: I just posted the question to the main Python mailing list
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Oscar Benjamin
On 22 December 2013 21:01, Dominik George  wrote:
>
> And it is what I hate *most*, especially on mailing lists. It makes me
> want to call for a complete GMail ban, because it appears GMail users
> *always* manage to do such things ...

Can we please focus on being welcoming to newcomers instead of making
unfounded generalisations?

I think it's very unfortunate that so many threads on python-list get
hijacked by flame wars about newsgroup etiquette but I don't want to
make it worse by wading in on them there. At least here in the tutor
list can we just try to be inviting? Keith has received several (IMO)
slightly rude and unhelpful replies about how to post here and now
you're having a go at all gmail users! Every email client has its
quirks and gmail is no exception but it can be used in a perfectly
reasonable way.

Suggestions about how to post should be given as advice rather than
criticism. It's obvious that the expected conduct on this list (no
plain-text, interleaved reply, quote attribution etc.) are surprising
to the majority of newcomers here. So when someone isn't aware of the
conventions or doesn't yet know how to follow them with their
technology then we shouldn't be surprised and certainly shouldn't make
them feel inadequate.

In short, if you're not going to offer constructive advice then please
don't bother. Being inviting to newcomers - showing *real* etiquette -
is significantly more important than at-all-times maintaining
newsgroup etiquette.


Oscar
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Using asyncio in event-driven network library

2013-12-23 Thread Mark Lawrence

On 23/12/2013 12:06, Tobias M. wrote:

On 22.12.2013 16:59, Tobias M. wrote:

On 12/22/2013 04:50 PM, Mark Lawrence wrote:


I'm sorry that I can't help directly, but the asyncio module is so
new that I don't know if any of the other regulars here can help
either :( I'd be inclined to wait for 24 hours from time of posting
and if you don't get any positive responses, then ask again on the
main Python mailing list/news group.  Note that personally I would
not ask on stackoverflow, I've seen too many completely wrong answers
there top voted.


Thanks for your advice. I actually wasn't sure which mailinglist is
the best one for my question.

FYI: I just posted the question to the main Python mailing list



I saw it.  Fingers crossed, or as they say on stage, go break a leg :)

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Mark Lawrence

On 23/12/2013 12:00, Oscar Benjamin wrote:

On 22 December 2013 21:01, Dominik George  wrote:


And it is what I hate *most*, especially on mailing lists. It makes me
want to call for a complete GMail ban, because it appears GMail users
*always* manage to do such things ...


Can we please focus on being welcoming to newcomers instead of making
unfounded generalisations?

I think it's very unfortunate that so many threads on python-list get
hijacked by flame wars about newsgroup etiquette but I don't want to
make it worse by wading in on them there. At least here in the tutor
list can we just try to be inviting? Keith has received several (IMO)
slightly rude and unhelpful replies about how to post here and now
you're having a go at all gmail users! Every email client has its
quirks and gmail is no exception but it can be used in a perfectly
reasonable way.

Suggestions about how to post should be given as advice rather than
criticism. It's obvious that the expected conduct on this list (no
plain-text, interleaved reply, quote attribution etc.) are surprising
to the majority of newcomers here. So when someone isn't aware of the
conventions or doesn't yet know how to follow them with their
technology then we shouldn't be surprised and certainly shouldn't make
them feel inadequate.

In short, if you're not going to offer constructive advice then please
don't bother. Being inviting to newcomers - showing *real* etiquette -
is significantly more important than at-all-times maintaining
newsgroup etiquette.


Oscar


I entirely agree.  I'll offer to supply the cotton wool, baby oil, bibs 
and nappies that we can wrap the newbies up in as we don't want to 
offend them.  I mean if we do offend them, they might desert us for 
places such as stackoverflow, where they can read top voted answers that 
are completely wrong.  They'll feel great but may have been lead up the 
garden path regarding Python.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Steven D'Aprano
On Mon, Dec 23, 2013 at 12:59:15PM +, Mark Lawrence wrote:

> I entirely agree.  I'll offer to supply the cotton wool, baby oil, bibs 
> and nappies that we can wrap the newbies up in 

"Wrap the newbies up in"? Who taught you to speak English? And what's 
with the two spaces after a full stop? It's not 1955 anymore, get with 
the program.

(See how annoying it is to have the substance of your post completely 
ignored while trivial incidentals are picked on? Are you now even a 
*tiny* bit moved to use a single space after full stops?)


> as we don't want to offend them.

It's not about *offending* them. It's about being a tedious, shrill 
nagger that makes the whole environment unpleasant for everybody, not 
just the newbies. If you can give advice without being unpleasant and a 
nag, please do so. Would you rather be "right", and ignored, or 
effective?


> I mean if we do offend them, they might desert us for 
> places such as stackoverflow, where they can read top voted answers that 
> are completely wrong.

I keep hearing people say this about StackOverflow, but whenever I 
google on a question I find plenty of good answers there. Yes, I see 
some pretty wrong or silly or ignorant answers, but not as the top-voted 
answer. Can you show me some of these top-voted but wrong answers?


-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Mark Lawrence

On 23/12/2013 15:11, Steven D'Aprano wrote:

On Mon, Dec 23, 2013 at 12:59:15PM +, Mark Lawrence wrote:


I entirely agree.  I'll offer to supply the cotton wool, baby oil, bibs
and nappies that we can wrap the newbies up in


"Wrap the newbies up in"? Who taught you to speak English?


My late parents.

And what's

with the two spaces after a full stop?


That's UK English, I don't care how people do English in the rest of the 
world as I live in Angleland.


It's not 1955 anymore, get with

the program.


You've clearly been taking too much notice of rr on the main mailing 
list.  Please just ignore him.




(See how annoying it is to have the substance of your post completely
ignored while trivial incidentals are picked on? Are you now even a
*tiny* bit moved to use a single space after full stops?)



No.




as we don't want to offend them.


It's not about *offending* them. It's about being a tedious, shrill
nagger that makes the whole environment unpleasant for everybody, not
just the newbies. If you can give advice without being unpleasant and a
nag, please do so. Would you rather be "right", and ignored, or
effective?


I'll nag who I bloody well like until such time time as they can post 
without pissing me off.  But what really pisses me off is people telling 
me how to behave.  So please stop nagging, you nagger.






I mean if we do offend them, they might desert us for
places such as stackoverflow, where they can read top voted answers that
are completely wrong.


I keep hearing people say this about StackOverflow, but whenever I
google on a question I find plenty of good answers there. Yes, I see
some pretty wrong or silly or ignorant answers, but not as the top-voted
answer. Can you show me some of these top-voted but wrong answers?




http://stackoverflow.com/questions/986006/python-how-do-i-pass-a-variable-by-reference

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Andy McKenzie
You know what?  I've been lurking here a long time.  I've asked a few
questions and gotten a few useful responses.

But overwhelmingly, when I think of this list, I find that my instinctive
response is "Full of rude, arrogant people."

So screw this.  I don't need to keep reading insults to people who are
trying to ask reasonable questions.  I don't need to read long rants about
how GMail is ruining the world and all its users ought to be banned.  I
don't need to watch people be harassed for daring to top-post.  There's at
least one post in every thread I read here that makes me think "This guy's
a jerk... why am I reading this?"

I'm done.  With the list, and possibly with Python... it doesn't seem to do
much that other languages I like don't do, and the loudest portion of the
language's advocates -- not the majority, just the loudest -- are just
plain obnoxious.  I don't need that in my life.

Good luck to all of you, and I hope your lives are pleasant.  And I hope
those of you who don't currently know learn how to treat people politely.

Andy McKenzie


On Mon, Dec 23, 2013 at 10:11 AM, Steven D'Aprano wrote:

> On Mon, Dec 23, 2013 at 12:59:15PM +, Mark Lawrence wrote:
>
> > I entirely agree.  I'll offer to supply the cotton wool, baby oil, bibs
> > and nappies that we can wrap the newbies up in
>
> "Wrap the newbies up in"? Who taught you to speak English? And what's
> with the two spaces after a full stop? It's not 1955 anymore, get with
> the program.
>
> (See how annoying it is to have the substance of your post completely
> ignored while trivial incidentals are picked on? Are you now even a
> *tiny* bit moved to use a single space after full stops?)
>
>
> > as we don't want to offend them.
>
> It's not about *offending* them. It's about being a tedious, shrill
> nagger that makes the whole environment unpleasant for everybody, not
> just the newbies. If you can give advice without being unpleasant and a
> nag, please do so. Would you rather be "right", and ignored, or
> effective?
>
>
> > I mean if we do offend them, they might desert us for
> > places such as stackoverflow, where they can read top voted answers that
> > are completely wrong.
>
> I keep hearing people say this about StackOverflow, but whenever I
> google on a question I find plenty of good answers there. Yes, I see
> some pretty wrong or silly or ignorant answers, but not as the top-voted
> answer. Can you show me some of these top-voted but wrong answers?
>
>
> --
> Steven
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Steven D'Aprano
On Mon, Dec 23, 2013 at 03:31:14PM +, Mark Lawrence wrote:
> On 23/12/2013 15:11, Steven D'Aprano wrote:
[...]
> >And what's
> >with the two spaces after a full stop?
> 
> That's UK English,

It isn't part of the English language. It's a *typesetting* convention, 
and one which was mostly popularised by the Americans in the mid-20th 
century. The history of sentence spacing is long and confusing, but 
before the invention of the typewriter sentence spacing was usually set 
to a single em-space between sentences, and a thin space between words. 
It was only after the invention of the typewriter that it became common 
to use a double em-space between sentences, and it really only took off 
and became really popular when the Americans took it up. With the 
development of proportional-width typewriters in the 1970s, and 
computerised type-setting in the 1980s, using double spaces between 
sentences is again frowned upon, as they are too wide.


> >(See how annoying it is to have the substance of your post completely
> >ignored while trivial incidentals are picked on? Are you now even a
> >*tiny* bit moved to use a single space after full stops?)
> 
> No.

And so you demonstrate my point for me.


> >>as we don't want to offend them.
> >
> >It's not about *offending* them. It's about being a tedious, shrill
> >nagger that makes the whole environment unpleasant for everybody, not
> >just the newbies. If you can give advice without being unpleasant and a
> >nag, please do so. Would you rather be "right", and ignored, or
> >effective?
> 
> I'll nag who I bloody well like until such time time as they can post 
> without pissing me off.  But what really pisses me off is people telling 
> me how to behave.

Oh the shameless hypocracy. So you think it's okay for you to be rude 
and obnoxious and nag anyone you like, but others mustn't do the same to 
you?


> So please stop nagging, you nagger.

I'm not nagging, I'm trying to reason with you. You're an intelligent 
man, surely you can tell the difference. If you actually want to support 
Python, as your signature claims, you should try to be less abrasive, 
more supportive, and lose the bad attitude. With the attitude you're 
displaying, you're doing more harm to Python than good.


> >>I mean if we do offend them, they might desert us for
> >>places such as stackoverflow, where they can read top voted answers that
> >>are completely wrong.
> >
> >I keep hearing people say this about StackOverflow, but whenever I
> >google on a question I find plenty of good answers there. Yes, I see
> >some pretty wrong or silly or ignorant answers, but not as the top-voted
> >answer. Can you show me some of these top-voted but wrong answers?
> 
> http://stackoverflow.com/questions/986006/python-how-do-i-pass-a-variable-by-reference

Nicely found. That's one. Any more?


-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Steven D'Aprano
With permission of the author, I have been asked to forward this to the 
list. I trust that those vigilantees on the warpath against gmail are 
happy now, as there is one fewer gmail user using Python.



- Forwarded message from Andy McKenzie  -

In-Reply-To: <20131223151122.GB29356@ando>
Date: Mon, 23 Dec 2013 10:17:19 -0500
Subject: Re: [Tutor] How to post: Was Re: The Charms of Gmail
From: Andy McKenzie 
To: "Steven D'Aprano" 

You know what?  I've been lurking here a long time.  I've asked a few
questions and gotten a few useful responses.

But overwhelmingly, when I think of this list, I find that my instinctive
response is "Full of rude, arrogant people."

So screw this.  I don't need to keep reading insults to people who are
trying to ask reasonable questions.  I don't need to read long rants about
how GMail is ruining the world and all its users ought to be banned.  I
don't need to watch people be harassed for daring to top-post.  There's at
least one post in every thread I read here that makes me think "This guy's
a jerk... why am I reading this?"

I'm done.  With the list, and possibly with Python... it doesn't seem to do
much that other languages I like don't do, and the loudest portion of the
language's advocates -- not the majority, just the loudest -- are just
plain obnoxious.  I don't need that in my life.

Good luck to all of you, and I hope your lives are pleasant.  And I hope
those of you who don't currently know learn how to treat people politely.

Andy McKenzie


On Mon, Dec 23, 2013 at 10:11 AM, Steven D'Aprano wrote:

> On Mon, Dec 23, 2013 at 12:59:15PM +, Mark Lawrence wrote:
>
> > I entirely agree.  I'll offer to supply the cotton wool, baby oil, bibs
> > and nappies that we can wrap the newbies up in
>
> "Wrap the newbies up in"? Who taught you to speak English? And what's
> with the two spaces after a full stop? It's not 1955 anymore, get with
> the program.
>
> (See how annoying it is to have the substance of your post completely
> ignored while trivial incidentals are picked on? Are you now even a
> *tiny* bit moved to use a single space after full stops?)
>
>
> > as we don't want to offend them.
>
> It's not about *offending* them. It's about being a tedious, shrill
> nagger that makes the whole environment unpleasant for everybody, not
> just the newbies. If you can give advice without being unpleasant and a
> nag, please do so. Would you rather be "right", and ignored, or
> effective?
>
>
> > I mean if we do offend them, they might desert us for
> > places such as stackoverflow, where they can read top voted answers that
> > are completely wrong.
>
> I keep hearing people say this about StackOverflow, but whenever I
> google on a question I find plenty of good answers there. Yes, I see
> some pretty wrong or silly or ignorant answers, but not as the top-voted
> answer. Can you show me some of these top-voted but wrong answers?
>
>
> --
> Steven
> ___
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor
>

- End forwarded message -
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Mark Lawrence

On 23/12/2013 16:26, Steven D'Aprano wrote:

With permission of the author, I have been asked to forward this to the
list. I trust that those vigilantees on the warpath against gmail are
happy now, as there is one fewer gmail user using Python.



what excellent news.  With any luck we'll soon be rid of the whole lot!!!

--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Prasad, Ramit
Mark Lawrence wrote:
> I'll nag who I bloody well like until such time time as they can post
> without pissing me off.  But what really pisses me off is people telling
> me how to behave.  So please stop nagging, you nagger.

Oh, the irony. 


~Ramit



This email is confidential and subject to important disclaimers and conditions 
including on offers for the purchase or sale of securities, accuracy and 
completeness of information, viruses, confidentiality, legal privilege, and 
legal entity disclaimers, available at 
http://www.jpmorgan.com/pages/disclosures/email.  
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Danny Yoo
Would everyone mind dropping this thread, at least for a few days?

As far as I can tell, there's zero Python content in it, so I'm not
getting much information from it.  More than that, it's affecting my
morale in a fairly negative manner.  Thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread emile

On 12/23/2013 07:11 AM, Steven D'Aprano wrote:


Are you now even a
*tiny* bit moved to use a single space after full stops?)


No.  See http://www.heracliteanriver.com/?p=324

Emile

___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Danny Yoo
Hi Emile,

Can we cut this thread off for a while?  I know it's interesting to
talk about the proper way of posting and composing mails: it's
something of a meta-topic, and therefore can attract a lot of
discussion due to it's self-feeding nature.

But it seems somewhat tangent to learning how to program in Python.

For all the discussion about the proper rules to post and comment,
we're focusing on the letter of the law.  But the spirit of the word
needs to be given some respect as well: we're all here to help and
learn and teach programming.

Anything that's separate from that is fine---humans should be free to
talk to humans!---but we should be careful not to distract from the
goal of tutoring.  This thread, in my mind, is a distraction.

Thanks.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Ricardo Aráoz

El 23/12/13 12:31, Mark Lawrence escribió:


I'll nag who I bloody well like until such time time as they can post 
without pissing me off.  But what really pisses me off is people 
telling me how to behave.  So please stop nagging, you nagger.


And that's a PLONK!
You are not so interesting that I would be willing to overlook this.
Bye.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Cantor pairing in three dimensions?

2013-12-23 Thread Danny Yoo
I've got a puzzle: so there's a well-known function that maps the
naturals N to N^2: it's called Cantor pairing:

http://en.wikipedia.org/wiki/Pairing_function

It's one of those mind-blowing things that I love.  I ran across it a
few years ago in a thread on Python-tutor a few years back:

https://mail.python.org/pipermail/tutor/2001-April/004888.html


Recently, the topic came up again for me, but in an expanded context:

https://plus.google.com/117784658632980303930/posts/4SMcjm2p9vv


So here's the question: is there an analogy of the Cantor pairing
function that maps N to N^3?
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Tim Johnson
* Danny Yoo  [131223 07:48]:
> Would everyone mind dropping this thread, at least for a few days?
> 
> As far as I can tell, there's zero Python content in it, so I'm not
> getting much information from it.  More than that, it's affecting my
> morale in a fairly negative manner.  Thanks.
  I've been on this list since 2000 or 2001. This is where I learned
  python and Danny has been one of my mentors. Danny's grace and
  tact should make his behavior a role model for the rest on this
  ML.

  Consider that what is posted to this list is archived and could go
  far to repesent what the poster might be as a prospective employee,
  mate, president, chairman of the Fed or whatever  :)

  I hope that you all have the best holiday season possible and that
  you have a great New Year.
-- 
Tim 
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com, http://www.tj49.com
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Cantor pairing in three dimensions?

2013-12-23 Thread Steven D'Aprano
On Mon, Dec 23, 2013 at 10:32:14AM -0800, Danny Yoo wrote:
> I've got a puzzle: so there's a well-known function that maps the
> naturals N to N^2: it's called Cantor pairing:
> 
> http://en.wikipedia.org/wiki/Pairing_function
[...]
> So here's the question: is there an analogy of the Cantor pairing
> function that maps N to N^3?

The Wikipedia article talks about generalizing the function so as to 
map N^k -> N for any integer k >= 1, so I would say so.

The mapping from N^3 -> N seems to be called the tripling function. Try 
this to start:

http://szudzik.com/ElegantPairing.pdf


Translating the Mathematica code into Python should be straight-forward.



-- 
Steven
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Fwd: Re: How to post: Was Re: The Charms of Gmail

2013-12-23 Thread Keith Winston
Yikes, as the progenitor of the antecedent of this screed... I'm sorry! I
have found, by and large, this to be a very helpful list, there's no
question it has kept me moving forward at times that I might not have in
python. Lots of generosity and knowledge. And when someone suggested a way
of doing gmail that should resolve some problems,I was happy to do it,
since my tedious manual efforts weren't very successful.

Anyway, I'd suggest people could consider being a little gentler with each
other, but mostly for the umpteenth time I'll appreciate the help I've
gotten here. It's a great list.

Okay this is funny... I'm responding on my phone, and I can't tell if it's
including anything I can't see;)
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor