[#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] One-Liners (#113)

From: Ruby Quiz <james@...>
Date: 2007-02-15 13:32:10 UTC
List: ruby-talk #239327
If you followed the solutions of this quiz you should have seen a little bit of
everything.  We saw clever algorithms, Ruby idioms, some golfing, and even a
mistake or two.  Follow along and I'll give you the highlights.

The problems of adding commas to numbers, shuffling Arrays, and resolving class
names were selected because I see them pretty regularly on Ruby Talk.  Because
of that, I figured most of us would know those idioms pretty well.  There were a
couple of surprises though, so I'm glad I decided to include them.

For adding commas to numbers, several of us used some variant of a pretty famous
reverse(), use a regular expression, and reverse() trick.  Here's one such
solution by Carl Porth:

	quiz.to_s.reverse.scan(/(?:\d*\.)?\d{1,3}-?/).join(',').reverse

I've always liked this problem and this trick to solve it, because it reminds me
of one of my favorite rules of computing:  when you're hopelessly stuck, reverse
the data.  I can't remember who taught me that rule now and I have no earthly
idea why it works, but it sure helps a lot.

Take this problem for example.  You need to find numbers in groups of three and
it's natural to turn to regular expressions for this.  If you attack the data
head-on though, it's a heck of a problem.  The left-most digit group might be
one, two, or three long, and you have to be aware of that decimal that ends
processing.  It's a mess, but one call to reverse() cleans it right up.

Now the decimal will be before the section we want to work with and, as we see
in Carl's code, you can skip right over it.  From there the digit groups will
line up perfectly as long as you always try to greedily grab three or less. 
Carl's code does this, picking the String apart with scan() and then join()ing
the groups with added commas.  I think it's clever, elegant, and Rubyish.

I'm serious about that reverse()ing the data trick too.  Try it out next time
you are struggling.

Shuffling Arrays surprised me.  More that one person sent in:

	quiz.sort{rand}

Yikes!

Does that even work?  Let's ask IRb:

	>> quiz = (1..10).to_a
	=> [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
	>> quiz.sort{rand}
	=> [10, 6, 1, 7, 3, 8, 5, 9, 4, 2]
	>> quiz.sort{rand}
	=> [10, 6, 1, 7, 3, 8, 5, 9, 4, 2]
	>> quiz.sort{rand}
	=> [10, 6, 1, 7, 3, 8, 5, 9, 4, 2]
	>> quiz.sort{rand}
	=> [10, 6, 1, 7, 3, 8, 5, 9, 4, 2]
	>> quiz.sort{rand}
	=> [10, 6, 1, 7, 3, 8, 5, 9, 4, 2]

That's not looking too random to me.

Let's think about this.  What does the above code do.  sort() compares elements
of the Array, arranging them based on the returned result.  We are suppose to
return a result of -1, 0, or 1 to indicate how the elements compare.  However,
rand() returns a float between 0.0 and 1.0.  Ruby considers anything over 0.0 to
be the 1 response, so most of the rand calls give this.  You can get a 0.0
result from time to time, but it will be a loner in a sea of 1s.

So what is the above code actually trying to do?  It's trying to compare a
selection of random numbers and sort on that instead.  Writing the process out
longhand it is:

	quiz.map { |e| [rand, e] }.sort.map { |arr| arr.last }

We change the elements into Arrays of random numbers and the element itself.  We
then sort() those.  Arrays compare themselves element by element, so they will
always start by comparing the random numbers.  Then we just drop the random
numbers back out of the equation.

Luckily, Ruby has a shorthand version of this process, known as the Schwartzian
Transform:

	quiz.sort_by { rand }

That's the popular Ruby idiom for randomizing an Array.  Make sure you use
sort_by() instead of sort() when that's your intent.

Resolving class names is a surprisingly complex issue.  Classes can be nested
inside other classes and modules, as the quiz example showed.  Inside that
nested scope we don't need to use the full name of the constant either. 
Finally, don't forget things like autoload()ing and const_missing() which
further complicate the issue.

I'll probably get hate mail for this, but if you want to handle all of those
cases with one easy bit of code I recommend this "cheating" solution from
Phrogz:

	eval(quiz) 

This asks Ruby to lookup the constant(s) and she will always remember to handle
all of the edge cases for us.  I know we always say eval() is evil and you
should avoid it, but this instance can be one of the exceptions, in my opinion. 
Of course, you must sanitize the input if you are taking it from a user to
ensure they don't sneak in any scary code, but even with that added overhead
it's still easier and more accurate than trying to do all the work yourself.

If you just can't get over the eval() call though, you can use something like:

	quiz.split("::").inject(Object) { |par, const| par.const_get(const) } 

This doesn't address all of the edge cases, but it often works as long as you
are working with fully qualified names.

Skipping ahead a bit, let's talk about the last three questions in the quiz. 
First, reading a random line from a file.  This one is just a fun algorithm
problem.  Alex Young offered this solution:

	(a=quiz.readlines)[rand(a.size)]

That pulls all the lines into an Array and randomly selects one.  You can even
eliminate the assignment to the Array as Aleksandr Lossenko does:

	quiz.readlines[rand(quiz.lineno)]

Same thing, but here we get the line count from the File object and thus don't
need a local variable.

The problem with both of these solutions is when we run them on a very large
file.  Slurping all of that data into memory may prove to be too much.

You could do it without slurping by reading the File twice.  You could read the
whole File to get a line count, choose a random line, then read back to that
line.  That's too much busy work though.

There is an algorithm for reading the File just once and coming out of it with a
random line.  I sent the Ruby version of this algorithm in as my solution:

	quiz.inject { |choice, line| rand < 1/quiz.lineno.to_f ? line : choice }

The trick is to select a line by random chance, based on the number of lines
we've read so far.  The first line we will select 100% of the time.  50% of the
time we will then replace it with the second line.  33.3% of the time we will
replace that choice with the third line.  Etc.  The end result will be that we
have fairly selected a random line just by reading through the File once.

The wondrous number problem was more an exploration of Ruby's syntax than
anything else.  I used:

	Hash.new { |h, n| n == 1 ? [1] : [n] + h[n % 2 == 0 ? n/2 : n*3+1] }[quiz]

This is really an abuse of Ruby's Hash syntax though.  I don't ever actually
store the values in the Hash since that would be pointless for this problem. 
Instead I am using a Hash as a nested lambda(), clarified by this translation
from Ken Bloom:

	(h=lambda {|n| n==1 ? [1] : [n] + h[n%2 == 0 ? n/2 : n*3+1] })[quiz]

A solution to this problem probably belongs on more than one line though as
these both feel like golfing to me.  I liked this two step offering from
Aleksandr Lossenko:

	a=[quiz]; a << (a.last%2==1 ? a.last*3+1 : a.last/2) while a.last!=1

The final question, about nested Hashes, is actually what inspired me to make
this quiz.  The question was raised recently on the Ruport mailing list and it
took Gregory Brown and myself working together a surprising amount of time to
land on a solution just like this one from Carl Porth:

	quiz.reverse.inject { |mem, var| {var => mem} }

Those of you who figured that out quickly deserve a pat on the back.  You are
smarter than me.

Again we see my favorite trick of reverse()ing the data.  This time though, the
mental block for me was figuring out that it's easier if you don't initialize
the inject() block.  This causes inject() to start the mem variable as the first
String in the Array, eliminating the lone-entry edge case.  The problem is
trivial from there, but that was a counter-intuitive leap for my little brain.

I'll leave you to glance over the other four problems on your own, but do give
them a look.  There was no shortage of great material this week.

My thanks to all of you who just couldn't stop fiddling with these problems,
generating great ideas all the while.  Yes, I'm talking to you Robert and Ken.

Tomorrow we've got a problem for all you Bingo nuts out there...

In This Thread

Prev Next