[#199818] Help please — "Dark Ambient" <sambient@...>

Recently I asked here about where "end" goes, in relation to code

14 messages 2006/07/01

[#199852] How to open a console and ruby a ruby script from ruby? — transfire@...

I know I can do

12 messages 2006/07/01

[#199959] Re: if problem in loop causing weirdness — Nuralanur@...

You can use the break command to stop iterating through a block, eg.

10 messages 2006/07/03

[#199970] About 1.9 #__method__ feature. — transfire@...

I think the name __method__ is probably a poor choice b/c "shadow

102 messages 2006/07/03
[#199978] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/03

Hi,

[#199983] Re: About 1.9 #__method__ feature. — ara.t.howard@... 2006/07/03

On Tue, 4 Jul 2006, Yukihiro Matsumoto wrote:

[#199991] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/03

Hi,

[#199994] Re: About 1.9 #__method__ feature. — ara.t.howard@... 2006/07/03

On Tue, 4 Jul 2006, Yukihiro Matsumoto wrote:

[#199988] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/03

Hi --

[#199993] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/03

Hi,

[#200002] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/03

Hi --

[#200021] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/03

Hi,

[#200109] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/04

Hi --

[#200126] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/04

Hi,

[#200135] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/04

Hi --

[#200136] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/04

Hi,

[#200145] Re: About 1.9 #__method__ feature. — "Austin Ziegler" <halostatue@...> 2006/07/04

On 7/4/06, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#200156] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/04

Hi,

[#200159] Re: About 1.9 #__method__ feature. — ara.t.howard@... 2006/07/04

On Wed, 5 Jul 2006, Yukihiro Matsumoto wrote:

[#200204] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/05

Hi,

[#200216] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/05

Hi --

[#200478] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/06

Hi,

[#200550] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/07

Hi --

[#200553] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/07

Hi,

[#200557] Re: About 1.9 #__method__ feature. — dblack@... 2006/07/07

Hi --

[#200559] Re: About 1.9 #__method__ feature. — Yukihiro Matsumoto <matz@...> 2006/07/07

Hi,

[#199979] One-Click Ruby Installer 184-18 Release Candidate 3 is available — "Curt Hibbs" <curt.hibbs@...>

Originally, this was planned to be the final 1.8.4 release of the One-Click

11 messages 2006/07/03

[#200056] Retired Ruby Mascott? — "Pawel Szymczykowski" <makenai@...>

Hi all,

22 messages 2006/07/03

[#200140] progress on "Automated Wrapper Generation for Information Extraction" — "A. S. Bradbury" <asbradbury@...>

As you may or may not be aware, I am currently working on one of the 10

8 messages 2006/07/04

[#200172] Parallel Array — "Nasir Khan" <rubylearner@...>

If I have two arrays a=[1,1,1,1] and b=[2,2,2,2] and I want to add each

16 messages 2006/07/05

[#200202] Problem installing gem — Alex Gian <alexgian@...>

Hi, first post here, hope it's the right forum.

15 messages 2006/07/05

[#200294] debugging proposal — "Max Muermann" <max@...>

Hi everybody,

13 messages 2006/07/06

[#200359] A newbie would like some code criticism, please... — "Just Another Victim of the Ambient Morality" <ihatespam@...>

I'm learning Ruby and I'd like some criticism on a program that I wrote.

14 messages 2006/07/06

[#200366] Re: Rails: http://localhost:3000/say/list_rcv OK on FireFox; nil on IE — "Richard" <RichardDummyMailbox58407@...>

Hi Robert,

10 messages 2006/07/06

[#200382] GC oddness — Alex Young <alex@...>

Hi all,

17 messages 2006/07/06
[#200384] Re: GC oddness — nobu@... 2006/07/06

Hi,

[#200392] Float#==. Legacy? — Guillaume Marcais <guslist@...>

As far as my experience goes, using Float#== is always an error. Float

15 messages 2006/07/06

[#200456] Easy Pathname — transfire@...

I find myself always using File.join, and never utilizing Pathname b/c

20 messages 2006/07/06

[#200470] Redefining core classes — Damaris Fuentes <dfl_maradentro@...>

Hi you all,

17 messages 2006/07/06
[#200472] Re: Redefining core classes — "Patrick Hurley" <phurley@...> 2006/07/06

On 7/6/06, Damaris Fuentes <dfl_maradentro@yahoo.es> wrote:

[#200517] ruby-opengl — "John Gabriele" <jmg3000@...>

I've tinkered a bit with Yoshi's original ruby-opengl. My changes are

20 messages 2006/07/07

[#200579] Panagrams (#86) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

40 messages 2006/07/07
[#200631] Re: [QUIZ] Panagrams (#86) — brian.mattern@... 2006/07/07

Is it a spoiler if we post a resulting pangram (no code)?

[#200642] Re: [QUIZ] Panagrams (#86) — James Edward Gray II <james@...> 2006/07/07

On Jul 7, 2006, at 12:34 PM, brian.mattern@gmail.com wrote:

[#200627] instance_exec — ara.t.howard@...

27 messages 2006/07/07

[#200758] Why Ruby over Python? — howachen@...

Besides ROR, can you give me a reason why perfer ruby instead of

106 messages 2006/07/08
[#200766] Re: Why Ruby over Python? — "vasudevram" <vasudevram@...> 2006/07/08

howachen@gmail.com wrote:

[#200791] Re: Why Ruby over Python? — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/08

vasudevram wrote:

[#200942] Re: Why Ruby over Python? — Daniel Martin <martin@...> 2006/07/09

"M. Edward (Ed) Borasky" <znmeb@cesmail.net> writes:

[#200946] Re: Why Ruby over Python? — "Francis Cianfrocca" <garbagecat10@...> 2006/07/09

On 7/9/06, Daniel Martin <martin@snowplow.org> wrote:

[#200795] Sweet Lord! — Daniel Schierbeck <daniel.schierbeck@...>

Why haven't I thought of this before?

22 messages 2006/07/08
[#200814] Re: Sweet Lord! — "William James" <w_a_x_man@...> 2006/07/08

Daniel Schierbeck wrote:

[#200910] Marshal's handling of floats — Brian Palmer <rubytalk@...>

I was thinking about writing a patch to modify how Marshal handles

15 messages 2006/07/09

[#201158] Real newbie question about methods — "simonh" <simonharrison@...>

Hi all. I'm trying to learn ruby using about 5 books(!) but keep

16 messages 2006/07/10

[#201274] Some questions about serious Ruby development... — "Just Another Victim of the Ambient Morality" <ihatespam@...>

I like Ruby. I like it more than Python. It's my PERL replacement. I

11 messages 2006/07/11

[#201323] Nuby Q: Daemonize (other materials have been read!) — Rogue Amateur <rogueamateur@...>

I've read the other references to daemonizing a process in ruby, but ...

16 messages 2006/07/11
[#201327] Re: Nuby Q: Daemonize (other materials have been read!) — ara.t.howard@... 2006/07/11

On Wed, 12 Jul 2006, Rogue Amateur wrote:

[#201339] Re: Nuby Q: Daemonize (other materials have been read!) — Rogue Amateur <rogueamateur@...> 2006/07/11

First, let me say thank you for the help.

[#201340] Re: Nuby Q: Daemonize (other materials have been read!) — Rogue Amateur <rogueamateur@...> 2006/07/11

Rogue Amateur wrote:

[#201333] Processes and Portability — Name Name <exl2@...>

I would like to run a process concurrently (thus if the process goes to

19 messages 2006/07/11

[#201388] Decent HTML Parser? — Kevin Weller <"http://www.itcrucible.com/contact"@...>

Anybody have experience with a decent HTML parser for a Ruby

18 messages 2006/07/11

[#201503] Help with a regexp — Daniel Schierbeck <daniel.schierbeck@...>

I'm trying to write a regular expression that matches bencoded strings,

36 messages 2006/07/12
[#201553] Re: Help with a regexp — "studlee2@..." <studlee2@...> 2006/07/12

Daniel,

[#201569] Re: Help with a regexp — Daniel Schierbeck <daniel.schierbeck@...> 2006/07/12

studlee2@gmail.com wrote:

[#201513] Appending to a CSV file — Bil Kleb <Bil.Kleb@...>

Just got a call from a telecommuting colleague

15 messages 2006/07/12

[#201636] prototype-0.1.0 — ara.t.howard@...

17 messages 2006/07/12

[#201661] Recursion and Ruby — Glenn Cadman <glenn.cadman@...>

As a practice to learn ruby I tried to create a recursive program

33 messages 2006/07/13
[#201668] Re: Recursion and Ruby — "Erik Veenstra" <erikveen@...> 2006/07/13

You could use "case" as well (see version 2). It's faster.

[#201696] Re: Recursion and Ruby — Daniel Martin <martin@...> 2006/07/13

"Erik Veenstra" <erikveen@gmail.com> writes:

[#201788] challenge — ara.t.howard@...

29 messages 2006/07/13
[#201790] Re: challenge — ara.t.howard@... 2006/07/13

On Fri, 14 Jul 2006 Ara.T.Howard@noaa.gov wrote:

[#201842] Re: challenge — transfire@... 2006/07/14

[#201848] Re: challenge — ara.t.howard@... 2006/07/14

On Fri, 14 Jul 2006 transfire@gmail.com wrote:

[#201852] Re: challenge — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/14

On 7/14/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#201889] Re: challenge — "Robert Dober" <robert.dober@...> 2006/07/14

On 7/14/06, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#201898] Re: challenge — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/14

On 7/14/06, Robert Dober <robert.dober@gmail.com> wrote:

[#201916] Re: challenge — "Robert Dober" <robert.dober@...> 2006/07/14

[snip]

[#201919] Re: challenge — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/14

On 7/14/06, Robert Dober <robert.dober@gmail.com> wrote:

[#201821] Preferred monkeypatching technique — Tom Werner <tom@...>

Allow me to present a scenario:

56 messages 2006/07/13
[#201837] Re: Preferred monkeypatching technique — dblack@... 2006/07/14

Hi --

[#201853] Re: Preferred monkeypatching technique — Hal Fulton <hal9000@...> 2006/07/14

dblack@wobblini.net wrote:

[#201864] How to speed up ruby and make it as fast as possible — Ben Johnson <bjohnson@...>

Hi,

20 messages 2006/07/14

[#201885] About MyClass#my_method — "Jonas Pfenniger" <zimba.tm@...>

Hi,

15 messages 2006/07/14

[#201903] Negative Sleep (#87) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

24 messages 2006/07/14

[#201950] Re: How to speed up ruby and make it as fast as possible — "Jamal Mazrui" <Jamal.Mazrui@...>

In answer to the multiple messages recommending that I learn C or

14 messages 2006/07/14

[#201990] Re: How to speed up ruby and make it as fast as possible — "Jamal Mazrui" <Jamal.Mazrui@...>

Certainly, Ruby performance is not always a problem. It may not even be

25 messages 2006/07/14
[#202208] Re: How to speed up ruby and make it as fast as possible — "S Wayne" <wrecklass1@...> 2006/07/16

Jamal Mazrui wrote:

[#202042] Mac OSX Ruby Configuration Question — "Steven R." <steverummel@...>

I recently installed Ruby 1.8.4 on my iMac, running OSX 10.4. Ruby,

14 messages 2006/07/14

[#202050] Alternate initializers or alternate class? — transfire@...

Jan Molic recently contacted me about a slighlty modified version of

11 messages 2006/07/14

[#202067] Some questions about Ruby and it's environment... — "Just Another Victim of the Ambient Morality" <ihatespam@...>

I have two issues in Ruby which are bugging me.

15 messages 2006/07/15

[#202091] net/http performance — Luke Burton <luke@...>

15 messages 2006/07/15

[#202109] Who likes Sudoku? — "studlee2@..." <studlee2@...>

Here is the smallest Ruby Sudoku solver I could come up with. I've

21 messages 2006/07/15
[#202113] Re: Who likes Sudoku? — dblack@... 2006/07/15

Hi --

[#202116] Re: Who likes Sudoku? — "studlee2@..." <studlee2@...> 2006/07/15

I'm not really sure about the whole "GOLF" vs. "golf". We'll say

[#202125] Re: Who likes Sudoku? — "studlee2@..." <studlee2@...> 2006/07/15

This is a little smaller.

[#202128] Re: Who likes Sudoku? — "studlee2@..." <studlee2@...> 2006/07/15

Smaller still. Thanks David/Daniel:

[#202250] additional requirements for a Ruby env — "Alexandru Popescu" <the.mindstorm.mailinglist@...>

Hi!

20 messages 2006/07/16
[#202333] Re: additional requirements for a Ruby env — "Alexandru Popescu" <the.mindstorm.mailinglist@...> 2006/07/17

Guys any hints for this? Sorry for pushing it to the top, but I am

[#202340] Re: additional requirements for a Ruby env — Alex Young <alex@...> 2006/07/17

Alexandru Popescu wrote:

[#202280] n00b Q: Obfuscation and locking the source — "Danno" <dh.evolutionnext@...>

I have been doing some Ruby on and off this year, so I am still a n00b.

14 messages 2006/07/17

[#202294] Printing Barcodes from Ruby — listrecv@...

I'd like to be able to generate barcodes from Ruby (to a PDF document).

14 messages 2006/07/17

[#202310] How can I parse binary files? — Fabio Vitale <fabio@...>

I've the need to parse a binary file with the following structure:

24 messages 2006/07/17
[#202317] Re: How can I parse binary files? — Daniel Martin <martin@...> 2006/07/17

Fabio Vitale <fabio@sferaconsulting.it> writes:

[#202338] Re: How can I parse binary files? — Fabio Vitale <fabio@...> 2006/07/17

Daniel Martin wrote:

[#202392] Re: How can I parse binary files? — Daniel Martin <martin@...> 2006/07/17

Fabio Vitale <fabio@sferaconsulting.it> writes:

[#202398] Re: How can I parse binary files? — Daniel Martin <martin@...> 2006/07/17

Daniel Martin <martind@martinhouse.internal> writes:

[#202448] Re: How can I parse binary files? — Fabio Vitale <fabio@...> 2006/07/18

Daniel Martin wrote:

[#202449] Re: How can I parse binary files? — Fabio Vitale <fabio@...> 2006/07/18

Fabio Vitale wrote:

[#202354] irb and readline — listrecv@...

I'm getting funny behavior when using irb (readline) on Windows. When

17 messages 2006/07/17

[#202467] Problems installing rubyzip gem on Debian...can someone help? — "subimage" <subimage@...>

I haven't had issues with it before, but now I am...I go to install

12 messages 2006/07/18

[#202498] One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...>

The One-Click Ruby Installer for Windows is at a cross-roads. The C++

119 messages 2006/07/18
[#202510] Re: One-Click Installer: MinGW? or VC2005? — ara.t.howard@... 2006/07/18

On Wed, 19 Jul 2006, Curt Hibbs wrote:

[#202512] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/18

On 7/18/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#202515] Re: One-Click Installer: MinGW? or VC2005? — ara.t.howard@... 2006/07/18

On Wed, 19 Jul 2006, Curt Hibbs wrote:

[#203110] Re: One-Click Installer: MinGW? or VC2005? — "Austin Ziegler" <halostatue@...> 2006/07/21

On 7/18/06, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:

[#202524] Re: One-Click Installer: MinGW? or VC2005? — "Francis Cianfrocca" <garbagecat10@...> 2006/07/18

On 7/18/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:

[#202529] Re: One-Click Installer: MinGW? or VC2005? — ara.t.howard@... 2006/07/18

On Wed, 19 Jul 2006, Francis Cianfrocca wrote:

[#202534] Re: One-Click Installer: MinGW? or VC2005? — Francis Cianfrocca <garbagecat10@...> 2006/07/18

unknown wrote:

[#202545] Re: One-Click Installer: MinGW? or VC2005? — Mauricio Fernandez <mfp@...> 2006/07/18

On Wed, Jul 19, 2006 at 03:06:10AM +0900, Francis Cianfrocca wrote:

[#202541] Re: One-Click Installer: MinGW? or VC2005? — Mauricio Fernandez <mfp@...> 2006/07/18

On Wed, Jul 19, 2006 at 12:22:16AM +0900, Curt Hibbs wrote:

[#202741] Re: One-Click Installer: MinGW? or VC2005? — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/19

On 7/18/06, Mauricio Fernandez <mfp@acm.org> wrote:

[#202779] Re: One-Click Installer: MinGW? or VC2005? — Simon Krer <SimonKroeger@...> 2006/07/19

Sean O'Halpin wrote:

[#202784] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

On 7/19/06, Simon Kr=F6ger <SimonKroeger@gmx.de> wrote:

[#202789] Re: One-Click Installer: MinGW? or VC2005? — Simon Krer <SimonKroeger@...> 2006/07/19

Curt Hibbs wrote:

[#202807] Re: One-Click Installer: MinGW? or VC2005? — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/19

On 7/19/06, Simon Krer <SimonKroeger@gmx.de> wrote:

[#202810] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/19

On 7/19/06, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#202814] Re: One-Click Installer: MinGW? or VC2005? — "Sean O'Halpin" <sean.ohalpin@...> 2006/07/19

On 7/19/06, Curt Hibbs <ml.chibbs@gmail.com> wrote:

[#202841] Re: One-Click Installer: MinGW? or VC2005? — "Curt Hibbs" <ml.chibbs@...> 2006/07/20

On 7/19/06, Sean O'Halpin <sean.ohalpin@gmail.com> wrote:

[#202915] Re: One-Click Installer: MinGW? or VC2005? — Ryan Raaum <devlists-ruby-talk@...> 2006/07/20

[#202980] Re: One-Click Installer: MinGW? or VC2005? — Reggie Mr <buppcpp@...> 2006/07/20

Ryan Raaum wrote:

[#203063] Re: One-Click Installer: MinGW? or VC2005? — Lothar Scholz <mailinglists@...> 2006/07/21

[#203075] Re: One-Click Installer: MinGW? or VC2005? — "stu" <yakumo9275@...> 2006/07/21

[#202514] more newbie help with classes and methods please — "simonh" <simonharrison@...>

I posted a question a week or so now which I got some great help with.

24 messages 2006/07/18
[#202622] Re: more newbie help with classes and methods please — "S Wayne" <wrecklass1@...> 2006/07/19

A couple of things:

[#202647] Re: more newbie help with classes and methods please — "simonh" <simonharrison@...> 2006/07/19

Thanks for replies. Just to point out, this code is not meant for

[#202653] Re: more newbie help with classes and methods please — "simonh" <simonharrison@...> 2006/07/19

decided to have a go at using the case statement. Why won't this work?

[#202671] Re: more newbie help with classes and methods please — Morton Goldberg <m_goldberg@...> 2006/07/19

There are two forms of case block and you have sort of mixed them up.

[#202673] Re: more newbie help with classes and methods please — dblack@... 2006/07/19

Hi --

[#202683] Net/HTTP is flaky? — "Just Another Victim of the Ambient Morality" <ihatespam@...>

Inexplicably, the following code fails:

13 messages 2006/07/19

[#202684] Time.parse has never visited Singapore? — "Harold Hausman" <hhausman@...>

I suspect that Time.parse is just not understanding the "Malay

11 messages 2006/07/19

[#202723] sandbox 0.0.11 -- taking the i out of eval — why the lucky stiff <ruby-talk@...>

Oh rapture! Oh, delicious zesty snacks! Oh, steamed uncles in a cabbage

14 messages 2006/07/19

[#202731] Beyond threads? Better concurrency methods? — anmus <anmus@...>

Hi All,

30 messages 2006/07/19
[#202853] Re: Beyond threads? Better concurrency methods? — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/20

anmus wrote:

[#202866] how to split an array in sub arrays of the same length — Paolo Bacchilega <paolo.bacchilega@...>

Hi,

14 messages 2006/07/20

[#202882] return statement where it is usefull ? — pere.noel@... (Une b騅ue)

i've the habit (from java ;-)) to put a return statement in a method

16 messages 2006/07/20

[#202955] Using .each with constructors — "Ben Zealley" <transhumanist@...>

Is there a nice elegant way of creating several named objects of the

31 messages 2006/07/20
[#203002] Re: Using .each with constructors — "Robert Dober" <robert.dober@...> 2006/07/20

On 7/20/06, Ben Zealley <transhumanist@gmail.com> wrote:

[#203021] Re: Using .each with constructors — transfire@... 2006/07/20

[#203033] Re: Using .each with constructors — Logan Capaldo <logancapaldo@...> 2006/07/21

[#203074] opacity of magic enumerator (was: Re: Using .each with constructors) — dblack@... 2006/07/21

Hi --

[#203076] Re: opacity of magic enumerator (was: Re: Using .each with constructors) — "Martin DeMello" <martindemello@...> 2006/07/21

On 7/21/06, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#202958] "" vs '' — Ben Johnson <bjohnson@...>

I know this is a very simply question, but I've seen many different

19 messages 2006/07/20

[#202967] Re: [ANN] Mongoose 0.1.1 — "Berger, Daniel" <Daniel.Berger@...>

> -----Original Message-----

15 messages 2006/07/20
[#202970] Re: [ANN] Mongoose 0.1.1 — Jamey Cribbs <jcribbs@...> 2006/07/20

Berger, Daniel wrote:

[#203124] Meta-Meta-Programming, revisited — "Erik Veenstra" <erikveen@...>

Do you remember the discussion about monitor-functions and

22 messages 2006/07/21

[#203151] Mongoose 0.2.0 — Jamey Cribbs <jcribbs@...>

You can download it from: http://rubyforge.org/projects/mongoose/

19 messages 2006/07/21

[#203171] Newbie Question: delete all non alphanumeric characters — Theallnighter Theallnighter <theallnighter@...>

Hi all,

17 messages 2006/07/21

[#203216] XML2RB - Executing XML — "Erik Veenstra" <erikveen@...>

----------------------------------------------------------------

11 messages 2006/07/21

[#203333] Infinity — "hadley wickham" <h.wickham@...>

irb(main):084:0> (-1.0/0.0)

15 messages 2006/07/22

[#203352] Set an instance variable before and after initialize — Martin Jansson <martialis@...>

If possible, I would like to set a instance variable in an object before

12 messages 2006/07/22

[#203438] Yadda yadda yadda operator — "Son SonOfLilit" <sonoflilit@...>

Hello.

25 messages 2006/07/23

[#203473] I'll have the duck! — transfire@...

I promised myself I'd shut-up for awhile, maybe I still should, but I

102 messages 2006/07/23
[#203528] Re: I'll have the duck! — benjohn@... 2006/07/24

> Now anything that responded to #to_a could use #transform. I'm not

[#203611] Re: I'll have the duck! — Daniel DeLorme <dan-ml@...42.com> 2006/07/24

benjohn@fysh.org wrote:

[#203615] Re: I'll have the duck! — transfire@... 2006/07/24

[#203628] Re: I'll have the duck! — dblack@... 2006/07/24

Hi --

[#203630] Re: I'll have the duck! — Chad Perrin <perrin@...> 2006/07/24

On Tue, Jul 25, 2006 at 05:48:29AM +0900, dblack@wobblini.net wrote:

[#203632] Re: I'll have the duck! — dblack@... 2006/07/24

Hi --

[#203664] Re: I'll have the duck! — "7rans" <transfire@...> 2006/07/25

[#203681] Re: I'll have the duck! — dblack@... 2006/07/25

Hi --

[#203729] Re: I'll have the duck! — "7rans" <transfire@...> 2006/07/25

[#203792] Re: I'll have the duck! — "Phil Tomson" <rubyfan@...> 2006/07/25

On 7/25/06, 7rans <transfire@gmail.com> wrote:

[#203799] Re: I'll have the duck! — ara.t.howard@... 2006/07/25

On Wed, 26 Jul 2006, Phil Tomson wrote:

[#203813] Re: I'll have the duck! — dblack@... 2006/07/25

On Wed, 26 Jul 2006, ara.t.howard@noaa.gov wrote:

[#203475] rb-gnome and gtkglext — "anne001" <anne@...>

I ran the darwinports install instructions on rb-gnome

16 messages 2006/07/23

[#203488] RLisp - Lisp naturally embedded in Ruby — "Tomasz Wegrzanowski" <tomasz.wegrzanowski@...>

Hello :-)

32 messages 2006/07/24
[#203624] Re: RLisp - Lisp naturally embedded in Ruby — "William James" <w_a_x_man@...> 2006/07/24

Tomasz Wegrzanowski wrote:

[#203639] Re: RLisp - Lisp naturally embedded in Ruby — "Tomasz Wegrzanowski" <tomasz.wegrzanowski@...> 2006/07/24

On 7/24/06, William James <w_a_x_man@yahoo.com> wrote:

[#203721] Re: RLisp - Lisp naturally embedded in Ruby — Christian Neukirchen <chneukirchen@...> 2006/07/25

"Tomasz Wegrzanowski" <tomasz.wegrzanowski@gmail.com> writes:

[#203727] Re: RLisp - Lisp naturally embedded in Ruby — "Tomasz Wegrzanowski" <tomasz.wegrzanowski@...> 2006/07/25

On 7/25/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:

[#203803] Re: RLisp - Lisp naturally embedded in Ruby — Christian Neukirchen <chneukirchen@...> 2006/07/25

"Tomasz Wegrzanowski" <tomasz.wegrzanowski@gmail.com> writes:

[#203514] [ANN] Nitro/Og 0.31.0 — gabriele renzi <surrender_itRemove@...>

(forwarding from nitro's list)

25 messages 2006/07/24

[#203526] Autoloading objects — Ruby equivalent for PHP5 "__autoload — "Naum T." <naum@...>

Does there exist a Ruby equivalent to PHP5 "magic" __autoload method

13 messages 2006/07/24

[#203711] Defining a method with an argument with a default value — "Pedro Cte-Real" <pedro@...>

I have this line in a class method to define an initializer:

12 messages 2006/07/25

[#203752] Hash order bug? — Javier Valencia <jvalencia@...01.org>

I have this piece of simple code:

46 messages 2006/07/25
[#203753] Re: Hash order bug? — dblack@... 2006/07/25

Hi --

[#250371] Re: Hash order bug? — Haoqi Haoqi <axgle@126.com> 2007/05/05

[#250372] Re: Hash order bug? — "Nicholas Clare" <nickclare@...> 2007/05/05

On 5/5/07, Haoqi Haoqi <axgle@126.com> wrote:

[#203778] Mongoose 0.2.5 - The "Two Steps Forward, One Step Back" release — Jamey Cribbs <jcribbs@...>

You can download it from: http://rubyforge.org/projects/mongoose/

19 messages 2006/07/25
[#204393] Re: Mongoose 0.2.5 - The "Two Steps Forward, One Step Back" release — GFunk913@... 2006/07/28

Jamey Cribbs wrote:

[#204401] Re: Mongoose 0.2.5 - The "Two Steps Forward, One Step Back" release — Jamey Cribbs <jcribbs@...> 2006/07/28

GFunk913@gmail.com wrote:

[#204406] Re: Mongoose 0.2.5 - The "Two Steps Forward, One Step Back" release — GFunk913@... 2006/07/28

[#203958] For performance, write it in C — Peter Hickman <peter@...>

Whenever the question of performance comes up with scripting languages

157 messages 2006/07/26
[#203962] Re: For performance, write it in C — benjohn@... 2006/07/26

Peter Hickman gave a very good article about prototyping in a scripting

[#203967] Re: For performance, write it in C — "Tomasz Wegrzanowski" <tomasz.wegrzanowski@...> 2006/07/26

On 7/26/06, benjohn@fysh.org <benjohn@fysh.org> wrote:

[#203995] Re: For performance, write it in C — "Charles O Nutter" <headius@...> 2006/07/26

I'll lob a couple of grenades and then duck for cover.

[#203996] Re: For performance, write it in C — James Edward Gray II <james@...> 2006/07/26

On Jul 26, 2006, at 8:57 AM, Charles O Nutter wrote:

[#204041] Re: For performance, write it in C — "David Pollak" <pollak@...> 2006/07/26

Writing code that runs as fast in Java as it does in C is real work,

[#204085] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/26

On Thu, Jul 27, 2006 at 12:42:46AM +0900, David Pollak wrote:

[#204182] Re: For performance, write it in C — "David Pollak" <pollak@...> 2006/07/27

On 7/26/06, Chad Perrin <perrin@apotheon.com> wrote:

[#204191] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/27

On Thu, Jul 27, 2006 at 09:26:45AM +0900, David Pollak wrote:

[#204196] Re: For performance, write it in C — Keith Gaughan <kmgaughan@...> 2006/07/27

On Thu, Jul 27, 2006 at 10:07:00AM +0900, Chad Perrin wrote:

[#204198] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/27

On Thu, Jul 27, 2006 at 10:35:52AM +0900, Keith Gaughan wrote:

[#204202] Re: For performance, write it in C — Keith Gaughan <kmgaughan@...> 2006/07/27

On Thu, Jul 27, 2006 at 10:50:32AM +0900, Chad Perrin wrote:

[#204205] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/27

On Thu, Jul 27, 2006 at 11:17:44AM +0900, Keith Gaughan wrote:

[#204209] Re: For performance, write it in C — Keith Gaughan <kmgaughan@...> 2006/07/27

On Thu, Jul 27, 2006 at 11:38:34AM +0900, Chad Perrin wrote:

[#204216] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/27

On Thu, Jul 27, 2006 at 12:19:24PM +0900, Keith Gaughan wrote:

[#203998] Re: For performance, write it in C — Peter Hickman <peter@...> 2006/07/26

Charles O Nutter wrote:

[#204020] Re: For performance, write it in C — "Dean Wampler" <deanwampler@...> 2006/07/26

On 7/26/06, benjohn@fysh.org <benjohn@fysh.org> wrote:

[#204094] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/26

On Thu, Jul 27, 2006 at 12:03:50AM +0900, Dean Wampler wrote:

[#204102] Re: For performance, write it in C — Ashley Moran <work@...> 2006/07/26

[#204116] Re: For performance, write it in C — Francis Cianfrocca <garbagecat10@...> 2006/07/26

Ashley Moran wrote:

[#204122] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/26

On Thu, Jul 27, 2006 at 04:59:13AM +0900, Francis Cianfrocca wrote:

[#204120] Re: For performance, write it in C — Chad Perrin <perrin@...> 2006/07/26

On Thu, Jul 27, 2006 at 04:27:57AM +0900, Ashley Moran wrote:

[#203989] Driving Oracle sqlplus with open3 — "Daniel Berger" <Daniel.Berger@...>

Hi all,

12 messages 2006/07/26

[#203993] eRuby: A tutorial on using Ruby on the web — tesla <tesla.nicoli@...>

A group (three) of us wanted to learn Ruby but we decided that Rails was no

12 messages 2006/07/26

[#204108] OO Paradigm and Ruby Exercises for a Beginner — Picklegnome <picklegnome@...>

I am at a loss for where to begin here, so I'll jump in.

16 messages 2006/07/26

[#204247] Ruby and Visual Basic — "Ike" <rxv@...>

Some years ago I wrote a magazine review regarding Visual Basic. At the time

13 messages 2006/07/27

[#204283] Wrapped method causing infinite recursion in rcov — "Pedro Cte-Real" <pedro@...>

I added this to my rails test helper to check for valid HTML automatically:

9 messages 2006/07/27

[#204292] String#chop slow? REALLY slow? — Mat Schaffer <schapht@...>

I just did a quick benchmark to prove something to myself. But I'd

14 messages 2006/07/27

[#204296] Learn to Program - Solutions? — pixelnate <pixelnate@...>

Is there some place that I can solutions to the exercises in the Learn

12 messages 2006/07/27

[#204307] Slow regular expressions :( — Roman Hausner <roman.hausner@...>

I am disappointed to learn that Ruby obviously implements yet another

29 messages 2006/07/27
[#204434] Re: Slow regular expressions :( — "Just Another Victim of the Ambient Morality" <ihatespam@...> 2006/07/28

[#204365] converting some autogenerated ruby code to C — "Eric Mahurin" <eric.mahurin@...>

One of the next things I want to do in my grammar package is to give

16 messages 2006/07/27
[#204803] Re: converting some autogenerated ruby code to C — Eric Hodel <drbrain@...7.net> 2006/07/29

On Jul 27, 2006, at 2:25 PM, Eric Mahurin wrote:

[#205117] Re: converting some autogenerated ruby code to C — "Eric Mahurin" <eric.mahurin@...> 2006/07/31

On 7/28/06, Eric Hodel <drbrain@segment7.net> wrote:

[#205274] Re: converting some autogenerated ruby code to C — "Dominik Bathon" <dbatml@...> 2006/07/31

Hi Eric,

[#204369] GDK#create_cairo_context not found — "Farrel Lifson" <farrel.lifson@...>

What version of rcairo, and ruby-gnome2 do I need to have

13 messages 2006/07/27
[#204500] Re: GDK#create_cairo_context not found — "anne001" <anne@...> 2006/07/28

do you get the same error in irb when you type

[#204412] About last night ... — "M. Edward (Ed) Borasky" <znmeb@...>

Now that I have your attention :) ... last night was FOSCON II -- Ruby

32 messages 2006/07/28

[#204459] For performance, write it in C - Part 2, comparing C, Ruby and Java — Peter Hickman <peter@...>

This is the follow up to my "Write it in C post" and is intended to

49 messages 2006/07/28
[#204477] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — "Isak Hansen" <isak.hansen@...> 2006/07/28

[#204478] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — Peter Hickman <peter@...> 2006/07/28

Isak Hansen wrote:

[#204636] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — "William James" <w_a_x_man@...> 2006/07/28

M. Edward (Ed) Borasky wrote:

[#204809] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/29

William James wrote:

[#204811] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — Chad Perrin <perrin@...> 2006/07/29

On Sat, Jul 29, 2006 at 12:22:05PM +0900, M. Edward (Ed) Borasky wrote:

[#204820] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/29

Chad Perrin wrote:

[#204832] Re: For performance, write it in C - Part 2, comparing C, Ruby and Java — Chad Perrin <perrin@...> 2006/07/29

On Sat, Jul 29, 2006 at 01:18:25PM +0900, M. Edward (Ed) Borasky wrote:

[#204915] Miscellanous Language Ranting (was Re: For performance, write it in C - Part 2, comparing C, Ruby and Java) — "M. Edward (Ed) Borasky" <znmeb@...> 2006/07/29

Chad Perrin wrote:

[#204471] Signaling Ruby from C/C++ — Asterix Gallier <asterixgallier@...>

Hello,

21 messages 2006/07/28
[#204816] Re: Signaling Ruby from C/C++ — "Suraj N. Kurapati" <skurapat@...> 2006/07/29

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

[#204481] Weird problem with case expressions — Daniel Schierbeck <daniel.schierbeck@...>

I have no problem doing this:

15 messages 2006/07/28

[#204492] Ruby::Tk on OS X event binding hint — Morton Goldberg <m_goldberg@...>

On Macintosh OS X, one can use 'Command' and 'Option' as Tk event

11 messages 2006/07/28

[#204544] state of unicode support — Chad Perrin <perrin@...>

I've heard rumors that "oniguruma fixes everything", and the like. I'm

23 messages 2006/07/28
[#204577] Re: state of unicode support — "Charles O Nutter" <headius@...> 2006/07/28

Oh man, I really don't have the energy for this thread again :) Chad: if you

[#204634] Re: state of unicode support — why the lucky stiff <ruby-talk@...> 2006/07/28

On Sat, Jul 29, 2006 at 01:08:06AM +0900, Charles O Nutter wrote:

[#204554] Using a '-' in a Key name in a Hash — Andrew Knott <aknott@...>

Hi,

13 messages 2006/07/28

[#204572] Re: state of unicode support — Chad Perrin <perrin@...>

On Sat, Jul 29, 2006 at 12:46:25AM +0900, Berger, Daniel wrote:

13 messages 2006/07/28
[#204583] Re: state of unicode support — Cliff Cyphers <cdc@...2go.com> 2006/07/28

Chad Perrin wrote:

[#204589] ruby threads? the point? — Eric Armstrong <Eric.Armstrong@...>

Saw an archived message yesterday that

26 messages 2006/07/28
[#204597] Re: ruby threads? the point? — Justin Collins <collinsj@...> 2006/07/28

Eric Armstrong wrote:

[#204705] Re: ruby threads? the point? — Eric Armstrong <Eric.Armstrong@...> 2006/07/28

Justin Collins wrote:

[#204709] Re: ruby threads? the point? — Justin Collins <collinsj@...> 2006/07/28

Eric Armstrong wrote:

[#204723] Re: ruby threads? the point? — "N Okia" <wrecklass1@...> 2006/07/28

Tested it with cygwin under Windows XP, and it worked fine. Again,

[#204742] Re: ruby threads? the point? — Eric Armstrong <Eric.Armstrong@...> 2006/07/28

N Okia wrote:

[#204749] Re: ruby threads? the point? — khaines@... 2006/07/28

On Sat, 29 Jul 2006, Eric Armstrong wrote:

[#204751] Re: ruby threads? the point? — Eric Armstrong <Eric.Armstrong@...> 2006/07/28

khaines@enigo.com wrote:

[#204610] Chip-8 (#88) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

19 messages 2006/07/28

[#204623] does ":" have an anolog in another language? — "Ike" <rxv@...>

does the colon operator have an anolog in say, Java or C++ ? It seems to be

28 messages 2006/07/28
[#204628] Re: does ":" have an anolog in another language? — Chad Perrin <perrin@...> 2006/07/28

On Sat, Jul 29, 2006 at 03:40:11AM +0900, Ike wrote:

[#204635] Re: does ":" have an anolog in another language? — "Matt Todd" <chiology@...> 2006/07/28

A simple way to describe it may be to look at it as a singleton object

[#204640] Re: does ":" have an anolog in another language? — Chad Perrin <perrin@...> 2006/07/28

On Sat, Jul 29, 2006 at 04:18:28AM +0900, Matt Todd wrote:

[#204657] Re: does ":" have an anolog in another language? — nothinghappens@...

Sorry if anyone's beat me to this, I find it hard to keep up with such a busy list...

12 messages 2006/07/28

[#204665] Finding "\" in a string — Eric Armstrong <Eric.Armstrong@...>

I'm going crazy, right? Surely it is possible

19 messages 2006/07/28

[#204975] TCPSocket and RFC 821 — "Satish Talim" <satish.talim@...>

I wanted to send an email from my desktop using a simple Ruby program.

17 messages 2006/07/30
[#205066] Re: TCPSocket and RFC 821 — Francis Cianfrocca <garbagecat10@...> 2006/07/30

Satish Talim wrote:

[#205111] Re: TCPSocket and RFC 821 — "Satish Talim" <satish.talim@...> 2006/07/31

I tried the various suggestions given by Francis and Yohanes, but still it

[#205075] Howto Delete 3 Leftmost Characters — "Skeets" <skillet3232@...>

i'm sure this is easy, but i've gone through Pickaxe's string methods,

18 messages 2006/07/30
[#205082] Re: Howto Delete 3 Leftmost Characters — Esteban Manchado Vel痙quez <zoso@...> 2006/07/30

On Mon, Jul 31, 2006 at 06:30:13AM +0900, Skeets wrote:

[#205116] Question regarding postings in comp.lang.ruby — "Michael W. Ryder" <_mwryder@...>

Why do I sometimes see replies to posts in this group but not the

22 messages 2006/07/31
[#205303] Re: Question regarding postings in comp.lang.ruby — "F. Senault" <fred@...> 2006/07/31

Le 31 juillet 2006 22:56, James Edward Gray II a 馗rit :

[#205305] Re: Question regarding postings in comp.lang.ruby — James Edward Gray II <james@...> 2006/08/01

On Jul 31, 2006, at 6:30 PM, F. Senault wrote:

[#205118] using the current method name within current method — "Matthew Heidemann" <matthew.heidemann@...>

Is there a way to get the current method name within the current method?

20 messages 2006/07/31
[#205120] Re: using the current method name within current method — Daniel Harple <dharple@...> 2006/07/31

On Jul 30, 2006, at 11:37 PM, Matthew Heidemann wrote:

[#205121] Re: using the current method name within current method — "Aleks Kissinger" <aleks0@...> 2006/07/31

This is kindof a hack, but it seems to work:

[#205130] Re: using the current method name within current method — "Matt Todd" <chiology@...> 2006/07/31

If you wanted to modularize it just for the sake of it, you could do

[#205150] Re: using the current method name within current method — Robert Klemme <shortcutter@...> 2006/07/31

Matt Todd wrote:

[#205243] Re: using the current method name within current method — Logan Capaldo <logancapaldo@...> 2006/07/31

[#205123] Environment variables with empty value missing from ENV? — Clifford Heath <no.spam@...>

Under Windows XP (using cygwin's bash, but native Ruby), I

12 messages 2006/07/31

[#205174] humanized Xml tree navigation — "chiaro scuro" <kiaroskuro@...>

Does anybody know of a library that allows to go through an xml tree as if

21 messages 2006/07/31

[#205207] Does Ruby need a "line separator" class? — Wes Gamble <weyus@...>

I've run into a problem where Ruby can't handle newlines on Windows

15 messages 2006/07/31
[#205219] Re: Does Ruby need a "line separator" class? — Xavier Noria <fxn@...> 2006/07/31

On Jul 31, 2006, at 5:40 PM, Wes Gamble wrote:

[#205256] I thought this was the one that worked? — Eric Armstrong <Eric.Armstrong@...>

#!/usr/bin/env ruby

139 messages 2006/07/31
[#205438] Re: I thought this was the one that worked? — "Just Another Victim of the Ambient Morality" <ihatespam@...> 2006/08/01

[#205444] Re: I thought this was the one that worked? — dblack@... 2006/08/01

Hi --

[#205506] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Tue, Aug 01, 2006 at 11:34:35PM +0900, dblack@wobblini.net wrote:

[#205266] Re: I thought this was the one that worked? — Logan Capaldo <logancapaldo@...> 2006/07/31

[#205268] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/07/31

On Tue, Aug 01, 2006 at 04:23:27AM +0900, Logan Capaldo wrote:

[#205277] Re: I thought this was the one that worked? — Logan Capaldo <logancapaldo@...> 2006/07/31

[#205286] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/07/31

On Tue, Aug 01, 2006 at 04:57:48AM +0900, Logan Capaldo wrote:

[#205290] Re: I thought this was the one that worked? — Logan Capaldo <logancapaldo@...> 2006/07/31

[#205297] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/07/31

On Tue, Aug 01, 2006 at 07:05:31AM +0900, Logan Capaldo wrote:

[#205307] Re: I thought this was the one that worked? — Logan Capaldo <logancapaldo@...> 2006/08/01

[#205323] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Tue, Aug 01, 2006 at 09:50:23AM +0900, Logan Capaldo wrote:

[#205331] Re: I thought this was the one that worked? — dblack@... 2006/08/01

Hi -

[#205369] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Tue, Aug 01, 2006 at 12:05:50PM +0900, dblack@wobblini.net wrote:

[#205406] Re: I thought this was the one that worked? — dblack@... 2006/08/01

Hi --

[#205496] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Tue, Aug 01, 2006 at 09:03:50PM +0900, dblack@wobblini.net wrote:

[#205505] Re: I thought this was the one that worked? — "Jacob Fugal" <lukfugl@...> 2006/08/01

On 8/1/06, Chad Perrin <perrin@apotheon.com> wrote:

[#205509] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Wed, Aug 02, 2006 at 04:56:53AM +0900, Jacob Fugal wrote:

[#205525] Re: I thought this was the one that worked? — "Jacob Fugal" <lukfugl@...> 2006/08/01

On 8/1/06, Chad Perrin <perrin@apotheon.com> wrote:

[#205533] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Wed, Aug 02, 2006 at 05:19:38AM +0900, Jacob Fugal wrote:

[#205472] Re: I thought this was the one that worked? — "Jacob Fugal" <lukfugl@...> 2006/08/01

On 8/1/06, Chad Perrin <perrin@apotheon.com> wrote:

[#205500] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Wed, Aug 02, 2006 at 01:28:45AM +0900, Jacob Fugal wrote:

[#205310] Re: I thought this was the one that worked? — "Just Another Victim of the Ambient Morality" <ihatespam@...> 2006/08/01

[#205416] Re: I thought this was the one that worked? — "Just Another Victim of the Ambient Morality" <ihatespam@...> 2006/08/01

[#205503] Re: I thought this was the one that worked? — Chad Perrin <perrin@...> 2006/08/01

On Tue, Aug 01, 2006 at 09:40:05PM +0900, Just Another Victim of the Ambient Morality wrote:

[#205515] Re: I thought this was the one that worked? — ara.t.howard@... 2006/08/01

On Wed, 2 Aug 2006, Chad Perrin wrote:

For performance, write it in C

From: Peter Hickman <peter@...>
Date: 2006-07-26 08:47:13 UTC
List: ruby-talk #203958
Whenever the question of performance comes up with scripting languages 
such as Ruby, Perl or Python there will be people whose response can be 
summarised as "Write it in C". I am one such person. Some people take 
offence at this and label us trolls or heretics of the true programming 
language (take your pick).

I am assuming here that when people talk about performance they really 
mean speed. Some will disagree but this is what I am talking about.

In this post I want to clear some things up and provide benchmarks as to 
why you should take "Write it in C" seriously. Personally I like to 
write my projects in Ruby or Perl or Python and then convert them to C 
to get a performance boost. How much of a boost? Well here I will give 
you some hard data and source code so that you can see just how much of 
a boost C can give you.

The mini project in question is to generate all the valid Latin squares. 
A Latin square is a grid of numbers (lets say a 9 x 9 grid) that has the 
numbers 1 to 9 appear only once in each row and column. Sudoku grids are 
a subset of Latin squares.

The approach taken is to create a list of all the permutations and then 
build up a grid row by row checking that the newly added row does not 
conflict with any of the previous rows. If the final row can be added 
without problem the solution is printed and the search for the next one 
starts. It is in essence depth first search. The first version of the 
program that I wrote in Perl took 473 minutes to generate all the valid 
5 x 5 Latin squares, version four of the program took 12 minutes and 51 
seconds. The C version of the program took 5.5 seconds to produce 
identical results. All run on the same hardware.

[Latin]$ time ./Latin1.pl 5 > x5

real    473m45.370s
user    248m59.752s
sys     2m54.598s  

[Latin]$ time ./Latin4.pl 5 > x5

real    12m51.178s
user    12m14.066s
sys     0m7.101s

[Latin]$ time ./c_version.sh 5

real    0m5.519s
user    0m4.585s
sys     0m0.691s

This is what I mean when I say that coding in C will improve the 
performance of your program. The improvement goes beyond percentages, it 
is in orders of magnitude. I think that the effort is worth it. If a 5 x 
5 grid with 120 permutations took 12 minutes in Perl, how long would a 6 
* 6 grid with 720 permutations take? What unit of measure would you be 
using for a 9 x 9 grid?

Size   Permutations
====   ============
   1              1
   2              2
   3              6
   4             24
   5            120
   6            720
   7           5040
   8          40320
   9         362880

Now lets look at first version of the code:

     1  #!/usr/bin/perl -w

     2  use strict;
     3  use warnings;

     4  use Algorithm::Permute;

     5  my $width_of_board = shift;

     6  my @permutations;

     7  my $p = new Algorithm::Permute( [ 1 .. $width_of_board ] );

     8  while ( my @res = $p->next ) {
     9      push @permutations, [@res];
    10  }
    11  my $number_of_permutations = scalar(@permutations);

    12  for ( my $x = 0 ; $x < $number_of_permutations ; $x++ ) {
    13      add_a_line($x);
    14  }

Lines 1 to 11 just build up a list of all the permutations using the 
handy Algorithm::Permute module from CPAN. Lines 12 to 14 starts on the 
first row of the solution by trying out all possible permutations for 
the first row.

    15  sub add_a_line {
    16      my @lines = @_;

    17      my $size = scalar(@lines);

    18      my $ok = 1;
    19      for ( my $x = 0 ; $x < $size ; $x++ ) {
    20          for ( my $y = 0 ; $y < $size ; $y++ ) {
    21              if ( $x != $y ) {
    22                  $ok = 0 unless compare( $lines[$x], $lines[$y] );
    23              }
    24          }
    25      }

    26      if ($ok) {
    27          if ( $size == $width_of_board ) {
    28              print join(':', map { p($_) } @lines) . "\n";
    29          }
    30          else {
    31              for ( my $x = 0 ; $x < $number_of_permutations ; 
$x++ ) {
    32                  add_a_line( @lines, $x );
    33              }
    34          }
    35      }
    36  }

The add_a_line() function first checks that none of the lines so far 
conflict (have the same digit in the same column), if it passes and the 
number of lines equals the size of the board then the result is printed 
and another solution is looked for. Failing that another line is added 
and add_a_line() is called.

Here is the function that tells if two lines conflict.

    37  sub compare {
    38      my ( $a, $b ) = @_;

    39      my $ok = 1;

    40      my @aa = @{ $permutations[$a] };
    41      my @bb = @{ $permutations[$b] };

    42      for ( my $x = 0 ; $x < $width_of_board ; $x++ ) {
    43          $ok = 0 if $aa[$x] == $bb[$x];
    44      }

    45      return $ok == 1;
    46  }

The p() function is a little utility to convert a list into a string for 
display.

    47  sub p {
    48      my ($x) = @_;

    49      my @a = @{ $permutations[$x] };
    50      my $y = join( '', @a );

    51      return $y;
    52  }

Well I have just exposed some pretty crap code to eternal ridicule on 
the internet, but there you have it. The code is crap, even non Perl 
programmers will be able to point out the deficenties with this code. It 
works, even though a 5 x 5 grid took 473 minutes to run. Lets try and 
salvage some pride and show version four and see how we managed to speed 
things up.

     1  #!/usr/bin/perl -w

     2  use strict;
     3  use warnings;

     4  use Algorithm::Permute;

     5  my $width_of_board = shift;

     6  my @permutations;
     7  my @output;
     8  my %compared;

     9  my $p = new Algorithm::Permute( [ 1 .. $width_of_board ] );

    10  while ( my @res = $p->next ) {
    11      push @permutations, [@res];
    12      push @output, join( '', @res );
    13  }
    14  my $number_of_permutations = scalar(@permutations);

Lines 1 to 14 are doing pretty much what version one was doing except 
that a new list, @output, is being built up to precalculate the output 
strings and remove the need for the p() function. A minor speed up but 
useful.

    15  for ( my $x = 0 ; $x < $number_of_permutations ; $x++ ) {
    16      for ( my $y = 0 ; $y < $number_of_permutations ; $y++ ) {
    17          my $ok = 1;

    18          my @aa = @{ $permutations[$x] };
    19          my @bb = @{ $permutations[$y] };

    20          for ( my $z = 0 ; $z < $width_of_board ; $z++ ) {
    21              if ( $aa[$z] == $bb[$z] ) {
    22                  $ok = 0;
    23                  last;
    24              }
    25          }

    26          if ( $ok == 1 ) {
    27              $compared{"$x:$y"} = 1;
    28          }
    29      }
    30  }

Lines 15 to 30 introduces new code to precalculate the comparisons and 
feed the results into a hash. Lines 31 to 33 start the work in the same 
way as version one.

    31  for ( my $x = 0 ; $x < $number_of_permutations ; $x++ ) {
    32      add_a_line($x);
    33  }

And now to the improved add_a_line() function. The code has been 
improved to only check that the newly added line does not conflict with 
any of the existsing lines rather than repeatedly comparing the existing 
(valid) lines.

    34  sub add_a_line {
    35      my @lines = @_;

    36      my $size = scalar(@lines);

    37      my $ok = 1;

    38      if ( $size > 1 ) {
    39          for ( my $x = 0 ; $x < ( $size - 1 ) ; $x++ ) {
    40              unless ( defined $compared{ $lines[$x] .':'. 
$lines[-1] } ) {
    41                  $ok = 0;
    42                  last;
    43              }
    44          }
    45      }

    46      if ($ok) {
    47          if ( $size == $width_of_board ) {
    48              print join( ':', map { $output[$_] } @lines ) . "\n";
    49          }
    50          else {
    51              for ( my $x = 0 ; $x < $number_of_permutations ; 
$x++ ) {
    52                  add_a_line( @lines, $x );
    53              }
    54          }
    55      }
    56  }

These changes took us down from 473 minutes to just 12. The elimination 
of unnessessary comparisons in add_a_line() helped as did the 
precalculation of those comparisons. There are lessons to be learnt 
here, write decent code and cache repetetive comparisons. There are no 
great tricks, just that bad code can cost you dearly and simple things 
can bring big improvements. So with such a massive improvement how could 
we make our code any faster?

Write it in C.

Having learnt the lessons developing the code in Perl I am not going to 
start the whole thing over in C. Using version four I used the 
precalculation phase of the Perl scripts to write out a C header file 
with data structures that would be useful for the C program.

     1  #define WIDTH_OF_BOARD 5
     2  #define NUMBER_OF_PERMUTATIONS 120
     3  char *output_strings[] = {
     4      "54321",

   123      "12345",
   124  };
   125  bool compared[NUMBER_OF_PERMUTATIONS][NUMBER_OF_PERMUTATIONS] = {
   126      {false, false, ...

   245      {false, false, ...
   246  };
   247  int work[WIDTH_OF_BOARD];

This then leaves the C code itself. Lines 1 to 7 includes a load of 
useful stuff, infact it is also probably including some quite 
unneccessary stuff too, I just cut and paste it from another project.

     1  #include <stdio.h>
     2  #include <stdlib.h>
     3  #include <stdbool.h>
     4  #include <err.h>
     5  #include <string.h>
     6  #include <unistd.h>
     7  #include <sys/types.h>

Line 8 is the header file that Perl precalculated.

     8  #include "Latin.h"

Now the meat. The code is pretty much the same as version four just 
adapted to C. No special C tricks, no weird pointer stuff, an almost 
line for line translation of the Perl code.

     9  void
    10  add_a_row(int row)
    11  {
    12      bool            is_ok;
    13      int             x,y;

    14      if (row == WIDTH_OF_BOARD) {
    15          for (x = 0; x < WIDTH_OF_BOARD; x++) {
    16              if (x == 0) {
    17                  printf("%s", output_strings[work[x]]);
    18              } else {
    19                  printf(":%s", output_strings[work[x]]);
    20              }
    21          }
    22          puts("");
    23      } else {
    24          for (x = 0; x < NUMBER_OF_PERMUTATIONS; x++) {
    25              work[row] = x;

    26              is_ok = true;
    27              if (row != 0) {
    28                  for( y = 0; y < row; y++ ) {
    29                      if(compared[work[row]][work[y]] == false) {
    30                          is_ok = false;
    31                          break;
    32                      }
    33                  }
    34              }
    35              if (is_ok == true) {
    36                  add_a_row(row + 1);
    37              }
    38          }
    39      }
    40  }

    41  int
    42  main(int argc, char *argv[])
    43  {
    44      add_a_row(0);
    45  }

And the C version ran in 5.5 seconds. In fact the 5.5 seconds includes 
the Perl program that does all the precalculation to write the Latin.h 
header file, the compiling of the C source and finally the running of 
the program itself. So we have not cheated by doing some work outside 
the timings.

Just think of it, 12 minutes down to 5.5 seconds without having to write 
any incomprehensible C code. Because we all know that C code is 
completely incomprehensible with it doing all that weird pointer stuff 
all the time.

Now the Perl code could be improved, there are tricks that could be 
pulled out of the bag to trim something off the 12 minutes. Perhaps 
another language would be faster? But how far could you close the gap 
from 12 minutes to 5.5 seconds?

Just to up the ante I added -fast -mcpu=7450 to the compiler (gcc 
optimized for speed on an G4 Macintosh) and ran it again.

[Latin]$ time ./c_version.sh 5 > x5

real    0m3.986s
user    0m2.810s
sys     0m0.540s

Another 30% performance improvement without changing any code.

Lets review the languages we have used and their advantages. C is very 
fast without any stupid tricks. C will give you better control over the 
amount of memory you use (the Perl code eats up massive amounts of 
memory in comparison, the 9 x 9 grid threw an out of memory error on my 
1Gb machine).

It is much easier to develop in Perl. Any error message you get is 
likely to at least give you a clue as to what the problem might be. C 
programmers have to put up with the likes of 'Bus error' or 
'Segmentation fault', which is why C programmers are grouches. Perl also 
allows you to significantly improve your code without major rewrites. 
There is a module called Memoize that can wrap a function and cache the 
calls all by adding two extra lines to your code, the same is true for 
most scripting languages.

So what am I recommending here, write all your programs in C? No. Write 
all your programs in Perl? No. Write them in your favourite scripting 
language to refine the code and then translate it into C if the 
performance falls short of your requirements. Even if you intend to 
write it in C all along hacking the code in Perl first allows you to 
play with the algorithm without having to worry about memory allocation 
and other such C style house keeping. Good code is good code in any 
language.

If you really really want that performance boost then take the following 
advice very seriously - "Write it in C".


In This Thread

Prev Next