Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Chris Angelico
On Thu, Oct 3, 2013 at 12:34 PM, Steven D'Aprano wrote: > py> def f(): > ... a = (1, 2, 3) > ... b = (1, 2, 3) > ... return a is b > ... > py> f() # Are the tuples the same object? > False That just means the compiler doesn't detect reuse of the same tuple. But compare: >>> def f():

Re: Goodbye: was JUST GOT HACKED

2013-10-02 Thread Ravi Sahni
On Thu, Oct 3, 2013 at 2:43 AM, Walter Hurry wrote: > Ding ding! Nikos is simply trolling. It's easy enough to killfile him but > inconvenient to skip all the answers to his lengthy threads. If only > people would just ignore him! Hello Walter Hurry please wait! Did I do/say something wrong?! If

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Terry Reedy
On 10/2/2013 9:24 PM, Steven D'Aprano wrote: On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: CPython core developers have be very conservative about what tranformations they put into the compiler. (1,2,3) can always be compiled as a constant, and so it is. [1,2,3] might or might not be a

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Terry Reedy
On 10/2/2013 9:46 PM, MRAB wrote: On 03/10/2013 02:39, Dave Angel wrote: On 2/10/2013 21:24, Steven D'Aprano wrote: On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: CPython core developers have be very conservative about what tranformations they put into the compiler. (1,2,3) can alway

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Steven D'Aprano
On Thu, 03 Oct 2013 02:46:53 +0100, MRAB wrote: > On 03/10/2013 02:39, Dave Angel wrote: >> On 2/10/2013 21:24, Steven D'Aprano wrote: >> >>> On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: >>> CPython core developers have be very conservative about what tranformations they put in

Re: hg.python.org: Server unresponsive and timeout

2013-10-02 Thread Terry Reedy
On 10/2/2013 7:07 PM, Ben Finney wrote: Terry Reedy writes: If you have a particular persistent problem with hg.python.org, I suggest talking to your ISP. If a reproducible issue is discovered, to whom should it be reported? The Python bug tracker doesn't seem to allow reports of fault in th

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread MRAB
On 03/10/2013 02:39, Dave Angel wrote: On 2/10/2013 21:24, Steven D'Aprano wrote: On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: CPython core developers have be very conservative about what tranformations they put into the compiler. (1,2,3) can always be compiled as a constant, and so

ANN: PyQt5 v5.1 Released

2013-10-02 Thread Phil Thompson
PyQt5 v5.1 has been released and is available from http://www.riverbankcomputing.com/software/pyqt/download5. PyQt5 is a comprehensive set of bindings for v5 of Digia's Qt cross-platform application framework. It supports Python v3, v2.7 and v2.6. The highlights of this release include full supp

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Dave Angel
On 2/10/2013 21:24, Steven D'Aprano wrote: > On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: > >> CPython core developers have be very conservative about what >> tranformations they put into the compiler. (1,2,3) can always be >> compiled as a constant, and so it is. [1,2,3] might or might

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 18:17:06 -0400, Terry Reedy wrote: > CPython core developers have be very conservative about what > tranformations they put into the compiler. (1,2,3) can always be > compiled as a constant, and so it is. [1,2,3] might or might not be a > constant, depending on the context, and

Re: Efficency help for a Calculator Program

2013-10-02 Thread Chris Angelico
On Thu, Oct 3, 2013 at 9:47 AM, Dennis Lee Bieber wrote: > try: > numItems = int(raw_input("\n\nHow many values? ")) > except: #naked exception is not really good programming > print "Invalid input, exiting..." > sys.exit(1) Please don't _ever_ advocate this pr

Re: hg.python.org: Server unresponsive and timeout

2013-10-02 Thread Ben Finney
Terry Reedy writes: > If you have a particular persistent problem with hg.python.org, I > suggest talking to your ISP. If a reproducible issue is discovered, to whom should it be reported? The Python bug tracker doesn't seem to allow reports of fault in the python.org infrastructure. -- \

Re: Goodbye: was JUST GOT HACKED

2013-10-02 Thread Terry Reedy
On 10/2/2013 5:13 PM, Walter Hurry wrote: Ding ding! Nikos is simply trolling. It's easy enough to killfile him but inconvenient to skip all the answers to his lengthy threads. Use news.gmane.org newsgroup gmane.comp.python.general and current Thunderbird or other newsreader with 'Ignore thre

Re: Killing threads with TB

2013-10-02 Thread Mark Lawrence
On 02/10/2013 23:34, Terry Reedy wrote: On 10/2/2013 9:21 AM, Tim Chase wrote: On 2013-10-02 05:38, feedthetr...@gmx.de wrote: (Hey Thunderbird has a very useful new feature. Ignore thread.) Unfortunately, as of when I last tested it, it only works in the newsgroup part of TB, not the mail po

Re: Killing threads with TB

2013-10-02 Thread Terry Reedy
On 10/2/2013 9:21 AM, Tim Chase wrote: On 2013-10-02 05:38, feedthetr...@gmx.de wrote: (Hey Thunderbird has a very useful new feature. Ignore thread.) Unfortunately, as of when I last tested it, it only works in the newsgroup part of TB, not the mail portion of TB. One can read python-list a

Re: Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
On 2013-W40-3, at 21:15, Stefan Behnel wrote: > Michael Schwarz, 02.10.2013 17:38: >> I've just started looking into distutils because I need to write an >> extension module in C (for performance reasons) and distutils seems to be >> the most straight-forward way. >> >> I've had success building

Re: hg.python.org: Server unresponsive and timeout

2013-10-02 Thread Terry Reedy
On 10/2/2013 5:36 AM, Tae Wong wrote: This post is irrelevant from using Python; so it's an Internet server problem. When you try to connect to hg.python.org, the connection takes forever. I believe hg.python.org is on a different machine than python.org. It has occasionally been down, but wo

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Terry Reedy
On 10/2/2013 4:17 AM, Alain Ketterlin wrote: Terry Reedy writes: Part of the reason that Python does not do tail call optimization is that turning tail recursion into while iteration is almost trivial, once you know the secret of the two easy steps. Here it is. Assume that you have already do

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
>> Part of the reason that Python does not do tail call optimization is >> that turning tail recursion into while iteration is almost trivial, once >> you know the secret of the two easy steps. Here it is. > > That should be a reason it _does_ do it - saying people should rewrite > their functions

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Terry Reedy
On 10/2/2013 8:31 AM, random...@fastmail.us wrote: On Tue, Oct 1, 2013, at 17:30, Terry Reedy wrote: Part of the reason that Python does not do tail call optimization is that turning tail recursion into while iteration is almost trivial, once you know the secret of the two easy steps. Here it is

Goodbye: was JUST GOT HACKED

2013-10-02 Thread Walter Hurry
On Wed, 02 Oct 2013 09:51:26 +0200, Antoon Pardon wrote: > Op 02-10-13 09:02, Ravi Sahni schreef: >> On Wed, Oct 2, 2013 at 12:19 PM, Ben Finney >> wrote: >>> Antoon Pardon writes: >>> Op 02-10-13 00:06, Ben Finney schreef: > This is an unmoderated forum, so we have occasional spates of

Hyper-spacial ray-tracer

2013-10-02 Thread Rouslan Korneychuk
I have been working on something I thought was interesting and I wanted to know what other people think. It's a ray-tracing library than can work with any number of spacial dimensions greater than two. It's a Python package that uses Pygame. The project and a screenshot are at: https://github.

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
On Wed, Oct 2, 2013 at 1:23 PM, Alain Ketterlin wrote: > On 10/02/2013 08:59 PM, Mark Janssen wrote: def fact(n): return 1 if n <= 1 else n * fact(n-1) >>> >>> How do know that either "<=" or "*" didn't rebind the name "fact" to >>> something else? I think that's the main reason why pyth

Trolls, Nikos, Ferrous Cranus

2013-10-02 Thread Alan Spence
Steven D'Aprano once wrote: > Definitely troll, and we got well and truly had. > > Shame on us -- he practically *screamed* "I am a troll" in his user-name. > "Ferrous Cranus" ("Iron Skull") is the name of a particular subspecies of > troll in Mike Reed's well known compendium: > > http://redwin

Re: Running code from source that includes extension modules

2013-10-02 Thread Stefan Behnel
Michael Schwarz, 02.10.2013 17:38: > I've just started looking into distutils because I need to write an > extension module in C (for performance reasons) and distutils seems to be > the most straight-forward way. > > I've had success building a C file into a Python extension module using > "pytho

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 10:04:49 -0400, random832 wrote: > On Wed, Oct 2, 2013, at 9:32, Steven D'Aprano wrote: >> Python is not as aggressively functional as (say) Haskell, but it is >> surely an exaggeration to suggest that the failure to include tail call >> optimization means that Python "rejects"

Re: I haev fixed it

2013-10-02 Thread Denis McMahon
On Wed, 02 Oct 2013 17:07:43 +0100, Mark Lawrence wrote: > Pardon my ignorance but how does asking for an apology translate into > threatening legal action, something that I've already stated that I > won't do for several reasons, the main one of which is that I find these > threads hilarious? Yo

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Mark Janssen
>> def fact(n): return 1 if n <= 1 else n * fact(n-1) >> >> into a tail recursion like > [...] > > How do know that either "<=" or "*" didn't rebind the name "fact" to > something else? I think that's the main reason why python cannot apply > any procedural optimization (even things like inlining a

Re: Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
On 2013-W40-3, at 19:15, "Gisle Vanem" wrote: > "Michael Schwarz" wrote: > >> So how do I run my code so it will find the built extension module? Do I >> pass the output directory on the command line manually or is there some >> other solution? I would like to still be able to run the code from

Re: JUST GOT HACKED

2013-10-02 Thread Ravi Sahni
On Wed, Oct 2, 2013 at 10:14 PM, wrote: > On 10/02/2013 01:02 AM, Ravi Sahni wrote: >> On Wed, Oct 2, 2013 at 12:19 PM, Ben Finney >> wrote: >>> Antoon Pardon writes: >>> Op 02-10-13 00:06, Ben Finney schreef: > This is an unmoderated forum, so we have occasional spates of > per

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Νίκος Αλεξόπουλος
Στις 2/10/2013 8:39 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to run arbitrary code

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Ethan Furman
On 10/02/2013 07:46 AM, Νίκος wrote: Στις 2/10/2013 4:58 μμ, ο/η Ned Batchelder έγραψε: As others have said in this thread, this is not a Python topic. Find another forum for this question. Do not ask it here again. You've said that you can improve. Show us by not asking non-Python questions

ANN: rom 0.21 - Redis object mapper for Python

2013-10-02 Thread Josiah Carlson
Hey everyone, As time progresses, so does my Redis object mapper. The "rom" package is a Redis object mapper for Python. It sports an interface similar to Django's ORM, SQLAlchemy + Elixir, or Appengine's datastore. The changelog for recent releases can be seen below my signature. You can find

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: > Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: >> On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: >> >>> Is it possible for someone that knows the MYSQL password of a server >>> to run arbitrary code on a linux server? >> >> Yes, it is possi

Re: Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread Neil Cerutti
On 2013-10-02, trip...@gmail.com wrote: > am trying to round off values in a dict to 2 decimal points > but have been unsuccessful so far. The input I have is like > this: > > y = [{'a': 80.0, 'b': 0.0786235, 'c': 10.0, 'd': 10.6742903}, {'a': > 80.73246, 'b': 0.0, 'c': 10.780323, 'd': 10.

Re: Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread Joel Goldstick
On Wed, Oct 2, 2013 at 1:01 PM, wrote: > am trying to round off values in a dict to 2 decimal points but have been > unsuccessful so far. The input I have is like this: > > > y = [{'a': 80.0, 'b': 0.0786235, 'c': 10.0, 'd': 10.6742903}, {'a': > 80.73246, 'b': 0.0, 'c': 10.780323, 'd': 10.0

Re: Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread Jussi Piitulainen
trip...@gmail.com writes: > am trying to round off values in a dict to 2 decimal points but > have been unsuccessful so far. The input I have is like this: > > y = [{'a': 80.0, 'b': 0.0786235, 'c': 10.0, 'd': 10.6742903}, > {'a': 80.73246, 'b': 0.0, 'c': 10.780323, 'd': 10.0}, {'a': >

Re: Running code from source that includes extension modules

2013-10-02 Thread Gisle Vanem
"Michael Schwarz" wrote: So how do I run my code so it will find the built extension module? Do I pass the output directory on the command line manually or is there some other solution? I would like to still be able to run the code from the source directory as I'm using PyCharm to edit and debu

Re: Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread Skip Montanaro
> def roundingVals_toTwoDeci(): > global y > for d in y: > for k, v in d.items(): > v = ceil(v*100)/100.0 > return > roundingVals_toTwoDeci() > > > > But it is not working - I am still getting the old values. You're not assigning the rou

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Νίκος Ακεξόπουλος
Στις 2/10/2013 6:13 μμ, ο/η Ravi Sahni έγραψε: On Wed, Oct 2, 2013 at 8:04 PM, Alister wrote: On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQ

Rounding off Values of dicts (in a list) to 2 decimal points

2013-10-02 Thread tripsvt
am trying to round off values in a dict to 2 decimal points but have been unsuccessful so far. The input I have is like this: y = [{'a': 80.0, 'b': 0.0786235, 'c': 10.0, 'd': 10.6742903}, {'a': 80.73246, 'b': 0.0, 'c': 10.780323, 'd': 10.0}, {'a': 80.7239, 'b': 0.7823640, 'c': 10.0, 'd':

Re: JUST GOT HACKED

2013-10-02 Thread rurpy
On 10/02/2013 01:02 AM, Ravi Sahni wrote: > On Wed, Oct 2, 2013 at 12:19 PM, Ben Finney > wrote: >> Antoon Pardon writes: >> >>> Op 02-10-13 00:06, Ben Finney schreef: >>> > This is an unmoderated forum, so we have occasional spates of >>> > persistent nuisances, and those who respond with the m

Re: JUST GOT HACKED

2013-10-02 Thread rurpy
On 10/01/2013 08:24 AM, Daniel Stojanov wrote: > On 02/10/2013 12:05 AM, "Νίκος" wrote: > >> Thanks for visting my website: you help me increase my google page >> rank without actually utilizing SEO. >> >> -- https://mail.python.org/mailman/listinfo/python-list > > 1) You need links, not page v

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Ravi Sahni
On Wed, Oct 2, 2013 at 8:04 PM, Alister wrote: > On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: > >> Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: >>> On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: >>> Is it possible for someone that knows the MYSQL password of a server to run

Re: JUST GOT HACKED

2013-10-02 Thread Neil Cerutti
On 2013-10-02, Steven D'Aprano wrote: > When I kill-file somebody, I tell them, and I always make it > temporary. This is not a matter of elitism, it is a matter of > responding to bad behaviour and sending a message that it is > inappropriate -- if you behave badly, I will not see your > messages

Re: I haev fixed it

2013-10-02 Thread Mark Lawrence
On 02/10/2013 16:48, Denis McMahon wrote: On Wed, 02 Oct 2013 15:01:31 +0100, Mark Lawrence wrote: I want a full apology to this entire group now for your behaviour, and a very specific formal apology to myself for your completely unfounded allegations. I expect to see this by 23:59 2nd Octobe

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Denis McMahon
On Wed, 02 Oct 2013 17:46:08 +0300, Νίκος wrote: > But i need to know what happened and how this .html file got uploaded. The html file started out in an editor on on another machine, and was created by someone typing at the keyboard. It was then saved to hard disk as a file. The other machine

Re: JUST GOT HACKED

2013-10-02 Thread Denis McMahon
On Wed, 02 Oct 2013 13:22:25 +0300, Νίκος wrote: > I was even mocked because all i wanted to do was to optimize code and > use the best solution there is to it. No. You were mocked because you insisted that your broken one line code was a better looking solution than anyone elses working multi l

Re: I haev fixed it

2013-10-02 Thread Denis McMahon
On Wed, 02 Oct 2013 15:01:31 +0100, Mark Lawrence wrote: > I want a full apology to this entire group now for your behaviour, and a > very specific formal apology to myself for your completely unfounded > allegations. I expect to see this by 23:59 2nd October 2013 BST. Honestly? Or you'll do wha

Running code from source that includes extension modules

2013-10-02 Thread Michael Schwarz
Hi I've just started looking into distutils because I need to write an extension module in C (for performance reasons) and distutils seems to be the most straight-forward way. I've had success building a C file into a Python extension module using "python setup.py build" but I am wondering what t

Re: PyDoc_STRVAR error in msvc compile

2013-10-02 Thread MRAB
On 02/10/2013 12:28, Robin Becker wrote: On 02/10/2013 11:49, Dave Angel wrote: conditional string or "" then MSVC 9 seems to be ok with it. > MSVC and other compilers do not not see eye to eye on the preprocessor semantics. I no longer use MSVC so I can't experiment. I can only try to recall

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Ned Batchelder
On 10/2/13 10:46 AM, Νίκος wrote: Στις 2/10/2013 4:58 μμ, ο/η Ned Batchelder έγραψε: On 10/2/13 9:41 AM, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread ishish
Am 02.10.2013 15:46, schrieb Νίκος: But i need to know what happened and how this .html file got uploaded. This is not a python question, but this happened from this pythons NG. ... ... Who says that?? -- https://mail.python.org/mailman/listinfo/python-list

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Alister
On Wed, 02 Oct 2013 16:41:40 +0300, Νίκος wrote: > Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: >> On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: >> >>> Is it possible for someone that knows the MYSQL password of a server >>> to run arbitrary code on a linux server? >> >> Yes, it is possi

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Νίκος
Στις 2/10/2013 4:58 μμ, ο/η Ned Batchelder έγραψε: On 10/2/13 9:41 AM, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to run arbitrary code on a linux server

Re: JUST GOT HACKED

2013-10-02 Thread Rod Person
On 10/2/2013 9:30 AM, Νίκος wrote: You learn and you are forced to solve problems better when you deal with real time problems. https://tinyurl.com/44teepw -- Rod The guide of millers uses only the finest grains: true Roman breads, for true Romans. -- https://mail.python.org/mailman/listinf

Re: Lowest Value in List

2013-10-02 Thread Ravi Sahni
On Wed, Oct 2, 2013 at 3:34 PM, wrote: > Dear Group, > > I am trying to work out a solution to the following problem in Python. > > The Problem: > Suppose I have three lists. > Each list is having 10 elements in ascending order. > I have to construct one list having 10 elements which are of the l

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread random832
On Wed, Oct 2, 2013, at 9:32, Steven D'Aprano wrote: > Python is not as aggressively functional as (say) Haskell, but it is > surely an exaggeration to suggest that the failure to include tail call > optimization means that Python "rejects" functional programming styles. > You can still write yo

Re: JUST GOT HACKED

2013-10-02 Thread Ravi Sahni
On Wed, Oct 2, 2013 at 1:21 PM, Antoon Pardon wrote: > Op 02-10-13 09:02, Ravi Sahni schreef: >> On Wed, Oct 2, 2013 at 12:19 PM, Ben Finney >> wrote: >>> Antoon Pardon writes: >>> Op 02-10-13 00:06, Ben Finney schreef: > This is an unmoderated forum, so we have occasional spates of >>

Re: I haev fixed it

2013-10-02 Thread Mark Lawrence
On 02/10/2013 00:28, Νίκος wrote: Στις 2/10/2013 1:57 πμ, ο/η Mark Lawrence έγραψε: On 01/10/2013 23:46, Νίκος wrote: If only there was a log file that could show the connection made by the hacker's host, so to post it here. I'd write a serious letter of complaint to all of your customers as

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Ned Batchelder
On 10/2/13 9:41 AM, Νίκος wrote: Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to run arbitrary code on a linux server? Yes, it is possible. Is that what might have h

Re: python function parameters, debugging, comments, etc.

2013-10-02 Thread Rotwang
On 02/10/2013 11:15, Oscar Benjamin wrote: On 2 October 2013 00:45, Rotwang wrote: So the upside of duck-typing is clear. But as you've already discovered, so is the downside: Python's dynamic nature means that there's no way for the interpreter to know what kind of arguments a function will a

Re: Efficency help for a Calculator Program

2013-10-02 Thread JonDoe297
On Wednesday, October 2, 2013 4:31:03 PM UTC+5:30, Chris Angelico wrote: > On Wed, Oct 2, 2013 at 8:44 PM, JonDoe297 wrote: > > > Is there any way to make it smaller? It does it's job, but I want it to > > look smaller, more efficient. > > > > Yes, it is, but let me first clarify something: "S

Re: PyDoc_STRVAR error in msvc compile

2013-10-02 Thread Robin Becker
On 02/10/2013 13:05, Dave Angel wrote: On 2/10/2013 07:28, Robin Becker wrote: The actual is this code from _renderPM.c https://bitbucket.org/rptlab/reportlab/src/fa65fe72b6c2aaecb7747bf14884adb996d8e87f/src/rl_addons/renderPM/_renderPM.c?at=default at the end of the lines etc etc

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Νίκος
Στις 2/10/2013 4:25 μμ, ο/η Steven D'Aprano έγραψε: On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: Is it possible for someone that knows the MYSQL password of a server to run arbitrary code on a linux server? Yes, it is possible. Is that what might have happened and someone managed to upl

Re: JUST GOT HACKED

2013-10-02 Thread Grant Edwards
On 2013-10-02, Ravi Sahni wrote: > On Wed, Oct 2, 2013 at 12:19 PM, Ben Finney > wrote: >> Antoon Pardon writes: >>> Op 02-10-13 00:06, Ben Finney schreef: >>> And what about the impuls control and the maturity of people who can't >>> stop answering [a nuisance], knowing they contribute to the

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 08:31:25 -0400, random832 wrote: > On Tue, Oct 1, 2013, at 17:30, Terry Reedy wrote: >> Part of the reason that Python does not do tail call optimization is >> that turning tail recursion into while iteration is almost trivial, >> once you know the secret of the two easy steps.

Re: JUST GOT HACKED

2013-10-02 Thread Chris Angelico
On Wed, Oct 2, 2013 at 10:51 PM, Steven D'Aprano wrote: > On Wed, 02 Oct 2013 04:42:32 -0700, feedthetroll wrote: > >> "Learning for personal pleasure" and "business server" can't be true >> both. > > Utter nonsense. Some people are fortunate enough to be paid to do > something that gives them ple

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
Στις 2/10/2013 4:12 μμ, ο/η Antoon Pardon έγραψε: Op 02-10-13 14:51, Steven D'Aprano schreef: On Wed, 02 Oct 2013 04:42:32 -0700, feedthetroll wrote: "Learning for personal pleasure" and "business server" can't be true both. Utter nonsense. Some people are fortunate enough to be paid to do s

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 15:20:00 +0300, Νίκος wrote: > Is it possible for someone that knows the MYSQL password of a server to > run arbitrary code on a linux server? Yes, it is possible. > Okey he uses the password and he gain access to the databases, then > what? MySQL is a database server how can

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread rusi
On Wednesday, October 2, 2013 1:53:46 PM UTC+5:30, Alain Ketterlin wrote: > rusi writes: > > > > > On Wednesday, October 2, 2013 3:00:41 AM UTC+5:30, Terry Reedy wrote: > >> Part of the reason that Python does not do tail call optimization is > >> that turning tail recursion into while iteratio

Re: JUST GOT HACKED

2013-10-02 Thread Tim Chase
On 2013-10-02 13:43, Νίκος wrote: > 2. Still feel that that the solution provided to me doesn't meet my > needs and should have been re-written in a different way. This is part of the trouble people had recently in the IP-address/default-value thread. Python has what folks here call a "pythonic"

Re: JUST GOT HACKED

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 13:28:11 +0200, Antoon Pardon wrote: > Op 02-10-13 11:08, Steven D'Aprano schreef: >> On Wed, 02 Oct 2013 12:32:57 +0530, Ravi Sahni wrote: >> >>> I find this real confused!! Why they are answering then?!?! As far as >>> I can make out everyone who is answering (helping!) doin

Re: Killing threads with TB (was: Can arbitrary code run in a server if someone's know just the MySQL password?)

2013-10-02 Thread Tim Chase
On 2013-10-02 05:38, feedthetr...@gmx.de wrote: > (Hey Thunderbird has a very useful new feature. Ignore thread.) Unfortunately, as of when I last tested it, it only works in the newsgroup part of TB, not the mail portion of TB. Sadly, Claws-Mail (my current mailer) doesn't have a native kill-thr

Re: JUST GOT HACKED

2013-10-02 Thread Antoon Pardon
Op 02-10-13 14:51, Steven D'Aprano schreef: > On Wed, 02 Oct 2013 04:42:32 -0700, feedthetroll wrote: > >> "Learning for personal pleasure" and "business server" can't be true >> both. > > Utter nonsense. Some people are fortunate enough to be paid to do > something that gives them pleasure. Man

Re: JUST GOT HACKED

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 14:03:25 +0300, Νίκος wrote: > I have to make some money and that needs for some reason to happen now > as we speak, so i have no alternative than to hop into a car and learn > to drive during the process, hoping i will not bang-smash the car. Yes you have alternatives. You ha

Re: Lowest Value in List

2013-10-02 Thread dvghana
On Wednesday, October 2, 2013 10:04:16 AM UTC, subhaba...@gmail.com wrote: > Dear Group, > > > > I am trying to work out a solution to the following problem in Python. > > > > The Problem: > > Suppose I have three lists. > > Each list is having 10 elements in ascending order. > > I have t

Re: JUST GOT HACKED

2013-10-02 Thread ishish
Am 02.10.2013 13:47, schrieb Chris “Kwpolska” Warrick: On Wed, Oct 2, 2013 at 1:48 AM, Tim Delaney wrote: On 2 October 2013 09:28, Νίκος wrote: con = pymysql.connect( db = 'mypass', user = 'myuser', passwd = 'mysqlpass', charset = 'utf8', host = 'localhost' ) That was viewable by the link

Re: JUST GOT HACKED

2013-10-02 Thread Steven D'Aprano
On Wed, 02 Oct 2013 04:42:32 -0700, feedthetroll wrote: > "Learning for personal pleasure" and "business server" can't be true > both. Utter nonsense. Some people are fortunate enough to be paid to do something that gives them pleasure. Many programmers and system administrators are in that luc

Re: JUST GOT HACKED

2013-10-02 Thread Chris “Kwpolska” Warrick
On Wed, Oct 2, 2013 at 1:48 AM, Tim Delaney wrote: > On 2 October 2013 09:28, Νίκος wrote: >> >> >> con = pymysql.connect( db = 'mypass', user = 'myuser', passwd = >> 'mysqlpass', charset = 'utf8', host = 'localhost' ) >> >> That was viewable by the link Mark have posted. >> >> But this wasnt my

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread feedthetroll
Am Mittwoch, 2. Oktober 2013 14:20:00 UTC+2 schrieb Ferrous Cranus: > ... > Is it possible for someone that knows the MYSQL password of a server to > run arbitrary code on a linux server? > ... > If yes, can you give an example please? http://lmgtfy.com/?q=mysql+shell+escape > Please, serious rep

Re: Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Antoon Pardon
Op 02-10-13 14:20, Νίκος schreef: > Tim delaney said: > > "Because there's no chance with the brilliance you display that there > could be any possibility of login details being kept in plaintext in > your database. > > And of course your database is so well locked down that no attacker with > a

Re: Tail recursion to while iteration in 2 easy steps

2013-10-02 Thread random832
On Tue, Oct 1, 2013, at 17:30, Terry Reedy wrote: > Part of the reason that Python does not do tail call optimization is > that turning tail recursion into while iteration is almost trivial, once > you know the secret of the two easy steps. Here it is. That should be a reason it _does_ do it - s

Can arbitrary code run in a server if someone's know just the MySQL password?

2013-10-02 Thread Νίκος
Tim delaney said: "Because there's no chance with the brilliance you display that there could be any possibility of login details being kept in plaintext in your database. And of course your database is so well locked down that no attacker with a login to it could then execute arbitrary code

Re: Stop posting HTML [was Re: I haev fixed it]

2013-10-02 Thread Dave Angel
On 1/10/2013 23:33, Michael Torrie wrote: > On 10/01/2013 08:40 PM, Steven D'Aprano wrote: >> On Tue, 01 Oct 2013 22:02:36 -0400, Joel Goldstick wrote: >> >>> On Tue, Oct 1, 2013 at 9:52 PM, Steven D'Aprano < >>> steve+comp.lang.pyt...@pearwood.info> wrote: >>> Joel, you've been asked repeat

Re: PyDoc_STRVAR error in msvc compile

2013-10-02 Thread Dave Angel
On 2/10/2013 07:28, Robin Becker wrote: > The actual is this code from _renderPM.c > > https://bitbucket.org/rptlab/reportlab/src/fa65fe72b6c2aaecb7747bf14884adb996d8e87f/src/rl_addons/renderPM/_renderPM.c?at=default > > PyDoc_STRVAR(__DOC__, > "Helper extension module for renderPM.\n\ > \n\ > In

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
Στις 2/10/2013 2:42 μμ, ο/η feedthetr...@gmx.de έγραψε: Am Mittwoch, 2. Oktober 2013 12:52:39 UTC+2 schrieb Ferrous Cranus: ... By the way: if you haven't already, you'll want to remove the extra line from your .htaccess file. Tell me the line you are referring to. I think it will be the line

Re: JUST GOT HACKED

2013-10-02 Thread feedthetroll
Am Mittwoch, 2. Oktober 2013 12:52:39 UTC+2 schrieb Ferrous Cranus: > ... >> By the way: if you haven't already, you'll want to remove the extra line >> from your .htaccess file. > Tell me the line you are referring to. I think it will be the line YOU did NOT enter. Just take a look yourself. The

Re: JUST GOT HACKED

2013-10-02 Thread Heiko Wundram
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Am 02.10.2013 13:03, schrieb Νίκος: > I have to make some money and that needs for some reason to happen > now as we speak, so i have no alternative than to hop into a car > and learn to drive during the process, hoping i will not bang-smash > the car.

Re: PyDoc_STRVAR error in msvc compile

2013-10-02 Thread Robin Becker
On 02/10/2013 11:49, Dave Angel wrote: conditional string or "" then MSVC 9 seems to be ok with it. > MSVC and other compilers do not not see eye to eye on the preprocessor semantics. I no longer use MSVC so I can't experiment. I can only try to recall extensive manipulation two decades ago.

Re: JUST GOT HACKED

2013-10-02 Thread Antoon Pardon
Op 02-10-13 11:08, Steven D'Aprano schreef: > On Wed, 02 Oct 2013 12:32:57 +0530, Ravi Sahni wrote: > >> I find this real confused!! Why they are answering then?!?! As far as I >> can make out everyone who is answering (helping!) doing it frustratation >> and disgust. But still they keep answerin

Re: JUST GOT HACKED

2013-10-02 Thread Chris Angelico
On Wed, Oct 2, 2013 at 9:03 PM, Νίκος wrote: > All i can say its that my visitor's websites are working smoothly and the > DNS, Mail issues and Python experiments are happening to my personal > account, i don't mess at all with my client's data and their settings. But when you expose your account

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
Στις 2/10/2013 1:54 μμ, ο/η Chris Angelico έγραψε: On Wed, Oct 2, 2013 at 8:43 PM, Νίκος wrote: Just bare with me and you will see improving over time. Tip: Start with this one... the word you want is 'bear'. In English, those two words have very different meanings, even though they're pronou

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
Στις 2/10/2013 1:54 μμ, ο/η Chris Angelico έγραψε: On Wed, Oct 2, 2013 at 8:43 PM, Νίκος wrote: Just bare with me and you will see improving over time. Tip: Start with this one... the word you want is 'bear'. In English, those two words have very different meanings, even though they're pronou

Re: Efficency help for a Calculator Program

2013-10-02 Thread Chris Angelico
On Wed, Oct 2, 2013 at 8:44 PM, JonDoe297 wrote: > Is there any way to make it smaller? It does it's job, but I want it to look > smaller, more efficient. Yes, it is, but let me first clarify something: "Smaller" and "more efficient" are two quite different concepts. Efficiency doesn't matter to

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
zero piraeus have said: In other words: you weren't "hacked". You'd been repeatedly told that you had publicly visible source code on the net containing passwords in plain text; all anyone had to do was login to your server with the credentials you negligently exposed, and open a text editor. If

Re: JUST GOT HACKED

2013-10-02 Thread Chris Angelico
On Wed, Oct 2, 2013 at 8:43 PM, Νίκος wrote: > Just bare with me and you will see improving over time. Tip: Start with this one... the word you want is 'bear'. In English, those two words have very different meanings, even though they're pronounced the same way; "bare with me" actually talks abou

Re: PyDoc_STRVAR error in msvc compile

2013-10-02 Thread Dave Angel
On 2/10/2013 06:01, Robin Becker wrote: > On 02/10/2013 10:00, Robin Becker wrote: >> On 01/10/2013 18:26, MRAB wrote: >>> On 01/10/2013 17:41, Robin Becker wrote: >> .. >>> I've tried it in a minimal console program, and it seems to work for me. >>> >> thanks for the test. I thought

Efficency help for a Calculator Program

2013-10-02 Thread JonDoe297
You may remember me from this : https://groups.google.com/forum/#!topic/comp.lang.python/PIkUno3avkw I need help to increase the efficiency of this code : global repeat repeat=1 def main(): c=int(raw_input("How many numbers do you want to work? (Min. 2 Max. 3) ")) if c==2: x

Re: JUST GOT HACKED

2013-10-02 Thread Νίκος
Στις 2/10/2013 1:32 μμ, ο/η Chris Angelico έγραψε: On Wed, Oct 2, 2013 at 8:22 PM, Νίκος wrote: I apologize though oif some times i loose my temper and use impoprer vocabulary on some people. The pressure is just too high at some point when i see so many people critisize and make ironic comment

  1   2   >