162200-164247 subjects 162639-163765

RCR: Array#to_h
162399 [xrfang@ho ma] I have registered 2 accounts for RCRkive, but all failed... So I posted
+ 162401 [marcel@ve ni] Having your proposed to_h accept a block is a nice idea but as it is you can
| + 162412 [xrfang@ho ma] The block may be useful because you may want to, for example, do some
| + 162669 [steven@lu os] => [1, 2, 3, 4, 5]
+ 162406 [nobuyoshi.na] Agreed here, but
| + 162411 [transfire@gm] I think the proposal is over specialized. Why should the array elements
| | + 162415 [xrfang@ho ma] This is actually the useful feature! I already said not everybody need it...
| | + 162421 [nobuyoshi.na] Yes, agreed, and I doubt that there is a solution which
| | + 162468 [dblack@wo bl] But then what's the point? :-)
| + 162414 [xrfang@ho ma] Ok, we may consider Array#to_h as a true reverse operation of Hash#to_a,
|   162417 [transfire@gm] module Enumerable
|   162418 [xrfang@ho ma] I am just reading the PickAxe 2e recently... According to Dave, to_h means a
|   + 162423 [transfire@gm] module Enumerable
|   + 162430 [transfire@gm] Right. But your reminder provokes me a solution, albiet it's a bit
+ 162428 [matz@ru y- a] Rejected.  Proposal Array#to_h(value=nil) does not actually solve the
| + 162429 [daniels@pr n] Maybe what we're actually after here is the equivalent to map/collect
| + 162435 [xrfang@ho ma] I don't know what you mean the "problem above"... My purpose is to have a
|   162441 [bob.news@gm ] If you just want a fast access to those elements a Set is sufficient - and
|   162453 [xrfang@ho ma] 1) Set won't work. I am not only test if an element exist or not, I want to
+ 162470 [dblack@wo bl] You'll have to give me more details if you want it fixed :-)

Re: Array#to_h
162404 [daniels@pr n] a = [1, 2, 3, 4, 5]
162438 [bob.news@gm ] Won't work.  This at least has to be
162444 [Ara.T.Howard] hash = a.inject({}){|h,x| h.update x => x*2}

Ruby's GC
162445 [jtregunna@bl] I'm curious if someone can point me to a technical description of
162449 [drbrain@se m] There might be one in the Ruby Hacking Guide (in Japanese).  Guy
162450 [jtregunna@bl] Yeah, I got that bit, was hoping for something a bit more technical in
+ 162454 [matz@ru y- a] conservative
| 162455 [jtregunna@bl] Thank you.
+ 162474 [no@sp m. le ] See <http://www.memorymanagement.org/> for more details on

Capturing stderr from a shell (WAS: Re: $stderr.reopen bug?)
162446 [drbrain@se m] require 'open3'

ruby gives different answer for checksum of files on windows and FreeBSD?
162456 [ralph@lk lk ] If I run this code to compute a "checksum" of a file I get a different answer on a windows machine
162460 [matz@ru y- a] Try
+ 162485 [ralph@lk lk ] that works. Thanks.
+ 162505 [Ara.T.Howard] this comes up so often - would it make sense to be the default mode on
  + 162517 [matz@ru y- a] Unless your program communicates with other programs on Windows, that
  | 162521 [pit@ca it in] Could someone provide an example for such a program? My Ruby programs
  | 162609 [dooby@d1 .k ] Notepad.
  | 162611 [sean.ohalpin] It's part of ANSI C for stdio to open files by default in text mode.
  | 162687 [pit@ca it in] Thanks to you and Daz for the detailed answer. So it seems that the
  + 162519 [michael.camp] I'm guessing here, but my guess is that reading text files with ruby
    162529 [halostatue@g] Some. I *always* open files in Ruby with "rb" or "wb" on Windows. Here's

Ruby and Eclipse and Rake
162457 [adelle@bu le] I recently downloaded and installed RDT

ruby for apache2 on windows
162458 [alxjvr.ruby@] ...
162854 [anibalrojas@] Could you elaborate more your question? What 's the usage you want for
162857 [alxjvr.ruby@] ...
162872 [drew.robinso] There is an installer for the Apache-specific ruby libraries/modules
163016 [alxjvr.ruby@] thanks guys, i'll dig more into this...

ruby-xosd problem: no Japanese unless readline is first called
162459 [gaizin@gm il] Using Ruby 1.8.3 with libxosd2-ruby 0.4 (also tried ruby-xosd 1.1.0), I

two rails 0.14.1 problems in win
162463 [jlz.3008@gm ] ...
162489 [se@di it le ] are you using 2 versions of Ruby? It looks like it because you use `cat`

Simple regex question
162465 [toddkennethb] Sorry to waste your time with this, but I'm new to regular expressions.
+ 162466 [w_a_x_man@ya] DATA.read.scan( /id="title">(.*?)</m ) { |s|
| 162473 [toddkennethb] Perfect, thanks!  Didn't know about String.scan.
+ 162479 [ruby.brian@g] irb(main):001:0> text = %(<span id="title">Dog Eggs</title>)

162467 [ad.hutchinso] ...

Re: WhyRuby? repository has moved to ruby-doc.org
162471 [clr8.10.rand] Any chance of a (stipped down?) PDF version? I don't have PP nor
+ 162472 [evl@tk sp ng] OpenOffice (2) opens it perfectly (and should be able to convert it to pdf)
| 162483 [clr8.10.rand] OK, I was able to see the nice presentation, thanks.
+ 162475 [m.fellinger@] charset="iso-8859-1"

Gauteng.rb meetup tonight (Tuesday 25 October)
162476 [luke.randall] If there is anyone on the list that hasn't heard about it before now,

postgres DBI question
162484 [Chris.Newman] ...
+ 162498 [erne@po er a] Here's a link to some documentation on the dbi.
+ 162518 [khaines@en g] ^^^^^^^^^^^^^^^^^^-- Don't need this line.  DBI will find the right driver and
  162522 [Chris.Newman] That fixed it. Thanks Kirk!

searching an array
162488 [ralph@lk lk ] I have an array of classes source[]
+ 162492 [shortcutter@] source.find {|x| x.fname == "foo"}
+ 162513 [bill@jr .o g] I like grep eg.
  162528 [bob.news@gm ] Unlikely that it works in this case as Ralf seems to have instances of a

Frozen @cookies
162504 [warrens@ac c] I tried to modify the cookies in an action method of ActionController but got the error
162549 [drbrain@se m] You'll probably have the most luck and fastest answer by asking the
162555 [james_b@ne r] I see a trend.
162567 [halostatue@g] And maybe something for Hal Fulton to add to his clr FAQ, pointing

Re: net-ssh question
162506 [jamis@37 ig ] What is your local host's OS and SSH version? What is the server's OS
162534 [itsme213@ho ] Win-XP (SP-2)
162662 [itsme213@ho ] I'll try asking the ISP, but know that they prefer to stick with the
162665 [jamis@37 ig ] Another possibility--are you doing anything like accessing the SSH

Comparing Classes with Case ?
162507 [warrens@ac c] ...
+ 162509 [bob.news@gm ] => nil
+ 162511 [christophe.g] Lose the ".class". === automatically looks for the class of the left argument.
  + 162527 [lukfugl@gm i] irb(main):001:0> String === "string"
  | 162602 [christophe.g] You're right of course! I keep forgetting that order :( .
  | 162693 [bob.news@gm ] If you think about it for a moment you'll see that it's the only
  | 162700 [christophe.g] Of course it is the only reasonable approach. I agree completely with it. But it
  | 162704 [bob.news@gm ] Just out of curiosity: which languages are you referring to and what do
  | 162713 [christophe.g] The only languages I've ever used that I know have a switch/case statement are
  | 162715 [bob.news@gm ] Interesting to learn.  Note however, that - if my rusty PASCAL doesn't
  + 162536 [ruby.brian@g] Just throwing in that it would not be a "BIG LOSS", not even a _big
    + 162552 [drbrain@se m] [snip example]
    + 162557 [clr8.10.rand] Well, is the following the rare case of 'nearly never' or just
      162563 [ruby.brian@g] One thing that may be bad about this approach is that you can't have
      162603 [clr8.10.rand] Thanks for your thoughts. The above (my approach) fits so nicely with
      162617 [sillewille@g] Of course, you asked a Ruby question, so you got a Ruby answer.
      162625 [clr8.10.rand] Actually I am happy that I did not ask a rails specific question,
      + 162626 [ruby.brian@g] I can assure that your post sounded completely polite and sensible to
      + 162636 [sillewille@g] My response certainly wasn't meant to scold, only to point out that

Meta methods to govern meta data?
162516 [duane.johnso] I was intrigued by one of Matz's "Wild and Crazy Ideas" at RubyConf--
+ 162556 [transfire@gm] See Facets annotation.rb. And I would urge you to call them annotations
+ 162800 [netghost@gm ] comment "Doubles the number"
| 162841 [gwtmp01@ma .] It seems to me that if you want to associate annotations with a
| 162856 [transfire@gm] It's a plesant notation, but a couple issues with the ideas Gary
| 162869 [gwtmp01@ma .] How about adding methods to Class and Method?
| 162878 [daniels@pr n] The following is an implementation I just whipped up of annotation.
+ 162868 [dblack@wo bl] It seems awkward (even leaving duck-typing issues aside :-) to have a
  163050 [netghost@gm ] I think the comments example isn't a good one, but there are some other

`report_activate_error': Could not find RubyGem activesupport
162523 [hany@pa co .] $ruby script/generate controleer Say

Re: regular expressions galore
162532 [bob.news@gm ] Hm, you said "multiple word chars *or* one of your special chars".  To me
162535 [kballard@gm ] Yeah, remove the vertical bars in your character class. Those are for
162537 [jcarbaut@la ] (file test.rb)
162546 [decoux@mo lo] This is interpreted as
162558 [jcarbaut@la ] Wow! I won't forget that! Thanks.
162560 [hawkman.gelo] ...
+ 162698 [decoux@mo lo] Give an example of what you are trying to match
+ 162701 [w_a_x_man@ya] %r{ ^ : ? [ / ' " # $ @ ] + }x
  162739 [hawkman.gelo] ...

Looking for ruby's regexp syntax
162533 [aurelianocal] I', looking everywhere and I can't find a summary of the ruby's regexp
+ 162564 [steve@wa ts ] I recalled the syntax being PCRE.  Couldn't find anything to support
+ 162575 [doodpants@ma] Ruby's regexp syntax is both described and summarized quite nicely in

Windows Move/Dir with wildcards ?
162544 [peter.fitzgi] ...
+ 162548 [m.fellinger@] charset="utf-8"
+ 162610 [sean.ohalpin] You're passing Ruby style filenames (i.e. with "/") to the DOS command

Re: by x,y allowing x,y to be passed as parms
162547 [netghost@gm ] Read the mailing list long enough and cool little trick inevitabely pop

What is Hoodwink'd?
162550 [gaston.garci] ...
+ 162554 [james_b@ne r] Sort of like Web graffiti. A means of adding comments to arbitrary Web
+ 162683 [ruby-talk@wh] Also see the hoodwink'd information booth.
| 162779 [gaston.garci] ...
+ 162782 [toddkennethb] Seems pretty cool to me...

having reference problems
162569 [shalperin@th] class Foo
+ 162581 [dblack@wo bl] OK, you need to clear some cobwebs :-)
+ 162582 [ef@al m. it ] How about this? =20
+ 162583 [halostatue@g] This is not necessary and definitely does not do what you want it to do.
+ 162584 [ef@al m. it ] Having read your example more carefully, I think this does what you
+ 162615 [sean.ohalpin] class Foo

Redefine minus unary method
162587 [email55555@g] class Integer
162592 [eric_mahurin] Fixnum overrode -@ but not +@.  Redefining the superclass

Implicit block argument
162588 [dbatml@gm .d] I would like to propose a shortcut for block arguments (the magic block
+ 162591 [halostatue@g] No, thank you. I don't think it helps anything.
+ 162594 [ef@al m. it ] =20
  162623 [discordantus] Which has already been fully discussed (disgust?) in the (in)famous

Lazy Streams and Other Functional Goodies
162589 [louis.j.scor] ...
162593 [rdm@cf l. om] I asked MJD about the idea of doing a "Higher Order Ruby" book.  He
+ 162620 [ptkwt@ar cn ] Or how about a webpage somewhere where we could put Ruby translations with
| 162680 [surrender_it] +1, actually I was doing this. Maybe we could just use a wiki section?
| 162725 [louis.j.scor] ...
+ 163255 [mjd@pl ve .c] Really it's more that I know Ruby badly enough to be confident of
  163721 [steve@wa ts ] Classic example of this: Numerical Recipes in _________
  163723 [ruby.brian@g] I expect you mean C <- FORTRAN, or is this the same confusion as with

String parsing?
162590 [mzanis@pu du] I am new to ruby but have an okay background in perl.  I am trying to parse
+ 162595 [james@gr yp ] => ["(", "foo", "0.05", ",", "bar", "0.115", ")", ";"]
+ 162597 [eric_mahurin] You can build a lexer (what you want) and/or a parser with ruby

Weird thing with "sub" and "rjust"
162596 [ricpelo@gm i] string.sub(/(\d+)/, '\1'.rjust(3, '0'))
+ 162598 [drbrain@se m] .sub(/(\d+)/) { $1.rjust 3, '0' }
+ 162601 [ef@al m. it ] The rjust is being evaluated before the sub call, so what you've

Re: narray and the stdlib
162600 [ptkwt@ar cn ] Well, perhaps we could build Hal's Ruby number questionaire into the Ruby
+ 162604 [Ara.T.Howard] what did you do?  mine suports read/write mmap so an narray can be backed by a
| + 162618 [ptkwt@ar cn ] I wanted to treat an NArray as an N-dimensional point so that I could find
| | 162634 [Ara.T.Howard] hmmm. what were you doing?  sounds interesting.  any chance you could post
| | 162685 [ptkwt@ar cn ] I'm using a Particle Swarm Optimizer (PSO) that I've written in Ruby to
| + 162703 [cameron.mcbr] btw, this sounds like a fun hack.  this anywhere public?  (yes, I'm
+ 162702 [cameron.mcbr] Yeah, me too.
  + 162706 [martindemell] Actually, the only popular compilerless platform today is Windows, so
  | 162727 [cameron.mcbr] a great point, Windows is the primary concern.
  | 162732 [curt.hibbs@g] ...
  | + 162734 [cameron.mcbr] To be clear, I didn't mean that as a dig.  It's a great project.  Keep
  | | 162737 [curt.hibbs@g] ...
  | + 162748 [ed.howland@g] Curt, is it possible/easy to remaster the One Click Installer? The
  |   162750 [curt.hibbs@g] ...
  + 162746 [Ara.T.Howard] i personally think this is because no one understands how to use it...  once

Re: Ruby's GC
162605 [matz@ru y- a] It's not faster than expected.  I will try again when YARV has come.
162679 [surrender_it] Ah, I see thanks

Installing ruby-odbc
162606 [brad.daily@g] Having a problem when installing ruby-odbc on one of my servers. When I

[ANN] rttool-1.0.0
162614 [rubikitch@ru] == Abstract

The "perfect" ORM?
162635 [hal9000@hy e] For many weeks I have had this at the back of my mind.
+ 162642 [james_b@ne r] What do you mean by 'metadata'? The data types of your object's state?
| 162785 [rubyhacker@g] Basically, yes.
+ 162645 [lyndon.samso] Ideally you'd be more generic than an ORM.
| 162786 [rubyhacker@g] True, but I'd want to walk before I run, so to speak.
+ 162648 [ruby-ml@ma i] I greatly specify code defining the database (Og)
| 162790 [rubyhacker@g] Yes. The latter problem is worse than the former, I think. And
+ 162651 [kevin.jackso] I've spent a fair bit of time with Hibernate and I can safely say that
| 162797 [rubyhacker@g] Thanks for this lengthy and informative post.
| 162914 [itsme213@ho ] What would be wrong with using re-opening classes for the mapping e.g.
| 162980 [george.mosch] FYI, the development version of Og also supports this :)
+ 162655 [transfire@gm] I think Og has a very good _outward_ design. I'm trying to get George
+ 162657 [jim@we ri hh] Hahahaha ... oh, that's a good one :)
| + 162668 [kevin.jackso] Actually re-thinking this again,
| | 162799 [rubyhacker@g] Welll... I don't really understand DI (sorry, Jamis) and I am not
| + 162796 [rubyhacker@g] Very discouraging, Jim. :)  Read my post from five mins ago and
+ 162658 [duane.johnso] ...
| + 162747 [hutch@re ur ] This guys stuff is very good. I've not used dybase, but I have used
| | 162751 [Alexander.J.] Why didn't anyone mention Cayenne. As a comparison it seems closer to
| | 162804 [rubyhacker@g] I've never heard of it, but I will add it to my
| | 162840 [zimba.tm@gm ] def Person
| + 162803 [rubyhacker@g] The classic ODBMS has some implementation and usage problems. It's
+ 162674 [khaines@en g] ...
| 162808 [rubyhacker@g] [snip snip snip]
+ 162721 [the.mindstor] #: Hal Fulton changed the world a bit at a time by saying on  10/26/2005 2:11 AM :#
| 162811 [rubyhacker@g] That sounds good so far.
| 162829 [the.mindstor] #: rubyhacker@gmail.com changed the world a bit at a time by saying on  10/26/2005 9:52 PM :#
+ 162726 [hutch@re ur ] Do you want an ORM? or do you want a way to persist classes in a non-
| 162815 [rubyhacker@g] Hshs... I really want the latter, but I am considering implementing
+ 162839 [mail@ad mv n] I'm not sure if this is relevant but in my opinion the perfect ORM is
| 162845 [james_b@ne r] Looks like Og.  Except you can leave out the inheritance part
+ 162910 [george.mosch] FYI, the development release of Og includes a KirbyBase wrapper.
| 162985 [rubyhacker@g] That is interesting.
| + 163003 [james_b@ne r] Here's a Devil's Advocate argument.  It may have actual merit; I'm not
| | + 163008 [gwtmp01@ma .] The failure modes are radically different also.  If you don't design/
| | + 163015 [jeremy@bi sw] You hit the nail on the head here, James.  Persisting objects to a
| |   + 163017 [hal9000@hy e] If I understand you right, that is the way I want to do it.
| |   + 163177 [george.mosch] Ehm, Og does that.
| + 163009 [khaines@en g] This is a hard thing to deal with, though.  A relational database has to use
| | 163216 [rubyhacker@g] Yes, but that's just giving different names to the same things, isn't
| | + 163221 [james@gr yp ] I just have to say first that I've really enjoyed reading these
| | | 163302 [hal9000@hy e] Not a dumb question at all. And I wouldn't dignify my ideas as a "vision"
| | | 163369 [dave@bu t. d] So Marshalled objects plus indexes?
| | | 163792 [duane.johnso] Nice summary, Dave.  If this is indeed what Hal is talking about, it
| | | + 163852 [jeff@op nd m] There is a package called DyBase out there, it's somewhat dated and unmaintained, but it
| | | + 163860 [hal9000@hy e] I guess I never replied to this one. I'm not sure that this is the
| | + 163227 [khaines@en g] Well, yeah. :)
| |   163305 [hal9000@hy e] I think I am definitely object-driven.
| |   163310 [daniel@da ie] I think it's easy to underestimate the value of being able to pass
| + 163175 [george.mosch] The metadata is stored in the object class not the actual instances.
|   163220 [rubyhacker@g] Yes, I realize that.
+ 163252 [daniel.amela] ...
+ 166929 [jhouchin@ca ] I don't know if you've seen this one or not.