[#60304] FreeRIDE hangs when I use gets — sothoth@... (Yog-Sothoth)

Hi there, and happy new year!

23 messages 2003/01/01
[#60305] Ruby DBI — David King Landrith <dave@...> 2003/01/01

Is there any way to retrieve the table and database associated with

[#60306] Re: Ruby DBI — Tom Sawyer <transami@...> 2003/01/01

On Wednesday 01 January 2003 07:03 am, David King Landrith wrote:

[#60309] Re: Ruby DBI — David Landrith <dlandrith@...> 2003/01/01

On Wednesday, January 1, 2003, at 09:20 AM, Tom Sawyer wrote:

[#60378] Interfaces in Ruby — "Robert" <bob.news@...>

15 messages 2003/01/02

[#60541] testunit 0.1.6 problems — Daniel Berger <djberg96@...>

ruby 1.6.7, 1.6.8, 1.7.3

39 messages 2003/01/04
[#60556] Re: testunit 0.1.6 problems — <nathaniel@...> 2003/01/04

Daniel Berger [mailto:djberg96@yahoo.com] wrote:

[#60579] Re: testunit 0.1.6 problems — Gavin Sinclair <gsinclair@...> 2003/01/04

On Sunday, January 5, 2003, 2:46:04 AM, nathaniel wrote:

[#60914] Re: Test::Unit fails w/no tests [was: testunit 0.1.6 problems] — <nathaniel@...> 2003/01/08

Gavin Sinclair [mailto:gsinclair@soyabean.com.au] wrote:

[#60947] Re: Test::Unit fails w/no tests [was: testunit 0.1.6 problems] — Gavin Sinclair <gsinclair@...> 2003/01/09

On Thursday, January 9, 2003, 6:56:44 AM, nathaniel wrote:

[#60959] Re: Test::Unit fails w/no tests [was: testunit 0.1.6 problems] — "Mike Campbell" <michael_s_campbell@...> 2003/01/09

> In my mind, there's nothing whatsoever wrong with an empty unit test.

[#60604] Forward: Drafting a "The Year in Scripting Languages" — matz@... (Yukihiro Matsumoto)

Hello,

21 messages 2003/01/05
[#60652] Re: Forward: Drafting a "The Year in Scripting Languages" — ptkwt@...1.aracnet.com (Phil Tomson) 2003/01/06

I noticed several replies which said that they could not do this - I

[#60620] bad interpreter — Arnaudo Massimo <marnaudo@...>

Hi everibody,

31 messages 2003/01/05
[#60985] Re: bad interpreter — mkcon@... (Martin Kahlert) 2003/01/09

In article <20030105144216.GA2879@gull.zena.it>,

[#61045] Re: bad interpreter — Arnaudo Massimo <marnaudo@...> 2003/01/09

* Martin Kahlert <mkcon@gmx.de> [gioved09 gennaio 2003, alle 16:36]:

[#61046] Re: bad interpreter — dblack@... 2003/01/09

Hi --

[#61052] Re: bad interpreter — Stoyan Zhekov <zhware@...> 2003/01/09

> > masarn1@gull:~/Ruby$ ./test.rb 2> error.log

[#61183] Re: bad interpreter — Arnaudo Massimo <marnaudo@...> 2003/01/11

* Stoyan Zhekov <zhware@hotpop.com> [venerd10 gennaio 2003, alle 08:55]:

[#60636] Compile time constant folding? — Dan Sugalski <dan@...>

Here's a quick question, now that parrot's close to getting object

19 messages 2003/01/05

[#60650] attr_cast, one a small step for interface techniques — Tom Sawyer <transami@...>

another addition to tomslib/rubylib:

16 messages 2003/01/06
[#60657] Re: attr_cast, one a small step for interface techniques — Jim Freeze <jim@...> 2003/01/06

On Monday, 6 January 2003 at 10:30:54 +0900, Tom Sawyer wrote:

[#60665] Re: attr_cast, one a small step for interface techniques — Gavin Sinclair <gsinclair@...> 2003/01/06

On Monday, January 6, 2003, 1:20:06 PM, Jim wrote:

[#60691] Re: attr_cast, one a small step for interface techniques — Tom Sawyer <transami@...> 2003/01/06

On Sunday 05 January 2003 09:30 pm, Gavin Sinclair wrote:

[#60702] Re: attr_cast, one a small step for interface techniques — Gavin Sinclair <gsinclair@...> 2003/01/06

On Monday, January 6, 2003, 7:48:18 PM, Tom wrote:

[#60766] Re: A very humour game — Gavin Sinclair <gsinclair@...>

Should a rule be set up that disallows messages (or attachments) of

13 messages 2003/01/07

[#60786] Re: attachment:ot -was RE: A very humour game — "Pe, Botp" <botp@...>

12 messages 2003/01/07

[#60877] Can you detect if a method takes a block argument? — Martin Hart <martin@...>

Hi all, hope everybody had a great new year - it is snowing outside for

16 messages 2003/01/08

[#60910] Ruby advocacy in sigs — Brennan Leathers <digibren@...>

I've started using the following as a sig on leoville.com, a very large

51 messages 2003/01/08
[#61644] Re: Ruby advocacy in sigs — "Gennady" <gfb@...> 2003/01/15

>

[#61645] Re: Ruby advocacy in sigs — Daniel Carrera <dcarrera@...> 2003/01/15

On Thu, 16 Jan 2003, Gennady wrote:

[#61662] Re: Ruby advocacy in sigs — "Park Heesob" <phasis@...> 2003/01/16

Hi,

[#61664] Re: Ruby advocacy in sigs — dblack@... 2003/01/16

Hi --

[#61667] Re: Ruby advocacy in sigs — "Hal E. Fulton" <hal9000@...> 2003/01/16

----- Original Message -----

[#61678] Re: Ruby advocacy in sigs — Tom Sawyer <transami@...> 2003/01/16

"More powerful than Perl, more object-oriented than Python."

[#61684] Re: Ruby advocacy in sigs — Hugh Sasse Staff Elec Eng <hgs@...> 2003/01/16

On Thu, 16 Jan 2003, Tom Sawyer wrote:

[#60926] The Year in Scripting Languages (Final Draft) — Lyle Johnson <lyle@...>

All,

44 messages 2003/01/08
[#60928] Re: The Year in Scripting Languages (Final Draft) — Tom Sawyer <transami@...> 2003/01/08

so who are we?

[#60943] Rubyists (Re: The Year in Scripting Languages (Final Draft)) — matz@... (Yukihiro Matsumoto) 2003/01/09

Hi,

[#60965] Re: Rubyists (Re: The Year in Scripting Languages (Final Draft)) — Jim Freeze <jim@...> 2003/01/09

On Thursday, 9 January 2003 at 9:18:00 +0900, Yukihiro Matsumoto wrote:

[#60944] OT: apple x11 — Brennan Leathers <digibren@...>

just in case anyone missed the word on the wire, apple has released its

24 messages 2003/01/09

[#61002] @@'s are not inherited? — Tom Sawyer <transami@...>

please correct me if i'm wrong but i beleive i just discovered something i did

12 messages 2003/01/09

[#61098] Using Observer pattern in client/server architecture - how? — Martin Hart <martin@...>

Hi everyone,

10 messages 2003/01/10

[#61144] Why Fox — Daniel Carrera <dcarrera@...>

Could someone explain to me why Ruby is adopting Fox as its standard GUI?

24 messages 2003/01/10

[#61167] 'require' search path — Tim Bates <tim@...>

I wish 'require' would count the current directory as the directory the file

16 messages 2003/01/11

[#61220] Ruby: politics & performance [long] — Louis Krupp <lkrupp@...>

The problem: Read a structured file (the details are irrelevant)

26 messages 2003/01/11

[#61271] sorting with the Swartzian transform — Daniel Carrera <dcarrera@...>

Hello all,

14 messages 2003/01/12

[#61349] OT: IE blatantly defiant of HTML standards — Tom Sawyer <transami@...>

33 messages 2003/01/13
[#62019] Re: OT: IE blatantly defiant of HTML standards — Eric Hodel <drbrain@...7.net> 2003/01/19

Tom Sawyer (transami@transami.net) wrote:

[#62046] Re: OT: IE blatantly defiant of HTML standards — Dmitri Colebatch <dim@...> 2003/01/20

> Tom Sawyer (transami@transami.net) wrote:

[#62048] Re: OT: IE blatantly defiant of HTML standards — Tom Sawyer <transami@...> 2003/01/20

On Sunday 19 January 2003 08:21 pm, Dmitri Colebatch wrote:

[#62049] Re: OT: IE blatantly defiant of HTML standards — Dmitri Colebatch <dim@...> 2003/01/20

Tom Sawyer wrote:

[#62060] Re: persistence (was: IE blatantly defiant of HTML standards) — Anders Bengtsson <ndrsbngtssn@...> 2003/01/20

--- Dmitri Colebatch <dim@colebatch.com> wrote:

[#62122] Re: persistence (was: IE blatantly defiant of HTML standards) — Tom Sawyer <transami@...> 2003/01/21

On Monday 20 January 2003 04:58 am, Anders Bengtsson wrote:

[#61351] UML tool for Linux? — Tim Bates <tim@...>

Does anyone know of a good OO modelling (UML?) tool for Linux, that works well

23 messages 2003/01/13

[#61435] Yet Another Test First Example ... in Ruby — Jim Weirich <jweirich@...>

Our local XP group did a Test-Driven Design clinic. Although most of

13 messages 2003/01/14

[#61497] ruby-dev summary 19198-19345 — Kazuo Saito <ksaito@...>

49 messages 2003/01/14
[#61499] Re: ruby-dev summary 19198-19345 — Paul Brannan <pbrannan@...> 2003/01/14

On Wed, Jan 15, 2003 at 02:31:22AM +0900, Kazuo Saito wrote:

[#61534] Re: ruby-dev summary 19198-19345 — Matt Armstrong <matt@...> 2003/01/14

Paul Brannan <pbrannan@atdesk.com> writes:

[#61565] Re: ruby-dev summary 19198-19345 — matz@... (Yukihiro Matsumoto) 2003/01/15

Hi,

[#61566] Re: ruby-dev summary 19198-19345 — Matt Armstrong <matt@...> 2003/01/15

matz@ruby-lang.org (Yukihiro Matsumoto) writes:

[#61571] Re: ruby-dev summary 19198-19345 — Gavin Sinclair <gsinclair@...> 2003/01/15

On Wednesday, January 15, 2003, 3:17:11 PM, Matt wrote:

[#61574] Re: ruby-dev summary 19198-19345 — matz@... (Yukihiro Matsumoto) 2003/01/15

Hi,

[#61512] Re: ruby-dev summary 19198-19345 — Tom Sawyer <transami@...> 2003/01/14

On Tuesday 14 January 2003 10:31 am, Kazuo Saito wrote:

[#61665] Re: ruby-dev summary 19198-19345 — Tom Sawyer <transami@...> 2003/01/16

On Tuesday 14 January 2003 12:40 pm, Tom Sawyer wrote:

[#61653] Quick question for Japanese speaker — "Hal E. Fulton" <hal9000@...>

I've created a graphic based on the Kanji

12 messages 2003/01/15

[#61682] Re: ruby-dev summary 19198-19345 — "Pe, Botp" <botp@...>

13 messages 2003/01/16

[#61749] Linux Editor — dwerder@... (Dominik Werder)

What's your favorite ruby editor on linux?

22 messages 2003/01/16

[#61757] quick: it responds, it evaluates, and is not empty — Tom Sawyer <transami@...>

quick quest: anyone know of a nice slick short and sweet way to do this:

38 messages 2003/01/17
[#61797] Re: quick: it responds, it evaluates, and is not empty — "Bulat Ziganshin" <bulatz@...> 2003/01/17

Hello Tom,

[#61842] Re: quick: it responds, it evaluates, and is not empty — Tom Sawyer <transami@...> 2003/01/17

On Thursday 16 January 2003 11:25 pm, Bulat Ziganshin wrote:

[#61846] Re: quick: it responds, it evaluates, and is not empty — "Bulat Ziganshin" <bulatz@...> 2003/01/17

Hello Tom,

[#61848] Re: quick: it responds, it evaluates, and is not empty — Tom Sawyer <transami@...> 2003/01/17

On Friday 17 January 2003 07:08 am, Bulat Ziganshin wrote:

[#61854] Re: quick: it responds, it evaluates, and is not empty — Gavin Sinclair <gsinclair@...> 2003/01/17

On Saturday, January 18, 2003, 1:22:09 AM, Tom wrote:

[#61855] Re: quick: it responds, it evaluates, and is not empty — dblack@... 2003/01/17

Hi --

[#61864] Re: quick: it responds, it evaluates, and is not empty — ahoward <ahoward@...> 2003/01/17

On Fri, 17 Jan 2003 dblack@candle.superlink.net wrote:

[#61872] Re: quick: it responds, it evaluates, and is not empty — dblack@... 2003/01/17

Hi --

[#61896] Re: quick: it responds, it evaluates, and is not empty — ahoward <ahoward@...> 2003/01/17

On Sat, 18 Jan 2003 dblack@candle.superlink.net wrote:

[#61759] most popular unix scripting language — dorli@... (dambalaMaster)

does anyone know which is the most popular unix scripting language?

26 messages 2003/01/17

[#61810] Automating Perl -> Ruby translation? — "Hal E. Fulton" <hal9000@...>

Has anyone given any thought to this

22 messages 2003/01/17
[#61875] Re: Automating Perl -> Ruby translation? — ptkwt@...1.aracnet.com (Phil Tomson) 2003/01/17

In article <034a01c2be07$95670380$0300a8c0@austin.rr.com>,

[#61901] Resolution to CGI API problem? — Travis Whitton <whitton@...>

There is a very long thread [ruby-talk:39898] that talks about changes

11 messages 2003/01/17

[#61965] PickAxe index? — Daniel Carrera <dcarrera@...>

Does PickAxe online have an index?

14 messages 2003/01/18

[#62063] a single class that supports multiple facets/interfaces — David Garamond <davegaramond@...>

i want to have a class that can support multiple sets of methods, based

16 messages 2003/01/20
[#62090] Re: a single class that supports multiple facets/interfaces — dblack@... 2003/01/20

Hi --

[#62268] extend (Re: a single class that supports multiple facets/interfaces) — David Garamond <davegaramond@...> 2003/01/22

dblack@candle.superlink.net wrote:

[#62093] Local variable scope — Daniel Carrera <dcarrera@...>

I'm a bit confused by the scope of local variables.

24 messages 2003/01/20

[#62203] accessors for module instance vars — ptkwt@...1.aracnet.com (Phil Tomson)

I've got a module that that has several classes defined within it. These

17 messages 2003/01/21
[#62250] Re: accessors for module instance vars — ptkwt@...1.aracnet.com (Phil Tomson) 2003/01/22

In article <Pine.LNX.4.33.0301212020500.6373-100000@eli.fsl.noaa.gov>,

[#62213] Newbie Q: do i need PStore for this or something else ? — "Vandemoortele Simon" <delirious_nospamplz@...>

_Background info:_

17 messages 2003/01/21

[#62319] Re: exit status, stderr and stdout — "Berger, Daniel" <djberge@...>

> -----Original Message-----

14 messages 2003/01/22

[#62321] Definition: iterator — Daniel Carrera <dcarrera@...>

I sort of know what an iterator is, but not well enough to explain it.

18 messages 2003/01/22

[#62340] mod_ruby: what's persistent and what's shared? — Tom Sawyer <transami@...>

i'm tired of being confused about this and i'm hoping someone can clear this

21 messages 2003/01/23

[#62344] Can we attack the 'not enough libraries' thing straight on? — dblack@...

Hi --

136 messages 2003/01/23
[#62349] Re: Can we attack the 'not enough libraries' thing straight on? — Simon Cozens <simon@...> 2003/01/23

dblack@candle.superlink.net writes:

[#62358] Re: Can we attack the 'not enough libraries' thing straight on? — dblack@... 2003/01/23

Hi --

[#62645] Re: Can we attack the 'not enough libraries' thing straight on? — "MikkelFJ" <mikkelfj-anti-spam@...> 2003/01/25

[#62648] Re: Can we attack the 'not enough libraries' thing straight on? — ahoward <ahoward@...> 2003/01/25

On Sat, 25 Jan 2003, MikkelFJ wrote:

[#62658] Re: Can we attack the 'not enough libraries' thing straight on? — Mark Wilson <mwilson13@...> 2003/01/25

The following is my initial, and not yet complete, proposal on

[#62696] Re: Can we attack the 'not enough libraries' thing straight on? — "Iain 'Spoon' Truskett" <spoon@...> 2003/01/26

* Mark Wilson (mwilson13@cox.net) [26 Jan 2003 09:44]:

[#62699] Re: Can we attack the 'not enough libraries' thing straight on? — Mark Wilson <mwilson13@...> 2003/01/26

[#62705] Re: Can we attack the 'not enough libraries' thing straight on? — "Iain 'Spoon' Truskett" <spoon@...> 2003/01/26

* Mark Wilson (mwilson13@cox.net) [26 Jan 2003 17:26]:

[#62725] Re: Can we attack the 'not enough libraries' thing straight on? — Dave Thomas <dave@...> 2003/01/26

Iain 'Spoon' Truskett wrote:

[#62731] Re: Can we attack the 'not enough libraries' thing straight on? — "Mike Campbell" <michael_s_campbell@...> 2003/01/26

[#62738] Re: Can we attack the 'not enough libraries' thing straight on? — Dave Thomas <dave@...> 2003/01/26

Mike Campbell wrote:

[#62750] Re: Can we attack the 'not enough libraries' thing straight on? — Daniel Carrera <dcarrera@...> 2003/01/26

I certainly think that RAA should have a search feature.

[#62808] Re: Can we attack the 'not enough libraries' thing straight on? — "NAKAMURA, Hiroshi" <nahi@...> 2003/01/27

Hi, all,

[#62733] Re: Can we attack the 'not enough libraries' thing straight on? — ahoward <ahoward@...> 2003/01/26

On Sun, 26 Jan 2003, Dave Thomas wrote:

[#62369] Re: Can we attack the 'not enough libraries' thing straight on? — Simon Cozens <simon@...> 2003/01/23

Daniel Carrera <dcarrera@math.umd.edu> writes:

[#62373] Re: Can we attack the 'not enough libraries' thing straight on? — dblack@... 2003/01/23

Hi --

[#62381] Re: Can we attack the 'not enough libraries' thing straight on? — Tom Sawyer <transami@...> 2003/01/23

want to here a crazy idea?

[#62545] Re: Can we attack the 'not enough libraries' thing straight on? — Warren Brian Noronha <warren@...> 2003/01/24

dear devels

[#62345] Hash#+ ? — Daniel Carrera <dcarrera@...>

I think that there should be a Hash#+ method, aking to Array#+.

22 messages 2003/01/23
[#62347] Re: Hash#+ ? — dblack@... 2003/01/23

Hi --

[#62350] Re: Hash#+ ? — Tom Sawyer <transami@...> 2003/01/23

On Wednesday 22 January 2003 06:52 pm, dblack@candle.superlink.net wrote:

[#62351] Re: Hash#+ ? — Daniel Carrera <dcarrera@...> 2003/01/23

On Thu, Jan 23, 2003 at 11:14:08AM +0900, Tom Sawyer wrote:

[#62376] Re: Hash#+ ? — Tom Sawyer <transami@...> 2003/01/23

On Wednesday 22 January 2003 07:20 pm, Daniel Carrera wrote:

[#62378] Re: Hash#+ ? — matz@... (Yukihiro Matsumoto) 2003/01/23

Hi,

[#62383] Missing libraries?? — "Hal E. Fulton" <hal9000@...>

I'm starting a new thread to get away from

22 messages 2003/01/23

[#62665] RAA proposal — Daniel Carrera <dcarrera@...>

Hello all,

20 messages 2003/01/26
[#62667] Re: RAA proposal — Jim Freeze <jim@...> 2003/01/26

On Sunday, 26 January 2003 at 10:48:02 +0900, Daniel Carrera wrote:

[#62669] Re: RAA proposal — Daniel Carrera <dcarrera@...> 2003/01/26

On Sun, Jan 26, 2003 at 10:57:28AM +0900, Jim Freeze wrote:

[#62708] solaris porting problem -- flock failure? — Joel VanderWerf <vjoel@...>

Any solaris gurus out there?

27 messages 2003/01/26

[#62730] cascading configuration variables — Wilbert Berendsen <wilbert@...>

-----BEGIN PGP SIGNED MESSAGE-----

13 messages 2003/01/26

[#62767] common regular expressions — Michael Garriss <mgarriss@...>

Sorry if this a stupid question but I am new to ruby AND regular

17 messages 2003/01/26

[#62836] Test::Unit -> order of tests? — Mauricio Fern疣dez <batsman.geo@...>

28 messages 2003/01/27
[#62845] Re: Test::Unit -> order of tests? — Michael Garriss <mgarriss@...> 2003/01/27

IMHO, it would be nice if they were run in the order they were defined.

[#62852] Re: Test::Unit -> order of tests? — ahoward <ahoward@...> 2003/01/27

On Tue, 28 Jan 2003, Michael Garriss wrote:

[#62855] Re: Test::Unit -> order of tests? — Chad Fowler <chad@...> 2003/01/27

[#62861] Re: Test::Unit -> order of tests? — ahoward <ahoward@...> 2003/01/27

On Tue, 28 Jan 2003, Chad Fowler wrote:

[#62867] Re: Test::Unit -> order of tests? — Matt Armstrong <matt@...> 2003/01/27

ahoward <ahoward@fsl.noaa.gov> writes:

[#62899] Re: Test::Unit -> order of tests? — "Warren Brown" <wkb@...> 2003/01/28

> To implement this, I would suggest renaming all your test_XXX methods

[#62847] tkgnuplot problem: fork() on win — Ralf <lausianne@...>

Hi,

17 messages 2003/01/27
[#62936] Re: tkgnuplot problem: fork() on win (popen3 for windows?) — ptkwt@...1.aracnet.com (Phil Tomson) 2003/01/28

In article <20030128122113W.nagai@ai.kyutech.ac.jp>,

[#62890] ruby-dev summary 19380-19436 — TAKAHASHI Masayoshi <maki@...>

Hello all,

14 messages 2003/01/27

[#63065] Local variables & blocks — ahoward <ahoward@...>

108 messages 2003/01/29
[#63072] Re: Local variables & blocks — Gavin Sinclair <gsinclair@...> 2003/01/29

On Wednesday, January 29, 2003, 5:04:51 PM, ahoward wrote:

[#63075] Re: Local variables & blocks — Gavin Sinclair <gsinclair@...> 2003/01/29

On Wednesday, January 29, 2003, 6:17:44 PM, Gavin wrote:

[#63087] Re: Local variables & blocks — Mauricio Fern疣dez <batsman.geo@...> 2003/01/29

On Wed, Jan 29, 2003 at 04:40:21PM +0900, Gavin Sinclair wrote:

[#63100] Re: Local variables & blocks — matz@... (Yukihiro Matsumoto) 2003/01/29

Hi,

[#63103] Re: Local variables & blocks — ahoward <ahoward@...> 2003/01/29

On Thu, 30 Jan 2003, Yukihiro Matsumoto wrote:

[#63119] Re: Local variables & blocks — matz@... (Yukihiro Matsumoto) 2003/01/29

Hi,

[#63203] Re: Local variables & blocks — Martin DeMello <martindemello@...> 2003/01/30

ahoward <ahoward@fsl.noaa.gov> wrote:

[#63211] Re: Local variables & blocks — ahoward <ahoward@...> 2003/01/30

On Thu, 30 Jan 2003, Martin DeMello wrote:

[#63558] Re: Local variables & blocks — "Robert Klemme" <bob.news@...> 2003/02/03

[#63560] Re: Local variables & blocks — matz@... (Yukihiro Matsumoto) 2003/02/03

Hi,

[#63094] Ruby Books -- A Question — Mark Probert <probertm@..._acm.org>

Rubyists,

15 messages 2003/01/29

[#63198] reading past a file header — Martin DeMello <martindemello@...>

Looking for a more idiomatic way to do this:

12 messages 2003/01/30

[#63216] Newbie question — n.vasiliev@... (Nicolay Vasiliev)

Hello!

17 messages 2003/01/30

[#63284] Return values from assertions — <nathaniel@...>

Eivind Eklund and I have been discussing whether assertions ought to

12 messages 2003/01/31

[#63305] %L, %l revisited — Tom Sawyer <transami@...>

this is a general request for opinion/support. i, for one, would very much

40 messages 2003/01/31
[#63556] Re: %L, %l revisited — nobu.nokada@... 2003/02/03

Hi,

[#63566] Re: %L, %l revisited — Tom Sawyer <transami@...> 2003/02/03

On Monday 03 February 2003 01:26 am, nobu.nokada@softhome.net wrote:

[#63592] Re: %L, %l revisited — nobu.nokada@... 2003/02/03

Hi,

[#63773] Re: %L, %l revisited — Tom Sawyer <transami@...> 2003/02/05

Nobu,

[#63777] Re: %L, %l revisited — dblack@... 2003/02/05

Hi --

[#63784] Re: %L, %l revisited — "Hal E. Fulton" <hal9000@...> 2003/02/05

----- Original Message -----

[#63799] Re: %L, %l revisited — Tom Sawyer <transami@...> 2003/02/05

On Wednesday 05 February 2003 02:44 pm, Hal E. Fulton wrote:

Re: redefining rand and srand

From: "Park Heesob" <phasis@...>
Date: 2003-01-21 09:15:55 UTC
List: ruby-talk #62151
Hi,

"Phil Tomson" <ptkwt@shell1.aracnet.com> wrote in message
news:b0ivi80pgg@enews3.newsguy.com...
> In article <b0idhk0gj3@enews4.newsguy.com>,
> >
> >A couple of questions:
> >1) how good is Ruby's rand function (what's the quality of randomness)?
I
> >suspec that it is just the same as C's rand, so there won't be a
> >difference.
> >2) I'd like to plug in my own random number generator that would probably
> >produce higher-quality random numbers than the current rand does.  I'm
> >pretty sure it should be doable and easy, like:
> >
> >module Kernel
> >  def rand(max=0)
> >    #do random number generation magic here
> >  end
> >end
> >
>
>
> Here's what I did.  At Robert Feldt's suggestion I used his RandomR
> package which uses the Mersenne Twister to generate random numbers (a much
> better method than whatever is built-in, I'm sure).  I then redefined rand
> and srand like so:
>
> require 'random/mersenne_twister'
> module Kernel
>   def rand(max=0)
>     if not defined? @__random
>       @__rng=Random::MersenneTwister.new Time.now.to_i
>     end
>     @__rng.rand(max)
>   end
>   def srand(seed)
>     @__rng=Random::MersenneTwister.new seed
>   end
> end
>

How about use native Ruby code instead of extension module?
The following is my rough translation from C code(mt19937ar.c) at
http://www.math.keio.ac.jp/~matumoto/emt.html

=================================================================
# Period parameters
 N = 624
 M = 397
 MATRIX_A = 0x9908b0df   # constant vector a
 UPPER_MASK = 0x80000000 # most significant w-r bits
 LOWER_MASK = 0x7fffffff # least significant r bits


# static unsigned long mt[N]; # the array for the state vector
# static int mti=N+1; # mti==N+1 means mt[N] is not initialized

$mt = Array.new(N)
$mti = N+1

# initializes mt[N] with a seed
def init_genrand(s)
    $mt[0]= s & 0xffffffff
    for $mti in 1...N
        $mt[$mti] =
            (1812433253 * ($mt[$mti-1] ^ ($mt[$mti-1] >> 30)) + $mti)
        # See Knuth TAOCP Vol2. 3rd Ed. P.106 for multiplier.
        # In the previous versions, MSBs of the seed affect
        # only MSBs of the array mt[].
        # 2002/01/09 modified by Makoto Matsumoto
        $mt[$mti] &= 0xffffffff
        # for >32 bit machines
    end
    $mti = N
end

# initialize by an array with array-length
# init_key is the array for initializing keys
# key_length is its length
def init_by_array(init_key, key_length)
    init_genrand(19650218)
    i=1
    j=0
    k = (N>key_length ? N : key_length)
    k.downto(1) {
        $mt[i] = ($mt[i] ^ (($mt[i-1] ^ ($mt[i-1] >> 30)) * 1664525)) +
init_key[j] + j # non linear
        $mt[i] &= 0xffffffff  # for WORDSIZE > 32 machines
        i+=1
        j+=1
        if (i>=N)
         $mt[0] = $mt[N-1]
         i=1
        end
        if (j>=key_length)
          j=0
        end
    }
    (N-1).downto(1) {
        $mt[i] = ($mt[i] ^ (($mt[i-1] ^ ($mt[i-1] >> 30)) * 1566083941)) - i
# non linear
        $mt[i] &= 0xffffffff  # for WORDSIZE > 32 machines
        i+=1
        if (i>=N)
          $mt[0] = $mt[N-1]
          i=1
        end
    }

    $mt[0] = 0x80000000 # MSB is 1; assuring non-zero initial array
end

# generates a random number on [0,0xffffffff]-interval
def genrand_int32()
    mag01=[0x0, MATRIX_A]
    # mag01[x] = x * MATRIX_A  for x=0,1

    if ($mti >= N)  # generate N words at one time
        if ($mti == N+1)   # if if init_genrand() has not been called,
            init_genrand(5489) # a default initial seed is used
        end

        for kk in 0...N-M
            y = ($mt[kk]&UPPER_MASK)|($mt[kk+1]&LOWER_MASK)
            $mt[kk] = $mt[kk+M] ^ (y >> 1) ^ mag01[y & 0x1]
        end
        for kk in (N-M) ... (N-1)
            y = ($mt[kk]&UPPER_MASK)|($mt[kk+1]&LOWER_MASK)
            $mt[kk] = $mt[kk+(M-N)] ^ (y >> 1) ^ mag01[y & 0x1]
        end
        y = ($mt[N-1]&UPPER_MASK)|($mt[0]&LOWER_MASK)
        $mt[N-1] = $mt[M-1] ^ (y >> 1) ^ mag01[y & 0x1]

        $mti = 0
    end

    y = $mt[$mti]
    $mti+=1
    y ^= (y >> 11)
    y ^= (y << 7) & 0x9d2c5680
    y ^= (y << 15) & 0xefc60000
    y ^= (y >> 18)

    return y
end

# generates a random number on [0,0x7fffffff]-interval
def genrand_int31()
    return (genrand_int32()>>1)
end

# generates a random number on [0,1]-real-interval
def genrand_real1(void)
    return genrand_int32()*(1.0/4294967295.0)
    # divided by 2^32-1
end

# generates a random number on [0,1)-real-interval
def genrand_real2()
    return genrand_int32()*(1.0/4294967296.0)
    # divided by 2^32
end

# generates a random number on (0,1)-real-interval
def genrand_real3()
    return (genrand_int32() + 0.5)*(1.0/4294967296.0)
    # divided by 2^32
end

# generates a random number on [0,1) with 53-bit resolution
def genrand_res53()
    a=genrand_int32()>>5
    b=genrand_int32()>>6
    return (a*67108864.0+b)*(1.0/9007199254740992.0)
end


    init=[0x123, 0x234, 0x345, 0x456]
    length=4
    init_by_array(init, length)

    printf("1000 outputs of genrand_int32()\n")
    for i in 0...1000
      printf("%10u ", genrand_int32())
      if (i%5==4)
        printf("\n")
      end
    end
    printf("\n1000 outputs of genrand_real2()\n")
    for i in 0 ...1000
      printf("%10.8f ", genrand_real2())
      if (i%5==4)
        printf("\n")
      end
    end



=====================================================

Park Heesob




In This Thread