223164-235875 subjects 223593-224452

Re: Dependency 1.0.0
223393 [twoggle@gm i] And observer.rb :)

Vacancy for Ruby developer in Amsterdam
223395 [davaco@gm il] We're hiring! Please email me if you're interested.

Webrick upload file issue
223396 [namepipe@gm ] Is there any feature in webrick using which we can upload our files
223487 [namepipe@gm ] Can anyone help me on this ?
223498 [jan.svitok@g] Try using cgi lib, http://ruby-doc.org/stdlib/libdoc/cgi/rdoc/index.html

Output not clear
223398 [learningruby] ...
+ 223400 [rimantas@gm ] Because you do not change @balance in your withdraw method.
| 223403 [learningruby] ...
| 223405 [rimantas@gm ] This is true. However in the case something = some_value Ruby sees it
| 223406 [learningruby] ...
| 223449 [david@va ln ] ? If
+ 223410 [jes@lu et nk] Greetings
  223413 [learningruby] ...
  + 223415 [jan.svitok@g] sure. the difference is whether you're getting the var from the inside
  | 223417 [learningruby] ...
  | 223422 [dblack@wo bl] It all starts with the instance variable, @balance.  The balance
  | 223423 [learningruby] ...
  | 223426 [dblack@wo bl] Glad to do it!
  + 223416 [dblack@wo bl] @bal is an instance variable, not a class variable.

Using another program (Lynx) from within Ruby
223412 [news01.web@m] I'm trying to write a script to read a list of URLS, get the HTTP response
+ 223418 [gabriele.mar] If you really want to use an external program, you could use
| 223476 [news01.web@m] Thanks, that example looks like it has exactly what I need...  going to try
+ 223419 [jan.svitok@g] the #{} should work. Try replacing the command with echo to see to
| 223474 [news01.web@m] I tried using Net::HTTP but I'm not sure how to get the HTTP response code.
+ 223420 [hgs@dm .a .u] You could do all that within ruby of course, but it's almost certainly
+ 223464 [barjunk@at g] snip
  223477 [news01.web@m] No, but I will look into it.  Thanks.

[QUIZ] Bytecode Compiler (#100)
223425 [james@gr yp ] 1.  Please do not post any solutions or spoiler discussion for this quiz until
+ 223589 [wilsonb@gm i] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| 223606 [james@gr yp ] Perl's regex engine can do this, as can Ruby 1.9's Oniguruma engine.
+ 223590 [ruby-talk@do] require 'interp'
| 223803 [ruby-talk@do] Changed my previous solution to use some of the things others have
| 223899 [bob.conn@bt ] Here's my effort.  I really enjoyed this quiz but spent way more than
+ 223601 [mail@ex ti o] Here is my solution, a simple recursive descent parser. It's a bit more
| 223607 [james@gr yp ] Did you write that language in Ruby?  I'm just curious.
| 223609 [mail@ex ti o] interpreter in C++. The whole thing is used as a scripting language for
+ 223649 [edbrannin@gm] ...
+ 223663 [martin@sn wp] # This is a solution to Ruby Quiz #100
+ 223667 [martin@sn wp] Note that the creator of this quiz left out one important case from
| + 223668 [wilsonb@gm i] A) Steals your cool C* unpack trick. :)
| + 223694 [rossrt@ro co] Phew - I expected I'd left out far more than just one important case :).
|   223743 [kallen19918@] This is my first post to ruby-talk and my first stab at a ruby quiz!
|   223745 [kallen19918@] Aaaargh formatting explosion! Here's that first bit all nice and unexploded.
|   223777 [adam.shelly@] Here is my solution.  I tried to keep it short and simple.
+ 223670 [GENIE@pr di ] My solution is a bit different than all the ones I've seen so far.  I
+ 223680 [wardies@gm i] Ouch! :)  Oh well, I don't think my Ruby is up to some of the more
+ 223923 [jgbailey@gm ] Some people started doing the Ruby quiz problems using Haskell, and
| 224153 [rossrt@ro co] Aww man, now I'm gonna have to look into Haskell a bit more :) I've been
| + 224163 [louis.j.scor] You won't be disappointed.  Haskell is an amazingly cool language.
| + 224240 [jgbailey@gm ] Awesome!
|   224259 [james@gr yp ] Great, write it up for us so we can all learn how it works!
+ 224037 [GENIE@pr di ] My 2nd solution, it's the same as the first except i stole the
+ 224241 [jgbailey@gm ] My solution in Haskell - and this time it actually works. The previous

SV: Stockholm RUG?
223427 [ndrsbngtssn@] Not a real Ruby user group, but there is a Rails community that meet

[ANN] ActiveRDF 1.0
223436 [benjamin.hei] It is our pleasure to announce the 1.0 release of ActiveRDF, available

Execute a file on read?
223442 [eddieroger@g] I am toying around with the concept of dynamic configuration files for
+ 223445 [max.afonov@m] You want Unix fifos (man mkfifo) coupled with a Ruby program that opens
+ 223450 [halostatue@g] File.open("foo.conf", "wb") do |cf|

http.get call works, but then fails when using debugger
223443 [jnjortn@sa d] Can someone tell me if I have found a bug or am doing something wrong
223451 [jan.svitok@g] This is probably normal behaviour. Run your script with -w or -d

Accessing a hash -- Beginner
223452 [donsdx@gm il] I want to access a hash via a gets command.  A simplified
+ 223453 [dblack@wo bl] Do you want to set a hash key, or retrieve a value using an existing
| 223481 [donsdx@gm il] I want to access the hash, then print part of the contents.
+ 223455 [shortcutter@] There is not a single Hash instance in your code.  Also "test" is not
| 223480 [donsdx@gm il] Robert, thanks for the response.  Part of my problem is I
+ 223456 [pubsub@ru yi] The trick is that you want the variable named test, while the return
  223457 [pubsub@ru yi] p eval('exit')
  223482 [donsdx@gm il] Thanks Tom.  I will skip eval for now.  I am going to repose
  223483 [donsdx@gm il] I think I did a poor job of communicating my problem.  I do
  223485 [marshall.jim] You could stick (or create from the beginning) those hashes into another
  223521 [donsdx@gm il] Excellent, Jim.  That's what I will do.

REXML ... performance & memory usage ...
223458 [jeff@da k- i] Wow ... I am trying to use REXML to parse through an 8.8Mb xml file ...
+ 223459 [pubsub@ru yi] If having a pure ruby parser is not a requirement and you're on *nix,
| + 223463 [jeff@da k- i] I had to make two fixes to the source to get things to compile
| | + 223467 [twifkak@co c] WOW.
| | + 223469 [support@ch l] Jeff,
| | + 223490 [rossrt@ro co] It's a good job I try to keep up with happenings on ruby-talk :) Thanks
| + 224189 [pbattley@gm ] I can vouch for that. I changed a bit of slow code from using REXML to
+ 223465 [david@va ln ] =2E
| 223489 [shortcutter@] I would not necessarily call that premature optimization.  If these
+ 224089 [tomasz.wegrz] magic/xml has extremely convenient stream parsing interface.
  + 224093 [jeff@da k- i] Thanks for the tip, I'll have to take a look...
  + 224128 [marcus.brist] Back in the world of j... there are these libs (nux and dom4j and
    224160 [david@va ln ] *groan*
    224195 [rossrt@ro co] Dammit! Another six-hundred quid down the drain...

[ANN] systemu-1.0.0
223466 [ara.t.howard] NAME
223535 [robert.dober] ...
223555 [ara.t.howard] ooops!
223563 [robert.dober] ...

Command line parameters testing..
223471 [rapparna@ho ] I'm using Runit to write unit test for a class that takes command line
+ 223486 [nospam@no it] By typing the Ruby script name and then the arguments. Perhaps a bit more
+ 223492 [jan.svitok@g] Passing arguments to your class instead of runit: (actually I don't

How to simplify "a.instance_of? classX or a.instance_of? classY "
223472 [stephane.wir] I would like to know if there is a way to simplify this code
+ 223473 [ezmobius@gm ] ].any? {|cls| object.instance_of? cls}
+ 223479 [gavin@re in ] case object
| 223493 [fred@la av .] LIST = [ WSDL::XMLSchema::ComplexContent,
| 223507 [gavin@re in ] Very nice.
+ 223484 [transfire@gm] If any are subclasses of the other's then use only the superclass.

VERBOSE and "warning: Insecure world writable dir..."
223488 [bantu@SK SU ] I've just got very popular -- as I guess from google hits -- warning
+ 223502 [ara.t.howard] $VERBOSE = nil
| 223505 [bantu@SK SU ] Yes, indeed, I was curious how to set the variable to nil, gee...
| + 223512 [ara.t.howard] then you have the answer
| | 223541 [david@va ln ] Hmm. Is $VERBOSE thread-local?
| + 223513 [ara.t.howard] google is your friend
+ 223510 [gavin@re in ] There are also other answers, if you continue Googling. The first page

Redefining a class
223491 [robert.dober] ...
+ 223504 [ara.t.howard] c = Class.new{
| 223526 [robert.dober] ...
| + 223528 [dblack@wo bl] Don't forget that several years ago, Matz deprecated POLS :-)
| | 223530 [robert.dober] ...
| + 223542 [david@va ln ] If you redefine the class at times, it's hardly constant. Personally, I
|   223562 [robert.dober] ...
+ 223531 [twifkak@co c] $ ri remove_const
  223533 [robert.dober] ...

uninitialized constant HTMLTree (NameError)
223495 [vikashkumar0] I am working on windows environment, in my code I am using,
+ 223508 [gavin@re in ] You need to require the library with HTMLTree in it.
+ 223691 [vikashkumar0] The above error is resolved by adding require 'html/tree', but a new

mod_ruby postgres
223496 [parragh@da k] ...

Re: openssl for general purpose data encryption in Ruby
223499 [jan.svitok@g] I'm not doing it ('cause I just don't need it ;-). Anyway I think it
223501 [support@ch l] portability w/ block symmetric encryption algorithms (specifically AES, but it

behavior of substitutions with sub
223500 [tammo@ta mo ] I have seen a somehow strange behavior with Strings and the sub-method.
223503 [shortcutter@] That's easily explained: the string you hand off to sub is interpreted
223602 [tammo@ta mo ] Thanks for you answer. That makes sense.

Add dynamic instance methods in a controller class
223506 [luc.juggery@] I have a problem while developping an application using rails.
+ 223511 [gavin@re in ] ...
| 223545 [luc.juggery@] Thanks a lot, I have post it in rubyonrails-talk.
+ 223514 [gabriele.mar] @main_sections.each do |section|

Problem with  rubygems
223509 [chen_li3@ya ] Pinging http://gems.rubyforge.org [] with 32 bytes of

How could I do this search using .scan - I am a newbie
223515 [sba5414@ya o] I am new to ruby and I have been search and pulling my hair to do this
+ 223517 [chen_li3@ya ] irb(main):001:0> line='bat rat cat mat pat'
| 223519 [sba5414@ya o] Thx for ur help....but this is just searching for 'rat' isn't it?
| + 223520 [caldridge@gm] puts %w(bat rat cat mat pat)[1]
| + 223522 [chen_li3@ya ] I assume you read a big file called test.txt  with many lines in this
| | 223524 [chen_li3@ya ] Typo,should be written as "columns on each line are separated with \t
| | 223532 [sba5414@ya o] dude thanks so...much...I was trying so hard....trying to do this....ur
| + 223523 [mguterl@gm i] ...
+ 223518 [mike@st k. a] You might want to look at String#split, e.g.
+ 223559 [robin@ni or ] ARGF.each_line do |line|

DRb: nested remote objects?
223527 [fxn@ha hr f.] I have followed a couple of intros and played around without luck. Given
223529 [fxn@ha hr f.] Nevermind, I opened drb/drb.rb and saw the comments there. For the

Accessing instance vars in a block?
223534 [joeat303@ya ] img.write(self.path) { self.quality = @quality }
+ 223536 [ezmobius@gm ] It looks like maybe ImageMagick is using instance_eval inside that
| 223571 [david@va ln ] <mad-rant>
| + 223580 [dblack@wo bl] But instance_eval takes a block; it's not a special context, but just
| | 223592 [david@va ln ] My point is that with instance_eval, the block doesn't close over its
| + 223642 [wilsonb@gm i] This is basically just a Ruby implementation problem. I'm reading
|   223647 [david@va ln ] ck
+ 223537 [joeat303@ya ] This works but...yuck!
  223547 [gavin@re in ] No reason to use a global. Use a local variable as Ezra suggested.

223538 [skimua@gm il] ...

[ANN] RingyDingy 1.2.0 Released
223539 [drbrain@se m] RingyDingy version 1.2.0 has been released!

Rakefile sound effects
223544 [phlipcpp@ya ] Suppose I wanted to play a WAV file each time any Rakefile tasks all
+ 223546 [jan.svitok@g] I suppose you can check the result code/errorlevel that rake returns,
+ 223550 [david@va ln ] For dirt-simple, bundle mplayer and shellout to it. Not exactly a
+ 223565 [hhausman@gm ] ... snip
| 223588 [vasudevram@g] 1. try 'cat'ing the WAV file to the sound device - maybe something like
| 223596 [david@va ln ] Except they won't work. /dev/dsp and /dev/audio take only very specific
+ 223603 [phlipcpp@ya ] I need to light a fire under this thread.
| + 223608 [twifkak@co c] Er... no, but I'll try & help anyhoo.
| + 223613 [david@va ln ] ably=20
+ 223614 [Mail@Jo as H] maybe with bundled (parts of) sdl - but then you would need to offer
  223616 [nalhawash@ya] Yes, what about pc-speaker? any interface to that existing in ruby?
  223675 [phlipcpp@ya ] "Bad Zoot" is mission-critical here.

RE : Rakefile sound effects
223548 [guillaume.be] rake && echo FINE || echo BAD

trap and multiple occurences
223551 [Philipp.Tapr] I am kind of new to ruby so forgive if this is really stupid...
223552 [gabriele.mar] This is not just a ruby issue, it's the way signal handlers work.
+ 223568 [shortcutter@] The way I'd probably do it is to set up a Queue and have a reader thread
+ 223576 [Philipp.Tapr] Thanks for the explanation and the link.

how to know if i am in a module or in the main script ?
223553 [stephane.wir] with ruby, it's possible to check if I am in the main script or in a
223554 [stephane.wir] Here is a way to find if a ruby file is a module or the main script.
223557 [gavin@re in ] Yes, that is a very common idiom used by many Ruby programmers to
+ 223572 [david@va ln ] Coincidentally, an idiom I don't like. Let libraries be libraries,
| 223586 [jeremymcanal] I don't know about Ruby, but many times this is used in Python libs to
| + 223594 [david@va ln ] By cluttering the file internally with code not related to its main
| | 223759 [tomp@ea th i] Ah, but is laziness not one of the cardinal virtues?
| + 223599 [james@gr yp ] This is a good point in that this in not Ruby specific.  I've seen
+ 223597 [stephane.wir] Thanks

Re: systemu-1.0.0
223558 [gavin@re in ] There's a scene in Total Recall where the cabbie says to the prostitute

[ANN] uri-relative 0.0.1
223560 [mental@ry ia] So, okay, guys.  I'm trying to get better about this release early/often
223623 [mental@ry ia] Hah!  Well, I feel dumb.  URI::Generic#merge and URI::Generic#route_to

Accessing .xml files through rubyzip
223561 [graham_stoke] Can anyone please suggest an approach for handling a .zip archive which
223581 [vasudevram@g] Check the Ruby standard libraries. I know this is possible in Python -
223582 [support@ch l] 1) Assuming you have the .xls file in-memory, how do you load it

[ANN] Ruby-VPI 10.0.0
223564 [ snk@gn .o g] Version 10.0.0 (2006-11-05)

How to match last word?
223569 [vipeak@gm il] I has a script to match 'Transfer dbf to SQLServer', the last
223578 [shortcutter@] Program
223584 [vipeak@gm il] It worked!

how to got a preview of a web page
223570 [yuesefa@gm i] ...
223575 [david@va ln ] def preview_of(url)
223585 [mtrier@gm il] David is correct. It's a problem I've spent numerous hours on.  All

maching input and output xmlsimple
223573 [hborda@co ca] I'm using xmlsimple to change values opn configurations files and it
223579 [david@va ln ] If you're using xmlsimple in the first place, odds are the format of

Re: [OT] how to got a preview of a web page
223577 [david@va ln ] Also, type properly please. Grammar Nazis Anonymous thanks you for

Modal dialogs in Gtk
223583 [ramsayw1@co ] Can anyone explain why my modal dialogs are not freezing the screen?

223587 [robert.mccor] I'm curious - as a newby- where to find existing code snippets that I
+ 223591 [david@va ln ] 1. You seem to have written this as a reply to a thread with another
| + 223604 [robert.mccor] where do I start a topic?  I only saw where to subscribe and it
| | 223617 [david@va ln ] Any mailing list post is an email to that address. If it's a reply to a
| + 223605 [robert.mccor] sorry hit the send button before i was done replying...
+ 224269 [james@gr yp ] Page 533 of the Ruby Cookbook has a slim but functional chat server
  224274 [keith@au io ] The code for (most) O'Reilly books is available from the "examples"
  224283 [robert.mccor] ...