[#111191] invisible Infinity — gabriele renzi <rff_rff@...>

Hi gurus and nubys,

17 messages 2004/09/01

[#111202] Ruby blog software. — Lloyd Zusman <ljz@...>

As a favor to a friend, I'm setting up a blog for her on my server.

44 messages 2004/09/01
[#111206] Re: Ruby blog software. — Jamis Buck <jgb3@...> 2004/09/01

Lloyd Zusman wrote:

[#111284] Re: Ruby blog software. — Mike Clark <mike@...> 2004/09/02

[#111287] Re: Ruby blog software. — Jamis Buck <jgb3@...> 2004/09/02

Mike Clark wrote:

[#111294] Re: Ruby blog software. — Dave Thomas <dave@...> 2004/09/02

[#111212] - EZFX Editor 0.6.0 — Richard Lyman <lymans@...>

Download:

17 messages 2004/09/01

[#111214] ruby sidebar for firefox? — djberg96@... (Daniel Berger)

Hi all,

27 messages 2004/09/01
[#111710] Firefox Ruby sidebar (Re: ruby sidebar for firefox?) — James Britt <jamesUNDERBARb@...> 2004/09/07

James Britt wrote:

[#111245] Not just $SAFE, but damn $SAFE — Aredridel <aredridel@...>

I've been toying with an IRC bot that takes input from users in channel,

20 messages 2004/09/02
[#111273] Re: Not just $SAFE, but damn $SAFE — Florian Gross <flgr@...> 2004/09/02

Aredridel wrote:

[#111277] Re: Not just $SAFE, but damn $SAFE — ts <decoux@...> 2004/09/02

>>>>> "F" == Florian Gross <flgr@ccan.de> writes:

[#111300] autochomp? — Martin DeMello <martindemello@...>

Any way to make IO.readlines chomp each line before adding it to the

33 messages 2004/09/02
[#111436] Re: autochomp? — "Robert Klemme" <bob.news@...> 2004/09/03

[#111447] Re: autochomp? — Ara.T.Howard@... 2004/09/03

On Fri, 3 Sep 2004, Robert Klemme wrote:

[#111448] Pickaxe 2 Suspense Is Killing Me — Zach Dennis <zdennis@...> 2004/09/03

I have been suffering from what appears to be an pre-PickAxe 2 Suspense

[#111364] Pickaxe 2 and rpa-base — Carl Youngblood <carl.youngblood@...>

I was just drooling in anticipation for pickaxe 2 and looking through

16 messages 2004/09/02

[#111477] Hashes and ordering — Hal Fulton <hal9000@...>

I've been wondering something today...

35 messages 2004/09/04
[#111481] Re: Hashes and ordering — Markus <markus@...> 2004/09/04

> Do people test equality of hashes very often? I, for one,

[#111483] Re: Hashes and ordering — Hal Fulton <hal9000@...> 2004/09/04

Markus wrote:

[#111488] OK... :) question about hash and array literals — Hal Fulton <hal9000@...>

It has always bothered me a little that [...] and {...} do not

31 messages 2004/09/04
[#111499] Re: OK... :) question about hash and array literals — Yukihiro Matsumoto <matz@...> 2004/09/04

Hi,

[#111521] Re: OK... :) question about hash and array literals — Hal Fulton <hal9000@...> 2004/09/04

Yukihiro Matsumoto wrote:

[#111576] Re: OK... :) question about hash and array literals — Yukihiro Matsumoto <matz@...> 2004/09/05

Hi,

[#111595] Re: OK... :) question about hash and array literals — Hal Fulton <hal9000@...> 2004/09/05

Yukihiro Matsumoto wrote:

[#111607] Re: OK... :) question about hash and array literals — Yukihiro Matsumoto <matz@...> 2004/09/05

Hi,

[#111610] Re: OK... :) question about hash and array literals — Hal Fulton <hal9000@...> 2004/09/05

Yukihiro Matsumoto wrote:

[#111614] Re: OK... :) question about hash and array literals — Bill Guindon <agorilla@...> 2004/09/05

On Mon, 6 Sep 2004 08:31:38 +0900, Hal Fulton <hal9000@hypermetrics.com> wrote:

[#111531] Anyone using Copland? I need feedback! — Jamis Buck <jgb3@...>

Copland (an IoC container for Ruby) is moving forward, and I *think*

13 messages 2004/09/04

[#111543] Videos of Ruby Conference — Carl Youngblood <carl.youngblood@...>

Is anyone going to be filming rubycon? I would really like to watch

51 messages 2004/09/04
[#111558] Re: Videos of Ruby Conference — Chad Fowler <chadfowler@...> 2004/09/05

On Sun, 5 Sep 2004 07:20:14 +0900, Carl Youngblood

[#111645] Re: Videos of Ruby Conference — Robert McGovern <robert.mcgovern@...> 2004/09/06

> I have a digital video camera of my own and am also planning to try to

[#111971] Re: Videos of Ruby Conference — Eric Hodel <drbrain@...7.net> 2004/09/09

Robert McGovern (robert.mcgovern@gmail.com) wrote:

[#112002] Re: Videos of Ruby Conference — Gavin Sinclair <gsinclair@...> 2004/09/09

On Thursday, September 9, 2004, 5:06:10 PM, Eric wrote:

[#112012] Re: Videos of Ruby Conference — Richard Kilmer <rich@...> 2004/09/09

We are going to have my buddy's audio mixing board, a wireless mic, and a

[#112016] Re: Videos of Ruby Conference — Chad Fowler <chadfowler@...> 2004/09/09

On Fri, 10 Sep 2004 00:08:22 +0900, Richard Kilmer <rich@infoether.com> wrote:

[#112021] Re: Videos of Ruby Conference — Richard Lyman <lymans@...> 2004/09/09

Please don't 'bittorrent-only' anything. There are those of use who

[#112025] BItTorrent: A Force for Good or Evil? (Re: Videos of Ruby Conference) — James Britt <jamesUNDERBARb@...> 2004/09/09

Richard Lyman wrote:

[#111687] Ruby-Nuby forum — Alexey Verkhovsky <alex@...>

Dear fellow ruby-talkers,

49 messages 2004/09/06
[#111714] Re: Ruby-Nuby forum — "Robert Klemme" <bob.news@...> 2004/09/07

[#111718] Re: Ruby-Nuby forum — Alexey Verkhovsky <alex@...> 2004/09/07

On Tue, 2004-09-07 at 10:05, Robert Klemme wrote:

[#111765] Re: Ruby-Nuby forum — Brian Wisti <brianwisti@...> 2004/09/07

[#111770] Re: Ruby-Nuby forum — "Bill Kelly" <billk@...> 2004/09/07

> There will always be some folks who think that all

[#111855] Re: Ruby-Nuby forum — David Ross <drossruby@...> 2004/09/08

That is a very good idea. I have a few thoughts to add

[#111757] Request for ideas: simple, useful web app — "Kirk Haines" <khaines@...>

I'm working on a much broader set of IOWA documentation, and core to this is

14 messages 2004/09/07

[#111759] Reporting errors/problem with modules part of ruby base — Dany Cayouette <danyc@...>

I am a ruby newbie and am intimitaded by posting to this newsgroup... I only made two postings related to modules included with base ruby 1.8.0 and 1.8.1 (net/imap and net/telnet). I think I did my homework in researching the behavior I observed, but never saw any replies to my postings.

11 messages 2004/09/07

[#111786] Unified type conversion framework — gabriele renzi <rff_rff@...>

Hi gurus and nubys,

13 messages 2004/09/07

[#111808] Extending ruby with crypto++ — dwerder@... (Dominik Werder)

Hello everybody,

15 messages 2004/09/07

[#111839] ruby-dev summary 24171-24235 — Minero Aoki <aamine@...>

Hi all,

13 messages 2004/09/08

[#111922] Ruby-Nuby forum — Alexey Verkhovsky <alex@...>

Hi all!

22 messages 2004/09/08

[#111972] Problem with ensuring consistency .. Finalization?? — Charles Hixson <charleshixsn@...>

I want to have a class which occasionally updates a file, but I want to

15 messages 2004/09/09

[#112096] OpenGL on MacOS X (again) — Gavin Kistner <gavin@...>

I'm trying to get Ruby/OpenGL working for just me on my MacOS X box;

13 messages 2004/09/09

[#112194] SQLite/Ruby 2.0.1 BETA — Jamis Buck <jgb3@...>

Another beta release for SQLite/Ruby is available, hard on the heels of

16 messages 2004/09/10
[#112200] Re: [ANN] SQLite/Ruby 2.0.1 BETA — Vincent Isambart <vincent.isambart@...> 2004/09/10

Hi,

[#112208] Re: [ANN] SQLite/Ruby 2.0.1 BETA — Jamis Buck <jgb3@...> 2004/09/10

Vincent Isambart wrote:

[#112195] hob x 0.2 .. blogink for ample abilities .. come into the arms of .. — why the lucky stiff <ruby-talk@...>

ok, ruby-talk. enough.

24 messages 2004/09/10

[#112229] Rails and RubyGems — Jim Menard <jimm@...>

I have two issues with installing Rails via RubyGems. I'm on Mac OS X.

12 messages 2004/09/11

[#112253] Singleton method on object via define_method? — Hal Fulton <hal9000@...>

OK, I have this variable called box.

50 messages 2004/09/11
[#112343] Re: Singleton method on object via define_method? — Martin DeMello <martindemello@...> 2004/09/12

"trans. (T. Onoma)" <transami@runbox.com> wrote:

[#112346] Re: Singleton method on object via define_method? — "trans. (T. Onoma)" <transami@...> 2004/09/12

On Sunday 12 September 2004 02:19 pm, Martin DeMello wrote:

[#112353] Re: Singleton method on object via define_method? — "David A. Black" <dblack@...> 2004/09/13

Hi --

[#112354] Re: Singleton method on object via define_method? — "Gavin Sinclair" <gsinclair@...> 2004/09/13

D. A. Black wrote:

[#112355] Re: Singleton method on object via define_method? — "David A. Black" <dblack@...> 2004/09/13

On Mon, 13 Sep 2004, Gavin Sinclair wrote:

[#112360] Re: Singleton method on object via define_method? — "Gavin Sinclair" <gsinclair@...> 2004/09/13

> On Mon, 13 Sep 2004, Gavin Sinclair wrote:

[#112382] Re: Singleton method on object via define_method? — "Robert Klemme" <bob.news@...> 2004/09/13

[#112464] Catching undefined global variable errors — "George Moschovitis" <george.moschovitis@...>

Hello everyone,

14 messages 2004/09/14

[#112506] Ruby Image — Brian Schroeder <spam0504@...>

Hello Group,

27 messages 2004/09/14
[#112511] Re: [Slightly OT] Ruby Image — James Edward Gray II <james@...> 2004/09/14

On Sep 14, 2004, at 9:04 AM, Brian Schroeder wrote:

[#112549] Programming Ruby available for pre-order — Dave Thomas <dave@...>

Folks:

37 messages 2004/09/14
[#112749] Re: [ANN] Programming Ruby available for pre-order — I did not <NOSPAM@...> 2004/09/16

On Thu, 16 Sep 2004 00:01:54 +0200, Dietmar Gack wrote:

[#112608] Ex-Perl coders: Howz it feel to convert to Ruby? — Chris <ceo@...>

I didn't even think about asking this question until now, based on a

95 messages 2004/09/15
[#112716] Re: Ex-Perl coders: Howz it feel to convert to Ruby? — ptkwt@... (Phil Tomson) 2004/09/16

In article <ER32d.2786$Qv5.1325@newssvr33.news.prodigy.com>,

[#112692] Hacking the Ruby interpreter — Tim Hunter <cyclists@...>

I've got an idea for a hack^H^H^H^H enhancement to the interpreter that I'd

12 messages 2004/09/15

[#112726] RubyGems 0.8.0 — Chad Fowler <chad@...>

Marking the 3000th download of RubyGems

13 messages 2004/09/16

[#112814] horribly impossible debugging task — "Ara.T.Howard" <Ara.T.Howard@...>

17 messages 2004/09/16

[#112815] Re: [ANN] Programming Ruby available for pre-order — Dale Martenson <dmartenson@...>

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

12 messages 2004/09/16

[#112831] Want a regular Ruby Quiz? (long) — James Edward Gray II <james@...>

I'm a fan of short, but regular programming "challenges" or "quizzes".

25 messages 2004/09/16

[#112881] Automatic class conversion / function overloading — torehalv@... (Tore Halvorsen)

Hi! Rather new to ruby, and I'm not quite sure where to look for the

18 messages 2004/09/17

[#112940] Accessing Hash elements in sorted order? — Chris <ceo@...>

Problem: I wanted to access the elements of a Hash (specifically from

14 messages 2004/09/17

[#112976] Return value of while loop. — Brian Schrer <ruby@...>

Maybe this question would be more adequate for the ruby-nuby forum ;), but

21 messages 2004/09/18

[#113026] Method improvement request .-- — Charles Hixson <charleshixsn@...>

I'm sure there must be a more idiomatic+efficient way to do this, but I

32 messages 2004/09/18

[#113055] Array#index block and rdetect — "trans. (T. Onoma)" <transami@...>

Tiny RCR suggestion:

62 messages 2004/09/19
[#113072] Re: Array#index block and rdetect — "Robert Klemme" <bob.news@...> 2004/09/19

[#113097] Re: Array#index block and rdetect — Yukihiro Matsumoto <matz@...> 2004/09/19

Hi,

[#113100] Re: Array#index block and rdetect — "David A. Black" <dblack@...> 2004/09/20

Hi --

[#113103] Re: Array#index block and rdetect — Yukihiro Matsumoto <matz@...> 2004/09/20

Hi,

[#113105] Re: Array#index block and rdetect — "David A. Black" <dblack@...> 2004/09/20

Hi --

[#113130] Re: Array#index block and rdetect — "Robert Klemme" <bob.news@...> 2004/09/20

[#113146] Re: Array#index block and rdetect — "Robert Klemme" <bob.news@...> 2004/09/20

[#113150] Re: Array#index block and rdetect — "David A. Black" <dblack@...> 2004/09/20

Hi --

[#113172] Re: Array#index block and rdetect — Yukihiro Matsumoto <matz@...> 2004/09/20

Hi,

[#113179] Re: Array#index block and rdetect — "David A. Black" <dblack@...> 2004/09/20

Hi --

[#113219] Re: Array#index block and rdetect — Yukihiro Matsumoto <matz@...> 2004/09/20

Hi,

[#113237] Re: Array#index block and rdetect — "David A. Black" <dblack@...> 2004/09/21

Hi --

[#113118] Re: [ANN] Vim/Ruby Configuration Files, 2004.09.20 — "Mehr, Assaph (Assaph)" <assaph@...>

10 messages 2004/09/20

[#113192] Store object in on disk / mini database — Kristian Sensen <ks@...>

Hi!

19 messages 2004/09/20
[#113207] Re: Store object in on disk / mini database — "Bill Kelly" <billk@...> 2004/09/20

From: "trans. (T. Onoma)" <transami@runbox.com>

[#113222] - install.rb hack # 42 — "Ara.T.Howard" <Ara.T.Howard@...>

18 messages 2004/09/20
[#113226] Re: [ANN] - install.rb hack # 42 — Tim Hunter <cyclists@...> 2004/09/21

Ara.T.Howard wrote:

[#113227] Re: [ANN] - install.rb hack # 42 — Ara.T.Howard@... 2004/09/21

On Tue, 21 Sep 2004, Tim Hunter wrote:

[#113233] Re: [ANN] - install.rb hack # 42 — "trans. (T. Onoma)" <transami@...> 2004/09/21

On Monday 20 September 2004 08:54 pm, Ara.T.Howard@noaa.gov wrote:

[#113328] text analyzator — "martinus" <martin.ankerl@...>

I have created a little text analyzation tool, that tries to extract

16 messages 2004/09/21

[#113347] soap4r. I just dont get it. — nkb <nkb@...>

Hi.

15 messages 2004/09/22
[#113349] Re: soap4r. I just dont get it. — "NAKAMURA, Hiroshi" <nakahiro@...> 2004/09/22

Hi,

[#113407] Regexp Arity — "trans. (T. Onoma)" <transami@...>

Just ran into a need to know how many parenthetical groupings a Regexp has.

16 messages 2004/09/22
[#113410] Re: Regexp Arity — Yukihiro Matsumoto <matz@...> 2004/09/22

Hi,

[#113443] Newbie: Case statement — "Graham Foster" <graham@...>

As a newbie I'm confused about the Case construct. All the

14 messages 2004/09/22

[#113479] whitespace string only — Henrik Horneber <ryco@...>

Hi!

39 messages 2004/09/23

[#113533] Design Advice: Sub-Class 'Instances' — Gavin Kistner <gavin@...>

Summary

23 messages 2004/09/23

[#113615] The Solitaire Cipher (#1) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

26 messages 2004/09/24

[#113627] Ruby Code to HTML — James Edward Gray II <james@...>

I need to HTMLify some Ruby code. Before I go make some crude

22 messages 2004/09/24

[#113648] openssl examples and docs — "Ara.T.Howard" <Ara.T.Howard@...>

13 messages 2004/09/24

[#113697] Proc / def / yield semantics (long) — Markus <markus@...>

16 messages 2004/09/25

[#113750] local_method_missing possible — "trans. (T. Onoma)" <transami@...>

13 messages 2004/09/26
[#113752] Re: local_method_missing possible — Markus <markus@...> 2004/09/26

[#113754] Re: local_method_missing possible — "trans. (T. Onoma)" <transami@...> 2004/09/26

On Saturday 25 September 2004 10:42 pm, Markus wrote:

[#113803] RPM of Ruby 1.8.x — Matt Lawrence <matt@...>

I'm trying to find rpms for the latest released version of Ruby. After I

22 messages 2004/09/26

[#113885] {newb} Each statements — STEPHEN BECKER I V <Becker004@...>

Do each statements change the thing that they are using?

14 messages 2004/09/27

[#113888] Any YARV pre-questions in RubyConf2004? — SASADA Koichi <ko1@...>

Hi,

20 messages 2004/09/27
[#113897] Re: Any YARV pre-questions in RubyConf2004? — James Britt <jamesUNDERBARb@...> 2004/09/27

SASADA Koichi wrote:

[#113923] Best name for "this method" ? — "trans. (T. Onoma)" <transami@...>

Wondering what the conscensus is on the best name for "this method". Right now

67 messages 2004/09/27
[#113930] Re: Best name for "this method" ? — "David A. Black" <dblack@...> 2004/09/28

Hi --

[#113994] Re: Best name for "this method" ? — "Robert Klemme" <bob.news@...> 2004/09/28

[#114003] Re: Best name for "this method" ? — Gavin Sinclair <gsinclair@...> 2004/09/28

On Tuesday, September 28, 2004, 5:49:21 PM, Robert wrote:

[#114117] Re: Best name for "this method" ? — "trans. (T. Onoma)" <transami@...> 2004/09/28

On Tuesday 28 September 2004 05:44 am, Gavin Sinclair wrote:

[#114121] Re: Best name for "this method" ? — "David A. Black" <dblack@...> 2004/09/28

Hi --

[#113939] Re: Best name for "this method" ? — Florian Gross <flgr@...> 2004/09/28

trans. (T. Onoma) wrote:

[#113946] irb configure options — James Edward Gray II <james@...>

Where is a good source I can learn irb configuration options from?

15 messages 2004/09/28

[#113965] Wish list for 2.0 — STEPHEN BECKER I V <Becker004@...>

In ref to http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/31099

18 messages 2004/09/28
[#113968] Re: Wish list for 2.0 — Yukihiro Matsumoto <matz@...> 2004/09/28

Hi,

[#113971] Re: Wish list for 2.0 — STEPHEN BECKER I V <Becker004@...> 2004/09/28

does that work for end lines in the middle of a string? or a tab? I

[#113981] Re: Wish list for 2.0 — Yukihiro Matsumoto <matz@...> 2004/09/28

Hi,

[#113988] Re: Wish list for 2.0 — Gavin Sinclair <gsinclair@...> 2004/09/28

On Tuesday, September 28, 2004, 2:40:02 PM, Yukihiro wrote:

[#113976] RubyGarden Spam — James Britt <jamesUNDERBARb@...>

The rubygarden wiki has been over-run with spam links.

45 messages 2004/09/28
[#113980] Re: RubyGarden Spam — David Ross <drossruby@...> 2004/09/28

You should create a way to generate images with text

[#114135] Re: RubyGarden Spam — Patrick May <patrick@...> 2004/09/28

Hello,

[#115134] Re: RubyGarden Spam — Patrick May <patrick@...> 2004/10/06

Hello,

[#115183] Re: RubyGarden Spam — Chad Fowler <chadfowler@...> 2004/10/06

On Wed, 6 Oct 2004 11:53:55 +0900, Patrick May <patrick@hexane.org> wrote:

[#117646] RubyGarden Spam - One step to Solution — David Ross <dross@...> 2004/10/25

Here is one step of which many could be applied.

[#114152] Ruby gems crash on OpenBSD Sparc64 — Wes Moxam <wildwildwes@...>

Hi,

12 messages 2004/09/29

[#114197] ruby-dev summary 24298-24353 — SASADA Koichi <ko1@...>

Hi all,

29 messages 2004/09/29
[#114202] Re: ruby-dev summary 24298-24353 — "Robert Klemme" <bob.news@...> 2004/09/29

[#114436] Re: ruby-dev summary 24298-24353 — "trans. (T. Onoma)" <transami@...> 2004/09/30

> "SASADA Koichi" <ko1@atdot.net> schrieb im Newsbeitrag

[#114439] Re: ruby-dev summary 24298-24353 — Yukihiro Matsumoto <matz@...> 2004/10/01

Hi,

[#114443] Re: ruby-dev summary 24298-24353 — "trans. (T. Onoma)" <transami@...> 2004/10/01

On Thursday 30 September 2004 08:17 pm, Yukihiro Matsumoto wrote:

[#114229] Purely static build of Ruby — "rcoder@..." <rcoder@...>

I'm trying to find out whether it's possible to build a completely

13 messages 2004/09/29

[#114249] FXRuby help — Jamis Buck <jgb3@...>

Having some troubles getting FXRuby to work for me. Any script that I

14 messages 2004/09/29

[#114278] Too Many Ways? — Gavin Kistner <gavin@...>

At what point do you cross over from:

99 messages 2004/09/30
[#114286] Re: Too Many Ways? — "Robert Klemme" <bob.news@...> 2004/09/30

[#114298] Re: Too Many Ways? — "David A. Black" <dblack@...> 2004/09/30

Hi --

[#114314] Re: Too Many Ways? — Gavin Kistner <gavin@...> 2004/09/30

On Sep 30, 2004, at 4:04 AM, David A. Black wrote:

[#114319] Range syntax theory — Zach Dennis <zdennis@...> 2004/09/30

I have been thinking lately about rangess and I will give you the two

[#114333] Re: Range syntax theory — gabriele renzi <rff_rff@...> 2004/09/30

Zach Dennis ha scritto:

[#114408] Re: Too Many Ways? — Brian Candler <B.Candler@...> 2004/09/30

> "Duplicate names and techniques to do the same

[#114631] Re: Too Many Ways? — Bob Sidebotham <bob@...> 2004/10/02

Brian Candler wrote:

[#114648] Re: Too Many Ways? — Gavin Sinclair <gsinclair@...> 2004/10/03

On Sunday, October 3, 2004, 3:34:57 AM, Bob wrote:

[#114652] Re: Too Many Ways? — "trans. (T. Onoma)" <transami@...> 2004/10/03

On Saturday 02 October 2004 10:12 pm, Gavin Sinclair wrote:

[#114750] Re: Too Many Ways? — Brian Candler <B.Candler@...> 2004/10/04

On Sun, Oct 03, 2004 at 12:29:39PM +0900, trans. (T. Onoma) wrote:

[#114792] Re: Too Many Ways? — "trans. (T. Onoma)" <transami@...> 2004/10/04

On Monday 04 October 2004 04:06 am, Brian Candler wrote:

[#114797] Re: Too Many Ways? — Brian Candler <B.Candler@...> 2004/10/04

On Mon, Oct 04, 2004 at 11:08:42PM +0900, trans. (T. Onoma) wrote:

[#114798] Re: Too Many Ways? — Brian Candler <B.Candler@...> 2004/10/04

On Mon, Oct 04, 2004 at 11:37:09PM +0900, Brian Candler wrote:

[#114799] Re: Too Many Ways? — "trans. (T. Onoma)" <transami@...> 2004/10/04

On Monday 04 October 2004 10:42 am, Brian Candler wrote:

[#114289] Funtionality of 'case'-Expression — Ralf Mler <r_mueller@...>

Salve!

15 messages 2004/09/30
[#114292] Re: Funtionality of 'case'-Expression — "Robert Klemme" <bob.news@...> 2004/09/30

[#114387] Proc.new(method)? (was Re: Funtionality of 'case'-Expression) — Mark Hubbart <discordantus@...> 2004/09/30

On Thu, 30 Sep 2004 16:50:03 +0900, Robert Klemme <bob.news@gmx.net> wrote:

[#114362] Re: Range syntax theory — "Mills Thomas (app1tam)" <app1tam@...>

Okay, maybe we think of it this way. '..' is a club. '...' is a club, with

23 messages 2004/09/30
[#114366] Re: Range syntax theory — Zach Dennis <zdennis@...> 2004/09/30

This has been a very fun discussion. I'll shut up now unless anyone

[#114447] Re: Range syntax theory — "Gavin Sinclair" <gsinclair@...> 2004/10/01

Zach wrote:

[#114450] Re: Range syntax theory — Zach Dennis <zdennis@...> 2004/10/01

Gavin Sinclair wrote:

[#114460] Re: Range syntax theory — "Gavin Sinclair" <gsinclair@...> 2004/10/01

Zach wrote:

[#114381] The new Pickaxe II book is a reality! — "Warren Brown" <WBrown@...>

To everyone eagerly awaiting Dave's new book:

29 messages 2004/09/30
[#114384] Re: The new Pickaxe II book is a reality! — Dave Thomas <dave@...> 2004/09/30

[#114399] Re: The new Pickaxe II book is a reality! — Kevin McConnell <kevin_mcconnell@...> 2004/09/30

> as of today

[#114402] Re: The new Pickaxe II book is a reality! — Mike Clark <mike@...> 2004/09/30

Got mine in Colorado today. I *love* the lay-flat binding. And

[#114483] Re: The new Pickaxe II book is a reality! — Victor Reyes <victor.reyes@...> 2004/10/01

PLEASSSSSSSSSSSSSSSSSSSSSSSEEEEEEEEEEEE stop enjoying it so much. I am

[#114492] Re: The new Pickaxe II book is a reality! — Florian Weber <csshsh@...> 2004/10/01

[#114392] Calling super methods — Grzegorz Dostatni <grzegorz@...>

16 messages 2004/09/30
[#114406] Re: Calling super methods — Andrew Johnson <ajohnson@...> 2004/09/30

[#114407] Re: Calling super methods — Florian Frank <flori@...> 2004/09/30

On Thu, 2004-09-30 at 22:20, Andrew Johnson wrote:

[#114398] irb: a great tool in it's own right — ptkwt@... (Phil Tomson)

irb (and a little Ruby knowledge) is great for system tasks, especially on

15 messages 2004/09/30

[SOLUTION] The Solitaire Cipher (#1)

From: Moses Hohman <mmhohman@...>
Date: 2004-09-26 17:55:07 UTC
List: ruby-talk #113793
Class-oriented, but kinda long maybe. Hey, it has unit tests . . . 
Reads in a file, deck.yaml, if it exists to specify the deck order. Zip 
of the files is attached. If you run it out of the box it will use the 
non-default deck in deck.yaml.

Thanks for the quiz, it was fun!

Moses



######################################################################## 
########
# solitaire.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'cipher'
require 'yaml'

module Solitaire
	text = ARGV.join(" ")
	if FileTest::readable?("deck.yaml")
		deck = Deck.new(YAML::load(File.open("deck.yaml")))
	else
		deck = Deck.new
	end
	cipher = Cipher.new(text, deck)
	puts "#{cipher.mode}ed: #{cipher.crypt}"
end

######################################################################## 
########
# cipher.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'util'
require 'deck'

module Solitaire
	ASCII_OFFSET = 64
	ALPHABET_SIZE = 26
		
	class Chunker
		CHUNK_SIZE = 5

		def initialize(text)
			@legal_chars_only = text.gsub(/[^A-Za-z]/, "").upcase
			@legal_chars_only <<= "X" * (-@legal_chars_only.size % CHUNK_SIZE)
			raise "Nothing to chunk (non-alphabet characters removed): #{text}"  
if @legal_chars_only.size==0
			@chunks = []
			@number_chunks = []
		end

		def chunks
			@chunks if @chunks.size > 0
			@chunks = @legal_chars_only.gsub(/(.{#{CHUNK_SIZE}})/, '\1  
').rstrip.split(" ")
		end

		def number_chunks
			@number_chunks if @number_chunks.size > 0
			chunks.collect { |chunk| chunk.split("").collect { |char_string|  
char_string[0]-ASCII_OFFSET } }
		end

		def Chunker.to_letters(number_chunks)
			number_chunks.collect { |chunk| chunk.collect { |num|  
(num+ASCII_OFFSET).chr }.join }
		end
	end

	class Keystream
		A_JOKER = Card.joker(?A)
		B_JOKER = Card.joker(?B)

		def initialize(deck=Deck.new)
			@deck = deck
		end

		def keystream_letters(chunks)
			chunks.collect { |chunk| (1..chunk.size).collect {  
next_keystream_letter }.join }
		end

		def Keystream.card_to_letter(card)
			return "" if card.is_joker?
			(card.value.offset_mod(ALPHABET_SIZE)+ASCII_OFFSET).chr
		end

		private

		def next_keystream_letter
			process_deck
			top_card = @deck[0]
			keystream_card = @deck[top_card.value]
			letter = Keystream.card_to_letter(keystream_card)
			letter = next_keystream_letter if letter==""
			letter
		end

		def process_deck
			@deck.move_card!(A_JOKER, +1)
			@deck.move_card!(B_JOKER, +2)
			@deck.triple_cut!([A_JOKER, B_JOKER])
			@deck.count_cut!
		end
	end

	class Cipher
		ENCRYPTED_TEXT_PATTERN = /\A[A-Z]{5}( [A-Z]{5})*\Z/

		def initialize(text, deck=Deck.new)
			@chunker = Chunker.new(text)
			keystream = Keystream.new(deck)
			@keystream_chunker =  
Chunker.new(keystream.keystream_letters(@chunker.chunks).join)
			if text =~ ENCRYPTED_TEXT_PATTERN
				@mode = "decrypt"
				@calc_number = proc { |num, keystream_num| num - keystream_num }
			else
				@mode = "encrypt"
				@calc_number = proc { |num, keystream_num| num + keystream_num }
			end
		end
		attr_reader :mode

		def crypt
			ciphered = [@chunker.number_chunks,  
@keystream_chunker.number_chunks].collect_peel do |num_chunk,  
keystream_num_chunk|
				[num_chunk, keystream_num_chunk].collect_peel do |num,  
keystream_num|
					@calc_number.call(num,keystream_num).offset_mod(ALPHABET_SIZE)
				end
			end
			Chunker.to_letters(ciphered).join(" ").rstrip
		end
	end
end

######################################################################## 
########
# deck.rb
######################################################################## 
########
require 'util'

module Solitaire
	class Deck
		NUM_CARDS = 54

		def initialize(order=nil)
			if order.nil?
				@order = Array.new(NUM_CARDS) { |x| x+1 }
			else
				@order = order.collect { |val| val.instance_of?(Range) ? val.to_a :  
val }.flatten
				@order.collect! { |val| Card.parse(val).code }
			end
		end
		attr_reader :order
		protected :order

		def [](index)
			Card.parse(@order[index])
		end

		def move_card!(card, offset)
			current_index = @order.index(card.code)
			new_index = current_index+offset
			if new_index >= NUM_CARDS
				new_index -= NUM_CARDS - 1
			elsif new_index < 0
				new_index += NUM_CARDS - 1
			end
			@order.delete_at(current_index)
			@order.insert(new_index, card.code)
		end

		def triple_cut!(cards)
			raise "exactly two cards required for triple cut: #{cards}" unless  
cards.size==2
			indices = [@order.index(cards[0].code),  
@order.index(cards[1].code)].sort
			@order = @order[(indices[1]+1)..@order.size] +  
@order[indices[0]..indices[1]] + @order[0..(indices[0]-1)]
		end

		def count_cut!
			num_moved = Card.parse(@order.last).value
			if num_moved!=53
				@order = @order[num_moved, NUM_CARDS - num_moved - 1] +  
@order[0..(num_moved-1)] + [@order.last]
			end
			self
		end

		def to_s
			"<Deck: #{@order.inspect}>"
		end
		
		def ==(val)
			@order == val.order
		end
	end

	class Card
		ACE = 1
		JACK = 11
		QUEEN = 12
		KING = 13

		def initialize(suit, value)
			@code = suit.value + value
		end
		attr_reader :code
		alias_method :value, :code

		def Card.parse(code)
			if (1..52).member?(code)
				Card.new(Suit.by_value(code), code.offset_mod(13))
			elsif (53..54).member?(code)
				Card.joker(code+12)
			elsif (65..66).member?(code)
				Card.joker(code)
			elsif code =~ /\A[AB]\Z/
				Card.joker(code[0])
			else
				raise "Illegal class or value for parameter value, #{code.class}  
#{code.inspect}"
			end
		end

		def Card.joker(char)
			JokerCard.new(char.chr)
		end

		def is_joker?
			false
		end

		def ==(other)
			code==other.code
		end

		def <=>(other)
			code<=>other.code
		end

		def to_s
			"Card: #{@code}"
		end
	end

	class JokerCard < Card
		JOKER_VALUE = 53

		def initialize(which_one)
			raise "No such joker: #{which_one}" unless which_one =~ /\A[AB]\Z/
			@code = 52 + (which_one[0].to_i-64)
		end

		def is_joker?
			true
		end

		def value
			JOKER_VALUE
		end
	end

	class Suit
		@@byValue = {}

		def Suit.by_value(val)
			@@byValue[(val-1)/13*13]
		end

		def initialize(name, value)
			@name = name
			@value = value
			@@byValue[value] = self
		end
		attr_reader :name, :value

		CLUBS = Suit.new("clubs", 0)
		DIAMONDS = Suit.new("diamonds", 13)
		HEARTS = Suit.new("hearts", 26)
		SPADES = Suit.new("spades", 39)
	end
end

######################################################################## 
########
# util.rb
######################################################################## 
########
#!/usr/bin/env ruby

class Array
	# "Peels" off a tuple of the elements at each successive index across  
multiple arrays.
	# Assumes self is an array of these multiple arrays. Stops when any of  
the arrays is
	# exhausted. I stole this from a ruby mailing list somewhere. I also  
considered calling this each_tuple
     def peel(&p)
         collect { |a|
             a.length
         }.min.times { |i|
             yield collect { |a| a[i] }
         }
     end

	# syntactic sugar for Cipher
	def collect_peel(&p)
		collected = []
		peel { |a,b| collected << p.call(a,b) }
		collected
	end
end

class Fixnum
	def offset_mod(base)
		((self-1)%base)+1
	end
end

######################################################################## 
########
# deck.yaml
######################################################################## 
########
# Array of numbers (1 through 54), ranges of those numbers,
# and "A" or "B" that describes the order of the keyed deck
---
- 25
- !ruby/range 1..24
- !ruby/range 26..54

######################################################################## 
########
# testsuite.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'test/unit'
require 'test_cipher'
require 'test_deck'
require 'test_util'

######################################################################## 
########
# test_cipher.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'test/unit'
require 'cipher'

module Solitaire
	class TestChunker < Test::Unit::TestCase
		def test_chunks
			chunker = Chunker.new("Code in Ruby, live longer!")
			assert_equal(["CODEI","NRUBY","LIVEL","ONGER"], chunker.chunks)
		end

		def test_pads_with_Xs
			chunker = Chunker.new("sty")
			assert_equal(["STYXX"], chunker.chunks)
		end

		def test_number_chunks
			chunker = Chunker.new("Code in Ruby, live longer!")
			assert_equal([[3,15,4,5,9], [14,18,21,2,25], [12,9,22,5,12],  
[15,14,7,5,18]], chunker.number_chunks)
		end

		def test_to_letters
			assert_equal(["CODEI","NRUBY","LIVEL","ONGER"],
				Chunker.to_letters([[3,15,4,5,9], [14,18,21,2,25], [12,9,22,5,12],  
[15,14,7,5,18]]))
		end
	end

	class TestKeystream < Test::Unit::TestCase
		def setup
			@keystream = Keystream.new
		end

		def test_keystream_letters
			chunker = Chunker.new("Code in Ruby, live longer!")
			assert_equal(["DWJXH","YRFDG","TMSHP","UURXJ"],  
@keystream.keystream_letters(chunker.chunks))
		end

		def test_card_to_letter
			assert_equal("", Keystream.card_to_letter(Card.joker(?A)), "A joker")
			assert_equal("", Keystream.card_to_letter(Card.joker(?B)), "B joker")
			assert_equal("A", Keystream.card_to_letter(Card.new(Suit::CLUBS,  
Card::ACE)), "AC")
			assert_equal("Z", Keystream.card_to_letter(Card.new(Suit::DIAMONDS,  
Card::KING)), "KD")
			assert_equal("A", Keystream.card_to_letter(Card.new(Suit::HEARTS,  
Card::ACE)), "AH")
			assert_equal("Z", Keystream.card_to_letter(Card.new(Suit::SPADES,  
Card::KING)), "KS")
		end
	end

	class TestCipher < Test::Unit::TestCase
		def test_encrypt
			cipher = Cipher.new("Code in Ruby, live longer!")
			assert_equal("encrypt", cipher.mode)
			assert_equal("GLNCQ MJAFF FVOMB JIYCB", cipher.crypt)
		end

		def test_decrypt
			cipher = Cipher.new("GLNCQ MJAFF FVOMB JIYCB")
			assert_equal("decrypt", cipher.mode)
			assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
		end

		def test_crypt_idempotent
			cipher = Cipher.new("GLNCQ MJAFF FVOMB JIYCB")
			assert_equal("decrypt", cipher.mode)
			assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
			assert_equal("CODEI NRUBY LIVEL ONGER", cipher.crypt)
		end
	end
end

######################################################################## 
########
# test_deck.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'test/unit'
require 'deck'

module Solitaire
	class TestDeck < Test::Unit::TestCase
		def test_constructor_accepts_ranges_in_array
			assert_equal(Deck.new, Deck.new([1, 2, 3, 4..52, 53..54]))
		end

		def test_construcor_accepts_chars_for_jokers
			assert_equal(Deck.new, Deck.new((1..52).to_a + [?A, ?B]))
		end

		def test_move_card_lower
			deck = Deck.new
			deck.move_card!(Card.new(Suit::DIAMONDS, 6), +5)
			assert_equal(Deck.new([1..18,20..24,19,25..54]).to_s, deck.to_s)
		end

		def test_move_card_one_lower
			deck = Deck.new
			deck.move_card!(Card.new(Suit::DIAMONDS, 6), +1)
			assert_equal(Deck.new([1..18,20,19,21..54]).to_s, deck.to_s)
		end

		def test_move_card_higher
			deck = Deck.new
			deck.move_card!(Card.new(Suit::DIAMONDS, 6), -5)
			assert_equal(Deck.new([1..13,19,14..18,20..54]), deck)
		end

		def test_move_card_is_cyclic_plus_1
			deck = Deck.new
			deck.move_card!(Card.joker(?A), +2)
			assert_equal(Deck.new([1,53,2..52,54]), deck)
		end

		def test_move_card_to_end
			deck = Deck.new
			deck.move_card!(Card.joker(?A), +1)
			assert_equal(Deck.new([1..52,54,53]), deck)
		end

		def test_move_card_to_one_before_end
			deck = Deck.new([2..54,1])
			deck.move_card!(Card.joker(?A), +1)
			assert_equal(Deck.new([2..52,54,53,1]).to_s, deck.to_s)
		end

		def test_move_card_to_beginning
			deck = Deck.new
			deck.move_card!(Card.new(Suit::CLUBS, 2), -1)
			assert_equal(Deck.new([2,1,3..54]), deck)
		end

		def test_move_card_is_cyclic_pass_end_forward
			deck = Deck.new
			deck.move_card!(Card.joker(?B), +1)
			assert_equal(Deck.new([1,54,2..53]), deck)
		end

		def test_move_card_is_cyclic_pass_end_backward
			deck = Deck.new
			deck.move_card!(Card.new(Suit::CLUBS, Card::ACE), -1)
			assert_equal(Deck.new([2..53,1,54]), deck)
		end

		def test_move_card_cyclic_backward_five
			deck = Deck.new
			deck.move_card!(Card.new(Suit::CLUBS, 5), -5)
			assert_equal(Deck.new([1..4,6..53,5,54]), deck)
		end

		def test_triple_cut
			deck = Deck.new
			deck.triple_cut!([Card.new(Suit::CLUBS, Card::JACK),  
Card.new(Suit::HEARTS, Card::KING)])
			assert_equal(Deck.new([40..54,11..39,1..10]), deck)
		end

		def test_triple_cut_with_empty_side
			deck = Deck.new([2..53,1,54])
			deck.triple_cut!([Card.joker(?A), Card.joker(?B)])
			assert_equal(Deck.new([53,1,54,2..52]), deck)
		end

		def test_count_cut
			deck = Deck.new
			deck.move_card!(Card.new(Suit::CLUBS, 5), 49)
			deck.count_cut!
			assert_equal(Deck.new([7..54,1..4,6,5]), deck)
		end
	end

	class TestCard < Test::Unit::TestCase
		def test_parse_joker_string
			assert_equal(Card.joker(?A), Card.parse("A"))
		end

		def test_parse_joker_char
			assert_equal(Card.joker(?A), Card.parse(?A))
		end

		def test_parse_normal_card
			assert_equal(Card.new(Suit::CLUBS, 5), Card.parse(5))
		end

		def test_value
			assert_equal(1, Card.new(Suit::CLUBS, Card::ACE).value, "AC")
			assert_equal(7, Card.new(Suit::CLUBS, 7).value, "7C")
			assert_equal(11, Card.new(Suit::CLUBS, Card::JACK).value, "JC")
			assert_equal(13, Card.new(Suit::CLUBS, Card::KING).value, "KC")
			assert_equal(14, Card.new(Suit::DIAMONDS, Card::ACE).value, "AD")
			assert_equal(26, Card.new(Suit::DIAMONDS, Card::KING).value, "KD")
			assert_equal(29, Card.new(Suit::HEARTS, 3).value, "3H")
			assert_equal(39, Card.new(Suit::HEARTS, Card::KING).value, "KH")
			assert_equal(40, Card.new(Suit::SPADES, Card::ACE).value, "AS")
			assert_equal(52, Card.new(Suit::SPADES, Card::KING).value, "KS")
			assert_equal(53, Card.joker(?A).value, "A Joker")
			assert_equal(53, Card.joker(?B).value, "B Joker")
		end

		def test_is_joker_when_joker
			assert(Card.joker(?A).is_joker?, "A joker not joker")
			assert(Card.joker(?B).is_joker?, "B joker not joker")
		end

		def test_is_joker_when_not_joker
			assert(!Card.new(Suit::SPADES, 7).is_joker?)
		end
	end

	class TestSuit < Test::Unit::TestCase
		def test_by_value_clubs
			assert_equal("clubs", Suit.by_value(1).name)
		end

		def test_by_value_hearts
			assert_equal("hearts", Suit.by_value(27).name)
		end

		def test_hearts
			assert_equal("hearts", Suit::HEARTS.name)
		end
	end
end

######################################################################## 
########
# test_util.rb
######################################################################## 
########
#!/usr/bin/env ruby
require 'test/unit'
require 'util'

class TestArray < Test::Unit::TestCase
	def test_peel_all_arrays_same_length
		tuples = []
		a1 = [1,3,5]
		a2 = [2,4,6]
		a3 = [1,4,9]
		[a1, a2, a3].peel { |x,y,z| tuples << [x,y,z] }
		assert_equal([[1,2,1],[3,4,4],[5,6,9]], tuples)
	end

	def test_peel_one_array_shorter
		tuples = []
		a1 = [1,3,5]
		a2 = [2,4]
		a3 = [1,4,9]
		[a1, a2, a3].peel { |x,y,z| tuples << [x,y,z] }
		assert_equal([[1,2,1],[3,4,4]], tuples)
	end

	def test_collect_peel
		a1 = [1,3,5]
		a2 = [2,4,6]
		assert_equal([3,7,11], [a1, a2].collect_peel { |a,b| a+b })
	end
end

class TestFixnum < Test::Unit::TestCase
	def test_offset_mod
		assert_equal(1, 27.offset_mod(26), "27 wrong")
		assert_equal(26, 26.offset_mod(26), "26 wrong")
		assert_equal(26, 0.offset_mod(26), "0 wrong")
		assert_equal(25, -1.offset_mod(26), "-1 wrong")
	end
end

Attachments (1)

solution.zip (5.7 KB, Archive)

In This Thread