[#237140] Counting Toothpicks (#111) — Ruby Quiz <james@...>

I think this was a pretty challenging quiz. I've played around with many of the

14 messages 2007/02/01

[#237235] halving a string — "Chris Shea" <cmshea@...>

I have a vacuum fluorescent display in my office, and I've been

22 messages 2007/02/02

[#237266] String Equations (#112) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

20 messages 2007/02/02

[#237290] Beginner questions: sorting csv files — Michael Sc <michael.schatzow@...>

Hello,

16 messages 2007/02/02

[#237377] Using fork to conserve memory — Daniel DeLorme <dan-ml@...42.com>

Lately I've been bothered by the large start-up time and memory consumption of

21 messages 2007/02/03

[#237380] Inheriting from Fixnum — "gga" <GGarramuno@...>

Now... this should be simple, but, alas, it is not.

16 messages 2007/02/03
[#237389] Re: Inheriting from Fixnum — Robert Klemme <shortcutter@...> 2007/02/03

On 03.02.2007 09:07, gga wrote:

[#237430] Hash#rekey — "Trans" <transfire@...>

There are a few facets (ie. extensions) I find myself using often. One

19 messages 2007/02/03
[#237451] Re: Hash#rekey — gwtmp01@... 2007/02/03

[#237456] Re: Hash#rekey — "Trans" <transfire@...> 2007/02/03

[#237500] Proc vs lambda vs proc — "Minkoo Seo" <minkoo.seo@...>

Hi group(and probably ruby-talk list - is it running btw?).

20 messages 2007/02/04

[#237543] call to arms: list readers — "Alex Combas" <alex.combas@...>

Custom Search Engine for Ruby http://rubykitchensink.ca

15 messages 2007/02/04

[#237644] Ajax woes — Patrick Spence <patrick@...>

The C# web app we are automating for QA testing has been recently

21 messages 2007/02/05
[#237645] Re: Ajax woes — "Jason Roelofs" <jameskilton@...> 2007/02/05

There is a method on @@ie (i'm assuming Watir usage here) called something

[#237699] - PathEditor 1.0.0 - A command line utility for managing your Window's Path — "Justin Bailey" <jgbailey@...>

What it is

10 messages 2007/02/05
[#237738] Re: - PathEditor 1.0.0 - A command line utility for managing your Window's Path — "bbiker" <renard@...> 2007/02/06

On Feb 5, 5:17 pm, "Justin Bailey" <jgbai...@gmail.com> wrote:

[#237726] Ruby Newbie Advice. — "Samantha" <rubygeekgirl@...>

Hello all.

40 messages 2007/02/06
[#237740] Re: Ruby Newbie Advice. — "Jeff Barczewski" <jeff.barczewski@...> 2007/02/06

On 2/5/07, Samantha <rubygeekgirl@gmail.com> wrote:

[#237741] Re: Ruby Newbie Advice. — Samantha <rubygeekgirl@...> 2007/02/06

On 2/5/07, Jeff Barczewski <jeff.barczewski@gmail.com> wrote:

[#237752] How do you get the rows out of FasterCSV? — Gary <gb3xct@...>

Hi. I want to add a normalized column to a csv file. That is, I want to

12 messages 2007/02/06

[#237799] Parse csv similar file — "Rebhan, Gilbert" <Gilbert.Rebhan@...>

17 messages 2007/02/06

[#237827] Linux OS — "Luke Ivers" <technodolt@...>

I'm building a Linux VM inside of my Windows box so I can experiment with

24 messages 2007/02/06

[#237877] Best way to do dynamic mixin or dynamic include? (Mixin module name is defined and included at runtime) — "Jeff Barczewski" <jeff.barczewski@...>

I am searching for the best way to do a dynamic mixin with Ruby.

10 messages 2007/02/06

[#237920] Comment for partial line — Xia __ <rebeccacannon@...>

Hi

13 messages 2007/02/07

[#237942] RubyScript2EXE Not Functioning — Richard Manning <mithrandirmage@...>

I've just downloaded Erik Veenstra's RubyScript2EXE, but it does not

14 messages 2007/02/07
[#238023] Re: RubyScript2EXE Not Functioning — "Erik Veenstra" <erikveen@...> 2007/02/07

Please cat your hello-world.rb.

[#238038] TupleSpace performance (TupleBag really) — "Mark Alexander Friedgan" <hubrix@...>

We've been struggling with this problem for months. We use TupleSpace to

14 messages 2007/02/07

[#238061] Adding Math.log2 and Math.logn to the core library. — "Phrogz" <gavin@...>

In a world of humans and finance, it's quite common to need base-10

10 messages 2007/02/07

[#238188] SimpleHTTP initial release — "Tim Becker" <a2800276@...>

I just got through putting together a little wrapper around Net:Http

16 messages 2007/02/08

[#238225] Help optimizing — Luke Ivers <lukeivers@...>

I'm going to cross-post this from the Rails group, because some of the

13 messages 2007/02/08

[#238242] Your favorite bit of ruby code? — "Carl Lerche" <carl.lerche@...>

Hello,

36 messages 2007/02/08

[#238271] Iterators and blocks question — Bharat Ruparel <bruparel@...>

I am new to ruby and am trying to learn my way around it. I saw the

14 messages 2007/02/08

[#238273] How to "pass" the current binding's block to some other method? — "Lyle Johnson" <lyle.johnson@...>

Suppose I have a method that will yield to a block if one is given:

12 messages 2007/02/08
[#238275] Re: How to "pass" the current binding's block to some other method? — "Phrogz" <gavin@...> 2007/02/08

On Feb 8, 3:52 pm, "Lyle Johnson" <lyle.john...@gmail.com> wrote:

[#238413] One-Liners (#113) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

46 messages 2007/02/09
[#238692] Re: [QUIZ] One-Liners (#113) — Alex Young <alex@...> 2007/02/11

My solutions. Be gentle, this is my first quiz :-) I haven't checked

[#238726] Re: One-Liners (#113) — "Phrogz" <gavin@...> 2007/02/12

On Feb 11, 4:40 pm, Alex Young <a...@blackkettle.org> wrote:

[#238459] Jumping to "the next one" in something#each — "Garance A Drosehn" <drosihn@...>

I'm sorry that this message will be long and somewhat rambling,

14 messages 2007/02/09

[#238500] the funniest thing ever — ara.t.howard@...

24 messages 2007/02/10
[#238502] Re: [OT] the funniest thing ever — Morton Goldberg <m_goldberg@...> 2007/02/10

On Feb 10, 2007, at 1:13 AM, ara.t.howard@noaa.gov wrote:

[#238802] Re: [OT] the funniest thing ever — David Morton <mortonda@...> 2007/02/12

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

[#238821] Re: [OT] the funniest thing ever — "Richard Conroy" <richard.conroy@...> 2007/02/12

On 2/12/07, David Morton <mortonda@dgrmm.net> wrote:

[#238919] Re: [OT] the funniest thing ever — Clifford Heath <no@...> 2007/02/13

Richard Conroy wrote:

[#238539] tr does not work with non-english chars — "J. mp" <joaomiguel.pereira@...>

Hi,

10 messages 2007/02/10
[#238548] Re: tr does not work with non-english chars — "Robert Dober" <robert.dober@...> 2007/02/10

On 2/10/07, J. mp <joaomiguel.pereira@gmail.com> wrote:

[#238551] Re: tr does not work with non-english chars — "J. mp" <joaomiguel.pereira@...> 2007/02/10

Robert Dober wrote:

[#238584] Windows and Ruby - Not very good friends? — Bharat Ruparel <bruparel@...>

I am new to Ruby and RoR, so pardon me if I ask naive questions.

14 messages 2007/02/11

[#238613] Getting my sister to learn programming — SonOfLilit <sonoflilit@...>

Hello fellow Rubyists,

39 messages 2007/02/11
[#238619] Re: Getting my sister to learn programming — "Mushfeq Khan" <mushfeq.khan@...> 2007/02/11

>

[#238620] Re: Getting my sister to learn programming — SonOfLilit <sonoflilit@...> 2007/02/11

Yes, but I want to teach her an environment where if she comes to me and

[#238616] One-Liners (#113) — "Phrogz" <gavin@...>

Here are my solutions to Quiz #113. For some of them I just couldn't

18 messages 2007/02/11

[#238655] What's the correct and fast way to determine if a (gig) number is a perfect square? — "Sam Kong" <sam.s.kong@...>

Hello,

11 messages 2007/02/11

[#238681] Regular expressions — "J. mp" <joaomiguel.pereira@...>

Hi folks,

19 messages 2007/02/11
[#238683] Re: Regular expressions — Vincent Fourmond <vincent.fourmond@9online.fr> 2007/02/11

J. mp wrote:

[#238685] Re: Regular expressions — "J. mp" <joaomiguel.pereira@...> 2007/02/11

Vincent Fourmond wrote:

[#238706] using YAML as config — Larry Edelstein <ribs@...>

Hi all -

14 messages 2007/02/12
[#238715] Re: using YAML as config — Joel VanderWerf <vjoel@...> 2007/02/12

Larry Edelstein wrote:

[#239007] Puzzling regex behaviour — Ian Macdonald <ian@...>

Hello,

24 messages 2007/02/13
[#239030] Re: Puzzling regex behaviour — Robert Klemme <shortcutter@...> 2007/02/13

On 13.02.2007 21:19, Ian Macdonald wrote:

[#239035] Re: Puzzling regex behaviour — Ian Macdonald <ian@...> 2007/02/13

On Wed 14 Feb 2007 at 06:45:08 +0900, Robert Klemme wrote:

[#239048] Re: Puzzling regex behaviour — "David Balmain" <dbalmain.ml@...> 2007/02/13

On 2/14/07, Ian Macdonald <ian@caliban.org> wrote:

[#239052] Re: Puzzling regex behaviour — "David Balmain" <dbalmain.ml@...> 2007/02/13

On 2/14/07, David Balmain <dbalmain.ml@gmail.com> wrote:

[#239056] Re: Puzzling regex behaviour — Ian Macdonald <ian@...> 2007/02/13

On Wed 14 Feb 2007 at 08:01:15 +0900, David Balmain wrote:

[#239057] Re: Puzzling regex behaviour — Ian Macdonald <ian@...> 2007/02/13

On Wed 14 Feb 2007 at 08:43:06 +0900, Ian Macdonald wrote:

[#239058] Re: Puzzling regex behaviour — "David Balmain" <dbalmain.ml@...> 2007/02/14

On 2/14/07, Ian Macdonald <ian@caliban.org> wrote:

[#239059] Re: Puzzling regex behaviour — Ian Macdonald <ian@...> 2007/02/14

On Wed 14 Feb 2007 at 09:08:17 +0900, David Balmain wrote:

[#239040] Converting class_for to a C extension — "Daniel Berger" <djberg96@...>

Hi all,

12 messages 2007/02/13

[#239079] Where do you use Ruby? — "Pål Bergström" <pal@...>

As I get myself more and more into Rails, and Ruby, I wonder in what

20 messages 2007/02/14
[#239084] Re: Where do you use Ruby? — Suraj Kurapati <snk@...> 2007/02/14

P奪l Bergstr旦m wrote:

[#239173] Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...>

Hello all,

90 messages 2007/02/14
[#239181] Re: Adopt-a-newbie? Based on actual experience. — Logan Capaldo <logancapaldo@...> 2007/02/14

On Thu, Feb 15, 2007 at 05:03:16AM +0900, SonOfLilit wrote:

[#239183] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/14

Well, to potential adoptees we can only offer the service...

[#239199] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/14

Well, until further notice (and please read this thread to the end to check

[#239227] Re: Adopt-a-newbie? Based on actual experience. — Jim Clark <diegoslice@...> 2007/02/14

[#239531] Re: Adopt-a-newbie? Based on actual experience. — "Eivind Eklund" <eeklund@...> 2007/02/16

On 2/14/07, SonOfLilit <sonoflilit@gmail.com> wrote:

[#239897] Re: Adopt-a-newbie? Based on actual experience. — Mark Woodward <markonlinux@...> 2007/02/19

On Thu, 15 Feb 2007 05:20:07 +0900, Logan Capaldo wrote:

[#239906] Re: Adopt-a-newbie? Based on actual experience. — Chad Perrin <perrin@...> 2007/02/19

On Mon, Feb 19, 2007 at 08:25:11PM +0900, Mark Woodward wrote:

[#239909] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/19

On 2/19/07, Chad Perrin <perrin@apotheon.com> wrote:

[#239913] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/19

http://rubymentor.rubyforge.org/wiki/wiki.pl?AurSarafAndSamantha

[#239927] Re: Adopt-a-newbie? Based on actual experience. — Derek Teixeira <derek.teixeira@...> 2007/02/19

So in order to get set up with someone to help you ... message

[#239935] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/19

No. To set up with someone, go to the wiki, find someone that seems

[#239957] Re: Adopt-a-newbie? Based on actual experience. — nodenator@... 2007/02/19

I happen to be fairly new to ruby, and I think the idea of having a

[#239961] Re: Adopt-a-newbie? Based on actual experience. — SonOfLilit <sonoflilit@...> 2007/02/19

Like to see it done? Do it!

[#239339] is it behaving strange ? — "sur max" <sur.max@...>

*a = 9 # => [9]

28 messages 2007/02/15
[#239341] Re: is it behaving strange ? — hemant <gethemant@...> 2007/02/15

On 2/15/07, sur max <sur.max@gmail.com> wrote:

[#239345] Re: is it behaving strange ? — dblack@... 2007/02/15

Hi --

[#239369] Re: is it behaving strange ? — "Robert Dober" <robert.dober@...> 2007/02/15

On 2/15/07, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#239373] Re: is it behaving strange ? — "sur max" <sur.max@...> 2007/02/15

def a *args

[#239377] Re: is it behaving strange ? — "Jacob Fugal" <lukfugl@...> 2007/02/15

On 2/15/07, sur max <sur.max@gmail.com> wrote:

[#239382] Best way to skip tests — "Daniel Berger" <djberg96@...>

Hi all,

18 messages 2007/02/15

[#239426] Oppinions on RCR for dup on immutable classes — Stefan Rusterholz <apeiros@...>

I'm about to make this RCR and would like to get some oppinions on it in

75 messages 2007/02/15
[#239427] Re: Oppinions on RCR for dup on immutable classes — "Phrogz" <gavin@...> 2007/02/15

On Feb 15, 4:46 pm, Stefan Rusterholz <apei...@gmx.net> wrote:

[#239463] Re: Oppinions on RCR for dup on immutable classes — Yukihiro Matsumoto <matz@...> 2007/02/16

Hi,

[#239541] Re: Oppinions on RCR for dup on immutable classes — Stefan Rusterholz <apeiros@...> 2007/02/16

Yukihiro Matsumoto wrote:

[#239558] Re: Oppinions on RCR for dup on immutable classes — "Gregory Brown" <gregory.t.brown@...> 2007/02/16

On 2/16/07, Stefan Rusterholz <apeiros@gmx.net> wrote:

[#239662] Re: Oppinions on RCR for dup on immutable classes — Yukihiro Matsumoto <matz@...> 2007/02/17

Hi,

[#239663] Re: Oppinions on RCR for dup on immutable classes — Stefan Rusterholz <apeiros@...> 2007/02/17

Yukihiro Matsumoto wrote:

[#239665] Re: Oppinions on RCR for dup on immutable classes — Yukihiro Matsumoto <matz@...> 2007/02/17

Hi,

[#239674] Re: Oppinions on RCR for dup on immutable classes — "Dean Wampler" <deanwampler@...> 2007/02/17

On 2/17/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#239690] Re: Oppinions on RCR for dup on immutable classes — "Robert Dober" <robert.dober@...> 2007/02/17

On 2/17/07, Dean Wampler <deanwampler@gmail.com> wrote:

[#239716] Re: Oppinions on RCR for dup on immutable classes — "Dean Wampler" <deanwampler@...> 2007/02/17

> ...

[#239487] class design issues — Spitfire <timid.gentoo@...>

I have a class which takes an input and produces an object. Let's

15 messages 2007/02/16

[#239542] Housie (#114) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

25 messages 2007/02/16

[#239631] Passing a block into a class_eval — Clifford Heath <no@...>

Here's a function similar to attr_accessor, except it takes a block,

15 messages 2007/02/17
[#239632] Re: Passing a block into a class_eval — "Austin Ziegler" <halostatue@...> 2007/02/17

On 2/16/07, Clifford Heath <no@spam.please.net> wrote:

[#239738] More flexible inheritance — "Trans" <transfire@...>

A notion came to me yesterday with regards to how we extend classes.

18 messages 2007/02/18

[#239764] Re : [ANN] One-Click Ruby Installer 1.8.5-23 released — Ruby Admirer <ruby_admirer@...>

Curt,

11 messages 2007/02/18

[#239807] Doc to PDF/HTML converter plugins available in Ruby? — "Invincible Code" <invincible.coder@...>

Hi,

15 messages 2007/02/18
[#239810] Re: Doc to PDF/HTML converter plugins available in Ruby? — "Jason Mayer" <slamboy@...> 2007/02/18

On 2/18/07, Invincible Code <invincible.coder@gmail.com> wrote:

[#239811] Re: Doc to PDF/HTML converter plugins available in Ruby? — "Invincible Code" <invincible.coder@...> 2007/02/18

Hi Jason,

[#239812] Re: Doc to PDF/HTML converter plugins available in Ruby? — "Jason Mayer" <slamboy@...> 2007/02/18

On 2/18/07, Invincible Code <invincible.coder@gmail.com> wrote:

[#239814] Re: Doc to PDF/HTML converter plugins available in Ruby? — "Jason Mayer" <slamboy@...> 2007/02/18

On 2/18/07, Jason Mayer <slamboy@gmail.com> wrote:

[#239816] Re: Doc to PDF/HTML converter plugins available in Ruby? — "Jason Mayer" <slamboy@...> 2007/02/18

On 2/18/07, Jason Mayer <slamboy@gmail.com> wrote:

[#239876] For loops don't count down — Michael Brooks <michael.brooks@...>

Hello:

25 messages 2007/02/19
[#239879] Re: For loops don't count down — "Michael Fellinger" <m.fellinger@...> 2007/02/19

On 2/19/07, Michael Brooks <michael.brooks@shaw.ca> wrote:

[#239901] Re: For loops don't count down — "David Vallner" <david@...> 2007/02/19

On Mon, 19 Feb 2007 07:28:36 +0100, Michael Fellinger

[#239902] Re: For loops don't count down — "Robert Dober" <robert.dober@...> 2007/02/19

On 2/19/07, David Vallner <david@vallner.net> wrote:

[#239917] Re: For loops don't count down — SonOfLilit <sonoflilit@...> 2007/02/19

Numeric#step counts down:

[#239919] Re: For loops don't count down — Yukihiro Matsumoto <matz@...> 2007/02/19

Hi,

[#239962] Re: For loops don't count down — Daniel Schierbeck <daniel.schierbeck@...> 2007/02/19

On Mon, 2007-02-19 at 22:38 +0900, Yukihiro Matsumoto wrote:

[#239887] The peak of the iceberg, was Range cannot loop down and RCR Integer#pred — "Robert Dober" <robert.dober@...>

Hi all

10 messages 2007/02/19
[#239964] Re: The peak of the iceberg, was Range cannot loop down and RCR Integer#pred — Daniel Schierbeck <daniel.schierbeck@...> 2007/02/19

On Mon, 2007-02-19 at 18:14 +0900, Robert Dober wrote:

[#239908] return statement — Derek Teixeira <derek.teixeira@...>

i've been getting confused about what exactly the return statement

16 messages 2007/02/19

[#239963] Assertions Testing in irb — Bharat Ruparel <bruparel@...>

I am working through the Everyday Scripting With Ruby book and am trying

19 messages 2007/02/19
[#239965] Re: Assertions Testing in irb — "Austin Ziegler" <halostatue@...> 2007/02/19

On 2/19/07, Bharat Ruparel <bruparel@mercury.com> wrote:

[#239971] Re: Assertions Testing in irb — Bharat Ruparel <bruparel@...> 2007/02/19

Hello Austin,

[#240035] Deconstructor to close file — "Raymond O'connor" <nappin713@...>

I'm trying to write a logger class. I open the file in the initialize

12 messages 2007/02/19

[#240041] Range#overlap? — Daniel Schierbeck <daniel.schierbeck@...>

(I'm sending this to the list because I think it has general interest.

22 messages 2007/02/20
[#240060] Re: [Facets] Range#overlap? — danfinnie@... 2007/02/20

I think that overlap? and within? are two different things, which I'm not sure you think from your email. Overlap? suggests, to me, that a subset of the things one range includes is the same as a subset of things that the other range includes. Within? suggests that all of one range is contained in a subset of the other range.

[#240115] Re: [Facets] Range#overlap? — Daniel Schierbeck <daniel.schierbeck@...> 2007/02/20

On Tue, 2007-02-20 at 10:56 +0900, danfinnie@optonline.net wrote:

[#240125] Re: [Facets] Range#overlap? — Daniel Finnie <danfinnie@...> 2007/02/20

That seems to be what facet/range/within does now.

[#240092] Help with Class design — Chris Lowis <chris.lowis@...>

I'm quite new to object-orientated programming and have a problem with a

15 messages 2007/02/20

[#240294] Komodo is the IDE for Ruby and Ruby on Rails! — "zoat" <enogrob@...>

The new Komodo IDE 4.0 is the first unified workspace for end-to-end

22 messages 2007/02/21
[#240388] Re: Komodo is the IDE for Ruby and Ruby on Rails! — "Griff" <grettke@...> 2007/02/22

I bought it, too. It is pretty nice.

[#240539] Rant abouts IDE's — Servando Garcia <garcia.servando@...> 2007/02/23

[#240459] Ruby's "case" doesn't behave like a normal switch — Guillaume Nargeot <guillaume.nargeotDONOTFUCKINGSPAM@...>

The problem with ruby is that you can't use a switch as it behaves with many

17 messages 2007/02/23

[#240474] Textmate on Windoze! — "William Smith" <wbsmith83@...>

http://www.e-texteditor.com/index.html

44 messages 2007/02/23
[#240496] Re: Textmate on Windoze! — Chad Perrin <perrin@...> 2007/02/23

On Fri, Feb 23, 2007 at 01:36:09PM +0900, William Smith wrote:

[#240578] Re: Textmate on Windoze! — Jonas Hartmann <Mail@...> 2007/02/23

Chad Perrin wrote:

[#240601] Re: Textmate on Windoze! — Chad Perrin <perrin@...> 2007/02/23

On Sat, Feb 24, 2007 at 01:30:06AM +0900, Jonas Hartmann wrote:

[#240613] Re: Textmate on Windoze! — David Vallner <david@...> 2007/02/23

Chad Perrin wrote:

[#240618] Re: Textmate on Windoze! — Chad Perrin <perrin@...> 2007/02/23

On Sat, Feb 24, 2007 at 05:09:04AM +0900, David Vallner wrote:

[#240779] extract a random number of items from an array — Josselin <josselin@...>

given an array of values, how should I extract an random number of these values

13 messages 2007/02/25

[#240888] Subclassing Array — El Gato <wmwilson01@...>

I'm sure I'm just being an idiot here... my mind is a little foggy this

15 messages 2007/02/26

[#240902] Installing Ruby, Sqlite3, Sqlite3-Ruby on Cygwin — Ruby Admirer <ruby_admirer@...>

Hi,

16 messages 2007/02/26

[#241007] PlanMachine9 - any interest? — "Phrogz" <gavin@...>

In my spare time I created a library in Ruby that mimics something I

25 messages 2007/02/27
[#241011] Re: PlanMachine9 - any interest? — Logan Capaldo <logancapaldo@...> 2007/02/27

On Wed, Feb 28, 2007 at 07:30:05AM +0900, Phrogz wrote:

[#241015] Re: PlanMachine9 - any interest? — Chad Perrin <perrin@...> 2007/02/27

On Wed, Feb 28, 2007 at 07:47:46AM +0900, Logan Capaldo wrote:

[#241017] Re: PlanMachine9 - any interest? — "Phrogz" <gavin@...> 2007/02/27

On Feb 27, 4:04 pm, Chad Perrin <per...@apotheon.com> wrote:

[#241020] Re: PlanMachine9 - any interest? — Chad Perrin <perrin@...> 2007/02/27

On Wed, Feb 28, 2007 at 08:10:12AM +0900, Phrogz wrote:

[#241027] Re: PlanMachine9 - any interest? — "Glen Holcomb" <damnbigman@...> 2007/02/27

Or Plan10 depending on how you want to pun it.

[#241028] Re: PlanMachine9 - any interest? — Chad Perrin <perrin@...> 2007/02/27

On Wed, Feb 28, 2007 at 08:34:39AM +0900, Glen Holcomb wrote:

[#241062] Re: PlanMachine9 - any interest? — Robert Klemme <shortcutter@...> 2007/02/28

On 28.02.2007 00:38, Chad Perrin wrote:

[#241112] Stepping out on a Limb - some very ugly code — Samantha <rubygeekgirl@...>

Hi all,

23 messages 2007/02/28
[#241125] Re: Stepping out on a Limb - some very ugly code — Sebastian Hungerecker <sepp2k@...> 2007/02/28

Am Mittwoch, 28. Februar 2007 18:56:25 schrieb Samantha:

[#241128] Re: Stepping out on a Limb - some very ugly code — Samantha <rubygeekgirl@...> 2007/02/28

On 2/28/07, Sebastian Hungerecker <sepp2k@googlemail.com> wrote:

[#241134] Re: Stepping out on a Limb - some very ugly code — Samantha <rubygeekgirl@...> 2007/02/28

On 2/28/07, Samantha <rubygeekgirl@gmail.com> wrote:

[#241138] Re: Stepping out on a Limb - some very ugly code — Sebastian Hungerecker <sepp2k@...> 2007/02/28

Am Mittwoch, 28. Februar 2007 20:52:44 schrieb Samantha:

[#241141] Re: Stepping out on a Limb - some very ugly code — Samantha <rubygeekgirl@...> 2007/02/28

On 2/28/07, Sebastian Hungerecker <sepp2k@googlemail.com> wrote:

[#241155] nmap-0.1.0 (narray + mmap = persistant grids) — "Ara.T.Howard" <ara.t.howard@...>

20 messages 2007/02/28
[#241160] Re: [ANN] nmap-0.1.0 (narray + mmap = persistant grids) — Joel VanderWerf <vjoel@...> 2007/02/28

Ara.T.Howard wrote:

[#241173] Re: [ANN] nmap-0.1.0 (narray + mmap = persistant grids) — ara.t.howard@... 2007/02/28

On Thu, 1 Mar 2007, Joel VanderWerf wrote:

[#241176] Re: [ANN] nmap-0.1.0 (narray + mmap = persistant grids) — "William Smith" <wbsmith83@...> 2007/02/28

memray?

[#241216] Re: [ANN] nmap-0.1.0 (narray + mmap = persistant grids) — ara.t.howard@... 2007/03/01

On Thu, 1 Mar 2007, William Smith wrote:

[#241159] Can't login to Rubyforge, just says "cookies must be enabled" — "Farrel Lifson" <farrel.lifson@...>

I registered a new account on Rubyforge but can't seem to login. After

27 messages 2007/02/28
[#241260] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Tom Copeland <tom@...> 2007/03/01

On Thu, 2007-03-01 at 07:15 +0900, Farrel Lifson wrote:

[#241305] Re: Can't login to Rubyforge, just says "cookies must be enabled" — "Farrel Lifson" <farrel.lifson@...> 2007/03/01

> Hi Farrel -

[#241317] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Samantha <rubygeekgirl@...> 2007/03/01

On 3/1/07, Farrel Lifson <farrel.lifson@gmail.com> wrote:

[#241320] Re: Can't login to Rubyforge, just says "cookies must be enabled" — "Farrel Lifson" <farrel.lifson@...> 2007/03/01

On 01/03/07, Samantha <rubygeekgirl@gmail.com> wrote:

[#241323] Re: Can't login to Rubyforge, just says "cookies must be enabled" — "Farrel Lifson" <farrel.lifson@...> 2007/03/01

On 01/03/07, Farrel Lifson <farrel.lifson@gmail.com> wrote:

[#241345] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Chad Perrin <perrin@...> 2007/03/01

On Fri, Mar 02, 2007 at 04:36:40AM +0900, Farrel Lifson wrote:

[#241352] Re: Can't login to Rubyforge, just says "cookies must be enabled" — "Tom Copeland" <tom@...> 2007/03/01

> > >I've only got Gecko based browsers on my machine (Firefox, Mozilla

[#241378] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Chad Perrin <perrin@...> 2007/03/01

On Fri, Mar 02, 2007 at 06:59:47AM +0900, Tom Copeland wrote:

[#241382] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Samantha <rubygeekgirl@...> 2007/03/01

I emailed with him a few times offlist... He's in Gentoo in the GNOME

[#241385] Re: Can't login to Rubyforge, just says "cookies must be enabled" — Chad Perrin <perrin@...> 2007/03/02

On Fri, Mar 02, 2007 at 08:58:24AM +0900, Samantha wrote:

[SUMMARY] Housie (#114)

From: Ruby Quiz <james@...>
Date: 2007-02-22 17:03:15 UTC
List: ruby-talk #240419
Eric I. said it best in a note attached to his solution:

	I really enjoyed this quiz.  On the surface it seems relatively simple.
	But there are some important subtleties.

This is the realization I came to as well.  When Brian first suggested the quiz,
we discussed the possible solutions.  When I say discussed, I mean that Brian
generated a nearly endless stream of excellent ideas while I watched it all
happen.  The more he generated, the more I realized how much I liked the
problem.  It's quite rich.

There are many ways to approach this quiz.  Brian's own solution generates bit
map patterns representing blanks and non-blanks in a ticket, then uses those
patterns to construct books filling in numbers as it works.  Eric I. used a
backtracking search, verifying that a solution is still possible as each ticket
is added.  Below I will examine a slightly simpler solution, that still produces
pretty good results.

Andy Restrepo's code is a random generation scheme.  It builds random books from
random tickets made out of random rows.  If the book doesn't end up being valid,
it just tries again.  However, it arranges the random generation such that rows
are correct more often than you might expect.

Let's jump into the code to see how it does that.  The process begins with this
trivial call:

	TicketGenerator.new.print_book

That's Ruby's default new() and TicketGenerator doesn't define an initialize()
method, so let's skip to print_book():

	class TicketGenerator
	 def print_book
	   # Keep generating ticket books until a valid
	   # one is returned.  Then, print out the tickets.
	   book = build_book until book
	   book.each { |t| t.print_ticket; puts "\n"}
	 end
	end

This is the process I explained earlier.  An attempt is made to build a book. 
If we get one, we're done.  Otherwise we try again.  When we have them all, the
tickets in the book are printed.

Let's dig deeper into book creation:

	class TicketGenerator
	 def build_book
	   # Generate 18 rows and divide them between six tickets
	   init_bins
	   all_rows = Array.new(18){ retrieve_row }
	   tickets = Array.new
	   0.step(15, 3) do |x|
	     ticket = Ticket.new(all_rows[x...x+3].sort_by { rand })
	     tickets.push(ticket)
	     # If an invalid ticket is found, indicate failure
	     # by setting the return value to false.
	     if not ticket.is_valid?
	       tickets = false; break
	     end
	   end
	   tickets
	 end
	end

The first two lines here make use of other methods in the class to create a set
of 18 rows.  We will get to those methods in a moment, but take it on faith for
now.

The rest of the method walks those rows in threes, making Ticket objects out of
them.  Each time a Ticket is made, the code ensures it is valid or bails out. We
haven't seen this class yet either, but it shouldn't too hard to guess what the
is_valid?() method does.

Here are the row making methods (with one minor edit by me):

	class TicketGenerator
	 def init_bins
	   # Create and fill the 9 bins of numbers, corresponding to
	   # the allowed numbers for each column.
	   @bins = Array.new
	   # 1 through 9
	   @bins << (1..9).sort_by{ rand }
	   # 10 through 19, 20 through 29, etc.
	   10.step(70, 10) do |x|
	     @bins << (x..x+9).sort_by{ rand }
	   end
	   # 80 through 90
	   @bins << (80..90).sort_by{ rand }
	 end
	 def retrieve_row
	   # Create a row by pulling one number from each of five non-empty bins.
	   row = Array.new(9, nil)
	   # Randomize which bins to choose from, but favor the most filled
	   # bins -- so we don't end up with less than 5 non-empty bins with
	   # still more rows to create.
	   bin_index_array = (0...@bins.length).sort_by{ |b|
	     [@bins[b].length, rand]
	   }
	   5.times do
	     bin_index = bin_index_array.pop
	     row[bin_index] = @bins[bin_index].pop
	   end
	   row
	 end
	end

First, init_bins() fills an Array with Arrays of randomized numbers for each
column.  These columns span six tickets and are used to build the entire book.

Now, retrieve_row() is used to create the 18 rows the code eventually builds
books out of.  It works by creating an empty row, choosing five of the column
bins, and adding a random number to the row from each bin.  The selection of
bins is not-quite-random and that turns out to be the best and worst feature of
this solution.

Bins are sorted first by length and then in random order before a pick is made
from the end.  This means that a selection will always be made from a bin with
the most members remaining.  That bin is selected randomly from those with the
same number of members remaining, but that doesn't mean the choice is random.

Think of it this way, the bins don't even start with the same number of members.
The eighth bin has eleven and will always sort to be chosen first.  Likewise,
the zeroth bin always sorts first and thus cannot be selected by this algorithm
during the creation of the first row.  Even after the first row is created the
eighth bin will still be tied for most entries and thus it will always come up
again in the second row.  That means the first ticket produced by this solution
will always have two or three numbers in the final column.  Never just one.

The downside of all of this is that the tickets aren't completely random. 
There's a pattern to them and you can find it if you look for it.  Given that,
these books would be fine for casual play, but probably not for games where
money is on the line.

The upside is speed.  Even though tickets are randomly generated, the sorting
keeps valid combination extremely likely.  In a set of ten sample runs I
conducted the code only called build_book() a maximum of two times per run and
it only needed one call eight out of ten times.  A truly random pattern would
need a lot more attempts to find a workable solution.  You can simulate this
scenario by removing the bin length sort condition from Andy's code.  It still
finds answers, but it can take some time.

The last bit of TicketGenerator code sets method visibility:

	class TicketGenerator
	 private :init_bins, :retrieve_row, :build_book
	 public :print_book
	end

The other piece of this puzzle is the Ticket class, so we will look at that now.
Tickets are just three rows that know how to validate and draw themselves.  The
initialization process for a Ticket is spread over three methods, so let's begin
with those:

	class Ticket
	 def initialize(rows)
	   # A ticket consists of an array of three rows,
	   # with 5 numbers and 4 nil entries per row.
	   @rows = rows
	   @empty_column = false
	   validate_ticket
	 end
	 def validate_ticket
	   # Convert three rows of 9 numbers into 9 columns of three numbers,
	   # check that each column satisfies the ascending order constraint,
	   # and then convert back into rows.
	   columns = Array.new(9) { [] }
	   columns.each { |c| @rows.each { |r| c << r.shift }; rectify(c) }
	   @rows.each { |r| columns.each { |c| r << c.shift } }
	 end
	 def rectify(column)
	   # If there are 2 or 3 numbers in a column, they must
	   # appear in increasing order downward.  If they don't, then
	   # swap the numbers around while maintaining 5 numbers
	   # in each row.
	   case column.nitems
	     when 0 then @empty_column = true
	     when 1 then column # do nothing
	     when 2
	       nil_index = column.index(nil)
	       non_nils = [0,1,2] - [nil_index]
	       first_nn, last_nn = non_nils.first, non_nils.last
	       # Swap the two non-nil elements
	       if column[first_nn] > column[last_nn]
	         column[first_nn], column[last_nn] = column[last_nn],
	                                             column[first_nn]
	       end
	     when 3 then column.sort! # just sort the three numbers
	   end
	 end
	end

You can see that initialize() just stores the rows and kicks off
validate_ticket().  That method does a bit of a dance to rearrange the rows into
columns, clean and validate those columns, and change them back. 
Array#transpose() probably would have simplified this process a bit.

The real work happens in rectify().  This method serves two purposes.  Its main
job is to reorder the numbers in a column to ensure they count down.  As it
works though, it watches for empty columns that would invalidate the Ticket.

Once we know whether or not a Ticket is valid, we need to provide easy access to
that information:

	class Ticket
	 def is_valid?
	   not @empty_column
	 end
	end

That's the method we saw TicketGenerator using to determine when a book build
needed to be restarted.

Tickets can also print themselves:

	class Ticket
	 def print_ticket
	   puts "+----" * 9 + "+"
	   @rows.each do |row|
	     line = row.inject("|") do |str, x|
	       if not x
	         str + "    |"
	       elsif x < 10
	         str + "  #{x} |"
	       else
	         str + " #{x} |"
	       end
	     end
	     puts line
	     puts "+----" * 9 + "+"
	   end
	 end
	end

That code just walks the rows, printing fields as it goes.  The if chain in the
middle could be simplified a bit to:

	str + " %2s |" % x

Finally, the code again sets the visibility for these methods:

	class Ticket
	 private :validate_ticket, :rectify
	 public :print_ticket, :is_valid?
	end

My thanks to all the book builders.  I didn't expect to see so many varied
approaches.

Tomorrow, I will put you to work solving a long-standing Ruby Quiz issue...

In This Thread

Prev Next