[#66078] Re: your BMW fku — "jam_kernovitch@..." <jam_kernovitch@...>
[#66079] gc_sweep(): unknown data type 48 — Mauricio Fern疣dez <batsman.geo@...>
Hi,
On Sat, Mar 01, 2003 at 07:26:58PM +0900, nobu.nokada@softhome.net wrote:
Hi,
Hi,
On Sun, Mar 02, 2003 at 12:55:48AM +0900, Yukihiro Matsumoto wrote:
Hi,
[#66088] Anything like Class::DBI from Perl — pw-googlegroups@... (Peter Wilkinson)
We've been doing some work using Class::DBI in Perl which makes access
[#66112] Additions to pop.rb... — "Frank S.Fejes III" <frank@...>
Hello all. I don't quite know if this is the place to post these types of
[#66119] GUI toolkit supporting Global IME? — bsl04@... (Brian)
I'm unable to confirm which if any of the Ruby GUI toolkits support
[#66137] Ruby 1.8.0 bug — Child <child@...9.ds.pwr.wroc.pl>
Hi,
On Sunday 02 March 2003 09:47 am, nobu.nokada@softhome.net wrote:
[#66185] Bug in date.rb? — Child <child@...9.ds.pwr.wroc.pl>
Hello
[#66202] Ruby/GNOME2 as multi-platform GUI toolkit — Gour <gour@...>
Hi!
[#66217] Prolly a simple question — <ghost-no-spam@...>
Sorry if these questions have come up before, but google searching hasn't
[#66229] ANN: coco/rb ver 0.5.0 — Mark Probert <probertm@..._acm.org>
[#66245] TCPSocket delay problem — Seth Kurtzberg <seth@...>
Matz,
Hi,
On Tuesday 04 March 2003 05:55 am, Yukihiro Matsumoto wrote:
>>>>> "S" == Seth Kurtzberg <seth@cql.com> writes:
[#66262] any ruby news aggregators out there? — "Chris Morris" <chrismo@...>
I checked RAA and didn't see anything out there. Anyone working on an
[#66269] OSCON — ptkwt@...1.aracnet.com (Phil Tomson)
For those coming to OSCON this year...
Hi,
[#66274] EBCDIC -> ASCII — Matt Lawrence <matt@...>
I'm trying to write a Ruby script that will translate data in EBCDIC and
[#66297] minor glitch in numeric.c — "Shashank Date" <sdate@...>
I was compiling ruby-1.8.0-preview1 from source using VC++ 6.0 on Win XP
[#66315] system command expansion after PTY.spawn — Christian von Mueffling <cvm@...>
Hi!
Hi,
>>>>> "n" == nobu nokada <nobu.nokada@softhome.net> writes:
On Thu, Mar 06, 2003 at 10:06:36PM +0900, ts wrote:
[#66317] Newbie question regarding drives — "Sperberg, Roger" <roger.sperberg@...>
Can someone advise me of how to find out within my Ruby program what drives
[#66330] cookies in eruby mod_ruby — Daniel Bretoi <lists@...>
Can someone explain how to set/delete cookies using mod_ruby (eruby)?
[#66332] Russian Ruby resource and Ruby Course — leikind@... (Yuri Leikind)
Hi all,
In article <003201c2e3fb$59b1b4b0$c20ca8c0@gfb>,
[#66348] Module#require — Eugene Scripnik <Eugene.Scripnik@...>
Is there require method implementaion, which loads library in the
[#66352] puts sometimes gives:in `write': Interrupted system call (Errno::EINTR) — Hugh Sasse Staff Elec Eng <hgs@...>
I sometimes get the error message:
Hi,
[#66361] Re: Is there a way to 'unload' a script/module/class ? — "Bennett, Patrick" <Patrick.Bennett@...>
That won't work since I need to instantiate a class within the loaded
>>>>> "B" == Bennett, Patrick <Patrick.Bennett@inin.com> writes:
[#66392] DRB and threads — Brian Candler <B.Candler@...>
I wonder if anyone can give me some hints on the interactions between dRuby
On Fri, Mar 07, 2003 at 07:15:29PM +0900, Robert Klemme wrote:
On Fri, 7 Mar 2003, Brian Candler wrote:
On Sat, Mar 08, 2003 at 11:38:31AM +0900, ahoward wrote:
On Sat, 8 Mar 2003, Brian Candler wrote:
On Sat, Mar 08, 2003 at 04:40:17PM +0000, ahoward wrote:
On Sun, 9 Mar 2003, Brian Candler wrote:
On Sun, Mar 09, 2003 at 06:40:35PM +0900, ahoward wrote:
On Mon, 10 Mar 2003, Brian Candler wrote:
[#66440] Solving the 'strange language' documentation problem — "Josef 'Jupp' Schugt" <jupp@...>
Dear Rubyists,
EHLO
Hello,
> IMHO, what we need is 'Writing documents in English
On Sunday 09 March 2003 07:46 am, Mike Campbell wrote:
> > IMHO, what we need is 'Writing documents in English
[#66455] Debugging in Test::Unit::TestCases — Robert Feldt <feldt@...>
Hi,
>>>>> "R" == Robert Feldt <feldt@ce.chalmers.se> writes:
[#66466] I'm to give short talk on ruby at work, anybody have material/outlines they can donate/ — Sam Roberts <sroberts@...>
On Saturday 08 March 2003 04:20 pm, Sam Roberts wrote:
[#66469] What character sets are available in Ruby ? — peterjohannsen@... (pj)
There is a Ruby FAQ which I read that said that Ruby only supports
[#66471] install.rb problem - ri and rdoc think OS X is windows! — Sam Roberts <sroberts@...>
I think this is the problem:
[#66482] rdoc - how to exclude internal APIs, and use :title: and :main:? — Sam Roberts <sroberts@...>
I'm sorry if I'm missing the obvious, but i'm staring at the docs, and
[#66489] $0 == false ?? — Tim Bates <tim@...>
I'm running a script under mod_ruby, and for some reason $0 is set to false.
[#66502] Suggestion for setsockopt — Brian Candler <B.Candler@...>
Extract from ruby-1.6.8:
>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:
[#66522] Thinking of learning Ruby — "anonimous" <n.thomp@...>
I have abour 3 or 4 years experience with Linux, and about 2 years
> Althoug getting a job in programming is a concern of mine, I think
[#66530] Protocols — "Ray Capozzi" <Ray_Capozzi@...>
Is there a preferred set of ruby libraries for client/server solutions? As
> "Ray Capozzi" <Ray_Capozzi@hotmail.com> wrote in message
On Sunday 09 March 2003 07:35 pm, jbritt@ruby-doc.org wrote:
Hi,
Hi,
On Sunday 16 March 2003 08:58 pm, NAKAMURA, Hiroshi wrote:
[#66551] RDoc 0.9 — Dave Thomas <dave@...>
It's been a while since the last RDoc release. In the meantime, I've
[#66556] YAML on solaris: problem with libiconv — Joel VanderWerf <vjoel@...>
[#66570] DRb: remote methods not running remotely??? — Hugh Sasse Staff Elec Eng <hgs@...>
I have a drb server on one machine, which is basically started with:
Hugh Sasse Staff Elec Eng (hgs@dmu.ac.uk) wrote:
On Tue, 11 Mar 2003, Eric Hodel wrote:
On Tue, 11 Mar 2003, Hugh Sasse Staff Elec Eng wrote:
Hugh Sasse Staff Elec Eng (hgs@dmu.ac.uk) wrote:
On Tue, 11 Mar 2003, Eric Hodel wrote:
[#66580] Limited Support for Multiple Inheritance in SWIG/Ruby — "lyle@..." <lyle@...>
All,
[#66586] project design issues — Travis Whitton <whitton@...>
Hello all - I've been using Ruby quite happily over the last year, and I have
[#66609] Debian & Gentoo installation instructions — Daniel Carrera <dcarrera@...>
I'm writing installation instructions for Ruby. I'd like to double
On Monday 10 March 2003 01:05 pm, Daniel Carrera wrote:
[#66629] Problem with log4r — Markus Jais <info@...>
hello
[#66633] Threads and DRb — "Hal E. Fulton" <hal9000@...>
I changed the title here because this is not
----- Original Message -----
----- Original Message -----
----- Original Message -----
[#66650] PSE as Ruby module and an RAA question — "Josef 'Jupp' Schugt" <jupp@...>
Hi!
[#66655] How to destroy a TkToplevel window — Daniel Carrera <dcarrera@...>
Hello,
[#66681] debugging — "Ramakrishnan Subramanian" <ramakrishnan.subramanian@...>
[#66690] SCGI — ahoward <ahoward@...>
[#66714] Ruby extension to get mount information in Linux — anonimous <n.thomp@...>
Is there a library for getting information in drives that can be mounted and
[#66718] scanning strings — "MikkelFJ" <mikkelfj-anti-spam@...>
I want to scan a string for breaks. I want to pick both the breaks and the
[#66720] IRC — Tommy Hallgren <thallgren@...>
Hi!
[#66736] Spanish documentation — Daniel Carrera <dcarrera@...>
Does anyone know of any Spanish Ruby books or other documentation?
[#66738] a newbie question — Ben Thomas <trickster@...>
Hi,
[#66770] Gentoo Administration — Bruce Williams <bruce@...>
This isn't really worth an [ANN], so I'm not making it one.
[#66774] Coding challenge: Recurring stream — Martin DeMello <martindemello@...>
Given a stream of numbers that, at some point, recurs with period k,
It's nasty (as in geometric-scaling as string size increases) *and*
[#66788] Re: Spanish documentation — Victor Manuel Reyes Viloria <vmreyes@...>
[#66804] Re: Problem with Mysql in win ruby 1.6.8 — "J.Hawkesworth" <J.Hawkesworth@...>
Greg,
J.Hawkesworth wrote:
ラ, 13.03.2003, ラ 08:56, Greg Brondo ホチミノモチフ:
At 10:12 +0900 3/13/03, Sergei Dolmatov wrote:
[#66805] Ruby newbie uninstall question? — "Colin Coates" <colin@...>
Hello Everyone,
[#66809] Prevent method override? — James Davis <jd204c@...>
Is there a way to prevent a subclass from overriding a method that was
[#66814] DBI and MSAccess — "Rasmus Debitsch" <Debitsch@...>
I want to access a MSAccess database with Ruby. I'm new to databases and
[#66838] UML software for linux — anonimous <n.thomp@...>
I was never big on learning UML but I think it would make programming a
[#66845] next iteration within a block — Wojciech Kaczmarek <schatten@...>
What is the most short/elegant way of ending the current iteration
[#66850] Ruby / Eiffel ? — <cailloux@...>
Hello evry body
also, related, does anyone know if there is a good reason for the absense
On Fri, 14 Mar 2003 05:59:33 +0900
On Fri, 14 Mar 2003, Ryan Pavlik wrote:
[#66853] raised access floor biz oppty! — "Meng Chaohua" <ebmail@163.com>
恊彰議人薩
[#66858] ruby accounts for 25 Hours in a day (2003-03-30) — "Ricardo Nogueira" <rnog2438@...>
I have reported this to ruby-lang bugs a week ago (incoming #639),
On Thu, 13 Mar 2003 18:29:36 +0900, Yukihiro Matsumoto wrote:
[#66869] Etc module in _The Ruby Way_ — Ollivier Robert <roberto@...>
In _The Ruby Way_, page 415, there is an interesting module mentionned: the
[#66878] Rubuy 1.8.0 preview2 debug doesn't stop at breakpoints — Jeff Putsch <putsch@...>
Howdy,
this is fixed in the snapshot
On Fri, Mar 14, 2003 at 03:53:20AM +0900, Seth Kurtzberg wrote:
[#66906] Syck 0.08 -- Next-generation of YAML.rb — why the lucky stiff <yaml-core@...>
citizens,
Works great under OS X and Ruby 1.8!
You're joking. Open up that Apple and make sure for me will ya? Wow. Gotta
On Sat, 15 Mar 2003, why the lucky stiff wrote:
why the lucky stiff wrote:
On Friday 14 March 2003 01:40 pm, Daniel Berger wrote:
syck doesn't build out of the box under FreeBSD-4.7 with its standard byacc.
On 14/03/03 00:16 -0700, why the lucky stiff wrote:
On Friday 14 March 2003 12:48 pm, Brian Ingerson wrote:
On 14/03/03 13:20 -0700, why the lucky stiff wrote:
On Friday 14 March 2003 02:54 pm, Brian Ingerson wrote:
[#66916] method call on terminated object [W2k,1.6.8} — Michael Bruschkewitz <brusch2@...>
Hello,
[#66927] dynamically create a method — Rudolf Polzer <abuse@...>
Is there a possiblilty to dynamically create a method, like this?
[#66958] a library versioning package — ahoward <ahoward@...>
[#66965] Overloaded operator interprets block as hash — ptkwt@...1.aracnet.com (Phil Tomson)
[#66974] The onion truck strikes again ... Announcing rake — Jim Weirich <jweirich@...>
Ok, let me state from the beginning that I never intended to write this
A couple of comments.
On Fri, 2003-03-14 at 23:06, Seth Kurtzberg wrote:
[#67013] ANN: vcard 0.1 - a vCard decoding library — Sam Roberts <sroberts@...>
http://raa.ruby-lang.org/list.rhtml?name=vcard
This is awesome...welcome to the contributing community members!
Quoteing rich@infoether.com, on Sun, Mar 16, 2003 at 04:15:57AM +0900:
I think the index method [] returning the preferred field (if pref is
[#67019] |FXRUBY] contextual menu in an Icon List — Pierre Baillet <oct@...>
Dear rubyists,
[#67030] Your favorite Ruby web library? was: Working on a CGI... — "Hal E. Fulton" <hal9000@...>
Got no replies to this one... (except one re: databases,
[#67033] mapping $? to text message — Joel VanderWerf <vjoel@...>
[#67037] Hash load and GC — Xiangrong Fang <xrfang@...>
Hi Guys,
[#67059] ruby-dev summary 19773-19824 — Takaaki Tateishi <ttate@...>
Hello,
On Mon, Mar 17, 2003 at 12:48:46AM +0900, Takaaki Tateishi wrote:
[#67062] Question about Amrita — kwa@... (makotz)
Hi,
[#67063] Iterator using Continuations — Hans =?iso-8859-15?q?J=F6rg=20Hessmann?= <hessmann@...>
Hi,
[#67071] How do I get irb to use readline, (with OS X)? — Sam Roberts <sroberts@...>
I'm sure I saw something about this somewhere, but I've been searching,
On Monday, 17 March 2003 at 5:38:45 +0900, Sam Roberts wrote:
Sorry for being vague. What I want is simpler that that - I want to be able to
[#67074] ANN: Madeleine 0.1 — Anders Bengtsson <ndrsbngtssn@...>
> http://sourceforge.net/project/showfiles.php?group_id=74624
On Mon, Mar 17, 2003 at 07:00:35AM +0900, Anders Bengtsson wrote:
--- Brian Candler <B.Candler@pobox.com> skrev:
On Mon, Mar 17, 2003 at 11:37:56PM +0900, Anders Bengtsson wrote:
--- Brian Candler <B.Candler@pobox.com> wrote:
On Tue, Mar 18, 2003 at 01:18:09AM +0900, Anders Bengtsson wrote:
[#67099] T-shirts — Armin Roehrl <armin@...>
Hi all,
[#67166] Accessing hash values sorted by their keys — "Josef 'Jupp' Schugt" <jupp@...>
Is an elegant way of doing this?
[#67174] CursWrap [n]Curses module — vangczung@... (Julian Snitow)
This weekend I wrote a ruby module that aims to provide a friendlier
[#67182] ruby + windows + apache — "RaymondLHW" <raymondlhw@...>
what should I do if I want to run ruby on apache ( windows ) ?
[#67185] Substitution in a string in a string — Tim Bates <tim@...>
I am using eval to dynamically define a method, and at some point, I want to
[#67222] OT: XML too hard (YAML opportunity?) — ptkwt@...1.aracnet.com (Phil Tomson)
On /. today there is a discussion about a weblog entry by an XML
> On /. today there is a discussion about a weblog entry by an XML
----- Original Message -----
> But beyond
I got this weird sense that people were talking about me...and here you
jbritt@ruby-doc.org wrote:
> jbritt@ruby-doc.org wrote:
[#67228] How to get the Windows handle for a socket — Tom Felker <tcfelker@...>
On Windows, I do the following (trying to get a nonblocking socket):
[#67233] OT: Getting at client headers from CGIs — Dave Thomas <dave@...>
Folks:
[#67260] Thoughts about native Ruby widget set — Idan Sofer <idan@...>
Looking at RAA's listing:
[#67277] Why does basic cgi example fail on Apache/Windows? — "Chris Morris" <chrismo@...>
This has come up in the past, but why does this bare-bones cgi example (from
[#67283] Digest::MD5 on Mac OS X — Ben Schumacher <ben@...>
Hello-
[#67293] Find::Bin, use lib, in ruby — Daniel Bretoi <lists@...>
Hi,
[#67302] Frequency of announcements — "Josef 'Jupp' Schugt" <jupp@...>
Hi!
Josef 'Jupp' Schugt wrote:
[#67304] Strong advantages over Python — Greg McIntyre <greg@...>
Hi lovely Ruby people,
Seth Kurtzberg <seth@cql.com> writes:
On Saturday 22 March 2003 02:09 pm, Johann Hibschman wrote:
On Sun, Mar 23, 2003 at 07:11:36AM +0900, Seth Kurtzberg wrote:
Greg McIntyre wrote:
Good list. Amalgamated with http://www.ruby-lang.org/en/whats.html, it
Greg McIntyre wrote:
Okay, not to feed the flames too much here, but I figured I may as well
I'm not going to go back and forth on preferences, but just talk about
Thanks to all of you who answered and cleared up some of my perceptions
Greg McIntyre wrote:
On Sun, 2003-03-23 at 16:17, Paul Prescod wrote:
On Mon, Mar 24, 2003 at 06:17:49AM +0900, Paul Prescod wrote:
Hi --
Mark Wilson <mwilson13@cox.net> wrote:
Jim Weirich <jweirich@one.net> wrote:
mike@ratdog.stok.co.uk (Mike Stok) wrote:
[#67337] eRuby/mod_ruby hosting proposal — trimmed@... (George Jempty)
I successfully installed mod_ruby on a virtual private server free
[#67342] Solaris2.5.1, ruby-1.8.0 snapshot 19-MAR-2003 — Hugh Sasse Staff Elec Eng <hgs@...>
I have just tried to build the nightly snapshot I picked up
On Fri, 21 Mar 2003, Yukihiro Matsumoto wrote:
[#67346] class level Exception handling — Xiangrong Fang <xrfang@...>
Hi
Great! This is much simpler than the last approaches. However, I'd make a
[#67366] Newbie question: 9/5=1 ? — Thomas Jollans <nospam@...>
while learning ruby i wanted to program a simple fahrenheit to celsius
On Thu, 20 Mar 2003, Thomas Jollans wrote:
Thomas Jollans wrote:
On Fri, Mar 21, 2003 at 04:05:42AM +0900, Joel VanderWerf wrote:
[#67381] which site_ruby dir? — "Chris Morris" <chrismo@...>
Probably a stupid question, but I can't find the answer.
[#67387] Ruby tutorial download — Daniel Carrera <dcarrera@...>
Someone asked that I make the ruby tutorial available for download,
----- Original Message -----
[#67415] Proposal: new operator: '<-' (for assignments) — ptkwt@...1.aracnet.com (Phil Tomson)
On Fri, 21 Mar 2003 11:20:27 +0900, Phil Tomson wrote:
[#67436] cvs.ruby-lang.org access — "Hal E. Fulton" <hal9000@...>
Hi, all.
[#67438] infinite Time — ahoward <ahoward@...>
Hi,
[#67446] Ruby & LaTeX — Walter Cazzola <cazzola@...>
Dear Ruby Experts,
On Friday, 21 March 2003 at 18:06:56 +0900, Walter Cazzola wrote:
[#67514] Rake problem? — manfred.lotz@... (Manfred)
Hi,
On Fri, 2003-03-21 at 14:44, Manfred wrote:
[#67515] ruby and cron help — Mark Probert <probertm@..._acm.org>
Hi, rubyists.
[#67525] Time::INFINITY — ahoward <ahoward@...>
rubyists-
On Sat, Mar 22, 2003 at 05:25:16AM +0900, ahoward wrote:
[#67545] Looking for Total Windows Solution — Jim Freeze <jim@...>
Hi:
Jim Freeze wrote:
[#67546] Expression results — debitsch@... (Rasmus)
Hello,
----- Original Message -----
--- "Hal E. Fulton" <hal9000@hypermetrics.com> wrote:
On Sat, Mar 22, 2003 at 07:39:02AM +0900, Hal E. Fulton wrote:
In article <20030321231000.GA65019@uk.tiscali.com>,
[#67567] List of Ruby-related RSS feeds? — <jbritt@...>
I'd like to put together a list of all known Ruby RSS/RDF feeds, and have
[#67586] up key doesn't work in irb — Emmanuel Touzery <emmanuel.touzery@...>
Hello,
[#67592] Quick Question about Queue's — duemoko <spam@...>
I am putting together a small app that will need a message queue. There
[#67634] exiting a loop — Daniel Carrera <dcarrera@...>
Hello,
Daniel Carrera wrote:
----- Original Message -----
On Mon, Mar 24, 2003 at 01:13:33PM +0900, Chris Pine wrote:
On Mon, 24 Mar 2003, Daniel Carrera wrote:
[#67660] Question about behavior of Array.new — Jeremy <thinker5555@...>
Hi,
[#67711] Iterate over two lists in parallel — Gavin Sinclair <gsinclair@...>
On Monday, March 24, 2003, 1:54:53 PM, Julian wrote:
----- Original Message -----
----- Original Message -----
>
On Tue, Mar 25, 2003 at 05:02:19PM +0900, Julian Snitow wrote:
[#67733] Building Ruby with MinGW help needed — Gour <gour@...>
Hi!
On Mon, 24 Mar 2003, Gour wrote:
[#67738] Call for first ruby programs — Chad Fowler <chadfowler@...>
Hello all,
[#67764] exec : Zero Sized Reply — "\"RayZ\" Andrew V Rumm" <rayz@...>
My cgi-script contains
>>>>> "R" == \"RayZ\" Andrew V Rumm <RayZ> writes:
[#67769] Writing a new method in C for a subclass — David Landrith <dlandrith@...>
Given the available documentation and having gone through the ruby
On Tue, Mar 25, 2003 at 01:07:40AM +0900, David Landrith wrote:
[#67796] acgi - a fastcgi alternative? — ahoward <ahoward@...>
On Tue, Mar 25, 2003 at 07:20:18AM +0900, ahoward wrote:
[#67804] defout vs stdout — ahoward <ahoward@...>
Hi,
On Tue, 25 Mar 2003 nobu.nokada@softhome.net wrote:
[#67859] ruby-fcgi: proposed patch — Brian Candler <B.Candler@...>
Here is a patch against Moonwolf's excellent ruby-fcgi-0.8.2, inspired by
[#67877] Garbage collector problems — "Jaen Saul" <jaen@...>
Note: I assume you know basic facts about the C stack, I'm using the x86
[#67880] question about include and modules — mhm26@... (matt)
ruby -v
>>>>> "m" == matt <mhm26@drexel.edu> writes:
On Wed, Mar 26, 2003 at 06:22:23PM +0900, ts wrote:
>>>>> "M" == Mauricio Fern疣dez <Mauricio> writes:
[#67882] Inheriting from WIN32OLE — ashokiitm@... (xellos)
Can anyone tell me why this does not work?
[#67900] tee in ruby while catching status — Daniel Bretoi <lists@...>
Hi all,
maybe something like this:
Thanks for your help so far guys.
[#67906] changing a stream of 'print' method to a string — kwa@... (makotz)
Hi,
[#67915] Conditionally make a method private? — Jeremy <thinker5555@...>
Hello again!
John Johnson wrote:
[#67920] Re: What kind of book is PickAxe? — "Pe, Botp" <botp@...>
[#67942] Dir.glob and space in folders names — Pierre Baillet <oct@...>
Hello,
[#67961] What are the differences between Ruby's blocks and Python's lambdas? — sdieselil@... (sdieselil)
See subject.
As was mentioned, Ruby has lambdas, but they are commonly called "procs".
On Thu, Mar 27, 2003 at 12:50:04AM +0900, Chris Pine wrote:
On Thu, Mar 27, 2003 at 01:01:25AM +0900, Mauricio Fern疣dez wrote:
On Thu, Mar 27, 2003 at 02:20:48AM +0900, Paul Brannan wrote:
On Thu, Mar 27, 2003 at 04:40:40AM +0900, Mauricio Fern疣dez wrote:
On Thu, Mar 27, 2003 at 05:17:47AM +0900, Paul Brannan wrote:
On Thu, Mar 27, 2003 at 06:00:09PM +0900, Mauricio Fern疣dez wrote:
>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:
On Thu, Mar 27, 2003 at 09:07:47PM +0900, ts wrote:
>>>>> "B" == Brian Candler <B.Candler@pobox.com> writes:
On Thu, Mar 27, 2003 at 10:03:14PM +0900, ts wrote:
[#67974] Programming Ruby in more formats? — Xavier Noria <fxn@...>
Are the LaTeX sources, or a dvi, ps, or pdf version of "Programming Ruby"
[#67977] Hurd and ruby 1.8preview2 — Manfred Hansen <manfred@...>
Hello,
[#67985] Need help running RDE on WIN2000 — Jim Freeze <jim@...>
On Wednesday, 26 March 2003 at 6:52:58 +0900, Daniel Berger wrote:
[#67987] syntax — "daniel" <offstuff@...>
hello,
[#67996] Regular Expresison in Method Problem — "Nick" <nick.robinson@...>
Hi,
[#68021] pack — Daniel Carrera <dcarrera@...>
Hi,
[#68027] Debugging Ruby itself. — John Carter <john.carter@...>
For various reasons I'm using the CVS latest version of Ruby....
[#68042] Caveats of rb_global_variable() ? — Julian Snitow <vangczung@...>
Fellow Rubygoers,
[#68054] 1.8 docs in progress? — Hugh Sasse Staff Elec Eng <hgs@...>
Is there any current work in progress on the 1.8 docs?
[#68058] Comparable, String and == — han.holl@... (Han Holl)
Maybe I'm doing something very stupid, but consider this.
[#68080] How to call super with different arguments — Han Holl <han.holl@...>
On Fri, Mar 28, 2003 at 07:02:09AM +0900, Han Holl wrote:
[#68082] Array question — walter@...
Any one know why Array.join can't take a code block and join that
Hi,
On Fri, Mar 28, 2003 at 06:00:59PM +0900, Yukihiro Matsumoto wrote:
On Fri, 28 Mar 2003 7:37 pm, Daniel Carrera wrote:
--- Robert Klemme <bob.news@gmx.net> wrote:
Hi,
--- Yukihiro Matsumoto <matz@ruby-lang.org> wrote:
[#68089] Windows Platform - changing directory of caller? — "Nick" <nick.robinson@...>
Hi,
[#68099] Article on secure code — Daniel Carrera <dcarrera@...>
Hello,
il Mon, 31 Mar 2003 03:06:52 +0900, "Josef 'Jupp' Schugt"
[#68103] Newbie question:Does Ruby have the structure of hash's array like Perl does? — Weng Lei-QCH1840 <LeiWENG@...>
Something like below doesn't work:
[#68110] Re: Newbie question:Does Ruby have the structure of hash's array like Perl does? — Weng Lei-QCH1840 <LeiWENG@...>
Thx!
On Fri, Mar 28, 2003 at 05:09:09PM +0900, Weng Lei-QCH1840 wrote:
On Fri, Mar 28, 2003 at 05:15:49PM +0900, Daniel Carrera wrote:
[#68151] new 1.8-snapshot regex warning — Brad Hilton <bhilton@...>
I just installed the latest 1.8 snapshot from 3/27 and found that I now
[#68171] Need #collect! on partial array — Jim Freeze <jim@...>
Hi:
[#68174] The Phrasebook Design Pattern, SQL and YAML — Daniel Berger <djberge@...>
Hi all,
[#68199] Ruby 1.6.8 vs Ruby 1.8.0 preview 2 - benchmarks — djberg96@... (Daniel Berger)
Hi all,
[#68201] Weighted random selection -- how would you do this? — "Hal E. Fulton" <hal9000@...>
Here's a little question for you.
In article <20030329063108.GA2300@math.umd.edu>,
In article <048601c2f5e4$b88d1ec0$0300a8c0@austin.rr.com>,
[#68233] C-API: Setting a Ruby-Object in a wrapped C struct — Lenny <kudling@...>
Hi,
[#68254] Saving code written during an irb session — Bil Kleb <W.L.Kleb@...>
OK, so I admit: I'm stupid. How do I save the code I've generated
[#68264] writing a 4 byte Integer to socket — gabriele renzi <surrender_it@...1.vip.lng.yahoo.com>
I need to write a value (it should be a Fixnum, but I'm not sure) over
[#68267] xml-simple 0.6.0 — Maik Schmidt <contact@...>
Yo!
[#68268] inspect question/request — "Chris Pine" <nemo@...>
Hello,
Hi,
Hi,
Hi,
[#68271] Hard coded newline characters — David King Landrith <dave@...>
There are a surprising number of ruby source files that have newline
Hi,
On Sunday, March 30, 2003, at 08:06 PM, nobu.nokada@softhome.net wrote:
David King Landrith wrote:
Hi,
[#68293] Re: Saving code written during an irb session — "Pe, Botp" <botp@...>
[#68297] How to allow iteration over a collection that can be enumerated in multiple ways? — Sam Roberts <sroberts@...>
Kind of a general question.
[#68318] syntax highlighting problem in vim — "Josef 'Jupp' Schugt" <jupp@...>
Hi!
Negative. It is correct for me. How is it displayed at you?
> On 0331, Josef 'Jupp' Schugt wrote:
On Mon, Mar 31, 2003 at 11:25:25PM +0900, KONTRA Gergely wrote:
On Tuesday, April 1, 2003, 1:58:45 AM, Mauricio wrote:
[#68323] Change to /.../.match("foo") behaviour in 1.6.8? — Austin Ziegler <austin@...>
In 1.6.7 and 1.7, I had the following line work:
Hi --
[#68367] GUI development under Ruby — jennyw <jennyw@...>
I was wondering what people were using for GUI development. I've seen a
il Tue, 1 Apr 2003 07:52:38 +0900, jennyw <jennyw@dangerousideas.com>
Re: Iterate over two lists in parallel
On Sun, 2003-03-23 at 22:15, Gavin Sinclair wrote:
> I'd like someone, hopefully including Julian and Jim (Weirich), to
> demonstrate how to iterate over twop lists in parallel. Extra marks
> for setting a realistic example problem and solving it!
Here's my take on this ... you can find an HTML version (that's a bit
more readable) at http://w3.one.net/~jweirich/talks/same_fringe/
-----------------------------------------------------------------------
#!/usr/bin/env ruby
# = Introduction
#
# [On Monday, March 24, 2003 in ruby-talk, Gavin Sinclair writes]
# "I'd like someone, hopefully including Julian and Jim (Weirich), to
# demonstrate how to iterate over two lists in parallel. Extra marks
# for setting a realistic example problem and solving it!"
#
# How can I refuse an offer like that!
#
# Here's what's ahead ... We will start with the Same Fringe problem.
# Then we will implement the solution three times (once by converting
# everything to arrays, once with a hand-written external iterator,
# and once with a generator). We will finish up with a discussion of
# how the generator implementation works (using continuations) works
# in Ruby.
#
# Sound good?
#
# = The Same Fringe Problem
#
# Lets imagine that we have a binary tree filled with sorted data.
# This kind of tree is a common data structure used to implement
# hash-like tables where the keys are stored in sorted order.
#
# These binary trees have the property that depth-first visit of the
# leaf nodes will visit the leaves in sorted order (we are ignoring
# interior nodes for this example). However, two trees containing the
# same leaf nodes may be structured differently (due to the order in
# which nodes are inserted into the tree).
#
# We want to write some code that will determine if two binary trees
# have the same fringe (i.e. leaf) nodes.
#
# == Example
#
# Consider the following trees ...
#
# tree1 tree2 tree3
# o o o
# / \ / \ / \
# A o o C o C
# / \ / \ / \
# B C A B A X
#
# Trees 1 and 2 have the same fringe leaves, although they are
# internally structured differently. Tree 3 does not have the same
# fringe as either tree 1 or 2, due to the leaf node X.
#
# = The Code
#
# So lets take a look at the code to handle this problem.
#
# == Class Node
#
# We will use a Node class to represent the interior nodes of our
# binary tree (leaf nodes will simply be strings). A node has an
# accessor for its left and right children.
class Node
attr_accessor :left, :right
def initialize(left, right)
@left, @right = left, right
end
end
# Iterating through a binary tree is pretty easy. You just
# recursively visit the left children and then the right children.
# Since we are ignoring the interior nodes, we don't have to worry
# about pre-order vs post-order.
#
# We use implement the iteration in term of +each+ and include
# +Enumerable+, making our trees respond to the standard Ruby internal
# iterator protocol.
class Node
include Enumerable
def each(&block)
handle_child(self.left, &block)
handle_child(self.right, &block)
end
def handle_child(value, &block)
case value
when Node
value.left.each(&block)
value.right.each(&block)
else
yield(value)
end
end
end
# == External Iterators
#
# Internal iterators are difficult to use in solving the same-fringe
# problem. The reason is that we want to walk both trees, one element
# at a time, so we can compare the elements. Because internal
# iterators encapsulate the iteration algorithm, it is difficult to
# change the algorithm to handle two trees.
#
# Fortunately it is easy to solve the same-fringe problem with
# external iterators. In the following code, assume an iterator
# provides a method named +get+ that returns the next available item
# from the iterator. When the iterator is done, +get+ will return
# nil.
#
# == Same Fringe Function Using External Iterators
#
# Here is the same_fringe function written with external iterators.
# The function takes two iterators as arguments, one iterator for each
# of the two trees being compared. Same_fringe will only return true
# if each element from both trees are identical all the way to the end
# of the list. Since the iterators just return a sequence of leaf
# nodes, we are ignoring the tree structure during the comparison.
def same_fringe(it1, it2)
while v1 = it1.get
v2 = it2.get
return false if v1 != v2
end
return v1 == it2.get
end
# Notice that +same_fringe+ doesn't care what kind of iterator it is
# given, as long as the iterator conforms to the +get+ specification
# we gave. We will write several iterators and pass them to
# +same_fringe+.
#
# == Support Code
#
# Before we write some iterators, here is some support code that we
# will use in the demonstration.
#
# *show* will show the contents of a tree using the given iterator.
# *show* is a good example of using our external iterator.
def show(msg, it)
print msg
while v = it.get
print " ", v
end
puts
end
# *show_sf* will run the +same_fringe+ function with the given
# iterators and show the results.
def show_sf(msg, expect, it1, it2)
result = same_fringe(it1, it2)
puts "Same Fringe, #{msg}, should be #{expect}, was #{result}"
fail "Unexected Result!" if expect != result
end
# Finally, *demonstrate* will create some trees and display them.
# *Demonstrate* expects a block that will return an iterator of the
# appropriate type.
def demonstrate(msg)
tree1 = Node.new("A", Node.new("B", "C"))
tree2 = Node.new(Node.new("A", "B"), "C")
tree3 = Node.new(Node.new("A", "X"), "C")
puts "Using #{msg} ..."
show("Tree1 = ", yield(tree1))
show("Tree2 = ", yield(tree2))
show("Tree3 = ", yield(tree3))
show_sf("tree1 vs tree2", true,
yield(tree1),
yield(tree2))
show_sf("tree1 vs tree3", false,
yield(tree1),
yield(tree3))
puts
end
# ----
#
# == Array Iterator
#
# Our first external iterator will be one that walks through an array.
# An array iterator is trivial to implement (as you can see). Also,
# it is easy to convert a tree to an array since the Node objects
# support the +Enumerable+ protocol. We just need to call +to_a+ and
# we have an array of leaf nodes.
#
# Here is the array iterator...
class ArrayIterator
def initialize(collection)
@array = collection.to_a.dup
end
def get
@array.shift
end
end
# We use our +demonstrate+ function to show that the array iterater
# does do its job.
demonstrate("Array Iterator") { |tree| ArrayIterator.new(tree) }
# === Output for Array Iterator
#
# Using Array Iterator ...
# Tree1 = A B C
# Tree2 = A B C
# Tree3 = A X C
# Same Fringe, tree1 vs tree2, should be true, was true
# Same Fringe, tree1 vs tree3, should be false, was false
# ----
#
# == Tree Iterator
#
# Although trivial to write, the array iterator suffers from a
# potential problem. The tree must be converted to an array before
# the +same_fringe+ function can even begin to look at leaf nodes. If
# the tree is large, then this can be problematic.
#
# Can we create an external iterator that examines the tree "in
# place"? Certainly! Here is the code.
class TreeIterator
def initialize(node)
@tree = node
@stack = []
end
# Get the next leaf node.
def get
if @tree
t = @tree
@tree = nil
left_most(t)
elsif ! @stack.empty?
node = @stack.pop
left_most(node.right)
else
nil
end
end
# Find the left-most leaf from +node+.
def left_most(node)
while Node === node
@stack.push(node)
node = node.left
end
node
end
end
# And again we use the +demonstrate+ method to show that the
# TreeIterator works.
demonstrate("Tree Iterator") { |tree| TreeIterator.new(tree) }
# === Output for Tree Iterator
#
# Using Tree Iterator ...
# Tree1 = A B C
# Tree2 = A B C
# Tree3 = A X C
# Same Fringe, tree1 vs tree2, should be true, was true
# Same Fringe, tree1 vs tree3, should be false, was false
# ----
#
# == Generators
#
# The tree iterator works great, but it was a big pain to code up.
# Did you notice the explicit stack that was used to remember the
# nodes that had not yet been processed? It works, but the logic is
# much more obscure than the internal iterator logic.
#
# Wouldn't it be nice if it were possible to write an external
# iterator reusing the logic from the internal iterator.
#
# Fortunately, it is possible to do exactly that using generators. A
# generator is simply a resumable function. After a generator returns
# a value, the next time it is called it starts executing immediately
# after the last return, remembering the values of all the local
# variables in the function.
#
# Python generators use the keyword *yield* to designate returning a
# value and the resumption point in a generator. Since Ruby already
# uses *yield* for blocks, we will use a *generate* method to return
# generated values.
#
# Here is a simple example that generates the squares of the numbers 0
# through 3. Notice that the iteration logic goes into a block given
# to the generator constructor. The generator object returned from
# the constructor can be used as an iterator, just like our Tree and
# Array iterators.
#
# $ irb --simple-prompt
# >> require 'generator'
# => true
# >> it = Generator.new { |g| 4.times { |i| g.generate(i**2) } }
# => #<Generator:0x401f24e8 @resume=#<Continuation:0x401f24ac>>
# >> it.get
# => 0
# >> it.get
# => 1
# >> it.get
# => 4
# >> it.get
# => 9
# >> it.get
# => nil
# >> exit
# $
#
# We will look at the guts of the generator in a moment. In the
# meantime, lets use a generator to solve the same-fringe problem.
#
# First we load the generator code.
require 'generator'
# Then we define a function that creates our generator for us. Since
# we already have an internal iterator that works, we will simply use
# that in the iteration logic of our generator.
def tree_generator(tree)
Generator.new do |generator|
tree.each { |value| generator.generate(value) }
end
end
# And we show that the generator works.
demonstrate("Generator") { |tree| tree_generator(tree) }
# === Output for Tree Iterator
#
# Using Generator ...
# Tree1 = A B C
# Tree2 = A B C
# Tree3 = A X C
# Same Fringe, tree1 vs tree2, should be true, was true
# Same Fringe, tree1 vs tree3, should be false, was false
# ----
#
# == Writing the Generator Code
#
# So how are generators written in Ruby? ... Very Carefully!
#
# No, seriously! We need to use continuations.
#
# === Continuations
#
# The key to writing generators is using continuations. A
# continuation is a callable object (i.e. you can send a :call message
# to a continuation) that encodes the return point of a function.
# Continuations are created by given the +callcc+ (or "Call with
# Current Continuation") method a block. +callcc+ passes its own
# continuation (the "current" continuation) to the block as a
# parameter. When the continuation is called, that particular
# instance of +callcc+ will return immediately with the value passed
# in the call argument list.
#
# Here's a short example ...
#
# x = callcc do |continuation|
# puts "In CALLCC"
# continuation.call("HI")
# puts "This is never printed"
# end
# puts "X = #{x}"
#
# Will print ...
#
# In CALLCC
# X = HI
#
# In this example, callcc looks like a version of setjump/longjump in
# C where the continuation plays the role of the jump buffer. There
# is one big difference. In C, you must never call longjump outside
# the scope of the setjump call. A continuation is allowed to be
# called anywhere! Even outside the scope of the callcc method.
#
# We can use this fact to create resumable functions. The following
# function will return once (returning a 1). We then resume the
# function and it returns a second time, assigning 2 to x.
#
# def resumable
# callcc do |continuation|
# $resume_point = continuation
# return 1
# end
# return 2
# end
#
# x = resumable
# puts "Again, X = #{x}"
# $resume_point.call if x != 2
#
# Will print ...
#
# Again, X = 1
# Again, X = 2
#
# Wow! This gives use the tools we need to create resumable functions.
# The key is to capture a continuation that will allow us to resume a
# function at the point we need.
#
# === The Generator Class
#
# The key to our generator design is tracking the two different
# continuations we need. The @resume_generator continuation will be
# called from the main code (via the +get+ function) and will resume
# into the generator. The @resume_mainline continuation will be
# used by the generator to return to the mainline code.
#
# Here's the start of our generator class.
class Generator
# The initialize function is carefully designed to initialize the
# @resume_generator instance variable. We use +callcc+ to capture
# the continuation we want, and then return _early_ from +initialize+.
# The rest of +initialize+ will be run the first time we resume the
# generator.
#
def initialize
callcc do |continuation|
@resume_generator = continuation
return
end
yield(self)
while true
generate(nil)
end
end
# The +get+ method is called from the mainline code to resume the
# generator (to eventually return the next value). Our tasks are to
# ...
# * Capture the mainline continuation.
# * Resume the generator.
def get
callcc do |continuation|
@resume_mainline = continuation
@resume_generator.call
end
end
#
# Finally we have the +generate+ method. It is called from the
# generator to return values to the mainline code. Our tasks are to
# ...
# * Capture the continuation for the generator.
# * Resume the mainline code, while returning the next generated
# value.
#
def generate(value)
callcc do |continuation|
@resume_generator = continuation
@resume_mainline.call(value)
end
end
end
# And that's it.
#
# ----
#
# = Further Reading
#
# [http://www.cs.indiana.edu/hyplan/dfried/appcont.pdf]
# <em>Lecture notes -- Applications of continuations</em>,
# Daniel Friedman
#
# [http://www.ps.uni-sb.de/~duchier/python/continuations.html]
# <em>Continuations made simple and Illustrated</em>,
# Denys Duchier
#
# Search for "continuations" on Google for even more references.
--
-- Jim Weirich jweirich@one.net http://w3.one.net/~jweirich
---------------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)