[#150244] Defining regexp's and variables set by them — Garance A Drosehn <drosihn@...>

Sometimes I get in a situation where I have a case statement

13 messages 2005/08/01

[#150361] algorithm help — "Ara.T.Howard" <Ara.T.Howard@...>

14 messages 2005/08/02

[#150371] Style question: when to use underscores — "francisrammeloo@..." <francisrammeloo@...>

When should you use underscores to

14 messages 2005/08/02

[#150385] different order of parameters... — JZ <usenet@...>

I'm trying to understand how to call methods in Ruby. Is it possible to

13 messages 2005/08/02
[#150387] Re: different order of parameters... — Yukihiro Matsumoto <matz@...> 2005/08/02

Hi,

[#150439] enum collection of constant values — Garance A Drosehn <drosihn@...>

I'd like to have a set of constants for a class, where their values

18 messages 2005/08/02

[#150451] setting up ruby on os x 10.2 — Julian Leviston <julian@...>

Hi All!

12 messages 2005/08/02

[#150495] array or with non-array — Simon Strandgaard <neoneye@...>

Sometimes wish that [3, 5, 13] | [8] can be written as [3, 5, 13] | 8

30 messages 2005/08/02
[#150502] Re: [RCR] array or with non-array — Eric Mahurin <eric_mahurin@...> 2005/08/02

--- Simon Strandgaard <neoneye@gmail.com> wrote:

[#150506] Re: [RCR] array or with non-array — Yukihiro Matsumoto <matz@...> 2005/08/02

Hi,

[#150519] Re: [RCR] array or with non-array — Eric Mahurin <eric_mahurin@...> 2005/08/03

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#150581] ruby-dev summary 26468-26661 — Takaaki Tateishi <ttate@...>

Here are recent ruby-dev summaries.

52 messages 2005/08/03
[#150710] Re: ruby-dev summary 26468-26661 — "David A. Black" <dblack@...> 2005/08/04

Hi --

[#150715] Re: ruby-dev summary 26468-26661 — Jamis Buck <jamis@37signals.com> 2005/08/04

On Aug 4, 2005, at 7:31 AM, David A. Black wrote:

[#150717] Re: ruby-dev summary 26468-26661 — Brian Schrer <ruby.brian@...> 2005/08/04

On 04/08/05, Jamis Buck <jamis@37signals.com> wrote:

[#150740] Re: ruby-dev summary 26468-26661 — Christian Neukirchen <chneukirchen@...> 2005/08/04

Jamis Buck <jamis@37signals.com> writes:

[#150742] Re: ruby-dev summary 26468-26661 — Yukihiro Matsumoto <matz@...> 2005/08/04

Hi,

[#150608] interesting test tool... looking for opinions. — Jeff Wood <jeff.darklight@...>

There is wonderful java-based testing unit framework called TestNG.

24 messages 2005/08/03
[#150646] Re: interesting test tool... looking for opinions. — "Ryan Leavengood" <mrcode@...> 2005/08/03

Jeff Wood said:

[#150648] Re: interesting test tool... looking for opinions. — Austin Ziegler <halostatue@...> 2005/08/03

On 8/3/05, Ryan Leavengood <mrcode@netrox.net> wrote:

[#150653] Re: interesting test tool... looking for opinions. — Alexandru Popescu <the_mindstorm@...> 2005/08/04

#: Austin Ziegler changed the world a bit at a time by saying on 8/4/2005 1:16 AM :#

[#150659] Re: interesting test tool... looking for opinions. — Jeff Wood <jeff.darklight@...> 2005/08/04

well, first we'll need to get matz input on adding attributes @ the

[#150662] Re: interesting test tool... looking for opinions. — Austin Ziegler <halostatue@...> 2005/08/04

On 8/3/05, Jeff Wood <jeff.darklight@gmail.com> wrote:

[#150666] Re: interesting test tool... looking for opinions. — Jeff Wood <jeff.darklight@...> 2005/08/04

I like your second one better ... my only question would then be your

[#150674] Re: interesting test tool... looking for opinions. — Austin Ziegler <halostatue@...> 2005/08/04

On 8/3/05, Jeff Wood <jeff.darklight@gmail.com> wrote:

[#150709] new block notation (was: Re: ruby-dev summary 26468-26661) — "Martin Elzen" <martinelzen@...>

>Now ruby(HEAD) accepts the notation '->(...){...}'

155 messages 2005/08/04
[#150767] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Brian Wisti <brian.wisti@...> 2005/08/04

On 8/4/05, Martin Elzen <martinelzen@hotmail.com> wrote:

[#150799] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/04

Hi,

[#150801] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Eric Mahurin <eric_mahurin@...> 2005/08/04

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#150802] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/04

Hi,

[#150817] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Florian Gro<florgro@...> 2005/08/05

Yukihiro Matsumoto wrote about new lambda syntaxes:

[#150822] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/05

Hi,

[#150836] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Florian Groß <florgro@...> 2005/08/05

Yukihiro Matsumoto wrote:

[#150843] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/05

Hi,

[#150901] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Florian Gro<florgro@...> 2005/08/05

Yukihiro Matsumoto wrote:

[#150980] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/06

Hi,

[#151018] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Florian Gro<florgro@...> 2005/08/06

Yukihiro Matsumoto wrote:

[#150872] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Gavin Kistner <gavin@...> 2005/08/05

On Aug 4, 2005, at 11:58 PM, Yukihiro Matsumoto wrote:

[#150978] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Yukihiro Matsumoto <matz@...> 2005/08/06

Hi,

[#150995] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Gavin Kistner <gavin@...> 2005/08/06

On Aug 6, 2005, at 1:57 AM, Yukihiro Matsumoto wrote:

[#150866] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — "James F. Hranicky" <jfh@...> 2005/08/05

On Fri, 5 Aug 2005 09:49:28 +0900

[#150870] Re: new block notation (was: Re: ruby-dev summary 26468-26661) — Jason Foreman <threeve.org@...> 2005/08/05

I hadn't seen this particular variant posted in this thread yet.

[#150842] Re: new block notation — Martin DeMello <martindemello@...> 2005/08/05

Eric Mahurin <eric_mahurin@yahoo.com> wrote:

[#150855] Re: new block notation — "Trans" <transfire@...> 2005/08/05

> That's rather drastic. All it needs is a new symbol for literal hashes.

[#151008] Re: new block notation — Daniel Brockman <daniel@...> 2005/08/06

"David A. Black" <dblack@wobblini.net> writes:

[#150881] Please help make CodeZoo truly useful — Curt Hibbs <curt@...>

I just posted this on my blog (http://blog.curthibbs.us/), but I thought

14 messages 2005/08/05

[#151017] OSCON videos, medias — why the lucky stiff <ruby-talk@...>

My friends, I've got my act together now and a BitTorrent tracker up

18 messages 2005/08/06

[#151080] cartesian product — "walter a kehowski" <wkehowski@...>

Hello,

26 messages 2005/08/07

[#151096] Adding yet another Array.new form — Nikolai Weibull <mailing-lists.ruby-talk@...>

How about adding a fifth way of constructing new arrays?:

18 messages 2005/08/07

[#151147] sending an email with an attachment in ruby — Matthew Margolis <mrmargolis@...>

I would like to send email from a server running FreeBSD(TextDrive) to

12 messages 2005/08/07

[#151162] String#to_ary and Test::Unit — "Trans" <transfire@...>

In Facets I offer:

14 messages 2005/08/08

[#151202] FXRuby or wxRuby? — baalbek <rcs@...>

I know wxWindows for C++ rather well, and have started to use wxRuby.

29 messages 2005/08/08

[#151224] Re: polymorphism and/or named parameters: the ruby way? — "Berger, Daniel" <Daniel.Berger@...>

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

14 messages 2005/08/08
[#151235] Re: polymorphism and/or named parameters: the ruby way? — Eric Mahurin <eric_mahurin@...> 2005/08/08

--- "Berger, Daniel" <Daniel.Berger@qwest.com> wrote:

[#151377] event driven framework for ruby — snacktime <snacktime@...>

Is there an event driven framework for ruby? Something similar to POE

30 messages 2005/08/09
[#151381] Re: event driven framework for ruby — zedshaw@... 2005/08/09

Actually, yes. I'm working on the Ruby/Event library. It's a C extension

[#151384] Re: event driven framework for ruby — James Edward Gray II <james@...> 2005/08/09

On Aug 9, 2005, at 12:23 PM, zedshaw@zedshaw.com wrote:

[#151389] Re: event driven framework for ruby — Yohanes Santoso <ysantoso-rubytalk@...> 2005/08/09

James Edward Gray II <james@grayproductions.net> writes:

[#151394] Re: event driven framework for ruby — James Edward Gray II <james@...> 2005/08/09

On Aug 9, 2005, at 12:57 PM, Yohanes Santoso wrote:

[#151400] Re: event driven framework for ruby — Yohanes Santoso <ysantoso-rubytalk@...> 2005/08/09

James Edward Gray II <james@grayproductions.net> writes:

[#151405] Re: event driven framework for ruby — James Edward Gray II <james@...> 2005/08/09

On Aug 9, 2005, at 2:22 PM, Yohanes Santoso wrote:

[#151445] Re: event driven framework for ruby — Tanaka Akira <akr@...17n.org> 2005/08/10

In article <84D5D729-3674-4084-A092-2359932E2FF4@grayproductions.net>,

[#151414] NitroHQ been vandalised? — John Carter <john.carter@...>

I went looking for the Nitro homepage to give it a mention to our

13 messages 2005/08/09

[#151441] NEWBIE QUESTION: pattern with nil — "basi" <basi_lio@...>

Hello,

33 messages 2005/08/10
[#151465] Re: NEWBIE QUESTION: pattern with nil — BearItAll <bearitall@...> 2005/08/10

On Wed, 10 Aug 2005 14:44:15 +0900, John Carter wrote:

[#151480] Re: NEWBIE QUESTION: pattern with nil — Austin Ziegler <halostatue@...> 2005/08/10

On 8/10/05, BearItAll <bearitall@rassler.co.uk> wrote:

[#151605] Re: NEWBIE QUESTION: pattern with nil — John Carter <john.carter@...> 2005/08/10

On Wed, 10 Aug 2005, Austin Ziegler wrote:

[#151517] Threading on Win32 - at an impasse — Bill Atkins <batkins57@...>

I'm working on a project that would have to run several TCPServer's in

15 messages 2005/08/10
[#151526] Re: Threading on Win32 - at an impasse — david@... 2005/08/10

Cit疸 Bill Atkins <batkins57@gmail.com>:

[#151627] Ruby report generation tool — "Greg Brown" <greg7224@...>

For as long as I can remember the end of the summer meant slaving over

20 messages 2005/08/11

[#151653] cartesian product - next to last version — "walter a kehowski" <wkehowski@...>

Hello,

12 messages 2005/08/11

[#151657] Performance Ruby — "Goel" <spam@...>

Hi,

26 messages 2005/08/11

[#151692] Re: Ruby report generation tool — "Berger, Daniel" <Daniel.Berger@...>

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

14 messages 2005/08/11

[#151723] Problems with Net::HTTP.get — Marek Kubica <pythonmailing@...>

Hello!

13 messages 2005/08/11

[#151735] Dear RubyGems: Perhaps a better way to override require... — "Trans" <transfire@...>

I may have found a much better way to override Kernel#require. Here's

16 messages 2005/08/11
[#151743] Re: Dear RubyGems: Perhaps a better way to override require... — Chad Fowler <chadfowler@...> 2005/08/11

On 8/11/05, Trans <transfire@gmail.com> wrote:

[#151768] Re: Dear RubyGems: Perhaps a better way to override require... — "Trans" <transfire@...> 2005/08/11

Hi Chad,

[#151774] Re: Dear RubyGems: Perhaps a better way to override require... — Chad Fowler <chadfowler@...> 2005/08/11

On 8/11/05, Trans <transfire@gmail.com> wrote:

[#151783] Re: Dear RubyGems: Perhaps a better way to override require... — "Ryan Leavengood" <mrcode@...> 2005/08/11

Chad Fowler said:

[#151758] Setting up Eclipse for Ruby — "francisrammeloo@..." <francisrammeloo@...>

Hi all,

14 messages 2005/08/11

[#151877] Another newbie question — "len" <lsumnler@...>

I am trying to write a small little program that will currently run in

20 messages 2005/08/12

[#151897] Ruby Performance — Bradley Kite <bradley.kite@...>

Hi all,

88 messages 2005/08/12
[#151909] Re: Ruby Performance — "Robert Klemme" <bob.news@...> 2005/08/12

Bradley Kite wrote:

[#151914] Re: Ruby Performance — Bradley Kite <bradley.kite@...> 2005/08/12

Those idioms are around 21 seconds each in Ruby.

[#152316] Re: Ruby Performance — "Isaac Gouy" <igouy@...> 2005/08/16

Austin Ziegler wrote:

[#152149] RubyGems or any HTTP on XP NOT working — mycallidus@...

I tried to start learning Ruby by installing Ruby & Rails on XP, and it

13 messages 2005/08/14

[#152151] hacker logo — "walter a kehowski" <wkehowski@...>

http://paulgraham.com/index.html -> http://reddit.com/ ->

15 messages 2005/08/14
[#152155] Re: hacker logo — Nikolai Weibull <mailing-lists.ruby-talk@...> 2005/08/15

walter a kehowski wrote:

[#152186] Troubles with the installation of RAILS — Jan Meskens <janmeskens@...>

Hello,

16 messages 2005/08/15

[#152208] Building a REPL for Ruby — Shalev NessAiver <shalev@...>

Yes, I know ruby already has irb, but I have a friend who keeps

19 messages 2005/08/15

[#152290] New site built using Ruby on Rails — David Teare <dteare@...>

Hi all,

23 messages 2005/08/15

[#152375] Ruby for my new business? — Jared Nuzzolillo <onceuponapriori@...>

Hello list. I am in the process of starting a new business venture in South

30 messages 2005/08/16

[#152434] Ruby on Unix vs. Windows — Rick Nooner <rick@...>

Yesterday at work we took an analysis program written in ruby that we had been

13 messages 2005/08/16

[#152451] Generic Parsing Library — "Adam Sanderson" <netghost@...>

I was wondering if anyone would be interested in, or knows of a generic

16 messages 2005/08/16

[#152535] Newbie question — "len" <lsumnler@...>

Is there some difference in the code I'm not seeing or is one better

18 messages 2005/08/17

[#152556] Prototype-based / Ruby question — "zimba.tm@..." <zimba.tm@...>

I just stumbled across this page[1] on RubyGarden. The writer tells

20 messages 2005/08/17
[#152578] Re: Prototype-based / Ruby question — Gavin Kistner <gavin@...> 2005/08/17

On Aug 17, 2005, at 2:21 AM, zimba.tm@gmail.com wrote:

[#152585] Re: Prototype-based / Ruby question — Lyndon Samson <lyndon.samson@...> 2005/08/17

I'd say prototype means no classes, that is create an Object from another (

[#152666] Novice Q: What's the difference between /\s*/ and /(\s)*/? — "Mike Meng" <meng.yan@...>

Hi,

13 messages 2005/08/18

[#152723] Idiomatic ruby version of this code? — Brock Weaver <brockweaver@...>

Showing off ruby to a coworker, and I want to emphasize how succinct yet

17 messages 2005/08/18

[#152740] Ruby Specifications — Brian Mitchell <binary42@...>

Over the past few days I've been working on implementing my own (yet

14 messages 2005/08/18

[#152772] Protecting commercial ruby code with public/private key encryption — "John Wells" <lists@...>

I was speaking with a co-worker today about the disappointment we feel

30 messages 2005/08/18

[#152776] Python vs Ruby! — Joe Van Dyk <joevandyk@...>

Which is better, Python or Ruby?

45 messages 2005/08/18
[#152828] Re: Python vs Ruby! — Jamey Cribbs <jcribbs@...> 2005/08/19

Joe Van Dyk wrote:

[#152777] New to Ruby! — Seth Thomas Rasmussen <sethrasmussen@...>

Hi all,

16 messages 2005/08/18

[#152780] AIX and Ruby issues (still) — ober <ober@...>

I know this is a thorn to bring up every so often.

15 messages 2005/08/18

[#152843] RedCloth .... PILES of warnings when I require it ... — Jeff Wood <jeff.darklight@...>

I've downloaded and have the Gem for RedCloth 3.0.3 installed.

11 messages 2005/08/19

[#152892] Sodoku Solver (#43) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

43 messages 2005/08/19
[#153016] Re: [QUIZ] Sodoku Solver (#43) — Karl von Laudermann <karlvonl@...> 2005/08/20

In article

[#153292] Re: [QUIZ] Sodoku Solver (#43) — Adam Shelly <adam.shelly@...> 2005/08/23

Hi. This is my first attempt at a ruby quiz, and my first post to ruby-talk.

[#153297] Re: [QUIZ] Sodoku Solver (#43) — James Edward Gray II <james@...> 2005/08/23

On Aug 22, 2005, at 9:08 PM, Adam Shelly wrote:

[#153314] Re: [QUIZ] Sodoku Solver (#43) — Adam Shelly <adam.shelly@...> 2005/08/23

Ok, I've updated my version to resort to guessing when it can't deduce

[#153348] Re: [QUIZ] Sodoku Solver (#43) — "Dominik Bathon" <dbatml@...> 2005/08/23

On Tue, 23 Aug 2005 13:54:25 +0200, Adam Shelly <adam.shelly@gmail.com>

[#153353] Re: [QUIZ] Sodoku Solver (#43) — Adam Shelly <adam.shelly@...> 2005/08/23

On 8/23/05, Dominik Bathon <dbatml@gmx.de> wrote:

[#153374] Re: [QUIZ] Sodoku Solver (#43) — David Brady <ruby_talk@...> 2005/08/24

Adam Shelly wrote:

[#153067] Still looking for a Ruby MUD client — Sy <sy1234@...>

I'm still looking for a Ruby-scriptable Telnet/MUD client. Does

52 messages 2005/08/20
[#154216] Re: Still looking for a Ruby MUD client — "Dave Burt" <dave@...> 2005/08/30

Jon wrote:

[#154219] Re: Still looking for a Ruby MUD client — Reyn Vlietstra <reyn.vlietstra@...> 2005/08/30

Have a look at my mud,

[#154246] Re: Still looking for a Ruby MUD client — Sy <sy1234@...> 2005/08/30

I look for months for a ruby mud client or at least something that can

[#154258] Re: Still looking for a Ruby MUD client — James Edward Gray II <james@...> 2005/08/30

On Aug 30, 2005, at 7:47 AM, Sy wrote:

[#154293] Re: Still looking for a Ruby MUD client — Sy <sy1234@...> 2005/08/30

On 8/30/05, James Edward Gray II <james@grayproductions.net> wrote:

[#154514] Re: Still looking for a Ruby MUD client — <agemoagemo@...> 2005/08/31

--- Sy <sy1234@gmail.com> wrote:

[#154535] Re: Still looking for a Ruby MUD client — Sy <sy1234@...> 2005/08/31

On 8/31/05, agemoagemo@yahoo.com <agemoagemo@yahoo.com> wrote:

[#154541] Re: Still looking for a Ruby MUD client — Greg Millam <ruby-talk@...> 2005/08/31

> > The main reason that I, at least, am using net/telnet

[#154579] Re: Still looking for a Ruby MUD client — <agemoagemo@...> 2005/09/01

--- Greg Millam <ruby-talk@lethalcode.net> wrote:

[#153101] www.ruby.net — Daniel Schierbeck <daniel.schierbeck@...>

I don't know if this has been discussed before (didn't find any messages

46 messages 2005/08/21
[#153110] Re: www.ruby.net — nobu.nokada@... 2005/08/21

Hi,

[#153112] Re: www.ruby.net — Daniel Schierbeck <daniel.schierbeck@...> 2005/08/21

nobu.nokada@softhome.net wrote:

[#153113] Re: www.ruby.net — Paul van Tilburg <paul@...> 2005/08/21

On Sun, Aug 21, 2005 at 09:36:17PM +0900, Daniel Schierbeck wrote:

[#153380] The Chainsaw Infanticide Logger Manuever — "Zed A. Shaw" <zedshaw@...>

One of the things that's really great about agile languages is they give you the power to do anything. One of the most horrible things about agile languages is they give every other idiot the same power to stab you in the back with a rusty pitchfork.

37 messages 2005/08/24
[#153439] Re: The Chainsaw Infanticide Logger Manuever — "Bill Kelly" <billk@...> 2005/08/24

From: "Zed A. Shaw" <zedshaw@zedshaw.com>

[#153445] Re: The Chainsaw Infanticide Logger Manuever — Jeff Wood <jeff.darklight@...> 2005/08/24

My feelings are in-line with the review of Dave's session as OSCON @

[#153414] determining the attribute names of an object — Mark Volkmann <r.mark.volkmann@...>

The way to determine the names of the attributes of objects created

16 messages 2005/08/24
[#153417] Re: determining the attribute names of an object — "David A. Black" <dblack@...> 2005/08/24

Hi --

[#153419] Re: determining the attribute names of an object — Mark Volkmann <r.mark.volkmann@...> 2005/08/24

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

[#153422] Good cross-platform IDE / multiple document text editor for ruby / rails? — Brock Weaver <brockweaver@...>

I apologize for the cross-post, but I thought it would spur a good

55 messages 2005/08/24
[#153426] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — Aaron Kulbe <akulbe@...> 2005/08/24

What about vim?

[#153548] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — tony summerfelt <snowzone5@...> 2005/08/25

Brock Weaver wrote on 8/24/2005 10:51 AM:

[#153570] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — Randy Kramer <rhkramer@...> 2005/08/25

On Thursday 25 August 2005 08:15 am, tony summerfelt wrote:

[#153793] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — Lothar Scholz <mailinglists@...> 2005/08/26

Hello Randy,

[#153842] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — Randy Kramer <rhkramer@...> 2005/08/27

On Friday 26 August 2005 07:56 pm, Lothar Scholz wrote:

[#153869] Re: Good cross-platform IDE / multiple document text editor for ruby / rails? — Lothar Scholz <mailinglists@...> 2005/08/28

Hello Randy,

[#153456] ruby way for piece of code — Alexandru Popescu <the.mindstorm.mailinglist@...>

Hi!

10 messages 2005/08/24

[#153513] Bokeo 0.25 - The initial release of an FXRuby interface to RubyGems — Richard Lyman <lymans@...>

I'm pleased to announce the initial release of Bokeo, an FXRuby

9 messages 2005/08/24

[#153562] idea: klass.from_s(str) — Eric Mahurin <eric_mahurin@...>

I was thinking how in seems a little asymmetric that many

18 messages 2005/08/25
[#153574] Re: idea: klass.from_s(str) — "David A. Black" <dblack@...> 2005/08/25

Hi --

[#153566] EventLoop 0.0.20050825.1600 — Daniel Brockman <daniel@...>

Hi list,

40 messages 2005/08/25

[#153656] rmagick question — Joe Van Dyk <joevandyk@...>

I'm trying to set the pixels of an image:

31 messages 2005/08/26
[#153673] Re: rmagick question — Brian Schrer <ruby.brian@...> 2005/08/26

On 26/08/05, Joe Van Dyk <joevandyk@gmail.com> wrote:

[#153714] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/26

On 8/26/05, Brian Schrer <ruby.brian@gmail.com> wrote:

[#153746] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/26

On 8/26/05, Joe Van Dyk <joevandyk@gmail.com> wrote:

[#153747] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/26

On 8/26/05, Joe Van Dyk <joevandyk@gmail.com> wrote:

[#153750] Re: rmagick question — "Ara.T.Howard" <Ara.T.Howard@...> 2005/08/26

On Sat, 27 Aug 2005, Joe Van Dyk wrote:

[#153752] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/26

On 8/26/05, Ara.T.Howard <Ara.T.Howard@noaa.gov> wrote:

[#153942] Re: rmagick question — Timothy Hunter <cyclists@...> 2005/08/28

Joe Van Dyk wrote:

[#153947] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/28

On 8/28/05, Timothy Hunter <cyclists@nc.rr.com> wrote:

[#153971] Re: rmagick question — Timothy Hunter <cyclists@...> 2005/08/29

Joe Van Dyk wrote:

[#154011] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/29

On 8/28/05, Timothy Hunter <cyclists@nc.rr.com> wrote:

[#154034] Re: rmagick question — Timothy Hunter <cyclists@...> 2005/08/29

Joe Van Dyk wrote:

[#154163] Re: rmagick question — Joe Van Dyk <joevandyk@...> 2005/08/29

On 8/29/05, Timothy Hunter <cyclists@nc.rr.com> wrote:

[#153662] DRb functions disappearing? — Kevin Brown <blargity@...>

I will start by admitting I'm new to Ruby, but am generally a quick learner.

18 messages 2005/08/26
[#153667] Re: DRb functions disappearing? — Eric Hodel <drbrain@...7.net> 2005/08/26

On 25 Aug 2005, at 21:49, Kevin Brown wrote:

[#153668] Re: DRb functions disappearing? — Kevin Brown <blargity@...> 2005/08/26

On Friday 26 August 2005 01:14, Eric Hodel wrote:

[#153670] Re: DRb functions disappearing? — Eric Hodel <drbrain@...7.net> 2005/08/26

On 26 Aug 2005, at 00:32, Kevin Brown wrote:

[#153671] Re: DRb functions disappearing? — Kevin Brown <blargity@...> 2005/08/26

On Friday 26 August 2005 02:08, Eric Hodel wrote:

[#153672] Method behaves differently when called using #send — Ron M <rm_rails@...>

I'm having difficulty using #send to call methods in

117 messages 2005/08/26
[#153723] Re: Method behaves differently when called using #send — calamitas@... 2005/08/26

On Fri, 26 Aug 2005, Ron M wrote:

[#153828] Re: Method behaves differently when called using #send — Yukihiro Matsumoto <matz@...> 2005/08/27

Hi,

[#153833] Re: Method behaves differently when called using #send — "David A. Black" <dblack@...> 2005/08/27

Hi --

[#153938] Re: Method behaves differently when called using #send — "daz" <dooby@...10.karoo.co.uk> 2005/08/28

[#153963] Re: Method behaves differently when called using #send — "David A. Black" <dblack@...> 2005/08/28

Hi --

[#154105] Re: Method behaves differently when called using #send — Yukihiro Matsumoto <matz@...> 2005/08/29

Hi,

[#154107] Re: Method behaves differently when called using #send — "David A. Black" <dblack@...> 2005/08/29

Hi --

[#154110] Re: Method behaves differently when called using #send — Yukihiro Matsumoto <matz@...> 2005/08/29

Hi,

[#154204] Re: Method behaves differently when called using #send — Yukihiro Matsumoto <matz@...> 2005/08/30

Hi,

[#154210] Re: Method behaves differently when called using #send — "Trans" <transfire@...> 2005/08/30

[#154213] Re: Method behaves differently when called using #send — Yukihiro Matsumoto <matz@...> 2005/08/30

Hi,

[#154247] Re: Method behaves differently when called using #send — Eric Mahurin <eric_mahurin@...> 2005/08/30

--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#154151] Re: Method behaves differently when called using #send — Daryl Richter <daryl@...> 2005/08/29

Yukihiro Matsumoto wrote:

[#154161] Re: Method behaves differently when called using #send — "David A. Black" <dblack@...> 2005/08/29

Hi --

[#153695] Word Chains (#44) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

40 messages 2005/08/26

[#153722] vim user switch to emacs? — Joe Van Dyk <joevandyk@...>

Hi,

38 messages 2005/08/26

[#153780] Introducing ruSH — Reyn Vlietstra <reyn.vlietstra@...>

Hi,

15 messages 2005/08/26
[#153788] Re: Introducing ruSH — Sy <sy1234@...> 2005/08/26

I've been waiting for something like this to come along.. but I'm

[#153789] Re: Introducing ruSH — Reyn Vlietstra <reyn.vlietstra@...> 2005/08/26

You have to have

[#153863] how do you describe '#!' in written english? — "SHIGETOMI, Takuhiko" <tshiget1@...>

quick question.

16 messages 2005/08/28

[#153927] Help needed with rexml — Michael <invalid@...>

I've been struggling to properly parse some XML with rexml. I will fully

15 messages 2005/08/28

[#153979] catching segmentation faults from Ruby — Iain Dooley <idoo4002@...>

hello, i've got ruby embedded into an application, and i've built a code

14 messages 2005/08/29
[#154028] Re: catching segmentation faults from Ruby — ts <decoux@...> 2005/08/29

>>>>> "I" == Iain Dooley <idoo4002@mail.usyd.edu.au> writes:

[#153980] how to unflatten a flat-array — "SHIGETOMI, Takuhiko" <tshiget1@...>

dear guys,

38 messages 2005/08/29
[#154014] Re: [Q] how to unflatten a flat-array — Robert Klemme <shortcutter@...> 2005/08/29

2005/8/29, SHIGETOMI, Takuhiko <tshiget1@gw.nsw.co.jp>:

[#154025] Re: [Q] how to unflatten a flat-array — "SHIGETOMI, Takuhiko" <tshiget1@...> 2005/08/29

greetings, Robert. thank you, it does make sense to me.

[#154056] Re: [Q] how to unflatten a flat-array — "Robert Klemme" <bob.news@...> 2005/08/29

SHIGETOMI, Takuhiko wrote:

[#154013] I think that French verb conjugation is as simple as, if not simpler than, that of English (no kidding!) - see www.sixpourcent.com — pan6pourcent@163.com

Dear friends,

11 messages 2005/08/29

[#154108] Thread.list confusion — "Andrew S. Townley" <andrew.townley@...>

12 messages 2005/08/29
[#154132] Re: Thread.list confusion — Eric Hodel <drbrain@...7.net> 2005/08/29

On 29 Aug 2005, at 08:57, Andrew S. Townley wrote:

[#154238] ThreadPool (was: Re: Thread.list confusion) — "Andrew S. Townley" <andrew.townley@...> 2005/08/30

[#154143] New to Ruby — "Steve" <sdouglas949@...>

I'm new to ruby and programming (although I did dabble in BASIC with my

15 messages 2005/08/29

[#154188] Aesthetics of while ... do ... end versus while ...: ... end — Nikolai Weibull <mailing-lists.ruby-talk@...>

OK, this is really quite lame, but what do you people prefer:

10 messages 2005/08/29

[#154344] MInimal Ruby Distribution with app — bww00amdahl@...

I'm looking for a minimal distribution of Ruby to distribute my app

12 messages 2005/08/30

[#154363] Nano Methods & Mega Modules — "Trans" <transfire@...>

19 messages 2005/08/30

[#154380] Ruby on Linux & Windows — Tim Ferrell <Tim.Ferrell@...0nspark.com>

I'm not trying to start anything here but I'd like some feedback from those of

18 messages 2005/08/30

[#154542] nano & mega — Jeff Wood <jeff.darklight@...>

What's up with the funky names ... AND, is there an easy way to just require

30 messages 2005/08/31
[#154592] Re: nano & mega — "Dave Burt" <dave@...> 2005/09/01

Jeff Wood wrote:

[#154624] Re: nano & mega — =?ISO-8859-15?Q?Florian_Gro=DF?= <florgro@...> 2005/09/01

Dave Burt wrote:

[#154626] Re: nano & mega — James Edward Gray II <james@...> 2005/09/01

On Sep 1, 2005, at 8:59 AM, Florian Growrote:

Fwd: [SOLUTION] Sodoku Solver (#43)

From: James Edward Gray II <james@...>
Date: 2005-08-26 13:03:30 UTC
List: ruby-talk #153688
Begin forwarded message:

> From: gdefty@attglobal.net
> Date: August 25, 2005 10:13:34 PM CDT
> To: james@grayproductions.net,
>
>
> James,
>
> My stab at a sudoku solver. A bit rough roung the
> edges (I have a job to do!) but it works.
>
> It seemed to me that basic algorithm and by
> association, data representation were the key
> factors here, and I was reasonably pleased with my
> choices (until I see some of the other solutions
> and realise what a dummy I was somewhere :-)
>
> Where I know I will be disappointed is in the
> ruby-ness of my code (or rather, lack of it :-(
> Mine always seems a bit pedestrian compared to
> some of the elegant stuff you show. Sigh. I guess
> I have been doing this too long. I'm probably
> writing a COBOL solution in Ruby! Still, learning
> is the whole point, no?
>
> Anyway, I hope you find something of interest in
> it, and thanks again for a great site.
>
> Regards,
>
> graeme

Attachments (3)

Sod.rb (5.86 KB, text/x-ruby)
# A number of design decisions (and some alternatives)
# 1. Store 'available numbers' 
#    a) at the cell level and make them unavailable to 
#       other cells in the row/col/block when one was set
#    b) at the row/col/block level and check these items each 
#       time a I needed to select a new cell value
#     I chose a), as I figured that there would be more time spent
#     checking than setting and unsetting. I think (without proof)
#     that this was a good choice 
# 2. Store available numbers for a given cell as 
#   a) a hash of the available keys
#   b) an array of 9 'true' and 'false' values
#     I chose b), and I think it was probably not the best choice.
#     you can see from the code that I have to access this array
#     in different ways which I suspect would have been easier with a hash.
# 3. Encapsulating the structure of the source data format was a 
#   'spur-of-the-moment' refactoring decision which just seemed like a good
#   idea at the time, and turned out to be so when I had to override
#   the 'clone' method for Sods

# The basic class to hold the value in a single location in the puzzle
class SodCell
  attr_reader :val
  
# can be initialised with a value, but in the event I didn't use this  
  def initialize(val)
    @val = val.to_i
    if @val == 0
      @allowed = Array.new(10, true)
    else
      @allowed = Array.new(10, false)
      @allowed[@val] = true
    end
  end

# set the cell to a given value
  def set(x)
    @val = x
  end

# unset the cell back to empty
  def unset()
    rslt = @val
    @val = 0
    return rslt
  end

# is the cell is allowed to contain 'x'?
  def allowed(x)
    @allowed[x]
  end
  
# what values are allowed?
# This is mostly to determine *how many* values are allowed
# and is the reason I think a Hash would have been better
  def alloweds
    rslt = ''
    @allowed.each_with_index{|v, i|
      rslt += v ? i.to_s : ''
    }
    return rslt
  end
  
# add 'x' to the list of allowed values
  def allow(x)
    @allowed[x] = true
  end

# drop 'x' from the list of allowed values
  def deny(x)
    @allowed[x] = false
  end

# create a printable representation of the cell (for debugging)
def to_s
    rslt = val.to_s + ':'
    @allowed.each_with_index{|v, i|
      rslt += v ? i.to_s : '.'
    }
    return rslt
  end
end

# A wrapper class round the input data
# Only one method 'each' which unravels the values
# and returns them one at a time. 
# Allows some flexibility in the input format (its's a feature ;-)
class SodSrc
  def initialize(src)
  @src = src
  end
  def each
    rowsrc = @src.split("\n")
    rownum = 0
    rowsrc.each{ |r|
      colnum = 0
      if r =~ /\d|'_'/ then
        while r =~ /.*?([\d_])(.*)/
          yield(rownum, colnum, $1)
          colnum += 1
          r = $2
        end
        rownum += 1
      end
    }
  end
end

# The main class representing a puzzle
class Sod

# can be created from a string representing a position,
# or from another Sod.
  def initialize(srcdata)
    @cells = []
    99.times{|i|
      @cells << SodCell.new('')
    }
    if srcdata.class == String then
      srcdata = SodSrc.new(srcdata)
    end
    srcdata.each{|row, col, val|
      setcell(row, col, val.to_i)
    }
  end

# return the cell at a given location
  def cell(row, col)
    @cells[row*10+col]
  end

# yield all the cells in a row
  def each_in_row(row)
    for col in 0..8
      yield cell(row, col)
    end
  end

# yield all the cells in a column
  def each_in_col(col)
    for row in 0..8
      yield cell(row, col)
    end
  end

# yield all the cells in a 3x3 block
  def each_in_block(row, col)
  baserow = row/3*3
  basecol = col/3*3
    for row in baserow..(baserow+2)
      for col in basecol..(basecol+2)
        yield cell(row, col)
      end
    end
  end
  
# yield all the cells in the puzzle. A bit different from the 
# other 'each...' methods in that it returns the location and
# value of the cell, instead of the cell itself. This is needed
# to make it work in 'initialize' (when cloning) which is the
# only place it is used
  def each()
    for row in 0..8
      for col in 0..8
        yield(row, col, cell(row, col).val)
      end
    end
  end

# set a given cell to a value and adjust all others in the row, column
# and block to deny them the use of that value
  def setcell (row, col, val)
    cell(row, col).set(val)     # set the cell value
    each_in_row(row){|c|        # and deny that value to others in the row ...
      c.deny(val)
    }
    each_in_col(col){|c|        # ... and column ...
      c.deny(val)
    }
    each_in_block(row, col){|c| # ... and block
      c.deny(val)
    }
  end

# reset a given cell and adjust all others in the row, column and block to
# allow them the use of that cell's value
  def unsetcell (row, col)
    val = cell(row, col).unset()# unset the cell value
    each_in_row(row){|c|        # and allow that value to others in the row ...
      c.allow(val)
    }
    each_in_col(col){|c|        # ... and column ...
      c.allow(val)
    }
    each_in_block(row, col){|c| # ... and block
      c.allow(val)
    }
  end
  
# Create a 'deep copy' clone of myself
# Needed because Object#clone creates a 'shallow' copy
  def clone
    Sod.new(self)
  end
  
# Generate the printable format
  def to_s
    rowconst = '+-------+-------+-------+'
    rslt = [rowconst]
    for blockrow in 0..2
      for relrow in 0..2
        rowdat = '|'
        for blockcol in 0..2
          for relcol in 0..2
            rowdat += ' ' + cell(blockrow*3 + relrow, blockcol*3 + relcol).val.to_s
          end
          rowdat += ' |'
        end
        rslt << rowdat
      end
      rslt << rowconst
    end
    rslt = rslt.join("\n")
    rslt.gsub('0', '_')
  end

# Dump the puzzle contents (for debugging only)
  def dump
    for row in 0..8
      for col in 0..8
        if cell(row, col).val == 0 then
          puts "(#{row.to_s},#{col.to_s})=#{cell(row,col).to_s}"
        end
      end
    end
  end
  
end
Sod_test.rb (3.09 KB, text/x-ruby)
require 'test/unit'
require 'Sod.rb'


class TC_Cell < Test::Unit::TestCase
	def setup
	end
  
	def test_setup
		c = SodCell.new('3')
		assert_equal(3, c.val)
		c = SodCell.new('_')
		assert_equal(0, c.val)
	end

	def test_set_unset
		c = SodCell.new('3')
		assert_equal(3, c.val)
		c.unset()
		assert_equal(0, c.val)
		c.set(7)
		assert_equal(7, c.val)
	end

  def test_allow_deny
    c = SodCell.new('5')
    assert_equal(true, c.allowed(5))
    assert_equal(false, c.allowed(3))
    c.allow(3)
    assert_equal(true, c.allowed(3))
    c.deny(3)
    assert_equal(false, c.allowed(3))

    c = SodCell.new('_')
    assert_equal(true, c.allowed(5))
    assert_equal(true, c.allowed(3))
  end
  
  def test_to_s
    c = SodCell.new('')
    assert_equal('0:0123456789', c.to_s)
    c.deny(3)
    c.deny(4)
    c.deny(9)
    assert_equal('0:012..5678.', c.to_s)
  end
end


class TC_SodSrc < Test::Unit::TestCase
	def test_setup
    @testdata = '+-------+-------+-------+
| _ 6 _ | 1 
8
----
| 2
----'
    src = SodSrc.new(@testdata)
    rslt = ''
    src.each{|row, col, val|
      rslt += '|' + row.to_s + ',' + col.to_s + ',' + val.to_s
    }
    assert_equal('|0,0,_|0,1,6|0,2,_|0,3,1|1,0,8|2,0,2', rslt)
  end

end


class TC_Sod < Test::Unit::TestCase
	def setup
    @testdata = '+-------+-------+-------+
| _ 6 _ | 1 _ 4 | _ 5 _ |
| _ _ 8 | 3 _ 5 | 6 _ _ |
| 2 _ _ | _ _ _ | _ _ 1 |
+-------+-------+-------+
| 8 _ _ | 4 _ 7 | _ _ 6 |
| _ _ 6 | _ _ _ | 3 _ _ |
| 7 _ _ | 9 _ 1 | _ _ 4 |
+-------+-------+-------+
| 5 _ _ | _ _ _ | _ _ 2 |
| _ _ 7 | 2 _ 6 | 9 _ _ |
| _ 4 _ | 5 _ 8 | _ 7 _ |
+-------+-------+-------+'
	end
  
	def test_setup
		sod = Sod.new(@testdata)
		assert_equal(6, sod.cell(0,1).val)
		assert_equal(2, sod.cell(2,0).val)
		assert_equal(7, sod.cell(8,7).val)
		assert_equal(@testdata, sod.to_s)   # test to_s
    assert_equal('1:..23......', sod.cell(5,5).to_s)  # test cell 'allowed's
    assert_equal('23',           sod.cell(5,5).alloweds)  
    assert_equal('0:...34...89', sod.cell(2,7).to_s)
#    sod.dump
	end
  
	def test_each_in_row
		sod = Sod.new(@testdata)
    rslt = ''
		sod.each_in_row(3){|c|
      rslt += c.val.to_s
    }
    assert_equal('800407006', rslt)
	end
  
	def test_each_in_col
		sod = Sod.new(@testdata)
    rslt = ''
		sod.each_in_col(2){|c|
      rslt += c.val.to_s
    }
    assert_equal('080060070', rslt)
	end
  
	def test_each_in_block
		sod = Sod.new(@testdata)
    rslt = ''
		sod.each_in_block(7,1){|c|
      rslt += c.val.to_s
    }
    assert_equal('500007040', rslt)
	end
  
  def test_set_unset
    sod = Sod.new(@testdata)
    sod.setcell(2, 6, 7)
    assert_equal(7, sod.cell(2, 6).val)
    assert_equal(false, sod.cell(2, 5).allowed(7)) # check the row deny
    assert_equal(false, sod.cell(5, 6).allowed(7)) # and the col deny
    assert_equal(false, sod.cell(1, 7).allowed(7)) # and the block deny   

    sod.unsetcell(2, 6)
    assert_equal(0, sod.cell(2, 6).val)
    assert_equal(true, sod.cell(2, 5).allowed(7)) # check the row allow
    assert_equal(true, sod.cell(5, 6).allowed(7)) # and the col allow
    assert_equal(true, sod.cell(1, 7).allowed(7)) # and the block allow   
  end
  
end

Sodoku.rb (2.89 KB, text/x-ruby)
require 'Sod.rb'

# The main solver of puzzles. The algorithm is straightforward
# 1.  Cycle through the grid looking for cells that can only take 
#     one value, and set them to that value. 
# 2.  This will restrict the values of other cells, so keep cycling thru
#     until all cells either are fixed or can take more than one value.
# 3.  (While this cycling is going on, also look for the cell which is unset
#     and also has the smallest list of possible values.)
# 4.  If there is NO smallest, all cells must already be set. That means
#     we have found a solution, so print it.
# 5.  Otherwise, cycle through the list of values that the chosen smallest
#     cell can take and for each one, 
#       - create a clone of the puzzle as it currently stands, 
#       - set the value of the cell to that value and 
#       - call 'solve' again recursively, passing it the clone.

# 6.  If more than one solution exists, this will find them all
# 7.  If no solution exists, none will be printed ;-)
# 8.  If the original puzzle was ill-formed, results are unpredictable.

def solve(sod)
  puts "\n\nSolver called to solve :\n#{sod.to_s}" if $VERBOSE

# set all the cells that can be determined from the initial conditions
  begin
    fixed = 0
    smallestval = 99
    smallest = []
    for row in 0..8
      for col in 0..8
        c = sod.cell(row, col)
        if c.val == 0
        if c.alloweds.size < smallestval.size
          smallest = [row,col]
          smallestval = c.alloweds
        end
          if c.alloweds.size == 1
            sod.setcell(row,col,c.alloweds.to_i)
            puts "(#{row},#{col}) set to #{c.val}" if $VERBOSE
            fixed += 1
          end
        end
      end
    end
    puts "#{fixed} were fixed" if $VERBOSE
  end while fixed > 0
  
  puts "\nSolver bottomed out at:\n#{sod.to_s}" if $VERBOSE
  puts "Smallest found was (#{smallest[0]},#{smallest[1]}) = #{smallestval}" if $VERBOSE

# If we got a solution, print it out
  if smallest == []
    puts "===> FOUND A SOLUTION !!"
    puts sod.to_s
    
# and if not, set a small-options cell to each of its options in turn (in a clone)...    
  else
    sod.cell(smallest[0], smallest[1]).alloweds.each_byte{|v|
      tempsod = sod.clone
      tempsod.setcell(smallest[0], smallest[1], v.chr.to_i)
# ... and call ourselves recursively to solve the clone      
      solve(tempsod)
    }
  end
end

#================== Main Program ====================

@testdata = <<HERE
'+-------+-------+-------+
| _ 6 _  | 1 _ 4  | _ 5 _ |
| _ _ 8  | 3 _ 5  | 6 _ _ |
| 2 _ _  | _ _ _  | _ _ 1 |
+-------+-------+-------+
| 8 _ _  | 4 _ 7  | _ _ 6 |
| _ _ 6  | _ _ _  | 3 _ _ |
| 7 _ _  | 9 _ 1  | _ _ 4 |
+-------+-------+-------+
| 5 _ _  | _ _ _  | _ _ 2 |
| _ _ 7  | 2 _ 6  | 9 _ _ |
| _ 4 _  | 5 _ 8  | _ 7 _ |
+-------+-------+-------+'
HERE
  
sod = Sod.new(@testdata)
puts "Solving... \n#{sod.to_s} \n"

solve sod

puts 'Press <ENTER> to continue...'
gets

In This Thread

Prev Next