Re: Seeding the rand() Generator

2009-08-03 Thread Carl Banks
On Aug 3, 8:12 pm, Fred Atkinson wrote: > On Sun, 2 Aug 2009 17:00:40 -0700 (PDT), Carl Banks > > wrote: > >         I appreciate the response.   > >         I am executing a statement to retrieve one record at random.   > >         An example would be: SELECT first, second, third, fourth, > fift

Re: RUBY vs COMMON LISP

2009-08-03 Thread Carl Banks
On Aug 3, 7:51 pm, fft1976 wrote: > On Aug 3, 1:19 am, p...@informatimago.com (Pascal J. Bourguignon) > wrote: > > > > > > > fft1976 writes: > > > By the way, here is in 1 line of BF, a complete BF reader that is able > > > to > > > read all the BF syntax needed to write it: > > > > ,+[-.,+] > >

Re: RUBY vs COMMON LISP

2009-08-03 Thread fft1976
On Aug 3, 8:02 pm, Carl Banks wrote: > On Aug 3, 7:51 pm, fft1976 wrote: > > > > > On Aug 3, 1:19 am, p...@informatimago.com (Pascal J. Bourguignon) > > wrote: > > > > fft1976 writes: > > > > By the way, here is in 1 line of BF, a complete BF reader that is able > > > > to > > > > read all the B

Re: file comparison

2009-08-03 Thread Dave Angel
learner learner wrote: Firstly thanks for showing the interest. I shall elobarate more on the problem: file-1.txt -- hai how r u file-2.txt --- r hai u The two files have some lines in common. For eg: File-1.txt-first line-"hai" does not match with File-2.txt-first li

Re: no-clobber dicts?

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 21:07:32 +, kj wrote: > I use the term "no-clobber dict" to refer to a dictionary D with the > especial property that if K is in D, then > > D[K] = V > > will raise an exception unless V == D[K]. In other words, D[K] can be > set if K doesn't exist already among D's ke

Re: Generate a new object each time a name is imported

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 16:38:43 +0200, Jean-Michel Pichavant wrote: > So what's the purpose of making > >>from Module import factory as a >>from Module import factory as b > > return 2 different objects ? If I had to write this code I would expect > 'a is b' to return 'True'. > > This is no "don'

Re: Is python buffer overflow proof?

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 14:04:53 -0700, sturlamolden wrote: > On 2 Aug, 15:50, Jizzai wrote: > >> Is a _pure_ python program buffer overflow proof? >> >> For example in C++ you can declare a char[9] to hold user input. If the >> user inputs 10+ chars a buffer overflow occurs. > > Short answer: NO >

Problem in installing PyGreSQL

2009-08-03 Thread Thangappan.M
Dear all, I want to access the database related stuffs in python.So I found the PyGreSQL module in net. Then I tried to download the module.But I am not able to download it. I am not a super user. I am using Linux debian machine Python version is 2.4.4 -- Regards, Thangappan.M -- http://mail.p

Re: kw param question

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 19:59:23 +, kj wrote: > I want to write a decorator that, among other things, returns a function > that has one additional keyword parameter, say foo=None. > > When I try > > def my_decorator(f): > # blah, blah > def wrapper(*p, foo=None, **kw): > x = f(*p

Re: Announcing PythonTurtle

2009-08-03 Thread r
On Aug 3, 8:53 pm, Asun Friere wrote: > On Aug 4, 6:35 am, r wrote: > > [snip] > > > > > I can remember the first time i used turtle (in python stdlib) and i > > kept saying to myself... > > >     "Were the heck is this damn turtle?!?!" (>_<) > > > :-) > > In Python2.6, try this: > > > > >>> turt

Which GUI framework to use?

2009-08-03 Thread koranthala
Hi, I am creating a very minimal application (a networking app). I have written the application using Twisted. Now, I need to put a GUI wrapper on the application. The application needs a login screen and also it needs to be minimized to system tray. If I right click the image on system

Re: Announcing PythonTurtle

2009-08-03 Thread John Posner
... I would also venture to say a key-map of sorts that is available thru the help menu where one could push an "Up" button, or a "rotate" button, and have the proper command inserted in the prompt, and then have the command execute, may also help make the connections here, a sort of *real* Visu

Re: Problem in installing PyGreSQL

2009-08-03 Thread Philip Semanchuk
On Aug 3, 2009, at 11:45 PM, Thangappan.M wrote: Dear all, I want to access the database related stuffs in python.So I found the PyGreSQL module in net. Then I tried to download the module.But I am not able to download it. I am not a super user. I am using Linux debian machine Python version

Re: Is python buffer overflow proof?

2009-08-03 Thread Paul Rubin
Steven D'Aprano writes: > > The Python interpreter is written in C. Python extension modules are > > written in C (or something similar). If you find an unprotected buffer > > in this C code, you can possibly overflow this buffer. > > How are C extension modules "_pure_ python"? A lot of basic

Re: Problem in installing PyGreSQL

2009-08-03 Thread David Lyon
On Tue, 4 Aug 2009 09:15:47 +0530, "Thangappan.M" wrote: > I want to access the database related stuffs in python.So I found the > PyGreSQL module in net. > Then I tried to download the module.But I am not able to download it. Did none of the links here work? http://www.pygresql.org/readme.html#

Re: Is python buffer overflow proof?

2009-08-03 Thread John Nagle
Gabriel Genellina wrote: En Mon, 03 Aug 2009 18:04:53 -0300, sturlamolden escribió: On 2 Aug, 15:50, Jizzai wrote: Is a _pure_ python program buffer overflow proof? For example in C++ you can declare a char[9] to hold user input. If the user inputs 10+ chars a buffer overflow occurs. Sh

Re: no-clobber dicts?

2009-08-03 Thread alex23
Steven D'Aprano wrote: > I also have a series of unit tests for it if you're interested in them. That's several times today that kj has asked a question and you've responded with ready-to-go code. If this was Stackoverflow, I'd accuse you of reputation-whoring... You _can_ just post your cool co

Re: Python docs disappointing - group effort to hire writers?

2009-08-03 Thread David Lyon
It isn't totally about the writers... Peoples egos are also at stake - it seems. If "Fred X wrote Doc Y".. they don't want their name taken off.. So they generally speaking don't want the docs changed. If you talk too much about docs.. you can be told you're OT.. even in a thread about docs...

Re: Is python buffer overflow proof?

2009-08-03 Thread Steven D'Aprano
On Mon, 03 Aug 2009 21:34:15 -0700, Paul Rubin wrote: > Steven D'Aprano writes: >> > The Python interpreter is written in C. Python extension modules are >> > written in C (or something similar). If you find an unprotected >> > buffer in this C code, you can possibly overflow this buffer. >> >>

Re: Python docs disappointing - group effort to hire writers?

2009-08-03 Thread alex23
On Aug 4, 3:55 pm, David Lyon wrote: > It isn't totally about the writers... > Peoples egos are also at stake - it seems. Citation please. > If "Fred X wrote Doc Y".. they don't want their name taken off.. So > they generally speaking don't want the docs changed. Ditto. > If you talk too much

Re: Which GUI framework to use?

2009-08-03 Thread Diez B. Roggisch
koranthala schrieb: Hi, I am creating a very minimal application (a networking app). I have written the application using Twisted. Now, I need to put a GUI wrapper on the application. The application needs a login screen and also it needs to be minimized to system tray. If I right cli

Re: Seeding the rand() Generator

2009-08-03 Thread Fred Atkinson
On Mon, 3 Aug 2009 20:00:08 -0700 (PDT), Carl Banks wrote: >Your question is a MySQL question, not a Python question. I don't >know off hand how to seed the RNG in MySQL, and, since this is a >Python group and not a MySQL group, I don't care to look it up. But >if you were able to produce the M

<    1   2