[#140667] Thinking of creating a small mini-language-interpreter using Ruby — Glenn Smith <glenn.ruby@...>

Always something I've wanted to write - an interpreter of my own. Now

12 messages 2005/05/01

[#140714] Ruby, Rails and now og — "Andrew Ballantine" <andrew.ballantine@...>

Hi,

16 messages 2005/05/02

[#140808] Re: "Bounty" approach for small pieces of code? — Hal Fulton <hal9000@...>

Molitor, Stephen L wrote:

12 messages 2005/05/03
[#140810] Re: "Bounty" approach for small pieces of code? — Richard Lyman <lymans@...> 2005/05/03

On 5/2/05, Hal Fulton <hal9000@hypermetrics.com> wrote:

[#140856] Bug Tracker — Andy Stone <xsltguru@...>

Hello all,

28 messages 2005/05/03

[#140910] Typo-checking instead of static typing — Ben Giddings <bg-rubytalk@...>

Once again, static typing reared its head on the mailing list, and once

31 messages 2005/05/03

[#140928] Re: [ANN] traits-0.0.0 — "Berger, Daniel" <Daniel.Berger@...>

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

16 messages 2005/05/03

[#141015] writing to a file with gsub! — Ralf Mler <r_mueller@...>

Hi,

12 messages 2005/05/04

[#141023] Object#inside_metaclass? — "Ara.T.Howard" <Ara.T.Howard@...>

56 messages 2005/05/04
[#141045] Re: [RCR] Object#inside_metaclass? — "David A. Black" <dblack@...> 2005/05/04

On Wed, 4 May 2005, Ara.T.Howard wrote:

[#141050] Re: [RCR] Object#inside_metaclass? — Ilias Lazaridis <ilias@...> 2005/05/04

David A. Black wrote:

[#141522] Re: [RCR] Object#inside_metaclass? — Yukihiro Matsumoto <matz@...> 2005/05/07

Hi,

[#141533] Re: [RCR] Object#inside_metaclass? — Ilias Lazaridis <ilias@...> 2005/05/07

Yukihiro Matsumoto wrote:

[#141548] Re: [RCR] Object#inside_metaclass? — Yukihiro Matsumoto <matz@...> 2005/05/07

In message "Re: [RCR] Object#inside_metaclass?"

[#141550] Re: [RCR] Object#inside_metaclass? — Ilias Lazaridis <ilias@...> 2005/05/07

Yukihiro Matsumoto wrote:

[#141575] Re: [RCR] Object#inside_metaclass? — Yukihiro Matsumoto <matz@...> 2005/05/07

[#141057] Fixnum's binary representation — camsight@...

Hi, people!

13 messages 2005/05/04

[#141143] Re: object reference handle (like perl's reference to scalar) — Eric Mahurin <eric_mahurin@...>

> > In ruby, is there a way to get a handle of an object

17 messages 2005/05/04

[#141165] Ruby Editor Plugin for jEdit 0.6 - method completion release — "Rob ." <rob.02004@...>

Version 0.6 of jEdit's Ruby Editor Plugin has been released and is

21 messages 2005/05/05
[#141176] Re: [ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release — Alexandru Popescu <the_mindstorm@...> 2005/05/05

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

[#141186] Re: [ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release — "Rob ." <rob.02004@...> 2005/05/05

Alexandru Popescu wrote:> Rob . said:> > Version 0.6 of jEdit's Ruby Editor Plugin has been released and is> > available for download!> >> > http://www.jedit.org/ruby/> > Great job Rob!Mulmesc!

[#141205] Re: [ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release — Tom Copeland <tom@...> 2005/05/05

On Thu, 2005-05-05 at 18:38 +0900, Rob . wrote:

[#141219] Re: [ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release — Alexandru Popescu <the_mindstorm@...> 2005/05/05

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

[#141225] Re: [ANN] Ruby Editor Plugin for jEdit 0.6 - method completion release — "Rob ." <rob.02004@...> 2005/05/05

Alex, I don't get an exception in this case, but I see what you mean.

[#141196] Whats so different about a Hash? — Andrew Walrond <andrew@...>

Consider:

15 messages 2005/05/05
[#141197] Re: Whats so different about a Hash? — Brian Schrer <ruby.brian@...> 2005/05/05

On 05/05/05, Andrew Walrond <andrew@walrond.org> wrote:

[#141199] Re: Whats so different about a Hash? — Andrew Walrond <andrew@...> 2005/05/05

Hi Brian,

[#141299] another Tk question — Joe Van Dyk <joevandyk@...>

In Tk, what's the best way to show a large table of data that gets

15 messages 2005/05/05
[#141326] Re: another Tk question — Hidetoshi NAGAI <nagai@...> 2005/05/06

From: Joe Van Dyk <joevandyk@gmail.com>

[#141307] String Manipulation Nuby Question — Chris Roos <chris@...>

I have a Person with title, forename and surname (all of which are

13 messages 2005/05/05

[#141311] Ruby Editor Plugin for jEdit 0.6.1 - method completion release II — "Rob ." <rob.02004@...>

Version 0.6.1 of jEdit's Ruby Editor Plugin has been released and is

12 messages 2005/05/05

[#141334] RCR 303: nil should accept missing methods and return nil — John Carter <john.carter@...>

A very simple and generic way of improving the reliability of Ruby

66 messages 2005/05/06
[#141338] Re: RCR 303: nil should accept missing methods and return nil — Luke Graham <spoooq@...> 2005/05/06

On 5/6/05, John Carter <john.carter@tait.co.nz> wrote:

[#141339] Re: RCR 303: nil should accept missing methods and return nil — Hal Fulton <hal9000@...> 2005/05/06

Luke Graham wrote:

[#141345] Re: RCR 303: nil should accept missing methods and return nil — John Carter <john.carter@...> 2005/05/06

On Fri, 6 May 2005, Hal Fulton wrote:

[#141340] Prove me Wrong! Re: RCR 303: nil should accept missing methods — John Carter <john.carter@...> 2005/05/06

On Fri, 6 May 2005, Alexey Verkhovsky wrote:

[#141349] What sound does no duck make? — John Carter <john.carter@...>

Imagine a flock of ducks in the sky. Listen.

13 messages 2005/05/06

[#141368] Re: compiler error: argument of type "VALUE *" is incompatible with parameter of type "VALUE" — me2faster@...

On May 5, 2005, at 2:44 PM, me2faster@excite.com wrote:

10 messages 2005/05/06

[#141529] [NITRO] - Mr. George Moschovitis applies Censorship on Public Project Forum — Ilias Lazaridis <ilias@...>

To understand further the _real_ difference between Nitro/Og and

25 messages 2005/05/07

[#141530] [NITRO] - Mr. Moschovitis Revolutionary Redefinition of an Open Source Project — Ilias Lazaridis <ilias@...>

George Moschovitis wrote

15 messages 2005/05/07

[#141576] HighLine 0.4.0 — James Edward Gray II <james@...>

HighLine 0.4.0 Released

29 messages 2005/05/07
[#141616] Re: HighLine 0.4.0 — "Vincent Foley" <vfoley@...> 2005/05/07

Hello James,

[#141618] Re: HighLine 0.4.0 — James Edward Gray II <james@...> 2005/05/07

On May 7, 2005, at 4:19 PM, Vincent Foley wrote:

[#141598] Vacation - email me when Ilias is gone or people FINALLY stop responding to him — Ryan Davis <ryand-ruby@...>

The signal:noise ratio on this list is terrible. I'm taking a

12 messages 2005/05/07
[#141647] Re: Vacation - email me when I. is gone or people FINALLY stop responding to him — Bertram Scharpf <lists@...> 2005/05/08

Hi,

[#141615] - Sterile Classes / Sterile Meta Classes — Ilias Lazaridis <ilias@...>

Another suggestion for the "Ruby Singleton Classes" or "Exclusive Classes":

72 messages 2005/05/07
[#141681] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Yukihiro Matsumoto <matz@...> 2005/05/08

In message "Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes"

[#141709] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Carlos <angus@...> 2005/05/08

[Yukihiro Matsumoto <matz@ruby-lang.org>, 2005-05-08 17.13 CEST]

[#141710] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Hal Fulton <hal9000@...> 2005/05/08

Carlos wrote:

[#141715] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Yukihiro Matsumoto <matz@...> 2005/05/08

Hi,

[#141719] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — "David A. Black" <dblack@...> 2005/05/08

Hi --

[#141748] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Yukihiro Matsumoto <matz@...> 2005/05/08

Hi,

[#141810] Re: [ETYMOLOGY] - Sterile Classes / Sterile Meta Classes — Yukihiro Matsumoto <matz@...> 2005/05/09

Hi,

[#141655] No Thing Here vs Uninitialized and RCR 303 — Cyent <cyent@...>

I'm observing a general trend in the responses to RCR 303.

26 messages 2005/05/08
[#141745] Re: No Thing Here vs Uninitialized and RCR 303 — Lionel Thiry <lthiryidontwantspam@...> 2005/05/08

Cyent a 馗rit :

[#141746] Re: No Thing Here vs Uninitialized and RCR 303 — Bill Atkins <batkins57@...> 2005/05/08

This isn't about changing programming habits. Having nil return nil

[#141707] Singleton class terminology — Hal Fulton <hal9000@...>

Just expressing my opinion here.

16 messages 2005/05/08

[#141776] Stats comp.lang.ruby (last 7 days) — Balwinder Singh Dheeman <bsd.SANSPAM@...>

Stats comp.lang.ruby (last 7 days)

15 messages 2005/05/09

[#141875] How to extract texts from html source? — "Sam Kong" <sam.s.kong@...>

Hi, all!

14 messages 2005/05/09

[#141900] Still umlauts — Bertram Scharpf <lists@...>

Hi,

8 messages 2005/05/09
[#142448] Re: Still umlauts — "Josef 'Jupp' SCHUGT" <jupp@...> 2005/05/12

Hi!

[#142507] Re: Still umlauts — Bertram Scharpf <lists@...> 2005/05/13

Hi,

[#142514] Re: Still umlauts — Jonas Hartmann <Mail@...> 2005/05/13

Bertram Scharpf wrote:

[#142527] Re: Still umlauts — =?WINDOWS-1252?Q?Brian_Schr=F6der?= <ruby.brian@...> 2005/05/13

On 13/05/05, Jonas Hartmann <Mail@jonas-hartmann.com> wrote:> Bertram Scharpf wrote:> > Hi,> >> > Am Freitag, 13. Mai 2005, 04:34:00 +0900 schrieb Josef 'Jupp' SCHUGT:> >> >>At Tue, 10 May 2005 06:58:30 +0900, Bertram Scharpf wrote:> >>> >>>does this no longer work?> >>> >>You forgot to define the meaning of 'no longer works':> >>> >> - What precisely do you mean by 'it works'?> >> >> > Sorry, that was not actually elaborate. Now I think it> > never worked at all.> >> >> >>>--------------------> >>>#!/usr/bin/env ruby> >>># -*- coding: UTF-8 -*-> >>>> >>>puts $KCODE> >>>puts "蔕ヨワ゜"> >>>--------------------> >>>> >>>I tried it with Ruby 1.8.2 and 1.9, Debian Linux.> >>>What do I miss?> >> >> > In the meantime I received an answer in ruby-core and it> > seems Matz just _planned_ to implement it but didn't have> > the time yet.> >> > The problem arises when my program is run on SuSE Linux> > where the default encoding is UTF-8.> >> > A better way to test in which encoding you reside is:> >> > "テ =~ /./> > puts $&.length> >> > This gives 1 in `None' and 2 in `UTF-8'.> >> >> >>When in doubt *set* $KCODE explicitly.> >> >> > This has no influence on how the source code is read. The> > string " produces an error when `ruby -Ku' is called.> >> > Of course I should have written "\xc3\xa4" and "\xc3".> > Is this the only way to handle strings UTF-8 in ruby?> > >> > Sorry again for the noise.> >> > Bertram> >> >> > regards> jonas> >

[#141958] Redesign 2005, Round Two — why the lucky stiff <ruby-talk@...>

I'm happy to say that our little redesign team has come to accord on a

80 messages 2005/05/10
[#142020] Re: [ANN] Redesign 2005, Round Two — gabriele renzi <surrender_it@...> 2005/05/10

why the lucky stiff ha scritto:

[#142033] Re: [ANN] Redesign 2005, Round Two — Ilias Lazaridis <ilias@...> 2005/05/10

why the lucky stiff wrote:

[#142041] Re: [ANN] Redesign 2005, Round Two — Mark Hubbart <discordantus@...> 2005/05/10

On 5/10/05, Ilias Lazaridis <ilias@lazaridis.com> wrote:

[#142057] Re: [ANN] Redesign 2005, Round Two — Nikolai Weibull <mailing-lists.ruby-talk@...> 2005/05/10

Mark Hubbart, May 11:

[#142196] Re: Redesign 2005, Round Two — "Karl von Laudermann" <doodpants@...> 2005/05/11

[#142219] Re: Redesign 2005, Round Two — "David A. Black" <dblack@...> 2005/05/11

Hi --

[#142221] Re: Redesign 2005, Round Two — James Britt <james_b@...> 2005/05/11

David A. Black wrote:

[#142237] Re: Redesign 2005, Round Two — "Ryan Leavengood" <mrcode@...> 2005/05/11

James Britt wrote:

[#142252] Re: Redesign 2005, Round Two — "David A. Black" <dblack@...> 2005/05/11

Hi --

[#142267] Re: Redesign 2005, Round Two — James Britt <james_b@...> 2005/05/11

David A. Black wrote:

[#142274] Re: Redesign 2005, Round Two — "John W. Long" <ng@...> 2005/05/11

James Britt wrote:

[#142302] Re: Redesign 2005, Round Two — Yukihiro Matsumoto <matz@...> 2005/05/12

[#142054] String Hashing Algorithms — "Phrogz" <gavin@...>

Summary

16 messages 2005/05/10

[#142129] options parsing: required and conflict — Kirill Shutemov <k.shutemov@...>

Can I define options dependencies using OptionParser?

13 messages 2005/05/11
[#142130] Re: options parsing: required and conflict — "Robert Klemme" <bob.news@...> 2005/05/11

Kirill Shutemov wrote:

[#142133] ruby vs. java? — "Franz Hartmann" <porschefranz@...>

Hello all,

61 messages 2005/05/11
[#142136] Re: ruby vs. java? — Michael Ulm <michael.ulm@...> 2005/05/11

Franz Hartmann wrote:

[#142141] Re: ruby vs. java? — "Franz Hartmann" <porschefranz@...> 2005/05/11

Hello Michael and all of you,

[#142149] Re: ruby vs. java? — Logan Capaldo <logancapaldo@...> 2005/05/11

On 5/11/05, Franz Hartmann <porschefranz@hotmail.com> wrote:

[#142155] Re: ruby vs. java? — "Franz Hartmann" <porschefranz@...> 2005/05/11

Hello Logan,

[#142166] Re: ruby vs. java? — Ralf Mler <r_mueller@...> 2005/05/11

[#142171] Re: ruby vs. java? — "Franz Hartmann" <porschefranz@...> 2005/05/11

Ralf,

[#142176] Re: ruby vs. java? — Ralf Mler <r_mueller@...> 2005/05/11

> (physician = Arzt, physicist = Physiker) :-)))

[#142224] alternatives to ? : contruct — "John-Mason P. Shackelford" <jpshack@...>

As an alternative to:

21 messages 2005/05/11

[#142260] Re: object loops and what they return — Eric Mahurin <eric_mahurin@...>

That sure looks ugly. I don't see any advantage of this over:

33 messages 2005/05/11
[#142359] Re: {} vs begin/end [was Re: object loops and what they return] — "Robert Klemme" <bob.news@...> 2005/05/12

Brian Schrer wrote:

[#142379] Re: {} vs begin/end [was Re: object loops and what they return] — "Jim Weirich" <jim@...> 2005/05/12

[#142268] Request for advice on applying a license — Nikolai Weibull <mailing-lists.ruby-talk@...>

Hi!

14 messages 2005/05/11
[#142276] Re: [OT] Request for advice on applying a license — Ben Giddings <bg-rubytalk@...> 2005/05/11

On Wednesday 11 May 2005 18:59, Nikolai Weibull wrote:

[#142370] Re: [OT] Request for advice on applying a license — Christian Neukirchen <chneukirchen@...> 2005/05/12

Ben Giddings <bg-rubytalk@infofiend.com> writes:

[#142342] Go through directories recursively — Jens Riedel <JensRie@...>

Hello,

17 messages 2005/05/12

[#142378] Amazing Mazes (#31) — Ruby Quiz <james@...>

Wow, these solutions are great fun to play with. I think next week's quiz needs

16 messages 2005/05/12

[#142404] We need a comprehensive test suite — Daniel Berger <djberge@...>

All,

12 messages 2005/05/12

[#142462] Get back data from a child (with exec) — Lawrence Oluyede <raims@...>

13 messages 2005/05/12

[#142620] ruby in WinXP as an automation tool — "kevin.gc@..." <kevin.gc@...>

Can anyone tell me if it can be done?

19 messages 2005/05/14

[#142671] infinite number of singleton_classes — Lionel Thiry <lthiryidontwantspam@...>

Hello!

37 messages 2005/05/15
[#142710] Re: infinite number of singleton_classes — Ara.T.Howard@... 2005/05/15

On Sun, 15 May 2005, Lionel Thiry wrote:

[#142745] Re: infinite number of singleton_classes — Lionel Thiry <lthiryidontwantspam@...> 2005/05/15

Ara.T.Howard@noaa.gov a 馗rit :

[#142746] Re: infinite number of singleton_classes — Hal Fulton <hal9000@...> 2005/05/15

Lionel Thiry wrote:

[#142711] Re: infinite number of singleton_classes — "David A. Black" <dblack@...> 2005/05/15

Hi --

[#142806] IRB, Mac OS X, command-line require via "-r" and Bus Errors — "James Adam" <james.adam@...>

Hey All,

22 messages 2005/05/16

[#142808] Ruby Weekly News 2nd - 15th May 2005 — timsuth@... (Tim Sutherland)

http://www.rubyweeklynews.org/20050515.html

15 messages 2005/05/16
[#143444] Array.=== Bug, Rails Bug, or brain failure? — Markus <markus@...> 2005/05/23

I've got some rails code that is failing in a very strange way. It is

[#143447] Re: Array.=== Bug, Rails Bug, or brain failure? — Jamis Buck <jamis@37signals.com> 2005/05/23

Markus,

[#143449] Re: Array.=== Bug, Rails Bug, or brain failure? — Markus <markus@...> 2005/05/23

[#142894] Google API, Soap and windows XP — ruby talk <rubytalk@...>

Hello,I am playing with the google api and soap. I have the newest versionof soap and i think ruby 1.8. I created my code on a laptop withmandrake 10.2 with the same version of ruby and soap. On my laptop itworks fine. On my windows computer it give me an error."F:\Documents and Settings\iv\Desktop\googlerip>ruby googled.rbmonkey filetype:pdfLoading compatibility library...c:/ruby/lib/ruby/1.8/xsd/datatypes.rb:172:in `_set': {http://www.w3.org/2001/XMLSchema}string: cannot accept '<b>...</b> Tibetan year of the <b>monkey</b>. These instructions are traditionally given <b>...</b><br> thus will give the rare ΓÇÖ<b>Monkey</b>-Year-TeachingsΓÇÖ after the inauguration in <b>...</b>'. (XSD::ValueSpaceError) from c:/ruby/lib/ruby/1.8/xsd/datatypes.rb:114:in `set' from c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:453:in `decode_textbuf' from c:/ruby/lib/ruby/1.8/soap/encodingstyle/soapHandler.rb:214:in `decode_tag_end' from c:/ruby/lib/ruby/1.8/soap/parser.rb:185:in `decode_tag_end' from c:/ruby/lib/ruby/1.8/soap/parser.rb:146:in `end_element' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/parser.rb:75:in `end_element' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:36:in `do_parse' from c:/ruby/lib/ruby/1.8/xsd/xmlparser/xmlparser.rb:31:in `parse' ... 7 levels... from (eval):2:in `doGoogleSearch' from googled.rb:16 from googled.rb:15:in `each' from googled.rb:15"

2 messages 2005/05/17

[#142901] Help regarding def wrapper — Nikolai Weibull <mailing-lists.ruby-talk@...>

I窶囘 like to have a def that I can scope in one go, i.e.,

17 messages 2005/05/17

[#143041] Compiling MySQL-Ruby on Tiger — "pat allan" <pat.allan@...>

Hi all

21 messages 2005/05/18

[#143087] (newbie Q) opposite of inspect for strings — "Basile Starynkevitch [news]" <basile-news@...>

14 messages 2005/05/18

[#143225] Re: Multiple return and parallel assignement — Eric Mahurin <eric_mahurin@...>

25 messages 2005/05/20

[#143229] Web services and Ruby — Luke Kanies <luke@...>

Hi all,

17 messages 2005/05/20

[#143252] HighLine 0.6.0 -- Now with menus! — James Edward Gray II <james@...>

HighLine 0.6.0 Released

18 messages 2005/05/20

[#143305] join not in Enumerable — Logan Capaldo <logancapaldo@...>

Just a few minutes ago I was playing with irb as I am wont to do, and

14 messages 2005/05/21

[#143328] Vim's Ruby indenting — "Vincent Foley" <vfoley@...>

Hi to all the vim users,

17 messages 2005/05/22

[#143337] Uniform vector class, inheriting from Array: How to make sure that methods return a Vector and not an Array? — Thomas <sanobast-2005a@...>

Hi folks,

8 messages 2005/05/22
[#143342] Re: Uniform vector class, inheriting from Array: How to make sure that methods return a Vector and not an Array? — Brian Schrer <ruby.brian@...> 2005/05/22

On 22/05/05, Thomas <sanobast-2005a@yahoo.de> wrote:

[#143366] Stats comp.lang.ruby (last 7 days) — Balwinder Singh Dheeman <bsd.SANSPAM@...>

Stats comp.lang.ruby (last 7 days)

11 messages 2005/05/23

[#143375] sciTe editor IRB window getting double characters — "soxinbox" <faker@...>

Has any one had a problem with the latest release of Ruby and the included

10 messages 2005/05/23

[#143515] if __FILE_ == $0 executed twice — Han Holl <han.holl@...>

Hello,

21 messages 2005/05/24

[#143550] new article — pat eyler <pat.eyler@...>

Sorry for posting about my own article, but I'm interested in feedback,

24 messages 2005/05/24

[#143655] A different perspective on Ruby. — ES <ruby-ml@...>

47 messages 2005/05/26
[#143681] Re: A different perspective on Ruby. — "gsinclair@..." <gsinclair@...> 2005/05/26

ES wrote:

[#143683] Re: A different perspective on Ruby. — Brian Schrer <ruby.brian@...> 2005/05/26

On 26/05/05, gsinclair@gmail.com <gsinclair@gmail.com> wrote:

[#143705] Intellisense and the psychology of typing — andrew.queisser@...

Yesterday I typed in some C++ code that called a function with two

50 messages 2005/05/26
[#143710] Re: Intellisense and the psychology of typing — Thomas Adam <thomas@...> 2005/05/26

On Fri, May 27, 2005 at 01:35:19AM +0900, andrew.queisser@hp.com wrote:

[#143716] Re: Intellisense and the psychology of typing — Lothar Scholz <mailinglists@...> 2005/05/26

Hello Thomas,

[#144032] Re: Intellisense and the psychology of typing — Richard Cole <rcole@...> 2005/05/30

Lothar Scholz wrote:

[#144040] Re: Intellisense and the psychology of typing — Austin Ziegler <halostatue@...> 2005/05/30

On 5/30/05, Richard Cole <rcole@itee.uq.edu.au> wrote:

[#144080] Re: Intellisense and the psychology of typing — Lothar Scholz <mailinglists@...> 2005/05/31

Hello Austin,

[#144088] Re: Intellisense and the psychology of typing — Austin Ziegler <halostatue@...> 2005/05/31

On 5/31/05, Lothar Scholz <mailinglists@scriptolutions.com> wrote:

[#144109] Re: Intellisense and the psychology of typing — Caleb Clausen <vikkous@...> 2005/05/31

Austin Ziegler wrote:

[#144114] Re: Intellisense and the psychology of typing — Austin Ziegler <halostatue@...> 2005/05/31

On 5/31/05, Caleb Clausen <vikkous@gmail.com> wrote:

[#144124] Re: Intellisense and the psychology of typing — Eric Mahurin <eric_mahurin@...> 2005/05/31

--- Austin Ziegler <halostatue@gmail.com> wrote:

[#143799] Plz comment — Dr Balwinder S Dheeman <bsd.SANSPAM@...>

Dear Rubiest!

22 messages 2005/05/27

[#143812] Ruby on Rails interest in comp.lang.python — Stephen Kellett <snail@...>

A heads up to the Rails folks.

14 messages 2005/05/27

[#143825] How to build an index of phrases in a phrase/sentence? — Dan Fitzpatrick <dan@...>

I am trying to build an indexing structure on some phrases. Most phrases

11 messages 2005/05/27

[#143884] preventing Object#send from dispatching to a global method? — Francis Hwang <sera@...>

Is there a way to prevent Object#send from dispatching to a global

17 messages 2005/05/28
[#143908] Re: preventing Object#send from dispatching to a global method? — Jim Weirich <jim@...> 2005/05/29

[#143975] Ruby-VTK-0.2.0 was released — Seiya Nishizawa <seiya@...>

Hi everyone,

11 messages 2005/05/30

[#143976] Stats comp.lang.ruby (last 7 days) — Balwinder Singh Dheeman <bsd.SANSPAM@...>

Stats comp.lang.ruby (last 7 days)

26 messages 2005/05/30
[#144084] Re: Stats comp.lang.ruby (last 7 days) — "David A. Black" <dblack@...> 2005/05/31

On Mon, 30 May 2005, Balwinder Singh Dheeman wrote:

[#144107] Re: Stats comp.lang.ruby (last 7 days) — pat eyler <pat.eyler@...> 2005/05/31

On 5/31/05, David A. Black <dblack@wobblini.net> wrote:

[#144113] Re: Stats comp.lang.ruby (last 7 days) — James Britt <james_b@...> 2005/05/31

pat eyler wrote:

[#144144] Re: Stats comp.lang.ruby (last 7 days) — Dr Balwinder S Dheeman <bsd.SANSPAM@...> 2005/05/31

On 05/31/2005 11:44 PM, James Britt wrote:

[#144145] Re: Stats comp.lang.ruby (last 7 days) — James Edward Gray II <james@...> 2005/05/31

On May 31, 2005, at 6:15 PM, Dr Balwinder S Dheeman wrote:

[#144004] creating variable with eval — "Geert Fannes" <Geert.Fannes@...>

Hello, what is the scope of a variable created inside an eval()

14 messages 2005/05/30

[#144096] parseargs-0.0.0 — "Ara.T.Howard" <Ara.T.Howard@...>

23 messages 2005/05/31
[#144170] binding, ObjectSpace._id2ref [WAS] Re: [ANN] parseargs-0.0.0 — "Zev Blut" <rubyzbibd@...> 2005/06/01

Hello,

[#144254] Re: binding, ObjectSpace._id2ref [WAS] Re: [ANN] parseargs-0.0.0 — "Ara.T.Howard" <Ara.T.Howard@...> 2005/06/01

On Wed, 1 Jun 2005, Zev Blut wrote:

[#144306] Re: binding, ObjectSpace._id2ref [WAS] Re: [ANN] parseargs-0.0.0 — "Zev Blut" <rubyzbibd@...> 2005/06/02

Hello,

[SUMMARY] Barrel of Monkeys (#30)

From: Gavin Kistner <gavin@...>
Date: 2005-05-06 04:43:35 UTC
List: ruby-talk #141353
Before I begin my analysis of others solutions, let me share two  
things I learned, in the hopes that it will help someone else:

1) I procrastinate. (I didn't learn this - I already knew it.) I  
discovered this manifesting itself in my code as I repeatedly put off  
the hard part of actually creating the playlist, and ended up  
refactoring my classes about 6 times, and spending a full half hour  
on just cleaning up the names of the songs. I learned the importance  
of doing a 'red thread' spike - lay down the core functionality  
first, get it working, and then make it pretty later.

If you run out of time on a project, it's arguably better to have  
SOMETHING working, than a really nice solution that's only half  
implemented, and doesn't do anything.

2) Premature Optimization is the Root of All Evil[1] - I had plans to  
implement my solution in the most brain-dead simple way possible, and  
only then (if necessary) optimize it. Somewhere along the way I  
wandered off the path, and ended up using 'ugly' hashes of hashes for  
speed sake and a single recursive function. In the end, I did need to  
do a bit of optimization to get it to run reasonably (see below). But  
even before that, the damage to my code was severe enough that when I  
wanted to try out a variation on the algorithm, my own code was ugly  
enough to deter me from messing with it. Even after my optimization,  
however, the algorithm was pretty brain-dead stupid, and STILL  
finished in a tenth of a second.

Moral - don't kill yourself on optimization until you're sure it's  
necessary.



So, on to the code analysis. Every solution needed to do four things  
to succeed:
1) Decide the parameters for the playlist to create (user input).
2) Load in the information for a song library.
3) Find a valid "Barrel of Monkeys" playlist based on the library and  
the playlist parameters.
4) Display the resulting solution.

Let's look at the solutions for each of these, spending the most time  
on the #3


==========================
Decide the Playlist Parameters
==========================
Ilmari, Pedro and I all picked songs at random from the library to  
make a path between. None of our solutions had any customization in  
terms of types of playlist to create. So much for the value of the  
Highline quiz ... it seems that UI is still an afterthought when it  
comes to solving a problem :)

Brian's solution does support different kinds of playlists (any path,  
shortest path, and best time fill) but he didn't have time to create  
a user UI, so his solution hard codes a few start and end points and  
then solves them.

James' solution assumed that you would supply two command-line  
arguments, the names of the first and last songs. I hadn't know about  
the Enumerable#find method, so it was nice to see it used here  
(finding the first song which had the supplied substring somewhere in  
the song title). Beyond that, his solution had no further parameters  
needed for a playlist.

Dave didn't let you pick the specific songs to start and end with  
(you pick a letter for the first song should start with and a letter  
for the last song to end with), but otherwise went all out on the  
options - his solution supports finding playlists with minimum,  
maximum, and target number of songs and/or playlist duration. The  
console input provides defaults while entering, making things  
particularly convenient. So, apparently the Highline quiz was  
valuable after all :)


==========================
Load in the Song Library
==========================
The provided song library was an XML file. There were three  
approaches to handling this, with very different speed results:

Gavin, James, Ilmari and Brian all read the XML file using REXML, and  
then used it's access methods to create instances of a Song class.  
(Ilmari actually used zlib to load the gzipped version directly, with  
roughly no performance hit. Nice!)

    Time to load the XML file into an REXML Document: ~4s
    Time to scrape the information from that into Song instances:
       Gavin: 28s (I did a lot of name cleaning during song  
initialization)
       James: 12s
       Ilmari: 4.5s
       Brian: 2.6s

Dave converted the library into YAML (how, I'm not sure) and loaded  
that directly.
    Time to load the YAML file of Songs: 1.5s

Pedro went hardcore and simply used regular expressions on each line  
of the XML file.
    Time to read the file and use regexp to find information: 0.2s

Gavin and Ilmari both dumped their libraries to a binary file using  
Marshal after parsing it the first time. I know that for me, this  
turned out to be a great decision, shaving 30+ seconds off every test  
iteration I had to do.
    Time to load a Marshalled file of songs: 0.1s


It appears that I was the only one who tried to do something about  
all the terribly-named songs in the song library I supplied. I used  
one of the solutions from the English Numerals quiz to turn integers  
into english words. I tried to intelligently remove various "remix"  
and "live" and "edit" variations on the name. In the end, I wish I  
hadn't - the english numerals were a nice touch (and let me use songs  
with names like "18" or "'74-'75"), but the rest was an exercise in  
futility. Any reasonable playlist system should assume that it's  
going to have a really nice, cleaned playlist fed to it. Regexp  
heuristics to clean up messy names just aren't a substitute for a few  
hours spent fixing one's ID3 tags :)


==========================
Create the Playlist
==========================
So, as the astute may have noticed, this quiz is really just a path- 
finding in fancy clothes. Just as Mapquest creates directions from  
point A to point B using roads connecting intersections, so this quiz  
is about finding your way from song A to song B. There are just a  
hell of a lot more roads connecting the intersections.

I'll cover my approach in depth, and then look at the code other  
participants supplied.

As I mentioned above, I decided that I would first try a really brain- 
dead algorithm and see how it performed. (I intended to try a  
solution on my own and later do research into optimized algorithms in  
this field, but never got around to the latter.)

After reading in all the songs, I partitioned them off into a Hash  
that mapped each letter of the alphabet to the songs that started  
with that letter. For each of those songs, I then figured out all the  
unique end letters that you could get to. For simplicity sake,  
whenever there were multiple songs with the same start/end letters  
(e.g. "All Out of Love" and "A
Whiter Shade of Pale") I simply picked one of them at random and  
threw out the rest.

I also threw out all the cases where songs started with and ended  
with the same letter. These might be very useful in determining  
specific-length playlists, but I didn't want to deal with them.

The end result looked something like this:

@song_links = {
     'a' => { 'c' => <Song 'Aerodynamic'>, 'd' => <Song 'All I  
Need'>, ... },
     'b' => { 'a' => <Song 'Bawitdaba'>, 'e' => <Song 'Brother of  
Mine'>, ... },
     ...
}

This hash of hashes was then my roadmap, telling me what  
intersections I could get to for each letter, and what songs I  
travelled along to take that path.

To walk 50 steps, you first have to walk 49 and then take the last  
step. Similarly, I decided that I would write a recursive function  
that checked to see if two songs could be linked together. If they  
could, that was the path. If not, take one 'step' forward - see if a  
path to the last song existed from each of the songs which connected  
to the first.

My first brain-dead approach just let me wander along each  
possibility until I found each match, and stored all the successes.  
(My idea was to find all the solutions and then select the shortest  
one from the list.) I quickly ran into neverending loops as I visited  
the same song again and again. So, I started passing along a string  
of all the letters I had already tried. Before taking a step to a new  
song, I checked to make sure it wasn't in this list.

NOW I WAS COOKING! Along with some debug output, I watched as my code  
began traverse the possibility path. And watch, and watch. I started  
thinking about it.

With 5000 songs evenly distributed across all the letters, and paths  
that can go 26 levels deep, my back-of-the-envelope calculations led  
me to realize there there were (very roughly) something like
878406105516319579477535398778457892291056669879055897379772997878407474 
708480000000000 possible paths. Ooops. That would take a while to  
search the entire possibility tree. After waiting for 20 minutes, I  
realized I might have to wait a really long time.

So, I made one more adjustment - whenever I found a valid path, I  
stored the length of that path in an instance variable. Any time my  
recursive function tried to go deeper than than, I bailed out. (If  
know one route to get to the mall that takes 3 miles, and you start  
down a strange road looking for a shortcut, after you've gone more  
than 3 miles you know it's time to head home. You might be able to  
get to the mall by driving across the country and back, but it's not  
the solution you're looking for.)

And WHAM...my brain-dead solution went from taking longer than the  
universe has existed, to finding solutions in less than a second.  
Usually less than 1/10th of a second.

Take THAT, optimized algorithms! :)

[As a disclaimer, in the cases where no such path exists the code has  
to end up searching the entire possibility space, so...it essentially  
hangs when it can't find the right path.]

I had visions of using the same sort of solution to find a specific- 
length playlist: I would accumulate time as I recursed, and bail out  
once I had passed the limit. And then I went to bed instead. :)


So, on to looking at others' solutions, as best I can.

Pedro's solution appears to use recursion, like mine. I can't quite  
tell how it's preventing infinite circular lists, or how it goes so  
fast. It stores a list of possible solutions, and when finished it  
yields the list of all found solutions to a passed-in proc to  
determine which solution is correct.

So, for example, the line:
    result=search(songs, first, last, &min_dur)
picks the playlist with the shortest duration from those it found,  
while:
    result=search(songs, first, last, &min_len)
picks the playlist with the fewest songs.

Because Pedro's solution didn't do any song name cleaning, it can  
produce some interesting results:
Proudest Monkey - Dave Matthews Band - 551 ms ===> 'Round The World  
With The Rubber Duck - C.W. McCall - 247 ms
Proudest Monkey - Dave Matthews Band - 551 ms
You May Be Right - Billy Joel - 255 ms
Teacher, Teacher - .38 Special - 193 ms
Rock Me - ABBA - 185 ms
Eden - 10,000 Maniacs - 250 ms
North - Afro Celt Sound System - 409 ms
Here Without You - 3 Doors Down - 238 ms
Under Attack - ABBA - 227 ms
Kelly Watch The Stars - Air [French Band] - 226 ms
Saguaro - A Small, Good Thing - 353 ms
Ostrichism - A Small, Good Thing - 152 ms
Mamma Mia - ABBA - 212 ms
All I Need - Air [French Band] - 268 ms
Does Your Mother Know - ABBA - 195 ms
When You're Falling - Afro Celt Sound System - 314 ms
God Must Have Spent A Little.. - Alabama - 203 ms
... to calm a turbulent soul - Falling You - 469 ms
Losing Grip - Avril Lavigne - 233 ms
Preacher in this Ring, Part I - Bruce Hornsby - 302 ms
Intergalactic - Beastie Boys - 231 ms
CDJ - Pizzicato Five - 344 ms
Jumpin' Jumpin' - Destiny's Child - 229 ms
'Round The World With The Rubber Duck - C.W. McCall - 247 ms

(Note the linkage of songs with apostrophes or periods. :)

However it traverses the results, it's speediness seems to be  
mitigated by results that aren't quite as short as possible. For  
example (after I hacked Pedro's code to ignore everything but spaces  
and letters in a title) it thinks that the shortest playlist between  
"Que Sera" and "Zaar" is:

Que Sera - Ace of Base - 227 ms ===> Zaar - Peter Gabriel - 178 ms
Que Sera - Ace of Base - 227 ms
Angeleyes - ABBA - 259 ms
Second Chance - .38 Special - 271 ms
Eden - 10,000 Maniacs - 250 ms
North - Afro Celt Sound System - 409 ms
Hold On Loosely - .38 Special - 279 ms
You May Be Right - Billy Joel - 255 ms
Teacher Teacher - .38 Special - 193 ms
Release It Instrumental - Afro Celt Sound System - 387 ms
Little Bird - Annie Lennox - 279 ms
Dont Talk - 10,000 Maniacs - 321 ms
Keepin Up - Alabama - 185 ms
Pluto - Bjk - 199 ms
Ostrichism - A Small, Good Thing - 152 ms
Mountain Music - Alabama - 252 ms
Caught Up In You - .38 Special - 276 ms
Unknown Track  - Boards of Canada - 311 ms
in the Morning - LL Cool J - 222 ms
Get Me Off - Basement Jaxx - 289 ms
Fine and Mellow - Billie Holiday - 220 ms
Waltz - Gabriel Yared - 118 ms
Zaar - Peter Gabriel - 178 ms

while my code discovered this path (after I stole the code from James  
to pick start and end songs):

Looking for a path between 'Que Sera' and 'Zaar'
#0 - Ace of Base :: Que Sera :: 3:47
#1 - Eric Serra :: A Bomb In The Hotel :: 2:15
#2 - Duke Ellington :: Limbo Jazz :: 5:14
#3 - Peter Gabriel :: Zaar :: 2:59
+0.2s to create playlist


James did a nice two-way search for his solution - instead of walking  
an ever-broadening possibility tree going from the start to the  
finish, he has the finish also start branching out at the same time  
until they meet. From a geometric perspective, a circle centered on  
the start point and touching the end point will cover twice the area  
of two circles centered on each point which just touch each other.  
This would seem to me to be an obvious benefit from both a speed and  
memory standpoint. (I had originally thought I would do something  
like this, but couldn't come up with a clear idea of how to implement  
it.)

I particularly like the incredible simplicity of James' code that  
does the work:

until (join_node = start.touch?(finish))
     start.grow
     finish.grow
end

Ruby code can be so simple and expressive when done right! Another  
nice line (from Brian's code):
         connections = starts & endings


Unfortunately, when I asked James' code to find the same path as  
above, it took a very long time (almost half an hour) to produce a  
result. I wish I had more domain knowledge (and time) to research why  
this was the case, with an algorithm that I though would be a better  
performer. (It does come up with a nice terse path, however:
1: Que Sera by Ace of Base <<227422>>
2: All Through the Night by Cyndi Lauper <<269740>>
3: These Are Days by 10,000 Maniacs <<293067>>
4: Santa Cruz by David Qualey <<131053>>
5: Zaar by Peter Gabriel <<293355>>



I wanted to play more with Brian and Dave's solutions, but they also  
took a very long time to finish. The first time I ran Dave's solution  
it took over 2 hours and 400MB of RAM, and eventually dumped out  
every playlist it could find that matched the criteria I supplied. (A  
1-3 song playlist between two letters that I forget, with no time  
constraints.)

As noted earlier, Dave's solution gives you the power to limit number  
of songs (min, max, and target) and playlist duration (again, min,  
max, and target). I wish I had thought of this - being able to take  
the number of recursive depths from 26 to something like 10 helps  
tremendously in terms of search space. Dave also notes that his code  
is a depth-first recursion, and seeing his exclamation point in the  
comment
     # (recursively, depth-first(!))
makes me realize that when searching for a shortest-path algorithm, a  
breadth-first search would almost certainly prove a better performer.  
Damn. :)

One thing I found particularly interesting in Dave's code was his way  
to specify Infinity as a starting point for a minimum-value algorithm:

result.inject(1.0/0.0) do |memo, pl|
   [ memo, (pl.total_duration - target_duration).abs ].min
end

In Javascript I've done stuff like that starting out with values like
   var theMin = Number.MAX_VALUE;
or
   var theMin = Infinity;
and had wished for a way to do the same in Ruby. I still wish for a  
nice portable Infinity constant, but Dave's solution here will do  
nicely for me for the future. Thanks Dave! :)


Brian's solution version quickly finds a few shortest playlists, but  
when it goes on to find an a->z playlist that's as close to 30  
minutes as possible, it ... well, it's been over 3 hours and it still  
hasn't finished, though it occasionally spits out progress which  
looks like it found a new playlist that is a slightly better match  
than the last.

Brian's code looks quite nice, however. Brian genericized his  
solution to allow for any type of minimization, using his  
BasicMatchEvaluator class. While the code is not documented, it would  
appear that his PlaytimeEvaluator subclass uses the square of the  
difference between the desired time and the actual playlist to  
determine fitness. But if that's all it did, it would require finding  
every solution - as it is, the #continue? method looks to be designed  
to provide a customizable way to determine early on if a path is a  
'dead end'.


Ilmari's solution is fast! I don't have the expertise to analyze his  
implementation of "Dijkstra's graph search algorithm with a block- 
customizable edge cost", but whatever it is, it works. Every solution  
took less than 1 second, usually under 1/2 a second.


One optimization that I had thought of, but that nobody implemented  
(as far as I could tell) was to find 'gaps'. For example, no song in  
the supplied playlist ended with a 'q', so all songs that started  
with 'q' could be removed. Similarly for songs beginning with 'x'.


==========================
Show the Result!
==========================
Finally, we get to the end - showing off the end result.
A few people (Gavin, Brian, Ilmari) took the messy milliseconds  
duration and made them into something more human readable. Ilmari's  
solution stands out in this department as particularly attractive:

Trying to find playlist from "Que Sera" to "Zaar"

Found playlist:
Que Sera                         (3:47)  by Ace of Base
And Now Little Green Bag         (0:15)  by Steven Wright
Good Friends Are for Keeps       (1:08)  by The Carpenters
Santa Cruz                       (2:11)  by David Qualey
Zaar                             (4:53)  by Peter Gabriel

(Needs a fixed-width font to display as intended.)


==========================
Summary
==========================
As I noted, I spent far too much time working on petty details, and  
didn't get to personally spend as much time playing with algorithms  
and research as I would have liked. I'm quite pleased to see all the  
solutions everyone submitted, because they showcase various nice Ruby- 
isms and programming styles. (Blocks and procs, or custom classes,  
used to turn a specific algorithm into a nice generic solution that  
can use all sorts of criteria for what a good playlist is.)

I've focused on performance a lot during this summary. The point was  
certainly not to write the fastest solution possible; however, in  
playing with these sorts of NP-complete[2] problems you sometimes  
HAVE to think about speed just to get a solution in a time that isn't  
measured in years.

I hope you all had fun playing with this very common, very difficult  
problem, even if it was disguised in sheep's clothing. :)


[1] http://c2.com/cgi/wiki?PrematureOptimization
[2] http://en.wikipedia.org/wiki/NP-complete : Some flavors of this  
quiz (such as "shortest playlist") are not NP-complete, but I think  
other flavors ("playlist closest to 30 minutes") are.

In This Thread