Re: FW: ciao

2011-03-26 Thread Raymond Hettinger
On Mar 26, 11:34 am, MRAB wrote: > On 26/03/2011 18:07, bledar seferi wrote: > > >     3.Scrivere unafunsioncheprende comeargomentouna lista > >     diinterierestituisce uninsieme contenentequei numerichesono2 o più > >     voltenellalista fornita.Per esempio,seservecomelista di > >     input=[1,2

Re: Understanding the Pystone measurement

2011-03-26 Thread Raymond Hettinger
I forgot to mention that PyStone is just a Python translation from C of the venerable Dhrystone benchmark. See http://en.wikipedia.org/wiki/Dhrystone for a short write-up on the history, purposes, and limitations of the benchmark. Raymond -- http://mail.python.org/mailman/listinfo/python-list

Re: Understanding the Pystone measurement

2011-03-26 Thread Raymond Hettinger
On Mar 24, 9:21 pm, "tleeuwenb...@gmail.com" wrote: > Hi there, > > Is there a good writeup of what the pystone measurement actually > means? I'm working on benchmarking of some Python code at work, and > I'm interested in how Pystone might be relevant to me. I've tried > googling, but I can't fin

Re: why memoizing is faster

2011-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2011 10:25:31 -0700, eryksun () wrote about Fibonacci function: > That's true. If you need more than double precision, obviously it's time > to defer to the experts. Here's an O(n) algorithm: > > http://www.gnu.org/software/gmp/manual/html_node/Fibonacci-Numbers- Algorithm.html

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Raymond Hettinger
On Mar 26, 4:39 am, Mark Dickinson wrote: > On Mar 25, 2:00 pm, Stefan Behnel wrote: > > > > > > > > > > > Westley Martínez, 25.03.2011 14:39: > > > > On Fri, 2011-03-25 at 07:11 +0100, Stefan Behnel wrote: > > >> Steven D'Aprano, 25.03.2011 06:46: > > >>> On Thu, 24 Mar 2011 18:32:11 -0700, Carl

Re: Problem with keyboard up/down arrows in Python 2.4 interpreter

2011-03-26 Thread Julien
On Mar 25, 6:35 pm, Ned Deily wrote: > In article > , >  Benjamin Kaplan wrote: > > > As I stated above, py-readline is for if you're using Macports, which > > is a package manager for Mac OS X. > > ... in which case you probably want: > >    sudo port install py-readline > > > If you installed P

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Dan Stromberg
(Trying again to get through to python-list) On Sat, Mar 26, 2011 at 2:10 AM, Steven D'Aprano wrote: > > Dan Stromberg wrote: > > There's also the issue of a lazy comparison function, that I don't seem to >> have gotten a response to - if you have a Very expensive comparison >> operation involvi

simple problem with jpype on WindowsXP

2011-03-26 Thread curtin
Hi, I've got some kind of install problem with jpype ... It should just work, but throws a dialog exception, that doesn't give a stack trace so not very helpful. This should be a simple install issue, but I've searched and haven't seen any thing import jpype p = jpype.getDefaultJVMPath() jpype.s

Re: why memoizing is faster

2011-03-26 Thread Terry Reedy
On 3/26/2011 11:49 AM, Steven D'Aprano wrote: On Sat, 26 Mar 2011 07:14:17 -0700, eryksun () wrote: Yikes! I know this thread is about caching the output of a function, but in the example of Fibonacci numbers, we're blessed with an easily derived closed form expression (via Z transform, etc):

Re: [SPAM] FW: ciao

2011-03-26 Thread MRAB
On 26/03/2011 18:07, bledar seferi wrote: 3.Scrivere unafunsioncheprende comeargomentouna lista diinterierestituisce uninsieme contenentequei numerichesono2 o più voltenellalista fornita.Per esempio,seservecomelista di input=[1,2,3,3,4,4,5,6,7,7,7],quindila funzionerestituiràilse

FW: ciao

2011-03-26 Thread bledar seferi
3. Scrivere una funsion che prende come argomento una lista di interi e restituisce uninsieme contenente quei numeri che sono 2 o più volte nella lista fornita. Per esempio,se serve come lista di input = [1,2,3,3,4,4,5,6,7,7,7], quindi la funzione restituirà il set([3,4,7]) M

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Terry Reedy
On 3/26/2011 4:49 AM, Steven D'Aprano wrote: On Fri, 25 Mar 2011 16:04:02 -0700, Carl Banks wrote: Call me crazy, I would call you a bit ungrateful. Steven could have stayed silent instead of making himself a target by informing interested people on this list about the pydev post by Guido.

Re: why memoizing is faster

2011-03-26 Thread Terry Reedy
On 3/26/2011 7:06 AM, Andrea Crotti wrote: Stefan Behnel writes: Not "restarted" in the sense that it gets cleaned up, though. The above simply passes an explicit value for it that will be used for the single call. Future calls won't be affected. Stefan About this global caching thing I tho

Re: why memoizing is faster

2011-03-26 Thread eryksun ()
On Saturday, March 26, 2011 11:49:02 AM UTC-4, Steven D'Aprano wrote: > > > > def fib(n): > > phi = (5 ** 0.5 + 1) / 2 > > f = (phi ** n - (1 - phi) ** n) / 5 ** 0.5 > > return int(f) > > Have you tried it? > > Unfortunately, with floating point rounding error, that r

Re: why memoizing is faster

2011-03-26 Thread Terry Reedy
On 3/26/2011 5:55 AM, Lie wrote: On Mar 26, 5:10 pm, Terry Reedy wrote: On 3/26/2011 12:17 AM, Stefan Behnel wrote: Not "restarted" in the sense that it gets cleaned up, though. The above simply passes an explicit value for it that will be used for the single call. Which satisfies the time

Which subversion interface is the most used one?

2011-03-26 Thread Markus Schaber
Hi, at one of our projects, we could make use of a subversion interface for IronPython. But there seems none to exist. The easiest way would be to directly expose SharpSVN to the IronPython scripts, but that is not a very pythonic solution. So we had the Idea of porting the existing python interf

Re: why memoizing is faster

2011-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2011 07:14:17 -0700, eryksun () wrote: > On Saturday, March 26, 2011 7:50:36 AM UTC-4, Steven D'Aprano wrote: >> >> That's of the order of 200 MB of memory -- not that much for today's >> systems. I've had people email me .doc files that big *wink* > > Yikes! I know this thread is

Re: why memoizing is faster

2011-03-26 Thread eryksun ()
On Saturday, March 26, 2011 7:50:36 AM UTC-4, Steven D'Aprano wrote: > > That's of the order of 200 MB of memory -- not that much for today's > systems. I've had people email me .doc files that big *wink* Yikes! I know this thread is about caching the output of a function, but in the example of

Hello Friends

2011-03-26 Thread Ashraf Ali
For Biography of Bollywood actresses just visit www.hothitsbollywood.blogspot.com Here Just for You Aiswarya Rai Aishwarya Rai Biography Ash Ash Baby Aishwarya Krishnaraj Rai was born on 1 November 1973 in Mangalore. Her father Krishnaraj Rai was a marine engineer and her mother Vrinda Rai is a w

Re: dynamic assigments

2011-03-26 Thread Seldon
On 03/24/2011 07:39 PM, Seldon wrote: Hi, I have a question about generating variable assignments dynamically. I have a list of 2-tuples like this ( (var1, value1), (var2, value2), .. , ) where var1, var2, ecc. are strings and value1, value2 are generic objects. Now, I would like to use data

Re: best python games?

2011-03-26 Thread Paul Rudin
sogeking99 writes: > hey guys, what are some of the best games made in python? free games > really. like pygames stuff. i want to see what python is capable of. Apparently Eve Online is (stackless) python. -- http://mail.python.org/mailman/listinfo/python-list

[ANN] Shed Skin 0.7.1

2011-03-26 Thread Mark Dufour
hi all, I have just released Shed Skin 0.7.1, an optimizing (restricted!) Python-to-C++ compiler. It comes with some important extension module fixes, optimizations for several builtins (zip, min, max, map, filter, reduce, pow), a warning for non-uniform tuples of length > 2 and some minor fixes a

Re: Writing to a file

2011-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2011 14:49:31 +1300, Gregory Ewing wrote: > jyoun...@kc.rr.com wrote: > >import os >os.system('echo "Testing a... b... c..." > "~/Desktop/test2.txt"') > > This is like going out the back door, getting a ladder out of the shed > and climbing through your bedroom window to g

Re: why memoizing is faster

2011-03-26 Thread Steven D'Aprano
On Sat, 26 Mar 2011 12:06:46 +0100, Andrea Crotti wrote: > About this global caching thing I thought, but isn't this a source of > possible HUGE memory leaks? Hypothetically, but probably not that huge. And I wouldn't call it a *leak* as such, since you can access the memory and recover it if yo

Free Software University - Python Certificate - In reply to Noah Hall

2011-03-26 Thread Lloyd Hardy
Noah Hall enalicho at gmail.com Tue Mar 22 17:38:48 CET 2011 >I've been following this project for a while, since it was annouced on the Ubuntu forums. I can't say that I've been at all impressed by anything they have to offer. Hi Noah, I'm interested in your post for a few reasons: 1. Ther

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Mark Dickinson
On Mar 25, 2:00 pm, Stefan Behnel wrote: > Westley Martínez, 25.03.2011 14:39: > > > On Fri, 2011-03-25 at 07:11 +0100, Stefan Behnel wrote: > >> Steven D'Aprano, 25.03.2011 06:46: > >>> On Thu, 24 Mar 2011 18:32:11 -0700, Carl Banks wrote: > > It's probably the least justified builtin other

Re: why memoizing is faster

2011-03-26 Thread Andrea Crotti
Stefan Behnel writes: > > Not "restarted" in the sense that it gets cleaned up, though. The > above simply passes an explicit value for it that will be used for the > single call. Future calls won't be affected. > > Stefan About this global caching thing I thought, but isn't this a source of poss

Re: why memoizing is faster

2011-03-26 Thread Lie
On Mar 26, 5:10 pm, Terry Reedy wrote: > On 3/26/2011 12:17 AM, Stefan Behnel wrote: > > > Not "restarted" in the sense that it gets cleaned up, though. The above > > simply passes an explicit value for it that will be used for the single > > call. > > Which satisfies the time test need, but... >

Re: C Callback Function using ctypes

2011-03-26 Thread OJ
On 26 March 2011 12:55, OJ wrote: >> 1. Use c_char_p instead of POINTER(c_char). >> 2. Use msg.value to obtain a Python string from the pointer. >> > > If I change to c_char_p, my program segfaults. > > If I use msg.value, I get this error message: > Traceback (most recent call last): >  File "_ct

Re: C Callback Function using ctypes

2011-03-26 Thread Nobody
On Sat, 26 Mar 2011 05:23:27 +0300, OJ wrote: > Hi I am opening a shared library which has defined the following > callback prototype: > extern void DebugMessage(int level, const char *message, ...); > > My implementation in Python looks like this: > DEBUGFUNC = ctypes.CFUNCTYPE(None, ctypes.c_in

Re: Writing to a file

2011-03-26 Thread Nobody
On Fri, 25 Mar 2011 19:39:11 -0600, Littlefield, Tyler wrote: > >with open(test_absname, 'w') as test: > what's the difference in that and test = ...? I can see why you mentioned > the os.path for cross-platform, but I don't understand why someone would > use with over =. Using "with" will a

xmlrpclib fault 8002

2011-03-26 Thread SONAL ...
I Sonal Dolas work on python for project. We connect to server as follows: *self.server = xmlrpclib.Server("http://localhost:7081";, allow_none=True)* I get following errror when the particular file is run: * File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__* *return self.__send

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread Steven D'Aprano
On Fri, 25 Mar 2011 16:04:02 -0700, Carl Banks wrote: > On Mar 25, 3:06 pm, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: > > The reason Guido is considering re-introducing cmp is that somebody at > > Google approached him with a use-case where a key-based sort did not > > work. The use-

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread OKB (not okblacke)
Steven D'Aprano wrote: > On Fri, 25 Mar 2011 10:21:35 +0100, Antoon Pardon wrote: > The reason Guido is considering re-introducing cmp is that somebody > at Google approached him with a use-case where a key-based sort did > not work. The use-case was that the user had masses of data, too > much da

Christian Louboutin shoesThere could be the shinny leather, which is a little stiff a

2011-03-26 Thread www.jersey-2009.com
Christian Louboutin shoesThere could be the shinny leather, which is a little stiff and would not be very soft to feel next to the skin. The matt finished leather would be less shinny and would be a little softer. This kind of leather would have a lot of variations and qualities available. Suede wo