Re: Seeding the rand() Generator

2009-08-06 Thread Nils Ruettershoff
Hi Fred, I just saw your SQL Statement An example would be: SELECT first, second, third, fourth, fifth, sixth from sometable order by rand() limit 1 and I feel me constrained to give you an advice. Don't use this SQL statement to pick up a random row, your user and maybe DBA would

Re: Seeding the rand() Generator

2009-08-04 Thread Fred Atkinson
On Tue, 04 Aug 2009 07:12:30 GMT, Jarkko Torppa wrote: >On 2009-08-04, Fred Atkinson wrote: >> On Mon, 3 Aug 2009 20:00:08 -0700 (PDT), Carl Banks >> wrote: >>> >>>If you don't "get" why this is a MySQL question and not a Python >>>question, then you need to learn more about what you are doing.

Re: Seeding the rand() Generator

2009-08-04 Thread Jarkko Torppa
On 2009-08-04, Fred Atkinson wrote: > On Mon, 3 Aug 2009 20:00:08 -0700 (PDT), Carl Banks > wrote: >> >>If you don't "get" why this is a MySQL question and not a Python >>question, then you need to learn more about what you are doing. > > I wouldn't agree. > > I tried using the same

Re: Seeding the rand() Generator

2009-08-04 Thread Xavier Ho
On Tue, Aug 4, 2009 at 5:48 PM, Fred Atkinson wrote: > I tried using the same command I used when I did this in PHP. > That command was: mt_srand(date("w")) > >It was a PHP command that seeds the MySQL random function, > according to the folks on the PHP newsgroup. Well, some people have

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

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: Seeding the rand() Generator

2009-08-03 Thread Fred Atkinson
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, fifth, sixth from sometable order by rand() limit 1 I

Re: Seeding the rand() Generator

2009-08-02 Thread Carl Banks
On Aug 2, 2:18 pm, Fred Atkinson wrote: > On Sun, 02 Aug 2009 08:53:50 -0700, Scott David Daniels > > wrote: > >Fred Atkinson wrote: > >>        How does one seed the rand() generator when retrieving random > >> recordings in MySQL?   > > >It is not entirely clear what you are asking.  If you are

Re: Seeding the rand() Generator

2009-08-02 Thread Fred Atkinson
On Sun, 02 Aug 2009 08:53:50 -0700, Scott David Daniels wrote: >Fred Atkinson wrote: >> How does one seed the rand() generator when retrieving random >> recordings in MySQL? > >It is not entirely clear what you are asking. If you are talking about >MySQL's random number generator, you are

Re: Seeding the rand() Generator

2009-08-02 Thread Scott David Daniels
Fred Atkinson wrote: How does one seed the rand() generator when retrieving random recordings in MySQL? It is not entirely clear what you are asking. If you are talking about MySQL's random number generator, you are talking in the wrong newsgroup. If you are talking about Python's, d

Re: Seeding the rand() Generator

2009-08-02 Thread Marcus Wanner
On 8/2/2009 9:42 AM, Fred Atkinson wrote: How does one seed the rand() generator when retrieving random recordings in MySQL? Regards, Fred something like: import random, time random.seed(time.time()) #not actual record access code: sqlite3.recordaccessfuction(recordid =

Seeding the rand() Generator

2009-08-02 Thread Fred Atkinson
How does one seed the rand() generator when retrieving random recordings in MySQL? Regards, Fred -- http://mail.python.org/mailman/listinfo/python-list