151368-152549

151127-156207 subjects 151551-166486

Get path of currently-executing Ruby interpreter
151368 [batkins57@gm] Is there a built-in variable that will return the name of the current
151375 [langstefan@g] require 'rbconfig'
151376 [mrcode@ne ro] require 'rbconfig'

Re: [SOLUTION] Stock Portfolios (#41)
151371 [james@gr yp ] Thanks for sharing.  I wasn't aware of that service and it is trivial
+ 151372 [james@gr yp ] #!/usr/local/bin/ruby
+ 151391 [jeff@op nd m] I use a web service that uses yahoo, I always thought this was dirty though,

event driven framework for ruby
151377 [snacktime@gm] Is there an event driven framework for ruby?  Something similar to POE
+ 151381 [zedshaw@ze s] Actually, yes.  I'm working on the Ruby/Event library.  It's a C extension
| + 151384 [james@gr yp ] Does this do all it's socket work in C, to bypass Ruby's Thread
| | + 151389 [ysantoso-rub] What blocking issue?
| | | 151394 [james@gr yp ] Writing a large chunk of data to a file, for example.  Ruby will
| | | 151400 [ysantoso-rub] Disk I/O will always block the process executing it. only way to avoid
| | | + 151405 [james@gr yp ] Non-blocking IO is another solution.
| | | | + 151410 [ysantoso-rub] I know no POSIX system that honours O_NONBLOCK for disk I/O. That
| | | | | 151421 [mailinglists] It should work on linux even if the linux implementation is done
| | | | + 151445 [akr@m1 n. rg] O_NONBLOCK is not always applicable.
| | | |   151447 [vjoel@pa h. ] Can you say a bit more about what happens differently on Linux 2.6 when
| | | |   151448 [akr@m1 n. rg] Linux 2.6's select notify readability by a UDP packet with a bad checksum.
| | | |   + 151454 [vjoel@pa h. ] That post (148436) suggests that the native thread running the
| | | |   | 151457 [akr@m1 n. rg] Ruby threads is not native threads.
| | | |   | + 151458 [vjoel@pa h. ] $ ruby -rsocket -e '
| | | |   | | + 151459 [vjoel@pa h. ] ...which means the packet was received normally by the UDP port.
| | | |   | | + 151460 [akr@m1 n. rg] I can reproduce the exit if server and client is same machine.
| | | |   | + 151461 [vjoel@pa h. ] Is there any disadvantage to setting O_NONBLOCK for all UDP packets, as
| | | |   |   + 151462 [akr@m1 n. rg] Some methods may behave differently.  At least IO#sysread raises
| | | |   |   + 151537 [billk@ct .c ] process blocking on a UDP recv.
| | | |   + 151776 [ralf.horstma] This should be fixed in 2.6.10. They made a workaround that validates
| | | |     + 151833 [akr@m1 n. rg] I didn't know that.  Thank you.
| | | |     + 151964 [vjoel@pa h. ] That's a big relief. Thanks for the information.
| | | + 151408 [rcoder@gm il] Actually, the entire point of "native" threading is to allow blocking
| | | + 151451 [akr@m1 n. rg] I think native (kernel level) thread doesn't block other threads.
| | + 151416 [zedshaw@ze s] Depending on the libevent API used, all of the actual socket
| |   151422 [james@gr yp ] This project interests me a great deal!  Thanks for taking the time
| + 151386 [ezra@ya im -] Hey Zed-
|   151417 [zedshaw@ze s] Hey Ezra, this stuff is actually still in my queue of things to get done.
+ 151439 [akr@m1 n. rg] Why do you need an event driven framework?

[ANN] another Ruby article at developerworks
151378 [pat.eyler@gm] IBM just published another Ruby of my articles on Ruby.   'Profiling and
151802 [jeff.darklig] Pat,
151894 [pat.eyler@gm] IBM has a 30 day exclusive, but I'm collecting all the articles from the

Update installed gems
151380 [dmartenson@m] I build my own gems as a way to distribute a variety of utilities where
151382 [ezra@ya im -] $ gem_server
151407 [dmartenson@m] I will give that a try, but it seems like it is meant to serve your
151473 [chadfowler@g] from an alternate directory (with the -d param) if you want to include
151505 [dmartenson@m] ...

Software used for Ruby on Rails "15m intro movie" ?
151388 [francisramme] I just saw the 15m intro movie for Ruby on Rails and I wonder what
151392 [james@gr yp ] The editor is TextMate and I really think it's worth a look, assuming
151395 [francisramme] Yes I'm using OS X at work. I really wanted something that uses tabbed
151396 [fxn@ha hr f.] ...
151463 [matt.mower@g] Yes it's iTerm.  DHH used (when I asked him about it a couple of weeks
151485 [brianm@ap ch] TextMate is pretty nice, but I've still been more productive lately
151486 [shalev@si pl] What's "inferior ruby" ?

[ANN] Rio 0.3.1
151393 [rio4ruby@ru ] I am pleased to announce the first public release of Rio -- Rio 0.3.1
151466 [wybo@se va y] Attempting remote installation of 'rio'
151483 [shalev@si pl] Usually when requiring a gem you need to first " require 'rubygems' "
151494 [wybo@se va y] it did - thanks!

"Conversations" and coroutines
151402 [levin@gr nd ] I am trying to write a some code that expresses a series of
+ 151406 [vjoel@pa h. ] I'm guessing #start runs the block? Why not
| 151419 [levin@gr nd ] I am pretty sure that I need Threads, but I think a single
+ 151425 [probertm@ac ] I think that the "serial link" part is important.  How does the

Re: Stock Portfolios (#41)
151413 [netghost@gm ] The application bit is a little unpolished, but it has some neat

NitroHQ been vandalised?
151414 [john.carter@] I went looking for the Nitro homepage to give it a mention to our
+ 151418 [jamis@37 ig ] Indeed, very sad. It's too bad that people feel the need to target
| 151434 [schlu-do@gm ] Yes. But as it's a Wiki, it should be easy to revert to a previous
| 151464 [george.mosch] Thanks for reporting, I have rolled-back the earlier version. I 'll
+ 151424 [transfire@gm] Perhaps put email confirmations on editing. Once confirmed perhaps the
  151435 [johnwilger@g] Must be those Absynthe programmers. Absynthe is the Apocolypse! :-D
  151442 [transfire@gm] Is that another agile web framework?
  + 151489 [johnwilger@g] No. (At least not that I'm aware of.) That's kind of an inside joke
  | 151628 [julian@co et] that's kinda funny... coz AbSynth is also a programmable synthesizer...
  | 151806 [hal9000@hy e] "Synth" as in synthesizer obviously, but also a play on
  | 152057 [johnwilger@g] Damn! I was hoping to get through this thread without anyone pointing
  + 151498 [dbatml@gm .d] No. Check out "The Least Surprised - Time dot now.avi" or "The Least
    151516 [transfire@gm] Shucks. I was hoping to get a LOL, but you all took me serious! Sorry,

Gateway Okay? (Missing Quiz Solutions?)
151423 [james@gr yp ] Looking through Google Groups, I can see a quiz solution on
151430 [omccabe@gm i] I think what happened is that I sent an email that looked like a
151438 [james@gr yp ] Gotcha.  Thanks for the info.

SOAP4R -- Need Help!
151426 [jeff.darklig] Ok, I've been scrounging around for the last hour to hour and a half

Ruby and ESB (Sonic)
151428 [bertvanbrake] Has anyone had any experience with ruby and ESB testing? Especially sonic ESB?
151481 [brianm@ap ch] I'm working on (in Java and JDBC terms) a generic Type-4 (protocol
151562 [bertvanbrake] Thanks Brian, looks cool.

[ANN] KirbyBase 2.2.1
151433 [jcribbs@tw i] I would like to announce version 2.2.1 of KirbyBase, a simple, pure-Ruby

NEWBIE QUESTION: pattern with nil
151441 [basi_lio@ho ] if a == "" or a == nil
+ 151443 [dblack@wo bl] if a.to_s.empty?
| + 151446 [Ara.T.Howard] 'normalize' is such a nicer word than 'cast' - i'll take it!
| + 151563 [basi_lio@ho ] Thanks all for the suggestions. This solution appeals to me because I
|   + 151565 [aredridel@nb] Certainly not the only criteria one should use -- but it sure feels
|   + 151566 [james@gr yp ] Ruby makes it trivially easy to alter the behavior of the core
|     151626 [gavin@re in ] This has been the biggest 'gotcha' for me; I started out with Ruby
|     151631 [john.carter@] My whole reply was a little tease....
+ 151444 [Ara.T.Howard] i generally use
+ 151453 [john.carter@] class NilClass
  151465 [bearitall@ra] I vote for this one because a good programmer is a lazy sod. Where ever
  151480 [halostatue@g] Just, please, don't do it in a library that you unleash on the rest of
  + 151544 [wilsonb@gm i] Rails defines a method called "blank?" on the class Object.
  + 151605 [john.carter@] Well...
  | + 151616 [dblack@wo bl] I would say that asking whether nil is empty is like asking whether 12
  | | 151630 [john.carter@] class Fixnum
  | | + 151659 [dblack@wo bl] Well, yes, Ruby lets you do that.  I would still argue that "it just
  | | + 151798 [w_a_x_man@ya] By definition, axioms are not provable.
  | |   151804 [flori@ni e. ] Yes, but back then it wasn't known, that the 5th Euclidean axiom was
  | + 151671 [halostatue@g] I didn't go into detail there, John, but it's worth noting that
  |   + 151777 [john.carter@] No, as I remember it, his problem wasn't with NULL, but
  |   | 151810 [halostatue@g] Um. In part, yes. The point is, though, that Codd believed toward
  |   | 151829 [john.carter@] John Carter                             Phone : (64)(3) 358 6639
  |   | + 151831 [kevin.jackso] Yeah I have to agree here, integers are a Set of values based on a
  |   | | 151832 [twifkak@co c] Woah, woah, woah. Integers are just things that satisfy a specific set
  |   | | 151834 [kevin.jackso] Ok, agreed it's just one way of defining 'things' that happen to satisfy
  |   | + 151863 [dblack@wo bl] Nothing on that page remotely implies that the Ruby Integer object 3
  |   + 151801 [dblack@wo bl] I'd say it's undefined, or just meaningless.  One could say that -3
  |   + 152539 [transfire@gm] Austin, I'd like to see a _real_ example of where Nilclass' suppossed
  |     152549 [halostatue@g] 1. It isn't a supposed contract. By default, Ruby does not offer #empty?
  + 152534 [netghost@gm ] Don't worry, you can redefine it to return :mu

IS there a GUI for RubyGems?
151449 [olczyk2002@y] Seen to have seen one called something like RubyGems Manager on one of
+ 151452 [brian.takita] ...
| 151482 [eduardo.yane] where?
+ 151474 [chadfowler@g] Paul Duncan created one for Linux called gemini
  + 151492 [snowzone5@ho] it's the long answer too.
  | 151532 [eduardo.yane] where is the option menu?
  + 151502 [ezra@ya im -] There is a Ruby web dialogs gem front end called RubySlippers for gems
  + 151510 [mailinglists] RubySlippers at http://freshmeat.net/projects/rubyslippers/
    151513 [chadfowler@g] Aah, yes.  Thanks for pointing that out and my apologies to the author of
    151540 [rob.02004@gm] Look's like a Gems interface is the next feature I should add to the

UDPSocket#bind with 0 or nil
151456 [vjoel@pa h. ] Anyone happen know what the difference between bind(0) and bind(nil) is?
151468 [daniel@br ck] Joel,
151555 [vjoel@pa h. ] ...snipped useful explanation...

passing a method
151467 [wybo@se va y] I want to make a method which can execute another method given to it as
+ 151469 [daniel@br ck] Why do you want to do this?
+ 151470 [twifkak@co c] @t = ''
+ 151471 [clr6.10.rand] what about
| 151475 [wybo@se va y] That's exactly what I needed. Thanks!
| + 151476 [dblack@wo bl] Why not just use send?
| + 151478 [bob.news@gm ] IMHO a superior solution would be to use a block instead of argument
|   151484 [wybo@se va y] exactly
+ 151472 [dblack@wo bl] Have you looked into the 'send' method?
+ 151477 [nobu.nokada@] yield

force_recycle
151493 [simon.kroege] is there a way to tell the GC that an object isn't needed anymore?
+ 151496 [nobu.nokada@] No.
| 151500 [simon.kroege] Thanks,
| 151504 [halostatue@g] Nobu just told you "no". There are three people who, if they tell you
| 151506 [simon.kroege] Ok, perhaps I (wanted to) misinterpret Nobu's 'no'. I thought this
| 151508 [nobu.nokada@] Sorry, I was too terse.
| 151514 [simon.kroege] I'm not lucky,
| + 151523 [Ara.T.Howard] fork - and do work in multiple processes.  all memory is freed when the
| + 151612 [nobuyoshi.na] The wrong thing is that you misuse GC to maintain expensive
|   151641 [simon.kroege] i realy appreciate your input but that's not the kind of problem
|   + 151642 [simon.kroege] That's what we try, but with problems atm.
|   | + 151643 [simon.kroege] Thanks,
|   | + 151645 [ruby.brian@g] Then maybe this is even a usable way, because if you proxy the objects
|   + 151647 [nobuyoshi.na] Have those threads all terminated and got freed?
|   + 151751 [vjoel@pa h. ] I patched the ruby interpreter to divulge this information, but that was
|     + 151854 [nobuyoshi.na] Interesting.
|     | 151876 [nobu.nokada@] Oops, a wrapper function is needed.
|     | 151982 [SimonKroeger] Thanks a lot!
|     + 151984 [SimonKroeger] Very cool!
+ 151515 [ruby.brian@g] The cleanest way i can think of would be to set the references to nil,

Matrix type ?
151507 [zimba.tm@gm ] Maybe you can help me.
+ 151518 [ruby.brian@g] You should start with a board class. Something like this
+ 151520 [bob.news@gm ] That can be simplified to
+ 151521 [Daniel.Berge] require "matrix"
+ 151528 [james@gr yp ] up.  I already have a quiz for next week, but it will pop-up after that.
+ 151621 [tom@in oe he] Yours,
| 151871 [leslie@ca ar] as one of my first Ruby programs. Very quick and easy -
| 152004 [james@gr yp ] Any chance I could talk you into posting that as a reply to the Ruby
+ 151987 [ jupp@gm .d ] Sudoku seem to be pandemic. I started sudokuing today using a booklet

problems installing gems on suse 9.1 (zlib probs?)
151512 [rocknroll@bi] first of all: i'm new to the list, i'm new to ruby, i'm not to suse :)
+ 151604 [eric.promisl] I'm on Windows, trying to install rails with the preview version
+ 151869 [caiomoritz@g] Lars, I was having the same problems you've describe trying to install

Threading on Win32 - at an impasse
151517 [batkins57@gm] I'm working on a project that would have to run several TCPServer's in
+ 151526 [david@va ln ] Oooh, nested parentheses. Don't take this as a pro's advice, just first ideas I
| 151527 [batkins57@gm] I'm using readine for its completion and history features.
| 151652 [david@va ln ] Hmm. DOSKEY does do history automagically, I also have a hunch IO#gets is
| 151681 [batkins57@gm] All right, just in case anyone googles this later on, I was able to
| 151687 [Ara.T.Howard] can you post a baby example?
| 151693 [batkins57@gm] Sure.  This solution might not work for everyone, because fortunately
| 151695 [Ara.T.Howard] it does - there is a win32-fork - guess you can't exec then?  i don't really
| + 151697 [Daniel.Berge] There is no win32-fork.  There's an implementation of fork in
| | 151711 [Ara.T.Howard] right-o.  i guess what wondering what the semantics of this wrapper are - do
| | 152052 [djberg96@gm ] A pretty good guide on the differences can be found at
| | 152053 [dooby@d1 .k ] (replacement link)
| + 151701 [batkins57@gm] There's a Process.fork in win32-process, but despite the name it does
+ 151561 [vjoel@pa h. ] Not very helpful, but what about hacking FXIrb and doing your user input
+ 151611 [akr@m1 n. rg] mechanism support Windows console.  I don't know current status,

RubyGems questions
151524 [mutoh@hi hw ] ...

require and relative paths
151530 [francisramme] require "./Classes/Printer" # My personal printer class
+ 151533 [bob.news@gm ] Did you try removing "./"?  Other than that, if directory "Classes" is
| 151538 [francisramme] I tried to remove the "./" but that doesn't work.
| 151539 [bob.news@gm ] Of course this won't work if you try it from irb.  Did you try it in your
| 151554 [francisramme] require File.join(File.dirname(__FILE__), 'Classes', 'Printer') works
+ 151535 [ jimm@io co ] require File.join(File.dirname(__FILE__), 'Classes', 'Printer')
| 151624 [meta@po ox c] I'm inclined to prefer doing
+ 151542 [pan@er kv en] $: << File.dirname(File.expand_path(__FILE__))
  151637 [francisramme] Thank you very much.
  151638 [francisramme] $: << File.dirname(File.expand_path(__FILE__))
  151654 [google@er kv] I couldn't do it clumpsier...:)
  151662 [francisramme] Thanks, that looks a lot better than my "solution"..

Re: Stock Portfolios (#41)
151534 [email55555@g] Typo error ?
151541 [james@gr yp ] You're right and I should know better.  Thanks!

Date from dd-mmm-yyyy
151543 [chris@se gu ] I've just spent a short while creating a couple of methods that take a
+ 151546 [patrick.fern] require 'date'
| 151547 [patrick.fern] d.strftime("%F") #=> "2005-08-10"
+ 151548 [khaines@en g] irb(main):001:0> require 'date'
  151646 [chris@se gu ] Just as I thought, two different ways to achieve in a max of two lines
threads.html
top