169943-374339 subjects 170407-176386

ruby-gnome2: catching middle clicks on tabs
170217 [ces.fci@gm i] What I am trying to do is capture the button-press-event when a person
170239 [mutoh@hi hw ] "tab_label" is not "child" of Gtk::Notebook.
+ 170254 [slitt@ea th ] Where does one get the gtk2 module?
| 170275 [ces.fci@gm i] Clayton
+ 170272 [ces.fci@gm i] puts nb==widget.parent # true
  170359 [mutoh@hi hw ] Strictly speaking, both of vbox and tab_label_box are
  170368 [ces.fci@gm i] No need to be sorry.  I greatly appreciate the help.

Re: [SOLUTION] Kalah (#58)
170218 [janchrister.] Rob, I think you forgot the code.
170222 [ruby@ml ic m] beh@myhost:/tmp/sol $ tar xfvz ~/solution.tar.gz

Rails crashes over night?
170219 [nospam@ya oo] I'm running Ruby on Rails on Fedora Core 4 with lighttpd and fastcgi. I
+ 170227 [tsumeruby@ts] Tsume
+ 170511 [jgbailey@gm ] I had a similar problem under Apache and FastCGI. The MySQL connection

Memory Usage
170220 [hsanson@mo g] I have a ruby script that reads data from a database, processes the data (long
+ 170230 [perrin@ap th] Are you making heavy use of symbols?  They don't relinquish RAM
+ 170234 [peter@se an ] I've had a problem like this using the flickr api and net/http. All it
+ 170262 [gene.tani@gm] and John Carter's thing to dump out your objects and (linux) processes
  170384 [hsanson@mo g] Thanks,
  170399 [gene.tani@gm] i just found this, tagged by 1 del.icio.us user (thx whoeve you are!),

Re: Kalah (#58)
170224 [janchrister.] Ach, I'm using http://www.ruby-forum.com
170225 [janchrister.] Strange,

Ruby GUI recommendations?
170226 [janchrister.] Which GUI lib is the best and which is the most widely used ?
+ 170231 [joevandyk@gm] Depending on your needs, a RubyOnRails application packaged up as an
+ 170233 [tsumeruby@ts] Here are comparisons between available toolkits.
  + 170258 [gene.tani@gm] this guy likes gtk2 too (in French)
  + 170445 [flecktone@gm] What are people's experience with packaging applications made with
    170505 [hawkman.gelo] ...
    170543 [snowzone5@ho] i just spent the last few hours trying this out. the install was
    170566 [snowzone5@ho] and add:  libgtjread-2.0-..dll
    170970 [pan@er kv en] It obviously needs more than just the DLL's. For TK, I included
    171133 [snowzone5@ho] yeah, with tk you'd probably need the package info, etc.

test/unit and pp
170229 [clr10.10.ran] #!/opt/ruby/1.8/bin/ruby -w
170253 [pat.eyler@gm] you should grab unitdiff from the ZenTest package, available at
170273 [clr10.10.ran] does it also clean up the messages? Couldn't find anything in the docs
+ 170278 [pat.eyler@gm] Ahh, I misread your request.  No it doesn't clean up the message.
+ 170300 [james@gr yp ] Yes and no.  It show's a diff of the two items that were suppose to

[ANN] - posixtimer 0.1
170237 [caleb@ae -t ] Here's my first RubyForge release, a small utility that wraps around the POSIX
170284 [vjoel@pa h. ] I'd be really interested in knowing how this performs compared to simply
170313 [caleb@ae -t ] I have a feeling it's implementation dependent.  I'll plan to run a few tests
170331 [sylvain.joye] It depends on the kind of signal used. For posix timers, it is recommended
170333 [caleb@ae -t ] Yep - I'm working on that for the next release.

[ANN] Rote 0.3.0 (doc/web)
170238 [rosco@ro co ] Rote 0.3.0 is now available for download from http://rote.rubyforge.org/.

170243 [robert_kuzel] is there a String#to_sym method anywhere in the
+ 170247 [mreed@th re ] It's called "intern", because Ruby internalizes the string into a symbol.
| 170250 [nobu@ru y- a] String#to_sym is also an alias in 1.8 or later.
| 170452 [robert_kuzel] obviously its there IF you try to call it.
| 170481 [transfire@gm] I see. FYI for the future. The best place to check first is always
+ 170285 [mental@ry ia] If you've got a reasonably recent version of Ruby, yes.  I don't
| 170316 [chneukirchen] eval ":#{dump}"
+ 170288 [transfire@gm] Hmm... What version of Ruby are you using? You should be able to use

A question about recursive programming
170244 [hankgong@gm ] ...
+ 170246 [steve@wa ts ] Do you just want to learn about recursion?  Or are you interested in
| 170257 [hankgong@gm ] ...
| + 170280 [bob.news@gm ] IMHO Ruby is not well suited for that because you'll run into stack
| | 170282 [hankgong@gm ] ...
| | + 170299 [mental@ry ia] def max( *values )
| | | + 170306 [desmarm@gm i] An empty list has no max.
| | | | 170443 [johannes.fri] If you are going to use it for anything serious, you don't want to
| | | + 170309 [hankgong@gm ] ...
| | |   170315 [mental@ry ia] It was just intended to illustrate a trivial transformation from
| | |   170320 [janchrister.] A question about recursive programming
| | + 170301 [julesjacobs@] Why would that be so difficult? It might be in Ruby because iterating
| | + 170437 [logancapaldo] ...
| + 170287 [chneukirchen] Unfortunately, Ruby doesn't have tail-call optimization, so recursive
| + 170318 [akonsu@gm il] if a function invokes itself and returns the result of this invocation,
+ 170249 [nobu@ru y- a] return arr if arr.length==1
| 170252 [simon.kroege] Hmm,
+ 170255 [chdiary@gm i] ...
| 170263 [dblack@wo bl] def all_sum(arr)
| 170265 [chdiary@gm i] ...
| 170269 [dblack@wo bl] I'm probably misunderstanding what the original poster wanted.  I
+ 170416 [ronjeffries@] require "test/unit"
+ 170432 [w_a_x_man@ya] class Array
  + 170436 [hankgong@gm ] ...
  + 170496 [mental@ry ia] That's awesome.

How To Turn Off Net::HTTP w/SSL Certificate Warnings?
170251 [keith@or il ] I've got a little Ruby script that needs to use SSL but doesn't really
170256 [decoux@mo lo] Try
170261 [keith@or il ] Works great--can't believe that I didn't find it myself. That said, it
170264 [decoux@mo lo] It's just that the file https.rb is apparently not in www.ruby-doc.org

AJAX in Ruby on Rails
170266 [charles.squi] I'm having some trouble getting AJAX working properly for me in Rails.  I've
+ 170267 [steve@wa ts ] Thanks for your message about Ruby on Rails.  I think you'll find
| 170277 [charles.squi] Thanks Steve, I didn't realize the Rails list was email-based.  I just sent
+ 170274 [charles.squi] Just to save someone a post... I know there's a Rails list, but I have
  170289 [f@an re s- .] Try www.ruby-forum.com. It mirrors the Rails mailing list and allows

interception method_added for blocks
170279 [robert_kuzel] is it possible to somehow intercept method_added
170290 [transfire@gm] class << Proc
170293 [transfire@gm] Ah misread that a bit. The code won't help, so ignore that.

GC in lambdas?
170291 [akonsu@gm il] could someone please confirm this? i am also interested to know why GC
170298 [ef@al m. it ] ever__
170302 [akonsu@gm il] thank you. if lambda creates an object during its execution, and by the
170307 [drbrain@se m] The object is eligible for garbage collection.  It may or may not be

module variables
170294 [akonsu@gm il] module MyModule
170304 [gwtmp01@ma .] The instance variable belongs to MyModule, which is an object.  In

Rant 0.5.2
170305 [langstefan@g] Rant is a flexible build tool written entirely in Ruby,

Re: Problems with missing collection method in has_many rela
170310 [ruby-forum-r] The 'Version:Class' is your best clue: it means that instead of
170311 [ruby-forum-r] The 'Version:Class' is your best clue: it means that instead of

Migration with Dynamic Table Names?
170312 [martin.glaud] (This is my first real Ruby/Rails project, so please bare with me...)
170323 [james_b@ne r] James

rendering charts via rails
170319 [ljw1001@gm i] Is there a recommended way to render charts from a ruby-based web
+ 170365 [wilsonb@gm i] ...
| 170376 [matthewparri] I'm using SVG::Graph for a home project.  It's easy to get going and
| 170381 [michael.schw] Any idea if this is better?
+ 170385 [steve@wa ts ] Check out [Gruff][1].  In the future, consider using the Rails specific
+ 170393 [zedshaw@ze s] Hey "larry",

matches -> regexp ?
170321 [akonsu@gm il] this is not exactly a ruby problem, i hope people will not consider
170322 [rretzbach@go] nice challenge, reminds me a bit of the 4th rubyquiz :>
170324 [ef@al m. it ] This is essentially an information compression problem.  There's
170326 [akonsu@gm il] well, right, that is what i mean.
170328 [akonsu@gm il] i suspect that from your trivial solution we can arrive at the final
170469 [bob.news@gm ] Another option is to build up a tree and create the RX from that.  I once

Any problems with Ruby on Rails - on Win CE
170327 [scottishguy@] I think the answer is going to be yes, knowing that Ruby runs on Win
0014 [rdusong@gm i] Hye,
0109 [scottishguy@] Im using Windows Mobile 2003 (which is WinCE)
171390 [rdusong@gm i] Hye,

How Do I Search Ruby ML?
170338 [speechexpert] OK - Here's my issue
+ 170344 [ruby-forum-r] Google with the site: parameter.
+ 170346 [agorilla@gm ] Some of us use gmail.  It's an excellent way to read lists.  Can send
| 170398 [gregory.t.br] I use Gmail and generally love it, but two annoying things for anyone
| 170504 [rasputnik@gm] Isn't that what a 'conversation' is?
| 170538 [gregory.t.br] Actually, yes and no.
+ 170546 [gene.tani@gm] This is a major win for Redmond: Outlook Express scales!

Hibernate on Ruby
170341 [listrecv@gm ] Any ideas on using Hibernate OR/M from within Ruby?
+ 170342 [transfire@gm] Why, when you have Og, ActiveRecord and a few other interesting
| 170345 [listrecv@gm ] ActiveRecord is great for small-to-medium things, but does quickly show
| 170353 [ruby-forum-r] Google up Og and Kansas and see if either suits you better.
| 170390 [zedshaw@ze s] No, that'd actually involve admitting he is wrong.  The day a
| 170391 [neil@ha ub .] Yeah, that's the way, go off on a tangent and berate someone for asking
| 170403 [listrecv@gm ] Thanks for the support Neil.
| 170479 [wilsonb@gm i] I won't claim to support this idea. Personally, I think it's like
+ 170450 [surrender_it] probably the only chance is using jruby, but are you sure you can't do

LXR style cross references Ruby code
170343 [listrecv@gm ] While trying to navigate a large, unfamiliar application, I find a
170404 [listrecv@gm ] Huh?!
+ 170618 [damphyr@fr e] Maybe because RDoc does most of the cross-references you want, if only
+ 170664 [chneukirchen] Where are the millions of lines of Ruby they would be needed for? :-)

Idiom wanted: do-while
170348 [adam.shelly@] So I was working on the quiz solution, and
+ 170349 [james@gr yp ] loop do
| + 170350 [ mfp@ac .o g] [ruby-core:06745]
| | 170358 [adelcambre@g] You can also do
| | 170377 [adam.shelly@] I was certain I had tried that....
| | 170382 [james@gr yp ] But hopefully you followed the Ruby Core link in this thread and saw
| | 170395 [mark.ericson] ...
| | + 170396 [adelcambre@g] The begin end one functions like a do while loop, the body will always
| | + 170433 [steve@wa ts ] Andy already answered, but I thought I'd take my shot at it too.
| + 170387 [slitt@ea th ] I do this quite a bit, but it's not structured programming and is a little
|   + 170392 [james@gr yp ] Which is probably a sign that method calls are needed.  Heck, I think
|   + 170497 [lukfugl@gm i] I see no similarity. 'goto' is unstructured because the target point
|     170579 [slitt@ea th ] Ahh -- I found a reference. See
|     + 170581 [james@gr yp ] The loop do ... end construct is infinite.  You must add a break to
|     | 170614 [perrin@ap th] It's certainly good policy to use unit tests.  On the other hand, coding
|     | 170641 [james@gr yp ] At the risk of sounding like a broken record, I think one of the big
|     + 170583 [jamis@37 ig ] Ok, I admit I'm coming onto this thread a bit late in the game, so
|     + 170656 [lukfugl@gm i] I'll concede that, but refer to James comment (about one break in a
|       170677 [slitt@ea th ] It's definitely not the break statement's fault. It might not be the
|       170678 [lukfugl@gm i] That's unfortunate if you feel that you're in that position (and I can
+ 170357 [surrender_it] you could do
+ 170364 [ara.t.howard] i = 0
  170369 [binary42@gm ] ( puts "foo" ) while nil

How to time the duration of a script.
170351 [rakxzo@gm il] If I wanted to find something like the "time" feature on shell...
+ 170355 [ruby-forum-r] Well, you can actually use 'time my.rb' :)
+ 170362 [ara.t.howard] BEGIN{ $start_time = Time::now.to_f }

Re: Weird (Errno::ENOEXEC) - Ruby bug?
170352 [kero@ch ll .] $ ruby test.rb

Way to combing Hash Definition sans => with %w() ?
170361 [dandiebolt@y] ...
170363 [james@gr yp ] => {"apple"=>"bananna", "orange"=>"grape"}
+ 170366 [dandiebolt@y] ...
| 170370 [james@gr yp ] That asterisk is Ruby "splat" or "explode" operator, in this
| 170380 [dandiebolt@y] ...
| + 170383 [james@gr yp ] As I said, it must be the last parameter of a method call.  Hash[...]
| + 170420 [martindemell] The * converts an array to a comma separated list (what David Black
+ 170372 [jgbailey@gm ] Was this question a ringer or what? Seriously, I love how easy Ruby

System Tray Icon
170367 [listrecv@gm ] Any one know of a simple way to load an icon to the system tray via
+ 170374 [wilsonb@gm i] I don't believe that there's any cross-platform way to do this.
+ 170451 [dooby@d1 .k ] daz

Using Float For Currency
170371 [lists@la to ] Howdy,
+ 170373 [mental@ry ia] If you're doing anything that matters, don't use floats for
| + 170375 [f@an re s- .] BigDecimal is good.
| + 170378 [lists@la to ] Thanks. Fortunately this is just some quick guestimation throw-away stuff.
| + 170424 [joevandyk@gm] What cracks can I lose money through?
|   + 170434 [steve@wa ts ] Floating point numbers represent an extremely wide range of values -
|   + 170550 [malte__@gm -] => 2.77555756156289e-17
|   + 171212 [meta@po ox c] It's not just that; your program logic can also behave unexpectedly. e.g.
|     171218 [steve@wa ts ] Excuse my ignorance, but I'm wondering what BigDecimal does different
|     171219 [james@gr yp ] It doesn't use floating point arithmetic.  That means it is accurate,
|     + 171222 [steve@wa ts ] I think you misread my question.  I realize the difference between
|     | + 171223 [james@gr yp ] Sorry about that.
|     | | 171231 [steve@wa ts ] Ahh, I see what BigDecimal is now.  Think I'd rather just use cents and
|     | + 171227 [neil@ha ub .] One would use BigDecimal instead of Fixnum or Bignum when one is going
|     + 171224 [lukfugl@gm i] And built-in integer types represent integers, not decimals. :)
+ 170379 [wilsonb@gm i] val = 9.756
| 170419 [dave@bu t. d] Or just
+ 170389 [neil@ha ub .] require 'bigdecimal'
| 170486 [wybo@se va y] ...
+ 171221 [ruby-forum-r] Posted via http://www.ruby-forum.com/.

How to catch Timeout::ERROR ?
170394 [vvlad@n4 .r ] Is there any way to catch Timeout::ERROR exception throw by timeout
170410 [drbrain@se m] rescue Timeout::Error => e

1.8.4 preview 2
170397 [gene.tani@gm] (my Dad's been pressuring me to re-learn Japanese, i might as well...)

Accessing C structures in Ruby
170400 [joevandyk@gm] (I've already looked at Swig, btw.  I'd like to do this one by hand.)
+ 170406 [joevandyk@gm] class Player
| 170417 [joevandyk@gm] VALUE get_player_x_pos(VALUE self)
+ 170412 [ruby-forum-r] My typical recommendation is to just wrap a pointer to
  170421 [joevandyk@gm] Can you share more details?  Is that essentially what I've done in my
  170426 [joevandyk@gm] #include "ruby.h"
  170428 [ruby-ml@ma i] Yep, that looks fine to me. There are certainly other ways but aside
  + 170438 [joevandyk@gm] How does my code differ from what you described?
  | 170440 [ruby-ml@ma i] It does not :) There are just many ways you could achieve the same
  + 170448 [martindemell] myself, but this seems like a prime use case)
    170530 [vjoel@pa h. ] I would have mentioned it but the OP wanted to do things the hard way :)