153669-154682 subjects 153969-156744

ruby quiz question '*' on the initialize parameters
153730 [gaston.garci] ...
+ 153731 [james@gr yp ] You guessed it.  It will collect all passed parameters into an Array
| 153734 [gaston.garci] ...
| 153735 [james@gr yp ] irb(main):001:0> def var_args( *args )
| 153736 [gaston.garci] ...
| + 153738 [james@gr yp ] It just means that if you have an Array of arguments, you can expand
| | 153742 [Daniel.Berge] I didn't see anyone mention it, but it's referred to as the "splat"
| | 153743 [james@gr yp ] Well, then I got to learn something too.  I've always called it the
| | 153805 [dblack@wo bl] I call it the unar[r]ay (unary un-array) operator :-)
| + 153744 [joevandyk@gm] % cat a.rb
+ 153732 [joevandyk@gm] Yes.  And it sticks them into an array.
+ 153733 [dblack@wo bl] Yes -- it creates an array out of whatever comes in, zero or more of

probably a stupid rails question
153762 [tsuraan@gm i] I'm working through the Rails intro on
+ 153763 [threeve.org@] 1)  It would be better to use the Rails mailing list for your Rails
| 153764 [tsuraan@gm i] Yeah, I just haven't subscribed yet.  I guess I should :)
+ 153767 [francois@ba ] Declare the id column as an serial.
  153889 [robby.lists@] Wait, don't forget the PRIMARY KEY!

stringio as file
153765 [joevandyk@gm] StringIO can be used as a standin for a File object when testing, right?
153768 [joevandyk@gm] Ah, nevermind.  I forgot File.open is a class method.
153769 [joevandyk@gm] require 'stringio'
+ 153770 [binary42@gm ] a.rewind
| 153772 [joevandyk@gm] Doh, that clears it up.  Thanks!
+ 153771 [joevandyk@gm] require 'stringio'
+ 153773 [nobu.nokada@] a.rewind

Asserting files are not different in Test::Unit?
153775 [ruby_talk@sh] I am writing some document generation classes now, and testing them with
+ 153777 [jeff.darklig] Hows about
+ 153778 [halostatue@g] You could use Diff::LCS, available on RubyForge.
+ 153845 [zoso@fo on e] def test_db

Introducing ruSH
153780 [reyn.vlietst] Traditionally the unix shell pipes text from one command to the next.
153788 [sy1234@gm il] I've been waiting for something like this to come along.. but I'm
153789 [reyn.vlietst] You have to have
153791 [sy1234@gm il] Again, my apologies for being an utter newbie.  =)
153792 [reyn.vlietst] Yes, thats one of the curses functions I added which were missing.
153798 [sy1234@gm il] Aah, I noticed this mention, but assumed I could run the colour-bugged
153800 [sy1234@gm il] I got it working, looks good.  I can't wait to start thinking about
153802 [reyn.vlietst] A screenshot for anyone interested.
+ 153804 [navindra@cs ] Cool.  Any reason external scripts aren't supported directly instead
| 153808 [emeza@cd .g ] I like it. It's exactly what I need !.
| 153813 [reyn.vlietst] JM, yes there's a directory where all the commands are held.
| 162292 [tanner.burso] ...
| + 162315 [reyn.vlietst] ...
| + 162409 [ruby-ml@ma i] Yes, although I have not done much recently, mainly due to
+ 153806 [jeffm@gh st ] Yes, interested. Looking good. Especially like the expressions feature.

Fwd: Good cross-platform IDE / multiple document text editor for ruby / rails?
153794 [gaston.garci] ...

[WAY OT]Re: vim user switch to emacs?
153799 [derek@de ek ] Because the shell suspends current vim usage, and you can't get back

Benchmark question
153803 [joevandyk@gm] irb(main):015:0> Benchmark.measure { 1000000.times { |i| i + 1 } }
153860 [mohit.muthan] Mohit Muthanna [mohit (at) muthanna (uhuh) com]
154015 [joevandyk@gm] ruby 1.8.2, compiled on Redhat 9.

[Ann] RueDoc: rdoc-hacks 0.1.2
153810 [ruby-ml@ma i] Exciting news! :)
+ 153811 [ruby-ml@ma i] template<typename duck>
| 153825 [james_b@ne r] At least one of the URLs is still broken
| 153840 [ruby-ml@ma i] Well, crikey.
+ 153812 [mailinglists] Did you work on the mny bugs in the ruby doc parser. Like skipping
| + 153819 [ruby-ml@ma i] No. These are specifically hacks to ease the pain until I or someone
| + 153823 [halostatue@g] Have you added those as bugs to Rdoc on RubyForge? If not, Eric and
+ 153850 [ruby-talk@wh] Great stuff, thankyou.  I needed this.  The YAML which RDoc builds is a

Soks Wiki - Support for page tagging added
153817 [the.mindstor] I am not sure this is the right place to post this message, so sorry if it is not.
154100 [tamc2@ca .a ] There is also a soks mailing list, you can join at http://
154130 [the.mindstor] ...

[ANN] vwmc mu* client (was: Still looking for a Ruby MUD client)
153818 [sy1234@gm il] For the interest of the thread-watchers, I found an emerging Ruby mu*

POP3 SSL on Ruby
153821 [diego@he bo ] I was wondering if it was possible to connect to a POP3 server using
153861 [mohit.muthan] You can do it with OpenSSL (openssl.rb). It's part of the standard library.

Unrequiring a module
153822 [idoo4002@ma ] rb_require("file.rb");
153824 [halostatue@g] Strictly speaking, you can't. Well, you can't unrequire. However,
153826 [idoo4002@ma ] my worry with doing this would be that it would reload the 'Qt'
153827 [decoux@mo lo] first remove the constant AssignSomeText, then use rb_load_protect()
153829 [idoo4002@ma ] i tried to find some way of remove a constant, but couldn't see one,
153830 [decoux@mo lo] Module#remove_const

Examples of WWW::Mechanize with cookies and redirect?
153834 [ljz@as as .c] I'd like to use Michael Neumann's WWW::Mechanize package to do some web
154037 [mneumann@nt ] A redirect is automatically followed, so you don't have to think about
154171 [ljz@as as .c] Thank you for clearing this up!

Replacing RDoc: what do you want to see?
153844 [ruby-ml@ma i] I am thinking of starting something up to entirely
+ 153847 [james_b@ne r] Have you considered discussion this in the ruby-doc mailing list?  There
+ 153848 [halostatue@g] Honestly, I don't want to see RDoc replaced. I *do* want to see it
| + 153853 [james_b@ne r] I don't entirely disagree with this, but I don't buy the "distraction"
| + 153855 [drbrain@se m] If RDoc is broken, people should file bugs so that us maintainers can
|   153858 [halostatue@g] Agreed. There are some things that I'd like to see done, but nothing
+ 154109 [meta@po ox c] Any replacement for Rdoc will need to accept the same input Rdoc

What's wrong with my index.rhtml?
153851 [lists@ka am ] When I use some eruby examples from the PickAxe book as my

millisec in strin representation of Time
153852 [vjoel@pa h. ] Is there a way to use Time#strftime to generate a string that contains
+ 153856 [james@gr yp ] This may not exactly answer your question, but you you parse with
+ 153859 [khaines@en g] Time.parse works via ParseDate.parsedate, and that, in turn, passes all the
  + 153915 [akr@m1 n. rg] I see.  I modified time.rb to use Date._parse directly.
  | 153934 [vjoel@pa h. ] Works perfectly. Many thanks to both of you, Kirk and Tanaka!
  + 153936 [vjoel@pa h. ] If the _date_ arg doesn't have fractional seconds, then parse still
    154065 [andrew.townl] Did I miss something or did someone actually answer this part of the
    154135 [vjoel@pa h. ] No, only the parsing side of the question was discussed.

how do you describe '#!' in written english?
153863 [tshiget1@gw ] quick question.
+ 153864 [jimfreeze@gm] Yes, it is known as the shebang or the Berkeley !# hack.
| 153865 [jimfreeze@gm] Make that Berkely #! hack.
| 153866 [tshiget1@gw ] greetings, Jim. :-)
| + 153867 [idoo4002@ma ] isn't it an interpreter?
| + 153868 [idoo4002@ma ] by the way, a 'BIKKURI' in english is an exclamation mark. exclamation
|   + 153870 [tshiget1@gw ] greetings iain.
|   | 153872 [idoo4002@ma ] dou dashimashite. nihon de "type" o surebanai koto ga zannen na koto da.
|   + 154121 [martindemell] And US hacker slang for the ! is "bang" ("pling" in the UK, though I think
|     154122 [Daniel.Berge] This reminds me of a Ricky Martin song for some reason....
|     154126 [flashdrvnk@H] lol I exactly thought the same
|     154215 [res0i3sf@ve ] It's referred to as an "octothorpe".  :-)
|     154230 [tshiget1@gw ] greetings. thanks.
|     154264 [springer@si ] That would be ab "asterisk". :-)
|     154342 [brockweaver@] I have heard "*" called "star" or "splat".  I even heard an old VAX
|     154351 [tshiget1@gw ] i also call it 'star' usually.
+ 153871 [james_b@ne r] James
  153873 [tshiget1@gw ] greetings, James.
  153874 [idoo4002@ma ] i think that's actually a pronunciation guideline. so that just means
  153875 [tshiget1@gw ] how can i thank you, iain.
  153876 [idoo4002@ma ] mochiron oshiete kureru!

Reopening with a bang: cannot assign to self
153877 [ruby_talk@sh] I'm writing some code that benefits from extending Array.  One of the
153882 [daniel.amela] Is Array#replace what you're looking for?
153884 [ruby_talk@sh] Possibly.  Array#replace seems to be like collect!, it's a nicer way
+ 153886 [daniel.amela] I see. Well, there isn't a general way to do it in any class, since
+ 153903 [daniel@br ck] Fixnum could not possibly have it, because fixnum values are

FXRuby addInput on telnet connection.
153878 [agemoagemo@y] In the program I'm working on, I'd like to use

Iterating over arrays in lockstep
153880 [ruby_talk@sh] James Gray's refactoring of my decidedly anidiomatic solution to Quiz
153881 [levin@gr nd ] array.zip(array.normalize) { |item, normalized_item| "..." }

Ruby idiom for enum?
153885 [ruby_talk@sh] I want to set up a program that uses some predefined values to determine
+ 153893 [shortcutter@] There are several possible solutions: Use an enum lib maybe there's
+ 153898 [ruby.brian@g] module RATING
| 153909 [phurley@gm i] See if it helps
+ 153905 [Ara.T.Howard] you could use enums : it's easy enough to do clearly in ruby
+ 153907 [florgro@gm i] That's also possible in Ruby, but I think it is a better idea to

Rubyists in Rio de Janeiro
153887 [daniel.amela] Any rubyists in Rio interested in getting together sometime the next
+ 153922 [demetriusnun] Hey Daniel,
+ 153924 [esmiralha@gm] Hey Daniel,

[ANN] gmailer-0.0.5
153888 [phasis@bc in] GMailer is a class for interface to Google's webmail service.
153892 [daniel.amela] Hey Park, looks great. We can tell that you're putting a lot into this

Hashing VALUES to C-Structs
153890 [ruby.brian@g] in an extension I'm writing I'd like to hash ruby objects to
153955 [vjoel@pa h. ] Not sure I understand, but what about using a ruby Hash whose values are

UDPSocket broadcast to
153895 [vjoel@pa h. ] Is my network stack screwy, or is there something strange about
153896 [daniel@br ck] Joel,
153933 [vjoel@pa h. ] Ah, you're right, of course. The mask for lo is, so of course

Fwd: [SOLUTION] Word Chains (#44)
153900 [james@gr yp ] ...
154239 [w_a_x_man@ya] D=IO.read('dict').split($/).grep(/^.{#{$*[0].size}}$/)
154346 [SimonKroeger] (the dictionary is the optional third parameter, no -d)
154381 [w_a_x_man@ya] Yours is faster and produces shorter chains.  I shortened it a
154400 [w_a_x_man@ya] [ clipped ]

Re: [SOLUTION] Word Chains (#44)
153901 [james@gr yp ] #!/usr/local/bin/ruby -w
+ 153916 [gavin@re in ] Here's my solution. It's most surely not the fastest, but it can be
| 153946 [gavin@re in ] After I posted my solution, I took a shower, scribbled a few diagrams
| + 153953 [levin@gr nd ] An interesting chain to stress-test your algorithms is "sahara" <->
| | + 153956 [SimonKroeger] Heya dear quizers,
| | + 153959 [gavin@re in ] Mine is missing many of the words in that chain. What dictionary is
| |   + 153960 [dbatml@gm .d] Here is my solution.
| |   + 153964 [levin@gr nd ] "/usr/share/dict/british-english" from Ubuntu Hoary.
| |     154052 [gavin@re in ] ...
| + 153961 [sellberg@gm ] Did you consider making it into an iterative deepening search instead?
| + 154073 [james@gr yp ] I will try, yes.
|   154152 [email55555@g] Here are my solutions. They are very slow ...
|   154634 [email55555@g] ...
|   + 154636 [james@gr yp ] That's a great point.  Thanks for bringing it up.  It's easy to
|   + 154656 [SimonKroeger] Yep!
+ 153919 [gavin@re in ] What's the benefit to using #warn rather than #puts here? stderr
| 153920 [james@gr yp ] I can redirect them separately.  For example, I can throw the chain
+ 153926 [james@gr yp ] I'm not sure, but there's a Ruby Quiz that gets you most of the way
| 153929 [jannis@ha de] ...
+ 153957 [vjoel@pa h. ] vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
  154039 [will@th mb e] My last email seemed to disappear in the ether, so here it is again.

Fwd: Ruby Gateway Done
153902 [james@gr yp ] Just passing the information along...

Re: RueDoc: rdoc-hacks 0.1.2
153904 [robertbrook.] Try http://www.magical-cat.org/projects/ruedoc/downloads/

Dynamic methods / accessors
153906 [lists@el st ] I'm trying to setup some kind of dynamic method / accessor assignment to
153911 [decoux@mo lo] moulon% cat b.rb

Dynamic methods / accessors
153908 [lists@el st ] I'm trying to setup some kind of dynamic method / accessor assignment to
+ 153912 [bob.news@gm ] You need so called singleton methods. These are present in just a single
| 153913 [bob.news@gm ] directly do
+ 153914 [lists@el st ] Thanks guys!

Re: Forcing attr_writer to a type?
153925 [malte.milatz] class Class

Help needed with rexml
153927 [invalid@de .] I've been struggling to properly parse some XML with rexml. I will fully
+ 153930 [shortcutter@] xml.elements.each do |elem|
| 154003 [grice@me us ] Thanks for the reply. I did read the tutorial--I just wasn't making the
+ 153931 [zerohalo@gm ] Michael, I came across the same problem recently when using ruby/rexml
| + 153948 [zerohalo@gm ] PS. There's a great XML plugin for JEdit that will show you the results
| | 153950 [zerohalo@gm ] Correction to my last post. It's in the XSLT plugin.
| + 153951 [transfire@gm] Written off teh top of my head, but you could write your own.
| | 153962 [james_b@ne r] If you really think you need to visit every element you  may be better
| | 153965 [zerohalo@gm ] James, would you mind pointing to a link that explains how to do this?
| | 154001 [james_b@ne r] I don't think there is much written about the pull parser (though I
| | 154125 [zerohalo@gm ] Thanks, James, I'll study that.
| | + 154220 [davidbe@gm i] Google on REXML and you get some good results!
| | + 154502 [james_b@ne r] No, the site is missing some obvious UI clues for friendlier usage.
| + 154000 [invalid@de .] Thanks! This is what I'm looking for. I read through the tutorial and
+ 154009 [zdennis@mk e] What type of information do you want to get out of this? You never

building rbtree 0.1.3 (was: [SOLUTION] Word Chains (#44))
153932 [levin@gr nd ] I tried to build it but it fails the unit tests

Debate about Ruby in Another Group
153935 [gervasdougla] ...

Re: [OT]-  [SOLUTION] Word Chains (#44) - time equivalent for windows
153939 [the.mindstor] #: Jannis Harder changed the world a bit at a time by saying on  8/28/2005 8:39 PM :#
153941 [flashdrvnk@H] You could use ruby's Time class to determine the duration.

time equivalent for windows (was: [OT]-  [SOLUTION] Word Chains (#44) - time equivalent for windows)
153940 [levin@gr nd ] If you want to benchmark ruby scripts you could use 'benchmark'
153995 [daniel.amela] ruby script I called 'rtime' Really trivial stuff.

Re: building rbtree 0.1.3
153958 [vjoel@pa h. ] Looks like your ruby headers or libs aren't where extconf.rb expects

UDPSocket broadcast and #connect
153966 [vjoel@pa h. ] Ok, a new problem. The following program outputs "received: foo". But if
+ 153976 [daniel@br ck] CONNECT(2)        Linux Programmers Manual        CONNECT(2)
| 153982 [vjoel@pa h. ] Hm, so linux connect() implies bind() on UDP sockets?
+ 154008 [vjoel@pa h. ] Wrong. Binding this socket lets the packet go through, when the

Re: Rio 0.3.3
153968 [rio4ruby@ru ] You're a damn genius, aren't you :)
+ 153970 [rio4ruby@ru ] This change has been checked into CVS, and will be in the next release.
| 154023 [dave@bu t. d] irb(main):002:0> rio('/usr/bin/ruby').rel('foo/bar')
| 155128 [rio4ruby@ru ] Your example seems wrong, but is actually correct. If you ran
+ 154020 [dave@bu t. d] ...
+ 154021 [dave@bu t. d] (Sorry about the blank post prior to this)
  155129 [rio4ruby@ru ] You now have both -- and more. You now can create pathless Rios in