Random number generator for Smalltalk/GemStone 
Author Message
 Random number generator for Smalltalk/GemStone

The purple book has some code showing Lehmer's linear congruential method
for generating random numbers. Also you may want to consult Knuth.

Joe

    Hello,
    We need to generate a random number in our server side GemStone.
    Instead of reinventing the wheel, we were wondering if some
    solutions/codes already exist.

    It could be a Smalltalk code or maybe a C code called from GemStone.

    Thierry

--

.....................................................................
. Thierry Thelliez                   Los Alamos National Laboratory .

.   Voice: (505) 665 8631                                   MS M310 .
.     Fax: (505) 665 5725                       Los Alamos NM 87545 .
.     URL: http://www.*-*-*.com/ ;           USA .
.....................................................................



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone

Quote:

> Hello,

> We need to generate a random number in our server side GemStone.
> Instead of reinventing the wheel, we were wondering if some
> solutions/codes already exist.

> It could be a Smalltalk code or maybe a C code called from GemStone.

> Thierry

> --

> .....................................................................
> . Thierry Thelliez                   Los Alamos National Laboratory .

> .   Voice: (505) 665 8631                                   MS M310 .
> .     Fax: (505) 665 5725                       Los Alamos NM 87545 .
> .     URL: http://www.lanl.gov/cgi-bin/phone/113845             USA .
> .....................................................................

How random does a "random number" need to be for your purposes?  To make
a generator that generates a stream of randoms that are "random enough"
(i.e., won't pass a DieHard or anything, but are good enough) would only
take a few minutes.  Here's some code that does this.  If  you need
something better, you'll prolly have to impliment it yourself :-) (look
for a L'Ecuyer random generator with safeguards.  These pretty much need
to implimented in C, since they rely on register overflow and hardware
quirks).

        | seed m a c|
seed := Time now asSeconds.
m := 233280.
a := 9301.
c := 49297.

100 timesRepeat:[ | randomNumber |
                                seed := ((seed * a) + c) \\ m.
                                randomNumber :=(seed asFloat / m).
                                Transcript show: randomNumber  printString; tab. ]

Good Luck :-)
pete



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone

Quote:

> Date: Fri, 01 May 1998 16:23:25 -0600

> Newsgroups: comp.lang.smalltalk, comp.databases.object
> Subject: Random number generator for Smalltalk/GemStone

> Hello,

> We need to generate a random number in our server side GemStone.
> Instead of reinventing the wheel, we were wondering if some
> solutions/codes already exist.

> It could be a Smalltalk code or maybe a C code called from GemStone.

> Thierry

Thierry:

I don't have specific GemStone code, but there is a good random number
generator written in C++ in:

T.J. Halloran (1993) Performance measurement of three commercial
object-oriented database management systems. Master's Thesis,
AFIT/GCS/ENG/93D-12, US Air Force Institute of Technology, December 1993.

Tim Halloran did a comparison of several and used the "best" one for his
research. I used the same random number generator for my PhD.

Good luck.

        -- Akmal

        akmal(at)bigfoot(dot)com

"Speed, quality, price. Pick any two." - James M. Wallace



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone
Thanks but I posted that more than a year ago. I guess it got reposted
somehow.

Thanks anyway.

Thierry


Quote:

> > Date: Fri, 01 May 1998 16:23:25 -0600

> > Newsgroups: comp.lang.smalltalk, comp.databases.object
> > Subject: Random number generator for Smalltalk/GemStone

> > Hello,

> > We need to generate a random number in our server side GemStone.
> > Instead of reinventing the wheel, we were wondering if some
> > solutions/codes already exist.

> > It could be a Smalltalk code or maybe a C code called from GemStone.

> > Thierry

> Thierry:

> I don't have specific GemStone code, but there is a good random number
> generator written in C++ in:

> T.J. Halloran (1993) Performance measurement of three commercial
> object-oriented database management systems. Master's Thesis,
> AFIT/GCS/ENG/93D-12, US Air Force Institute of Technology, December 1993.

> Tim Halloran did a comparison of several and used the "best" one for his
> research. I used the same random number generator for my PhD.

> Good luck.

>         -- Akmal

>         akmal(at)bigfoot(dot)com

> "Speed, quality, price. Pick any two." - James M. Wallace



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone


Quote:
> Thanks but I posted that more than a year ago. I guess it got reposted
> somehow.

> Thanks anyway.

> Thierry

Thierry:

My answer is also almost as old as your original post! There have been
a number of phantom posts recently on comp.lang.smalltalk - some still
seem to keep appearing. I believe someone on comp.object suggested that
they are being posted from a Smalltalk User Group site (but I forget
the address). Alas ...

Kind Regards,

akmal

PS In case anyone thinks that _this_ is a phantom post, it happens to
be 2:11 AM on 20 August 1999. Yawn :-)

Quote:


> > > Date: Fri, 01 May 1998 16:23:25 -0600

> > > Newsgroups: comp.lang.smalltalk, comp.databases.object
> > > Subject: Random number generator for Smalltalk/GemStone

> > > Hello,

> > > We need to generate a random number in our server side GemStone.
> > > Instead of reinventing the wheel, we were wondering if some
> > > solutions/codes already exist.

> > > It could be a Smalltalk code or maybe a C code called from
GemStone.

> > > Thierry

> > Thierry:

> > I don't have specific GemStone code, but there is a good random
number
> > generator written in C++ in:

> > T.J. Halloran (1993) Performance measurement of three commercial
> > object-oriented database management systems. Master's Thesis,
> > AFIT/GCS/ENG/93D-12, US Air Force Institute of Technology, December
1993.

> > Tim Halloran did a comparison of several and used the "best" one
for his
> > research. I used the same random number generator for my PhD.

> > Good luck.

> >         -- Akmal

> >         akmal(at)bigfoot(dot)com

> > "Speed, quality, price. Pick any two." - James M. Wallace

--
akmal at bigfoot dot com | www.bigfoot.com/~akmal/

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone
On Fri, 20 Aug 1999 01:13:30 GMT, akmal b. chaudhri

Quote:



>> Thanks but I posted that more than a year ago. I guess it got reposted
>> somehow.

>> Thanks anyway.

>> Thierry

>Thierry:

>My answer is also almost as old as your original post! There have been
>a number of phantom posts recently on comp.lang.smalltalk - some still
>seem to keep appearing. I believe someone on comp.object suggested that
>they are being posted from a Smalltalk User Group site (but I forget
>the address). Alas ...

>Kind Regards,

>akmal

>PS In case anyone thinks that _this_ is a phantom post, it happens to
>be 2:11 AM on 20 August 1999. Yawn :-)

Yes, but since its now April 1 2010, where have you been??

- Show quoted text -

Quote:



>> > > Date: Fri, 01 May 1998 16:23:25 -0600

>> > > Newsgroups: comp.lang.smalltalk, comp.databases.object
>> > > Subject: Random number generator for Smalltalk/GemStone

>> > > Hello,

>> > > We need to generate a random number in our server side GemStone.
>> > > Instead of reinventing the wheel, we were wondering if some
>> > > solutions/codes already exist.

>> > > It could be a Smalltalk code or maybe a C code called from
>GemStone.

>> > > Thierry

>> > Thierry:

>> > I don't have specific GemStone code, but there is a good random
>number
>> > generator written in C++ in:

>> > T.J. Halloran (1993) Performance measurement of three commercial
>> > object-oriented database management systems. Master's Thesis,
>> > AFIT/GCS/ENG/93D-12, US Air Force Institute of Technology, December
>1993.

>> > Tim Halloran did a comparison of several and used the "best" one
>for his
>> > research. I used the same random number generator for my PhD.

>> > Good luck.

>> >         -- Akmal

>> >         akmal(at)bigfoot(dot)com

>> > "Speed, quality, price. Pick any two." - James M. Wallace



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone


Quote:
> On Fri, 20 Aug 1999 01:13:30 GMT, akmal b. chaudhri



> >> Thanks but I posted that more than a year ago. I guess it got
reposted
> >> somehow.

> >> Thanks anyway.

> >> Thierry

> >Thierry:

> >My answer is also almost as old as your original post! There have
been
> >a number of phantom posts recently on comp.lang.smalltalk - some
still
> >seem to keep appearing. I believe someone on comp.object suggested
that
> >they are being posted from a Smalltalk User Group site (but I forget
> >the address). Alas ...

> >Kind Regards,

> >akmal

> >PS In case anyone thinks that _this_ is a phantom post, it happens to
> >be 2:11 AM on 20 August 1999. Yawn :-)

> Yes, but since its now April 1 2010, where have you been??

Dennis:

What's that American tale about the guy who fell asleep under a tree?
(or maybe I'm thinking of something else). How did the Y2K problem go?
Any major failures? Has Java really taken over the world and Smalltalk
and C++ totally disappeared (flame bait)? ;-)

Kind Regards,

akmal

--
akmal at bigfoot dot com | www.bigfoot.com/~akmal/

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Wed, 18 Jun 1902 08:00:00 GMT  
 Random number generator for Smalltalk/GemStone
On Fri, 20 Aug 1999 10:21:39 GMT, akmal b. chaudhri

Quote:



>> On Fri, 20 Aug 1999 01:13:30 GMT, akmal b. chaudhri



>> >> Thanks but I posted that more than a year ago. I guess it got
>reposted
>> >> somehow.

>> >> Thanks anyway.

>> >> Thierry

>> >Thierry:

>> >My answer is also almost as old as your original post! There have
>been
>> >a number of phantom posts recently on comp.lang.smalltalk - some
>still
>> >seem to keep appearing. I believe someone on comp.object suggested
>that
>> >they are being posted from a Smalltalk User Group site (but I forget
>> >the address). Alas ...

>> >Kind Regards,

>> >akmal

>> >PS In case anyone thinks that _this_ is a phantom post, it happens to
>> >be 2:11 AM on 20 August 1999. Yawn :-)

>> Yes, but since its now April 1 2010, where have you been??

>Dennis:

>What's that American tale about the guy who fell asleep under a tree?
>(or maybe I'm thinking of something else). How did the Y2K problem go?
>Any major failures? Has Java really taken over the world and Smalltalk
>and C++ totally disappeared (flame bait)? ;-)

Sorry, Java has totally taken over and runs everything in our lives,
they did change the syntax a bit though, uses a things like

        object message
        object message: parm def: parm
things like that, and added
        perform:
and a brand new concept called "blocks of code"
        [code]
really neat stuff.

- Show quoted text -

Quote:

>Kind Regards,

>akmal



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Random number generator for Smalltalk/GemStone

2. Random Number Generator to produce SAME random number from 12:00am-11:59pm

3. Smalltalk Random Number Generator

4. Smalltalk Random Number Generator

5. Smalltalk Random Number Generator - the real bits!

6. Pentium III processor number and random number generator

7. J random-number generator: what is used?

8. Random number generators

9. Random number generators

10. random number generator?

11. random number generator

12. Problem Solved: Need A Random Number Generator

 

 
Powered by phpBB® Forum Software