[#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] Counting Toothpicks (#111)

From: Ruby Quiz <james@...>
Date: 2007-02-01 12:58:04 UTC
List: ruby-talk #237140
I think this was a pretty challenging quiz.  I've played around with many of the
solutions and noted that some become pretty sluggish with large numbers and at
least one still seems to get some incorrect answers.  That's not do to bad
coding mind you, it's just a challenging problem to get right.

The solutions are very interesting browsing material though, despite any
problems.  I saw an RSpec specification, clever math, metaprogramming, and even
a little golf.  Do take the time to search through them.  It's worth it.

I've chosen to talk a little about Frank Fischer's entry below.  It was
significantly smaller than most entries and easy enough to grasp the inner
workings of.  There were faster solutions though.

Let's get to the code:

	# Number to calculate with toothpicks
	class ToothNumber
	  attr_reader :value, :num, :pic
	  def initialize value, num=value, pic=("|"*num)
	    @value, @num, @pic = value, num, pic
	  end
	  
	  def + x; operation(:+, 2, "+", x); end
	  
	  def * x; operation(:*, 2, "x", x); end
	  
	  def <=> x; @num <=> x.num; end
	  
	  def to_s; "#{@pic} = #{@value} (#{@num} Toothpicks)"; end
	  
	  private
	  # create new ToothNumber using an operation
	  def operation meth, n_operator_sticks, operator, x
	    ToothNumber.new @value.send(meth, x.value),
	                    @num + x.num + n_operator_sticks,
	                    @pic + operator + x.pic
	  end
	end
	
	# ...

This class is a representation of a toothpick number.  These numbers support the
standard operators, so you can work with them much like you do Ruby's native
numbers.  Here's an IRb session showing such operations:

	>> two = ToothNumber.new(2)
	=> #<ToothNumber:0x10a3588 @pic="||", @value=2, @num=2>
	>> three = ToothNumber.new(3)
	=> #<ToothNumber:0x109c2ec @pic="|||", @value=3, @num=3>
	>> six = two * three
	=> #<ToothNumber:0x10935d4 @pic="||x|||", @value=6, @num=7>
	>> eight = six + two
	=> #<ToothNumber:0x108e430 @pic="||x|||+||", @value=8, @num=11>
	>> eight.to_s
	=> "||x|||+|| = 8 (11 Toothpicks)"

Glancing back at the code, the instance variable @value holds the actual number
value, @num confusingly holds the toothpick count, and @pic holds the actual
toothpick pattern in String form.  Note that ToothNumber objects compare
themselves using @num, so lower counts sort first.  Beyond that, the only
semi-tricky method is operation().  If you break it down though you will see
that it just forwards the math to Ruby and manually builds the new count and
String.

To see how these are put to use, we need another chunk of code:

	# ...
	
	# contains minimal multiplication-only toothpick for each number
	$tooths = Hash.new {|h,n| h[n] = tooth_mul n}
	$tooths_add = Hash.new {|h,n| h[n] = toothpick n}
	
	# should return the minimal toothpick-number
	# should only use multiplication
	def tooth_mul n
	  ways = [ToothNumber.new(n)] +
	  (2..(Math.sqrt(n).to_i)).map{|i|
	    n % i == 0 ? ($tooths[i] * $tooths[n/i]) : nil
	  }.compact
	  ways.min
	end
	
	# returns minimal toothpick-number with multiplication and addition
	def toothpick n
	  ways = [$tooths[n]] +
	         (1..(n/2)).map{|i| $tooths[n-i] + $tooths_add[i] }
	  ways.min
	end
	
	# ...

Start with the $tooths Hash.  You can see that it delegates Hash initialization
to tooth_mul(), which is just a factor finder.  It walks from two to the square
root of the number finding all combinations that multiply to the original
number.  It then uses min() to pull the result with the lowest toothpick count.

Now remember, we're only talking about multiplication at this point. 
$tooths[10] is going to find the two and five factors and return that as a
result, since they have a lower count than the ten factor itself.  However,
$tooths[13] is just going to return thirteen, since it is a prime number and
addition is needed to get a lower count.

That brings us to the other Hash and method, which layer addition on top of
these factors.  The work here is basically the same:  walk the lower numbers
building up all the possible sums equal to the passed integer.  Because this
walk indexes into the $tooths factor Hash though, the results will actually make
use of multiplication and division.  That's the answer we are after and again
the low count is pulled with min().

Here's the final bit of code that turns it into a solution:

	# ...
	
	for i in 1..ARGV[0].to_i
	  puts $tooths_add[i]
	end

This just walks a count from one to the passed integer printing toothpick
counts.  Note that building the bigger numbers isn't generally too much work
since the factor cache grows as we count up.

My thanks to all who gave this quiz a go and to Gavin for pointing me to the
problem in the first place.

Tomorrow we will try the other 2006 ACM problem I liked...

In This Thread

Prev Next