[#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] String Equations (#112)

From: Ruby Quiz <james@...>
Date: 2007-02-08 20:09:31 UTC
List: ruby-talk #238231
This quiz is much more difficult than it looks.  There are an infinite number of
combinations, even for small word sets, because each term can be repeated.

To handle this, most brave souls who solved the quiz used some matrix
transformations from linear algebra for solving a system of linear equations. 
This makes it possible to find solutions in reasonable time, but I had to drag
out the math textbooks to decode the solutions.

Let's take a look into one such solution by Eric I.:

	require 'mathn'
	
	CompactOutput = false
	
	# calculate the least common multiple of one or more numbers
	def lcm(first, *rest)
	  rest.inject(first) { |l, n| l.lcm(n) }
	end
	
	# ...

This should be pretty easy to digest.  The mathn library is pulled in here to
get more accurate results in the calculations the code will be doing, a constant
selects the desired output mode, and a shortcut is defined for applying lcm()
over an Array of numbers.

The next method is where all the action is, so let's take that one slowly:

	# ...
	
	# Returns nil if there is no solution or an array containing two
	# elements, one for the left side of the equation and one for the
	# right side.  Each of those elements is itself an array containing
	# pairs, where each pair is an array in which the first element is the
	# number of times that word appears and the second element is the
	# word.
	def solve_to_array(words)
	  # clean up word list by eliminating non-letters, converting to lower
	  # case, and removing duplicate words
	  words.map! { |word| word.downcase.gsub(/[^a-z]/, '') }.uniq!
	  
	  # ...

The first comment does a good job of describing the result this method will
eventually produce, so you may want to glance back to it when we get that far.

The first set of operations is the word normalization process right out of the
quiz.  This code shouldn't scare anybody yet.  (Just a quick side note though,
it is possible to use delete("^a-z") here instead of the gsub() call.)

One more easy bit of code, then we will ramp things up:

	  # ...
	  
	  # calculate the letters used in the set of words
	  letters = Hash.new
	  words.each do |word|
	    word.split('').each { |letter| letters[letter] = true }
	  end
	  
	  # ...

This code just makes a list of all letters used in the word list.  (Only the
keys() of the Hash are used.)  To see what that's for, we need to dive into the
math:

	  # ...
	  
	  # create a matrix to represent a set of linear equations.
	  column_count = words.size
	  row_count = letters.size
	  equations = []
	  letters.keys.each do |letter|
	    letter_counts = []
	    words.each { |word| letter_counts << word.count(letter) }
	    equations << letter_counts
	  end
	  
	  # ...

This code build the matrix we are going to work with to find answers.  Each
column in the matrix represents a word and each row a letter.  The numbers in
the matrix then are just a count of the letter in that word.  For example, using
the quiz equation this code produces the following matrix:

	          v      
	          o      
	          l   m  
	          d   a r
	          e   r i
	        l m   v d
	        o o t o d
	      a r r o l l
	    i m d t m o e
	  +--------------
	v | 0 0 0 1 0 1 0
	l | 0 0 1 1 0 1 1
	a | 0 1 0 0 0 1 0
	m | 0 1 0 1 1 1 0
	d | 0 0 1 1 0 0 2
	o | 0 0 1 2 1 2 0
	e | 0 0 0 1 0 0 1
	r | 0 0 1 1 0 1 1
	t | 0 0 0 1 1 0 0
	i | 1 0 0 0 0 0 1

If you glance back at the code now, it should be pretty clear how it builds the
matrix as an Array of Arrays.

Now we're ready to manipulate the matrix and this is the first chunk of code
that does that:

	  # ...
	  
	  # transform matrix into row echelon form
	  equations.size.times do |row|
	    # re-order the rows, so the row with a value in then next column
	    # to process is above those that contain zeroes
	    equations.sort! do |row1, row2|
	      column = 0
	      column += 1 until column == column_count ||
	        row2[column].abs != row1[column].abs
	      if column == column_count : 0
	      else row2[column].abs <=> row1[column].abs
	      end
	    end
	
	    # figure out which column to work on
	    column = (0...column_count).detect { |i| equations[row][i] != 0 }
	    break unless column
	
	    # transform rows below the current row so that there is a zero in
	    # the column being worked on
	    ((row + 1)...equations.size).each do |row2|
	      factor = -equations[row2][column] / equations[row][column]
	      (column...column_count).each do |c|
	        equations[row2][c] += factor * equations[row][c]
	      end
	    end
	  end
	  
	  # ...

Now you really don't want me to describe that line by line.  Trust me.  Instead,
let me sum up what it does.

This code transforms the matrix into row echelon form, which says that higher
rows in the matrix have entries in further left columns and that the first
significant entry in a row is preceded only by zeros.  That sounds scarier than
it is.  Here's the transformed matrix (without the labels this time):

	1  0  0  0  0  0  1
	0  1  0  1  1  1  0
	0  0  1  2  1  2  0
	0  0  0 -1 -1 -2  2
	0  0  0  0 -1 -2  3
	0  0  0  0  0 -2  2
	0  0  0  0  0  0  0
	0  0  0  0  0  0  0
	0  0  0  0  0  0  0
	0  0  0  0  0  0  0

The why behind this transformation is that its the first step in solving for our
equation.

On to the next bit of code:

	  # ...
	  
	  # only one of the free variables chosen randomly will get a 1, the
	  # rest 0
	  rank = equations.select { |row| row.any? { |v| v != 0 }}.size
	  free = equations[0].size - rank
	  free_values = Array.new(free, 0)
	  free_values[rand(free)] = 2 * rand(2) - 1
	  
	  # ...

This bit of math uses the rank of the matrix to determine the free variables it
will solve for.  Free variables are just placeholders for substitutions in our
system of equations.  More concretely, they are where one or more words will be
inserted in our string equations.

Setting a single value to one, as the comment mentions, is basically preparing
to to work with one word at a time.  That's why the others are zeroed out.

One more variable is prepared:

	  # ...
	  
	  values = Array.new(equations[0].size)  # holds the word_counts
	  
	  # ...

As the comment explains, this will eventually be the counts for each word.

OK, here's the last big bit of math:

	  # ...
	  
	  # use backward elimination to find values for the variables; process
	  # each row in reverse order
	  equations.reverse_each do |row|
	    # determine number of free variables for the given row
	    free_variables = (0...column_count).inject(0) do |sum, index|
	      row[index] != 0 && values[index].nil? ? sum + 1 : sum
	    end
	
	    # on this row, 1 free variable will be calculated, the others will
	    # get the predetermined free values; the one being calculated is
	    # marked with nil
	    free_values.insert(rand(free_variables), nil) if free_variables > 0
	
	    # assign values to the variables
	    sum = 0
	    calc_index = nil
	    row.each_index do |index|
	      if row[index] != 0
	        if values[index].nil?
	          values[index] = free_values.shift
	
	          # determine if this is a calculated or given free value
	          if values[index] : sum += values[index] * row[index]
	          else calc_index = index
	          end
	        else
	          sum += values[index] * row[index]
	        end
	      end
	    end
	    # calculate the remaining value on the row
	    values[calc_index] = -sum / row[calc_index] if calc_index
	  end
	  
	  # ...

This elimination is the second and final matrix transform leading to a solution.
The code works through each row or equation of the matrix, determining values
for the free variables.

Again this process is much more linear algebra than Ruby, so I won't bother to
break it down line by line.  Just know that the end result of this process is
that values now holds the counts of the words needed to solve quiz.  Positive
counts belong on one side of the equation, negative counts on the other.

This is the code that breaks down those counts:

	  # ...
	  
	  if values.all? { |v| v } && values.any? { |v| v != 0 }
	    # in case we ended up with any non-integer values, multiply all
	    # values by their collective least common multiple of the
	    # denominators
	    multiplier =
	      lcm(*values.map { |v| v.kind_of?(Rational) ? v.denominator : 1 })
	    values.map! { |v| v * multiplier }
	
	    # deivide the terms into each side of the equation depending on
	    # whether the value is positive or negative
	    left, right = [], []
	    values.each_index do |i|
	      if values[i] > 0 : left << [values[i], words[i]]
	      elsif values[i] < 0 : right << [-values[i], words[i]]
	      end
	    end
	
	    [left, right]   # return found equation
	  else
	    nil  # return no found equation
	  end
	end
	
	# ...

Assuming we found a solution, this code divides the words to be used into two
groups, one for each side of the equation.  It divides based on the positive and
negative counts I just explained in values and the end result was described in
that first comment at the top of this long method.

With the math behind us, the rest of the code is easy:

	# ...
	
	# Returns a string containing a solution if one exists; otherwise
	# returns nil.  The returned string can be in either compact or
	# non-compact form depending on the CompactOutput boolean constant.
	def solve_to_string(words)
	  result = solve_to_array(words)
	  if result
	    if CompactOutput
	      result.map do |side|
	        side.map { |term| "#{term[0]}*\"#{term[1]}\"" }.join(' + ')
	      end.join(" == ")
	    else
	      result.map do |side|
	        side.map { |term| (["\"#{term[1]}\""] * term[0]).join(' + ') }.
	          join(' + ')
	      end.join(" == ")
	    end
	  else
	    nil
	  end
	end
	
	# ...

This method just wraps the previous solver and transforms the resulting Arrays
into the quiz equation format.  Two different output options are controlled by
the constant we saw at the beginning of the program.

Here's the final piece of the puzzle:

	# ...
	
	if __FILE__ == $0  # if run from the command line...
	  # collect words from STDIN
	  words = []
	  while line = gets
	    words << line.chomp
	  end
	
	  result = solve_to_string(words)
	
	  if result : puts result
	  else exit 1
	  end
	end

This code just brings in the word list, taps the solver to do the hard work, and
sends back the results.  This turns the code into a complete solution.

My thanks to all of you who know math so much better than me.  I had to use math
books and my pet math nerd just to breakdown how these solutions worked.

Tomorrow we return to easier problems, pop quiz style...

In This Thread

Prev Next