[#132675] Modules and methods — Javier Valencia <jvalencia@...01.org>

Explaine this to me please:

22 messages 2005/03/02
[#132676] Re: Modules and methods — Javier Valencia <jvalencia@...01.org> 2005/03/02

Javier Valencia wrote:

[#132677] Re: Modules and methods — Brian Schrer <ruby.brian@...> 2005/03/02

On Wed, 2 Mar 2005 20:48:35 +0900, Javier Valencia <jvalencia@log01.org> wrote:

[#132678] Re: Modules and methods — Javier Valencia <jvalencia@...01.org> 2005/03/02

Brian Schrer wrote:

[#132679] Re: Modules and methods — Javier Valencia <jvalencia@...01.org> 2005/03/02

Javier Valencia wrote:

[#132682] Re: Modules and methods — Javier Valencia <jvalencia@...01.org> 2005/03/02

Just another example:

[#132683] Re: Modules and methods — ts <decoux@...> 2005/03/02

>>>>> "J" == Javier Valencia <jvalencia@log01.org> writes:

[#132685] Re: Modules and methods — Brian Schrer <ruby.brian@...> 2005/03/02

On Wed, 2 Mar 2005 21:55:02 +0900, ts <decoux@moulon.inra.fr> wrote:

[#132686] Re: Modules and methods — ts <decoux@...> 2005/03/02

>>>>> "B" == Brian Schr=F6der?= <ISO-8859-1> writes:

[#132689] Re: Modules and methods — Javier Valencia <jvalencia@...01.org> 2005/03/02

ts wrote:

[#132703] A wish: Simple database — Hal Fulton <hal9000@...>

Hi, all...

35 messages 2005/03/02

[#132778] post inc problem — Sebesty駭 G畸or <segabor@...>

Hi,

13 messages 2005/03/03
[#132780] Re: post inc problem — Brian Schrer <ruby.brian@...> 2005/03/03

On Thu, 3 Mar 2005 15:14:44 +0900, Sebesty駭 G畸or <segabor@chello.hu> wrote:

[#132783] RAA Status & The Problem with Ruby — "Curt Hibbs" <curt@...>

Below, I posting the entire text of this blog entry:

96 messages 2005/03/03
[#132784] Re: RAA Status & The Problem with Ruby — "Curt Hibbs" <curt@...> 2005/03/03

Curt Hibbs wrote:

[#132786] Re: RAA Status & The Problem with Ruby — Alexander Kellett <ruby-lists@...> 2005/03/03

On Mar 3, 2005, at 1:07 PM, Curt Hibbs wrote:

[#132794] Re: RAA Status & The Problem with Ruby — Francis Hwang <sera@...> 2005/03/03

[#132823] Re: RAA Status & The Problem with Ruby — Lyle Johnson <lyle.johnson@...> 2005/03/03

On Thu, 3 Mar 2005 21:21:03 +0900, Alexander Kellett

[#132845] Re: RAA Status & The Problem with Ruby — "Curt Hibbs" <curt@...> 2005/03/03

Lyle Johnson wrote:

[#132859] Re: RAA Status & The Problem with Ruby — Yukihiro Matsumoto <matz@...> 2005/03/04

Hi,

[#132901] Re: RAA Status & The Problem with Ruby — leon breedt <bitserf@...> 2005/03/04

On Fri, 4 Mar 2005 09:45:16 +0900, Yukihiro Matsumoto

[#132821] Re: RAA Status & b — James Britt <jamesUNDERBARb@...> 2005/03/03

Curt Hibbs wrote:

[#132822] Re: RAA Status & b — "Curt Hibbs" <curt@...> 2005/03/03

James Britt wrote:

[#132826] Re: RAA Status & b — Ben Giddings <bg-rubytalk@...> 2005/03/03

Curt Hibbs wrote:

[#132827] Re: RAA Status & b — Brian Schrer <ruby.brian@...> 2005/03/03

On Fri, 4 Mar 2005 05:02:52 +0900, Ben Giddings

[#132830] Re: RAA Status & b — "Jim Weirich" <jim@...> 2005/03/03

[#132881] Re: ruby gems, and the require problem (was Re: RAA Status & b) — "Pe, Botp" <botp@...>

Sam Roberts [mailto:sroberts@uniserve.com] wrote:

25 messages 2005/03/04
[#132883] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Sam Roberts <sroberts@...> 2005/03/04

Quoting botp@delmonte-phil.com, on Fri, Mar 04, 2005 at 12:21:01PM +0900:

[#132884] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Richard Kilmer <rich@...> 2005/03/04

[#132889] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Sam Roberts <sroberts@...> 2005/03/04

Quoting rich@infoether.com, on Fri, Mar 04, 2005 at 12:47:34PM +0900:

[#132894] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Richard Kilmer <rich@...> 2005/03/04

[#132899] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Sam Roberts <sroberts@...> 2005/03/04

Quoting rich@infoether.com, on Fri, Mar 04, 2005 at 02:11:16PM +0900:

[#132913] Re: ruby gems, and the require problem (was Re: RAA Status & b) — Austin Ziegler <halostatue@...> 2005/03/04

On Fri, 4 Mar 2005 14:37:28 +0900, Sam Roberts

[#132925] Roman Numerals (#22) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

24 messages 2005/03/04

[#132989] building rdocs for Rake — Joel VanderWerf <vjoel@...>

11 messages 2005/03/05

[#133002] ruby-dev summary 25741-25780 — Minero Aoki <aamine@...>

Hi all,

29 messages 2005/03/06
[#133004] Re: ruby-dev summary 25741-25780 — "David A. Black" <dblack@...> 2005/03/06

Hi --

[#133006] Re: ruby-dev summary 25741-25780 — Yukihiro Matsumoto <matz@...> 2005/03/06

Hi,

[#133010] Re: ruby-dev summary 25741-25780 — "David A. Black" <dblack@...> 2005/03/06

Hi --

[#133021] Noob:Objects as key in hash — Tom Willis <tom.willis@...>

Hi all,

14 messages 2005/03/06

[#133058] WEBrick for a local application? — Jeremy Bear <jeremy.bear@...>

Hello!

17 messages 2005/03/07
[#133060] Re: WEBrick for a local application? — Joao Pedrosa <joaopedrosa@...> 2005/03/07

Hi,

[#133063] Re: WEBrick for a local application? — Jeremy Bear <jeremy.bear@...> 2005/03/07

> > My main question, I guess, is this: Is there any way that I can use

[#133094] ncurses ruby and utf-8 — Brian Schrer <ruby.brian@...>

hello group,

12 messages 2005/03/07

[#133255] Tiny URLs — James Britt <jamesUNDERBARb@...>

Informal poll: Are there others as leery as I am of tinyurl and similar

33 messages 2005/03/10

[#133265] ruby-ldap rebinding ? — Dick Davies <rasputnik@...>

14 messages 2005/03/10
[#133345] Re: ruby-ldap rebinding ? — Ian Macdonald <ian@...> 2005/03/11

On Thu 10 Mar 2005 at 20:46:51 +0900, Dick Davies wrote:

[#133366] Re: ruby-ldap rebinding ? — Dick Davies <rasputnik@...> 2005/03/11

* Ian Macdonald <ian@caliban.org> [0345 06:45]:

[#133313] Gateway broken? — "Berger, Daniel" <Daniel.Berger@...>

Hi all,

18 messages 2005/03/10
[#133314] Re: Gateway broken? — "ES" <ruby-ml@...> 2005/03/10

On Thu, March 10, 2005 9:38 pm, Berger, Daniel said:

[#133317] Re: Gateway broken? — Dennis Oelkers <dennis@...> 2005/03/10

Hey folks,

[#133336] Possible ruby job in SF Bay Area — Joel VanderWerf <vjoel@...>

This is an informal announcement of a possible position for

23 messages 2005/03/11
[#133338] Re: [JOB] Possible ruby job in SF Bay Area — Jamis Buck <jamis_buck@...> 2005/03/11

On Mar 10, 2005, at 8:20 PM, Joel VanderWerf wrote:

[#133382] Redesign 2005 Blog — why the lucky stiff <ruby-talk@...>

The vit-core team (assigned to redesign ruby-lang.org) has unveiled our

30 messages 2005/03/11
[#133491] Re: [ANN] Redesign 2005 Blog — "Josef 'Jupp' Schugt" <jupp@...> 2005/03/13

why the lucky stiff wrote:

[#133426] Codefest Grant - RubyGems cleanup and enhancement — Eric Hodel <drbrain@...7.net>

Seattle.rb will be hosting a RubyGems cleanup and enhancement codefest!

46 messages 2005/03/12
[#133532] Re: Codefest Grant - RubyGems cleanup and enhancement — Ben Giddings <bg-rubytalk@...> 2005/03/14

Eric Hodel wrote:

[#133542] Re: Codefest Grant - RubyGems cleanup and enhancement — vruz <horacio.lopez@...> 2005/03/14

> Is there any chance you could start this process a little bit? Choose

[#133548] Re: Codefest Grant - RubyGems cleanup and enhancement — James Edward Gray II <james@...> 2005/03/15

On Mar 14, 2005, at 5:18 PM, vruz wrote:

[#133432] Help a newbie pick a gui tool kit — Dennis Roberts <denrober@...>

So I am still learning Ruby. I am also learning C. I just did

39 messages 2005/03/12

[#133483] how do you duck-type something to String, so String believes you? — Sam Roberts <sroberts@...>

I can give something a #to_str, which should be an indication that it is

11 messages 2005/03/13

[#133511] RubyURL.com — Robby Russell <robby@...>

I felt like giving myself a small project to get my feet a bit more wet

27 messages 2005/03/14

[#133550] Getting Started with Orbjson tutorial — James Britt <jamesUNDERBARb@...>

I wrote a tutorial on using the Orbjson library to create Web

12 messages 2005/03/15
[#133553] Re: [ANN] Getting Started with Orbjson tutorial — vruz <horacio.lopez@...> 2005/03/15

> I wrote a tutorial on using the Orbjson library to create Web

[#133611] class variables and class instance variable? — Lionel Thiry <lthiryidontwantspam@...>

Hello.

20 messages 2005/03/15

[#133614] n body problem — Martin DeMello <martindemello@...>

Here's a first pass at the n body problem in the shootout - I've tried

23 messages 2005/03/15

[#133616] will '@@' disapear in ruby2? — Lionel Thiry <lthiryidontwantspam@...>

Hello there!

13 messages 2005/03/15

[#133688] eval/binding question — Stefan Kaes <skaes@...>

I tried to create local variables from a name=>value hash passed as a

23 messages 2005/03/15
[#133703] Re: eval/binding question — Yukihiro Matsumoto <matz@...> 2005/03/15

Hi,

[#133719] Re: eval/binding question — Stefan Kaes <skaes@...> 2005/03/15

Yukihiro Matsumoto wrote:

[#133748] FAQ for comp.lang.ruby — hal9000@...

RUBY NEWSGROUP FAQ -- Welcome to comp.lang.ruby! (Revised 2004-10-16)

15 messages 2005/03/15

[#133785] Examples for racc? — Ben Giddings <bg-rubytalk@...>

Hey all,

15 messages 2005/03/15

[#133852] Fibonacci Benchmark Correction — jzakiya@...

The Great Computer Language Shootout Benchmarks

26 messages 2005/03/16

[#133875] Symbol vs String — Sebesty駭 G畸or <segabor@...>

Hi,

20 messages 2005/03/16

[#133909] bug? ruby doesn't flush stdio on exit! — Sam Roberts <sroberts@...>

This can't be a feature... stdio should flush on exit!

11 messages 2005/03/17

[#133959] new language shootout — Martin Ankerl <martin.ankerl@...>

Hi, I have been thinking a bit on creating a new language shootout. All

11 messages 2005/03/17

[#133981] Maximum stack depth — Glenn Parker <glenn.parker@...>

It would be useful to have a Ruby command-line option to specify a

27 messages 2005/03/17

[#133999] Free Rails hosting? — Aquila <braempje@...>

I know a lot of free hosters who support PHP etc. but I'd rather try Rails.

23 messages 2005/03/17

[#134022] encapsulating rubygems so that my users don't need to be aware of it — Csaba Henk <csaba@..._for_avoiding_spam.org>

Hi!

9 messages 2005/03/17

[#134074] Crobjob problem with ruby script. — "andreas.cahen@..." <andreas.cahen@...>

Hi!

19 messages 2005/03/18

[#134078] - E03 - jamLang Evaluation Case Applied to Ruby — Ilias Lazaridis <ilias@...>

[EVALUATION] - E02 - Nitro, a Ruby Based WebFramework

75 messages 2005/03/18
[#134092] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Martin DeMello <martindemello@...> 2005/03/18

Ilias Lazaridis <ilias@lazaridis.com> wrote:

[#136612] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Csaba Henk <csaba@..._for_avoiding_spam.org> 2005/04/03

On 2005-04-03, Ilias Lazaridis <ilias@lazaridis.com> wrote:

[#136628] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Ilias Lazaridis <ilias@...> 2005/04/03

Csaba Henk wrote:

[#136631] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Saynatkari <ruby-ml@...> 2005/04/03

[#136640] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Ilias Lazaridis <ilias@...> 2005/04/03

Saynatkari wrote:

[#136702] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Csaba Henk <csaba@..._for_avoiding_spam.org> 2005/04/04

On 2005-04-04, Robert Klemme <bob.news@gmx.net> wrote:

[#136713] Re: [EVALUATION] - E03 - jamLang Evaluation Case Applied to Ruby — Ilias Lazaridis <ilias@...> 2005/04/04

Csaba Henk wrote:

[#134080] Texas Hold'Em (#24) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

17 messages 2005/03/18

[#134103] Iterating through a string and removing leading characters — Randy Kramer <rhkramer@...>

This is going to seem a little strange (for a number of reasons I might

44 messages 2005/03/18

[#134158] Paul Graham recommends Ruby — Joe Van Dyk <joevandyk@...>

Paul wrote an article about his recommendations for current

93 messages 2005/03/19
[#134244] Re: Paul Graham recommends Ruby — Martin DeMello <martindemello@...> 2005/03/19

Navindra Umanee <navindra@cs.mcgill.ca> wrote:

[#134248] Re: Paul Graham recommends Ruby — "Florian Frank" <flori@...> 2005/03/19

Martin DeMello wrote:

[#134250] Re: Paul Graham recommends Ruby — "David A. Black" <dblack@...> 2005/03/19

Hi --

[#134304] Re: Paul Graham recommends Ruby — Navindra Umanee <navindra@...> 2005/03/20

David A. Black <dblack@wobblini.net> wrote:

[#134270] Re: Paul Graham recommends Ruby — Yukihiro Matsumoto <matz@...> 2005/03/19

Hi,

[#134169] Re: Paul Graham recommends Ruby — Premshree Pillai <premshree.pillai@...> 2005/03/19

On Sat, 19 Mar 2005 11:54:41 +0900, Joe Van Dyk <joevandyk@gmail.com> wrote:

[#134182] Re: Paul Graham recommends Ruby — Christian Neukirchen <chneukirchen@...> 2005/03/19

Premshree Pillai <premshree.pillai@gmail.com> writes:

[#134218] Re: Paul Graham recommends Ruby — Navindra Umanee <navindra@...> 2005/03/19

Christian Neukirchen <chneukirchen@gmail.com> wrote:

[#134221] Re: Paul Graham recommends Ruby — Laurent Sansonetti <laurent.sansonetti@...> 2005/03/19

On Sun, 20 Mar 2005 02:35:50 +0900, Navindra Umanee

[#134227] Re: Paul Graham recommends Ruby — Navindra Umanee <navindra@...> 2005/03/19

Laurent Sansonetti <laurent.sansonetti@gmail.com> wrote:

[#134232] Re: Paul Graham recommends Ruby — Christian Neukirchen <chneukirchen@...> 2005/03/19

Navindra Umanee <navindra@cs.mcgill.ca> writes:

[#134234] Re: Paul Graham recommends Ruby — Navindra Umanee <navindra@...> 2005/03/19

Christian Neukirchen <chneukirchen@gmail.com> wrote:

[#134236] Re: Paul Graham recommends Ruby — Christian Neukirchen <chneukirchen@...> 2005/03/19

Navindra Umanee <navindra@cs.mcgill.ca> writes:

[#134237] Re: Paul Graham recommends Ruby — Navindra Umanee <navindra@...> 2005/03/19

Christian Neukirchen <chneukirchen@gmail.com> wrote:

[#134242] Re: Paul Graham recommends Ruby — Christian Neukirchen <chneukirchen@...> 2005/03/19

Navindra Umanee <navindra@cs.mcgill.ca> writes:

[#134200] strip and its evil brother strip! — Aquila <braempje@...>

Possibly a stupid question: why does strip! of a string with a single

37 messages 2005/03/19
[#134203] Re: strip and its evil brother strip! — Glenn Parker <glenn.parker@...> 2005/03/19

Aquila wrote:

[#134207] Re: strip and its evil brother strip! — Florian Gross <flgr@...> 2005/03/19

Glenn Parker wrote:

[#134220] Re: strip and its evil brother strip! — Glenn Parker <glenn.parker@...> 2005/03/19

Florian Gross wrote:

[#134223] Re: strip and its evil brother strip! — Florian Gross <flgr@...> 2005/03/19

Glenn Parker wrote:

[#134210] Re: strip and its evil brother strip! — Jason Sweat <jason.sweat@...> 2005/03/19

On Sun, 20 Mar 2005 01:07:15 +0900, Glenn Parker

[#134213] Re: strip and its evil brother strip! — "David A. Black" <dblack@...> 2005/03/19

Hi --

[#134215] Re: strip and its evil brother strip! — Daniel Amelang <daniel.amelang@...> 2005/03/19

I ranted about this very behavior 2 days ago. I'm willing to do an RCR

[#134262] RCR 296: Destructive methods return self — Daniel Amelang <daniel.amelang@...>

I know that it's not standard policy to announce RCRs on ruby-talk,

90 messages 2005/03/19
[#134276] Re: RCR 296: Destructive methods return self — Daniel Amelang <daniel.amelang@...> 2005/03/19

For those interested in an alternative, I just put this up on the RCR:

[#134577] Re: RCR 296: Destructive methods return self — Yukihiro Matsumoto <matz@...> 2005/03/22

Hi,

[#134594] Re: RCR 296: Destructive methods return self — Daniel Amelang <daniel.amelang@...> 2005/03/22

Yes, I am liking the proposal less and less as time goes on. And I'm

[#134697] Re: RCR 296: Destructive methods return self — Ben Giddings <bg-rubytalk@...> 2005/03/22

Yukihiro Matsumoto wrote:

[#134370] can WEBrick bind to port 0, and then tell me what port was allocated? — Sam Roberts <sroberts@...>

I don't want to use a hard-coded port number, I want it to bind to

12 messages 2005/03/20

[#134413] Ruby, brother of VB? — "Mike Cox" <mikecoxlinux@...>

Hi. I am researching a language to switch to after Microsoft EOL'd classic

16 messages 2005/03/21

[#134481] FMOD or other sound libraries...anyone? — david@... (David Casal)

I'm looking for a good Ruby sound library...

19 messages 2005/03/21

[#134517] Support for 10x Productivity Increase with Rails! — "Curt Hibbs" <curt@...>

I got a lot of flack for what I wrote in my ONLamp.com article on Rails when

27 messages 2005/03/21

[#134555] Ruby newbie: 3 week learning project — "Al Abut - alabut.com" <alabut@...>

Hi all, I'm (very) new to Ruby and I'm blogging out every day of a 3

16 messages 2005/03/21

[#134642] Getting the word to conventional programmers — claird@... (Cameron Laird)

*DevSource* profiles "The State of the Scripting Universe" in

25 messages 2005/03/22

[#134660] RubyConf 2005 Preregistration now open! — "David A. Black" <dblack@...>

17 messages 2005/03/22

[#134710] Any guides for good coding in Ruby? — "Arfin" <arfinmail@...>

Is there some kind of class to format numbers? Something to let you

75 messages 2005/03/22
[#134718] Re: Any guides for good coding in Ruby? — "David A. Black" <dblack@...> 2005/03/22

Hi --

[#134724] Re: Any guides for good coding in Ruby? — Martin Ankerl <martin.ankerl@...> 2005/03/22

> I try to follow the style that is predominant in the Ruby parts of the

[#134730] Re: Any guides for good coding in Ruby? — James Edward Gray II <james@...> 2005/03/22

On Mar 22, 2005, at 4:24 PM, Martin Ankerl wrote:

[#134747] Re: Any guides for good coding in Ruby? — Nikolai Weibull <mailing-lists.ruby-talk@...> 2005/03/23

* James Edward Gray II (Mar 22, 2005 23:50):

[#134736] Re: Any guides for good coding in Ruby? [OT] tabs vs. spaces — Ben Giddings <bg-rubytalk@...> 2005/03/22

Martin Ankerl wrote:

[#134740] Re: Any guides for good coding in Ruby? [OT] tabs vs. spaces — Sam Roberts <sroberts@...> 2005/03/22

Quoting bg-rubytalk@infofiend.com, on Wed, Mar 23, 2005 at 08:17:53AM +0900:

[#134866] Dwemthy's Array -- the Ruby mini_adventure — why the lucky stiff <ruby-talk@...>

Since you were a very young rabbit in little cotton pants, Dwemthy's

17 messages 2005/03/23
[#134885] Re: [ANN] Dwemthy's Array -- the Ruby mini_adventure — ptkwt@... (Phil Tomson) 2005/03/23

In article <50756767050323100730f7f739@mail.gmail.com>,

[#134892] Re: [ANN] Dwemthy's Array -- the Ruby mini_adventure — Patrick Hurley <phurley@...> 2005/03/23

> No doubt _why has put some magic in DwemthysArray that we're missing.

[#134896] Ruby article on DevSource — Hal Fulton <hal9000@...>

FWIW, DevSource.com (previously mentioned here) now has

13 messages 2005/03/23

[#134990] Syntax 0.7.0 — Jamis Buck <jamis@37signals.com>

Syntax is a pure-Ruby framework for doing lexical analysis (and, in

23 messages 2005/03/24
[#135020] Re: [ANN] Syntax 0.7.0 — Sam Roberts <sroberts@...> 2005/03/24

Quoting jamis@37signals.com, on Thu, Mar 24, 2005 at 02:54:20PM +0900:

[#135038] Re: [ANN] Syntax 0.7.0 — gabriele renzi <surrender_it@...> 2005/03/24

Sam Roberts ha scritto:

[#135042] Re: [ANN] Syntax 0.7.0 — Sam Roberts <sroberts@...> 2005/03/24

Quoting jamis@37signals.com, on Fri, Mar 25, 2005 at 01:27:37AM +0900:

[#135013] Syntax for gem list file when hosting own rubygems repository — James Britt <james_b@...>

Are there online docs for creating the YAML file needed when

10 messages 2005/03/24

[#135092] OO database concepts... — Hal Fulton <hal9000@...>

I've been thinking about OO databases -- never having really

24 messages 2005/03/25

[#135147] A Poll — "jeem" <jeem.hughes@...>

Hello group. Please take a minute to satisfy my idle curiousity. I'll

72 messages 2005/03/25

[#135168] Hash::MixIn and Python style Object#dict — Florian Gross <flgr@...>

Moin.

17 messages 2005/03/25
[#135179] Re: Hash::MixIn and Python style Object#dict — gabriele renzi <surrender_it@...> 2005/03/25

Florian Gross ha scritto:

[#135200] English Numerals (#25) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

22 messages 2005/03/25

[#135236] Rake 0.5.0 Release — Jim Weirich <jim@...>

= Rake 0.5.0 Released

14 messages 2005/03/25

[#135253] comment on today's poll and more questions — ptkwt@... (Phil Tomson)

15 messages 2005/03/26

[#135265] Evaluator for a mini-Ruby in Haskell — "Daniel Berger" <djberg96@...>

Maybe I need to rethink my view of Haskell after all:

17 messages 2005/03/26

[#135372] RubyScript2Exe 0.3.3 — "Erik Veenstra" <pan@...>

17 messages 2005/03/26

[#135393] ! haphazard — bertrandmuscle@...

is ! haphazardly implemented for a reason?

18 messages 2005/03/27
[#135395] Re: ! haphazard — Daniel Amelang <daniel.amelang@...> 2005/03/27

Tell us what you mean by 'haphazardly' ?

[#135399] Re: ! haphazard — Lyle Johnson <lyle.johnson@...> 2005/03/27

On Sun, 27 Mar 2005 10:47:15 +0900, Daniel Amelang

[#135400] Re: ! haphazard — bertrandmuscle@... 2005/03/27

>>Tell us what you mean by 'haphazardly' ?

[#135404] Re: ! haphazard — Daniel Amelang <daniel.amelang@...> 2005/03/27

Gotcha. Well, I can tell you firsthand about the controversies of the

[#135480] Ruby Weekly News 21st - 27th March 2005 — timsuth@... (Tim Sutherland)

http://www.rubyweeklynews.org/20050327.html

17 messages 2005/03/28
[#135826] Re: Ruby Weekly News 21st - 27th March 2005 — timsuth@... (Tim Sutherland) 2005/03/30

In article <slrnd4ffpm.98l.timsuth@europa.zone>, Tim Sutherland wrote:

[#135484] Best (Windows) Ruby editor — "Peter C. Verhage" <usenet2@...>

Hi,

36 messages 2005/03/28
[#135554] Re: Best (Windows) Ruby editor — "B. K. Oxley (binkley)" <binkley@...> 2005/03/28

Lothar Scholz wrote:

[#135485] Re: Best (Windows) Ruby editor — "Neville Burnell" <Neville.Burnell@...>

I'm using jedit [www.jedit.org]

26 messages 2005/03/28
[#135519] Re: Best (Windows) Ruby editor — Chris Morris <the.chrismo@...> 2005/03/28

> I'm using jedit [www.jedit.org ]

[#135615] Re: Java for Rubyists — "Albert Chou" <achou@...>

I'm not anything like a Java expert, but I do refer to Bruce Eckel's

18 messages 2005/03/29
[#135623] Re: Java for Rubyists — Tom Willis <tom.willis@...> 2005/03/29

I second Eckel

[#135686] Re: Java for Rubyists — Lyndon Samson <lyndon.samson@...> 2005/03/29

> I fell the original posters pain. My work world is filled with long

[#135699] FreeBSD Rubyists? Do Remote Objects work for you? — Miles Keaton <mileskeaton@...>

Looking for any Ruby users on FreeBSD.

11 messages 2005/03/29

[#135708] attr :<symbol>? — Luke Renn <goseigen@...>

What is the proper term for things like attr :<id> and belongs_to

18 messages 2005/03/29

[#135770] Open letter to anyone developing a Ruby IDE — "Adelle Hartley" <adelle@...>

It has been said that features like "intellisense" or "autocomplete" are

25 messages 2005/03/30
[#135778] Re: Open letter to anyone developing a Ruby IDE — Lothar Scholz <mailinglists@...> 2005/03/30

Hello Adelle,

[#135784] Blah-Blah List (and why line counts are a bad metric) — Ben Giddings <bg-rubytalk@...>

So, I did a search for Ruby on Rails today, and my interest was piqued

13 messages 2005/03/30

[#135806] - Time for "comp.lang.ruby.announce" ? — Ilias Lazaridis <ilias@...>

I've noticed a high ammount of announcements ("[ANN]") on this group.

21 messages 2005/03/30

[#135820] Poor efficency of Ruby... — JZ <spamerom@...>

I have prior experiency with php and recently pythonic application servers

48 messages 2005/03/30

[#135841] look-behind regexp ? — Shajith <demerzel@...>

Hi!

14 messages 2005/03/30

[#135859] Defining a Class Accessor — James Edward Gray II <james@...>

I was playing around with an idea in another thread and ran into a

13 messages 2005/03/30

[#135863] Respect and Disappointment — Curt Hibbs <curt@...>

I've finally started a blog. I really didn't want to go public with it

148 messages 2005/03/30
[#136024] Re: Respect and Disappointment — Josef Pospisil <perails@...> 2005/03/31

Hello Curt,

[#136033] Re: Respect and Disappointment — Bill Atkins <batkins57@...> 2005/03/31

Ridiculous. You're saying Rails (I'm assuming that's what you mean by

[#136048] Re: Respect and Disappointment — Francis Hwang <sera@...> 2005/03/31

My .02 cents:

[#136087] Re: Respect and Disappointment — Austin Ziegler <halostatue@...> 2005/03/31

On Mar 31, 2005 6:17 AM, Francis Hwang <sera@fhwang.net> wrote:

[#136122] Re: Respect and Disappointment [OT] — Ben Giddings <bg-rubytalk@...> 2005/03/31

Austin Ziegler wrote:

[#136127] Re: Respect and Disappointment [OT] — Austin Ziegler <halostatue@...> 2005/03/31

On Mar 31, 2005 12:11 PM, Ben Giddings <bg-rubytalk@infofiend.com> wrote:

[#136135] Re: Respect and Disappointment [OT] — Nikolai Weibull <mailing-lists.ruby-talk@...> 2005/03/31

* Austin Ziegler (Mar 31, 2005 19:30):

[#136159] Re: Respect and Disappointment [OT] — Austin Ziegler <halostatue@...> 2005/03/31

On Mar 31, 2005 1:01 PM, Nikolai Weibull

[#136147] Re: Respect and Disappointment — David Heinemeier Hansson <david@...> 2005/03/31

> I've finally started a blog. I really didn't want to go public with it

[#136171] Re: Respect and Disappointment — Stephen Kellett <snail@...> 2005/03/31

In message <6c87a002d5858216dd00a4abe83e032d@loudthinking.com>, David

[#136006] Complete beginner in programming — "Roger Grosswiler" <roger@...>

Hi,

11 messages 2005/03/31

[SUMMARY] Texas Hold'Em (#24)

From: Ruby Quiz <james@...>
Date: 2005-03-24 14:04:08 UTC
List: ruby-talk #135015
People wrote quite a bit of code to solve this quiz.  I don't think it's all
that tough, but there are quite a few combinations to check for, which seemed to
increase the line count of the solutions.

There was something interesting in all the solutions though, so I do recommend
browsing through them if you haven't already.  I know I'm always saying that.  I
guess it's always true.

I'm going to show Patrick Hurley's solution below.  Patrick resubmitted just to
defend against my rant about how programs should stay within an 80 character
line limit.  My argument wasn't meant as an attack on any submissions, but I
still appreciate Patrick's efforts.  Here's the start of the code:

	#!ruby -w

	class Card
	  SUITS = "cdhs"
	  FACES = "L23456789TJQKA"
	  SUIT_LOOKUP = {
	    'c' => 0,
	    'd' => 1,
	    'h' => 2,
	    's' => 3,
	    'C' => 0,
	    'D' => 1,
	    'H' => 2,
	    'S' => 3,
	  }
	  FACE_VALUES = {
	    'L' =>  1,   # this is a magic low ace
	    '2' =>  2,
	    '3' =>  3,
	    '4' =>  4,
	    '5' =>  5,
	    '6' =>  6,
	    '7' =>  7,
	    '8' =>  8,
	    '9' =>  9,
	    'T' => 10,
	    'J' => 11,
	    'Q' => 12,
	    'K' => 13,
	    'A' => 14,
	  }

	  def Card.face_value(face)
	    if (face)
	      FACE_VALUES[face] - 1
	    else
	      nil
	    end
	  end

	  def build_from_string(card)
	    build_from_face_suit(card[0,1], card[1,1])
	  end

	  def build_from_value(value)
	    @value = value
	    @suit  = value / FACES.size()
	    @face  = (value % FACES.size())
	  end

	  def build_from_face_suit(face, suit)
	    @face  = Card::face_value(face)
	    @suit  = SUIT_LOOKUP[suit]
	    @value = (@suit * FACES.size()) + (@face - 1)
	  end

	  def build_from_face_suit_values(face, suit)
	    build_from_value((face - 1) + (suit * FACES.size()))
	  end

	  # got a little carried away with this constructor ;-)
	  def initialize(*value)
	    if (value.size == 1)
	      if (value[0].respond_to?(:to_str))
	        build_from_string(value[0])
	      elsif (value[0].respond_to?(:to_int))
	        build_from_value(value[0])
	      end
	    elsif (value.size == 2)
	      if (value[0].respond_to?(:to_str) &&
	          value[1].respond_to?(:to_str))
	        build_from_face_suit(value[0], value[1])
	      elsif (value[0].respond_to?(:to_int) &&
	             value[1].respond_to?(:to_int))
	        build_from_face_suit_values(value[0], value[1])
	      end
	    end
	  end

	  attr_reader :suit, :face, :value

	  def to_s
	    FACES[@face].chr + SUITS[@suit].chr
	  end
	end
	
	# ...

That's the Card class Patrick uses for tracking individual cards.  It looks like
a lot of code, but it's mostly a single constructor that accepts many different
forms of initialization.  initialize() breaks down the parameters and hands them
off to the various build_from_... methods.  Those build methods should probably
be private, leaning on initialize() as their interface.  Once you get past
construction, you'll see that Card just contains a suit, face, and value. 
Glance at build_from_face_suit() to see how those break down.

You can see it above and a little more below, but this code has a little
creeping featurism.  Patrick was clearly building for the future with the card
handling classes.  That's probably a safe bet as card quizzes are fairly common.
Dave Burt reused code from his Blackjack solution this time around.  All I'm
saying is, don't be surprised if you see a handful of things in here that never
get used.  Agile purists bare with us...

Let's move on to Deck objects:

	# ...

	class Deck
	  def shuffle
	    deck_size = @cards.size
	    (deck_size * 2).times do
	      pos1, pos2 = rand(deck_size), rand(deck_size)
	      @cards[pos1], @cards[pos2] = @cards[pos2], @cards[pos1]
	    end
	  end

	  def initialize
	    @cards = []
	    Card::SUITS.each_byte do |suit|
	      # careful not to double include the aces...
	      Card::FACES[1..-1].each_byte do |face|
	        @cards.push(Card.new(face.chr, suit.chr))
	      end
	    end
	    shuffle()
	  end

	  def deal
	    @cards.pop
	  end

	  def empty?
	    @cards.empty?
	  end
	end

	# ...

initialize() just creates and shuffles a deck.  deal() pops a card and empty?()
tells you if there are any left.  If you read shuffle(), you'll see that it's
just a bunch of random swaps.  Not sure why Patrick went this way.  I believe
the standard Ruby shuffling idiom is:

	@cards.sort_by { rand }

On to the Hand class, but let's take this one in slices:

	# ...

	class Hand
	  def initialize(cards = [])
	    if (cards.respond_to?(:to_str))
	      @hand = cards.scan(/\S\S/).map { |str| Card.new(str) }
	    else
	      @hand = cards
	    end
	  end
	  attr_reader :hand

	  # ...

initialize() just builds new Hand objects from the lines of input in the quiz by
scan()ing for the two character format.  You can also build a Hand from an Array
of Card objects.  Then there's the accessor to get them back.

	  # ...
	
	  def face_values
	    @hand.map { |c| c.face }
	  end
      
	  def by_suit
	    Hand.new(@hand.sort_by { |c| [c.suit, c.face] }.reverse)
	  end
      
	  def by_face
	    Hand.new(@hand.sort_by { |c| [c.face, c.suit] }.reverse)
	  end

	  # ...

You can use the above methods to request hands by face_values(), by_suit(), or
by_face(). Note that both of the by_... sorts also sort by the other value, as a
secondary condition.

	  # ...
      
	  def =~ (re)
	    re.match(@hand.join(' '))
	  end
      
	  def arrange_hand(md)
	      hand = if (md.respond_to?(:to_str))
	        md
	      else
	        md[0] + ' ' + md.pre_match + md.post_match
	      end
	      hand.gsub!(/\s+/, ' ')
	      hand.gsub(/\s+$/,'')
	  end
      
	  # ...

The first method here is an operator overload to allow using regular expressions
on Hand objects.  The second method returns a hand string in an order specified
by a MatchData object (the else clause).  Whatever cards were matched are put
first, follow by cards preceding the match, and finally trailing cards.  This
floats a matched "hand" to the front of the string while keeping the ordering
for any non-matched cards.  arrange_hand() can also be called with a string
order (the if clause), but it doesn't do much in these cases except clean up
spacing issues.

From here, we start to get into hand matching code:

	  # .. 
	  
	  def royal_flush?
	    if (md = (by_suit =~ /A(.) K\1 Q\1 J\1 T\1/))
	      [[10], arrange_hand(md)]
	    else
	      false
	    end
	  end
	  
	  # ...

This method looks for the coveted royal flush.  First it calls by_suit() to
order the cards.  Remember that will order suits first, then faces.  That makes
it trivial to spot the pattern with a Regexp.  When found, royal_flush?()
returns a hand ranking number and the properly arranged hand in an Array, which
is of course a true value in Ruby.  false is used when no match is found.

The code then pauses to define a couple more helper methods for spotting the
other hands:

	  # ...
	  
	  def delta_transform(use_suit = false)
	    aces = @hand.select { |c| c.face == Card::face_value('A') }
	    aces.map! { |c| Card.new(1,c.suit) }
      
	    base = if (use_suit)
	      (@hand + aces).sort_by { |c| [c.suit, c.face] }.reverse
	    else
	      (@hand + aces).sort_by { |c| [c.face, c.suit] }.reverse
	    end
      
	    result = base.inject(['',nil]) do |(delta_hand, prev_card), card|
	      if (prev_card)
	        delta = prev_card - card.face
	      else
	        delta = 0
	      end
	      # does not really matter for my needs
	      delta = 'x' if (delta > 9 || delta < 0)
	      delta_hand += delta.to_s + card.to_s + ' '
	      [delta_hand, card.face]
	    end
      
	    # we just want the delta transform, not the last cards face too
	    result[0].chop
	  end
	  
	  # ...

Dave Burt asked on Ruby Talk what delta_transform() does.  Here's the author's
own response:

	The delta transform creates a version of the cards where the delta
	between card values is in the string, so a regexp can then match a
	straight and/or straight flush - I used regexp to match all my cases
	with appropriate sort and/or transforms.

Because that's probably easier to understand when you see it, here's a typical
return value from delta_tranform():

	"0Jh 38h xJd 38d 44d 13d x8c"

The extra character preceding each card shows the drop from the previous card
rank.  The jack is the first card, so it shows a 0 drop.  The eight is then down
3, as shown.  Tracking increases isn't needed in the solution, so the code just
punts with an x character, as seen with the next jack.  All this is just
building up a handy string for pattern matching.

Note that the first couple of lines of delta_transform() add a "low ace" to the
back of the hand for each ace found in the hand.  This is for spotting low
straights, but the magic must eventually be undone by:

	  # ...
	  
	  def fix_low_ace_display(arranged_hand)
	    # remove card deltas (this routine is only used for straights)
	    arranged_hand.gsub!(/\S(\S\S)\s*/, "\\1 ")
      
	    # Fix "low aces"
	    arranged_hand.gsub!(/L(\S)/, "A\\1")
      
	    # Remove duplicate aces (this will not work if you have
	    # multiple decks or wild cards)
	    arranged_hand.gsub!(/((A\S).*)\2/, "\\1")
      
	    # cleanup white space
	    arranged_hand.gsub!(/\s+/, ' ')
	    # careful to use gsub as gsub! can return nil here
	    arranged_hand.gsub(/\s+$/, '')
	  end
	  
	  # ...

This just restores the ace back to its usual display.

Now we can see both of those methods put to good use:

	  # ...
	  
	  def straight_flush?
	    if (md = (/.(.)(.)(?: 1.\2){4}/.match(delta_transform(true))))
	      high_card = Card::face_value(md[1])
	      arranged_hand = fix_low_ace_display(md[0] + ' ' +
	          md.pre_match + ' ' + md.post_match)
	      [[9, high_card], arranged_hand]
	    else
	      false
	    end
	  end
	  
	  # ...

This is similar in function to royal_flush?(), but you can see that it uses
delta_transform() to make it easy to match a straight.  fix_low_ace_display() is
called on the result, before the method returns.

The rest of the hand methods are very similar.  Sort the cards, match a pattern,
return rank and hand or false.  Here they are, without further explanation:

	  # ...
	  
	  def four_of_a_kind?
	    if (md = (by_face =~ /(.). \1. \1. \1./))
	      # get kicker
	      (md.pre_match + md.post_match).match(/(\S)/)
	      [
	        [8, Card::face_value(md[1]), Card::face_value($1)],
	        arrange_hand(md)
	      ]
	    else
	      false
	    end
	  end
      
	  def full_house?
	    if (md = (by_face =~ /(.). \1. \1. (.*)(.). \3./))
	      arranged_hand = arrange_hand(md[0] + ' ' +
	          md.pre_match + ' ' + md[2] + ' ' + md.post_match)
	      [
	        [7, Card::face_value(md[1]), Card::face_value(md[3])],
	        arranged_hand
	      ]
	    elsif (md = (by_face =~ /((.). \2.) (.*)((.). \5. \5.)/))
	      arranged_hand = arrange_hand(md[4] + ' '  + md[1] + ' ' +
	          md.pre_match + ' ' + md[3] + ' ' + md.post_match)
	      [
	        [7, Card::face_value(md[5]), Card::face_value(md[2])],
	        arranged_hand
	      ]
	    else
	      false
	    end
	  end
      
	  def flush?
	    if (md = (by_suit =~ /(.)(.) (.)\2 (.)\2 (.)\2 (.)\2/))
	      [
	        [
	          6,
	          Card::face_value(md[1]),
	          *(md[3..6].map { |f| Card::face_value(f) })
	        ],
	        arrange_hand(md)
	      ]
	    else
	      false
	    end
	  end
      
	  def straight?
	    result = false
	    if hand.size > 5
	      transform = delta_transform
	      # note we can have more than one delta 0 that we
	      # need to shuffle to the back of the hand
	      until transform.match(/^\S{3}( [1-9x]\S\S)+( 0\S\S)*$/) do
	        transform.gsub!(/(\s0\S\S)(.*)/, "\\2\\1")
	      end
	      if (md = (/.(.). 1.. 1.. 1.. 1../.match(transform)))
	        high_card = Card::face_value(md[1])
	        arranged_hand = fix_low_ace_display(md[0] + ' ' +
	            md.pre_match + ' ' + md.post_match)
	        result = [[5, high_card], arranged_hand]
	      end
	    end
	  end
      
	  def three_of_a_kind?
	    if (md = (by_face =~ /(.). \1. \1./))
	      # get kicker
	      arranged_hand = arrange_hand(md)
	      arranged_hand.match(/(?:\S\S ){3}(\S)\S (\S)/)
	      [
	        [
	          4,
	          Card::face_value(md[1]),
	          Card::face_value($1),
	          Card::face_value($2)
	        ],
	        arranged_hand
	      ]
	    else
	      false
	    end
	  end
      
	  def two_pair?
	    if (md = (by_face =~ /(.). \1.(.*) (.). \3./))
	      # get kicker
	      arranged_hand = arrange_hand(md[0] + ' ' +
	          md.pre_match + ' ' + md[2] + ' ' + md.post_match)
	      arranged_hand.match(/(?:\S\S ){4}(\S)/)
	      [
	        [
	          3,
	          Card::face_value(md[1]),
	          Card::face_value(md[3]),
	          Card::face_value($1)
	        ],
	        arranged_hand
	      ]
	    else
	      false
	    end
	  end
      
	  def pair?
	    if (md = (by_face =~ /(.). \1./))
	      # get kicker
	      arranged_hand = arrange_hand(md)
	      arranged_hand.match(/(?:\S\S ){2}(\S)\S\s+(\S)\S\s+(\S)/)
	      [
	        [
	          2,
	          Card::face_value(md[1]),
	          Card::face_value($1),
	          Card::face_value($2),
	          Card::face_value($3)
	        ],
	        arranged_hand
	      ]
	    else
	      false
	    end
	  end
      
	  def highest_card?
	    result = by_face
	    [[1, *result.face_values[0..4]], result.hand.join(' ')]
	  end
	  
	  # ...

Now what we really need to know is which one of those hands was found.  The code
for that isn't overly complex:

      # ...
      
      OPS = [
        ['Royal Flush',     :royal_flush? ],
        ['Straight Flush',  :straight_flush? ],
        ['Four of a kind',  :four_of_a_kind? ],
        ['Full house',      :full_house? ],
        ['Flush',           :flush? ],
        ['Straight',        :straight? ],
        ['Three of a kind', :three_of_a_kind?],
        ['Two pair',        :two_pair? ],
        ['Pair',            :pair? ],
        ['Highest Card',    :highest_card? ],
      ]
      
      def hand_rating
        OPS.map { |op|
          (method(op[1]).call()) ? op[0] : false
        }.find { |v| v }
      end
      
      def score
        OPS.map { |op|
          method(op[1]).call()
        }.find([0]) { |score| score }
      end
      
      # ...

The OPS Array maps hand names to the method that will spot them.  With that, you
call call either hand_rating() or score() which will walk the whole list of
tests, then return the first one that was true.  hand_rating() returns the name
while score() returns the rank and hand Array from the hand method call.

Finally, Hand has a few more very basic helper methods:

	  # ...
	
	  def take_card(card)
	    @hand.push(card)
	  end

	  def arranged_hand
	    score[1] + " (#{hand_rating})"
	  end

	  def just_cards
	    @hand.join(" ")
	  end

	  def to_s
	    just_cards + " (" + hand_rating + ")"
	  end
	end
	
	# ...

The only thing to notice there is the arranged_hand() is just a shell over
score() and hand_rating() and to_s() is a shell over just_cards() and
hand_rating().

The rest of Patrick's code goes on to build a complete game of Texas Hold'Em
that plays itself out round by round and displays results as it goes.  This is
very interesting stuff, but it doesn't solve the quiz, the way I read it. 
Luckily, a solution is easy to finish off from here.  Here's my solution to the
quiz, using Partick's classes:

	# ...
	
	### code by JEG2 ###
	if __FILE__ == $0
		best = nil
		results = []
		
		ARGF.each_line do |line|
			if line.length < 20                                # they folded
				results << line.chomp
			else
				hand            = Hand.new(line)               # rank hand
				name            = hand.hand_rating
				score, arranged = hand.score
				
				if best.nil? or (score[0] <=> best[0]) == 1    # track best
					best = [score[0], results.size]
				end

				results << "#{arranged} #{name}"
			end
		end
		
		# show results
		results.each_with_index do |e, index|
			puts(if index == best[1] then "#{e} (winner)" else e end)
		end
	end

That should be pretty straight forward by this point.  I setup variables to
track the best hand and the complete results, parse input, handle folds, score
each hand, remembering to track the best so far, and finally out the results. 
That funny compare, (score[0] <=> best[0]) == 1, is because the grade returned
by score is actually an Array of values and Array implements <=> but not >; go
figure.  That gets me the following output for the quiz example:

	Ks Kd Kc 9s 9d 6d 3c Full house (winner)
	Ks Kd 9d 9c Ah 6d 3c Two pair
	Ac Qc Ks Kd 9d 3c
	9h 5s
	Kd 9d 6d 4d 2d Ks 3c Flush
	7s Ts Ks Kd 9d

While I'm showing output, check out this neat variation by Derek Wyatt:

	9d 9s Kd Ks Kc 3c 6d  Full House (Kings over Nines) (winner)
	9d 9c Kd Ks Ah 3c 6d  Two Pair (Kings and Nines)
	Ac Qc Ks Kd 9d 3c     
	9h 5s                 
	Ks Kd 2d 4d 3c 6d 9d  Pair (Kings)
	7s Ts Ks Kd 9d        

I love the way it gives you extra details about the hand, but as you can see we
don't agree on hand number four.  Don't sweat that though, seems everyone had a
good round of bug hunting for this one.

My thanks to all the card sharks out there.  I also want to thank Patrick for
writing code I could figure out how to hijack.  This summary was definitely a
team effort.

Tomorrow, Tymothy Byrd will hit you with a brain bender you and Ruby can work
together to solve...

In This Thread

Prev Next