193176-194645

192893-193640 subjects 193398-202321

[OT] First interesting Java development in a while...
193176 [jpshack@gm i] Take a look at http://code.google.com/webtoolkit/overview.html. Very
194344 [chneukirchen] I have to admit I'm pretty impressed by

Blocks in Procs?
193177 [meshac.ruby@] ...
+ 193178 [gwtmp01@ma .] I don't believe you can pass a block argument when calling a Proc.
| 193180 [meshac.ruby@] ...
| 193508 [dave@bu t. d] It's already there, I think.
+ 193202 [pbattley@gm ] Is this any use to you?

Fwd: Please Forward: Ruby Quiz Submission
193179 [james@gr yp ] ...

When will the gateway be back?
193187 [rubyfan@gm i] I really prefer to read comp.lang.ruby instead of being subscribed to
+ 193206 [shortcutter@] +1
| 193209 [Bil.Kleb@NA ] +1
| 193217 [shortcutter@] I think in googlemail you always delete whole threads - if you delete
| + 193239 [Daniel.Berge] I second that!
| + 193255 [lukfugl@gm i] Ah, but deleting a thread still only deletes the messages currently in
+ 193257 [khaines@en g] is the gateway currently gone simply because of a lack of a machine to run it
  193260 [halostatue@g] The gateway is currently gone, as I understand it, because the
  193262 [khaines@en g] It's something that I am probably willing to run, if there is a news provider
  193264 [halostatue@g] That's the real trick; finding such a news provider. Maybe someone
  193294 [ray@wa mr om] I'm reading, and responding, to this thread in gmane.comp.lang.ruby.general.
  193297 [halostatue@g] Right. But that's a gmane-specific mailing list interface. My
  193364 [pjhyett@gm i] Gmail using filters that auto-archive threads (thus bypassing your
  193366 [danielbaird@] ...
  193420 [rubyfan@gm i] The other thing is that with news I don't get a bunch of stuff

Rbfactorings
193192 [daniel@fl in] The other day I had an idea - wouldn't it be cool to collect

Re: Welcome to our (ruby-talk ML) You are added automatically
193201 [matt.g.brown] ...

Capturing stdout
193205 [damphyr@fr e] I have code that prints to stdout (using puts and/or print).
+ 193207 [shortcutter@] You can use popen but then your code is in another process.
| + 193208 [shortcutter@] ...
| + 193213 [damphyr@fr e] Yes, but I can change Kernel#puts :)
|   + 193216 [shortcutter@] You can use a simple mock method for this. See
|   + 193218 [dharple@ge e] require 'stringio'
|     + 193219 [r.mark.volkm] Here's another alternative.
|     | + 193276 [uncutstone@s] I think this is what duck type means. It's really a good example of duck
|     | + 193291 [drbrain@se m] How is this better than using StringIO?
|     |   193301 [uncutstone@s] IMHO, by using StringIO, you pay for something useless in this case but
|     |   193312 [drbrain@se m] You're confusing unused with useless.  I almost never use Hash#index
|     |   193317 [r.mark.volkm] You don't have to add a puts method to the String object in order to
|     |   + 193351 [uncutstone@s] Yes, print does the same.
|     |   + 193354 [drbrain@se m] The Kernel methods have this behavior, yes, but this is not a general
|     + 193220 [uncutstone@s] I am wondering whether Ruby has something similar to C++ stringstream,
+ 193212 [uncutstone@s] s = `ruby file1.rb` , you don't need to load file1.rb in .
+ 193221 [a2800276@gm ] All you have to do is assign a different IO Object to the global
+ 193289 [sroberts@un ] Yes,

Method name
193214 [Michael_ee@y] I'm looking around, but I didn't find a replacement for c++
193223 [r.mark.volkm] I assume you mean the name of the current method.  Here's one way.
193250 [dave@bu t. d] Does this work?
193284 [uncutstone@s] What if I am at the outmost level?
193293 [miken700@ya ] It seems to work properly for me on the outermost level.
193298 [uncutstone@s] I mean at the outmost level, you are still execute in a function's

Please answer to this code?
193225 [visweshwar_0] can anybody execute it and tell me where i go wrong.please let me know
+ 193228 [has.sox@gm i] ...
+ 193229 [miken700@ya ] I think you forgot the .chomp on the second gets. This is probably your
| 193232 [visweshwar_0] That's wonderfull quick time replies and iam thankfull for both.
| 193246 [visweshwar_0] can u suggest me how to write a method where both cases are accepted to
| 193287 [miken700@ya ] I'm not too sure what you are asking for. Something like this?
| 193380 [visweshwar_0] Thanks for ur time.
| 193384 [phurley@gm i] You can use regular expressions for case insensitivity or downcase the
| 193386 [a2800276@gm ] Have a quick look at this documentation, it will answer a lot of your
| 193612 [cklaiber@gm ] viswesh, how about something like this? i'm a bit of a ruby newbie
| 193626 [agorilla@gm ] Converted to a case statement (because I needed a break from work).
+ 193230 [xiaofeng.li@] You'd get gets.chomp for fine and use fine=="good" for direct comparison.
+ 193236 [gm.vlkv@gm i] < Your code
+ 193266 [daniel.schie] puts "what is your name?"
| 193310 [david@ko nt ] list.rb:8: private method `String' called for "David\n":String (NoMethodError)
+ 193372 [xiaofeng.li@] You'd get gets.chomp for fine and use fine=="good" for direct comparison.

Weird forking/rejoining issue
193234 [lutzky@gm il] I'm a Unix admin at a research lab in the technion, and use (and
193243 [ara.t.howard] do your daemon apparently exited and it doesn't prevent itself from running
193259 [lutzky@gm il] hehe... manually, at this point, so that's not it. Excellent point
193277 [ara.t.howard] deleting a job from the queue, forking the child, and adding the cid to the

Module, class and methods confusion
193235 [patrick@pk p] I have a test harness script that requires module "mhiqErrorLogger".
193240 [rmagick@gm i] Just a guess, but should that be
+ 193241 [patrick@pk p] ErrorLogger is not a class/module
+ 193242 [shortcutter@] module MHIQErrorLogger
  193245 [patrick@pk p] Now I'm confused as to how it should be called...
  193251 [patrick@pk p] OK, got it! This works...

Print quota management in Ruby?
193238 [lutzky@gm il] I'm a unix admin at a lab, and we use Pykota to manage print quotas
193305 [logancapaldo] Oh but you can. Don't share a real printer. Install ghostscript, and

Help installing rails
193252 [CMcDevitt@aa] ...
193288 [drbrain@se m] Try the rails mailing list.

is there "equalsIgnoreCase" in ruby?
193254 [visweshwar_0] Please let me know whether any method similar to ("equalsIgnoreCase" in
+ 193256 [halostatue@g] What does equalsIgnoreCase do, and could you not have spent five
+ 193258 [lyle.johnson] Yes, it's called String#casecmp().
  193269 [visweshwar_0] can u please correct the code...
  + 193271 [lyle.johnson] if fine.casecmp("good")
  + 193273 [jmg3000@gm i] See "ri String#casecmp".
  + 193274 [a2800276@gm ] you forgot to tell us what you want the program  to do, what it's

Need help designing UI
193261 [scottlholmes] I'm working on a user interface and I'm hoping I can get some
+ 193265 [leavengood@g] Over the years I'm sure there has been invented countless ways of
| + 193280 [uncutstone@s] I think there are two essential design patterns here, one is message
| | 193282 [scottlholmes] Thanks, will google that!
| + 193281 [scottlholmes] Thanks for replying Ryan. This got me thinking about some design goals.
|   193286 [leavengood@g] In other words anything starting with a colon. These are unique per
+ 193357 [ilmari.heikk] In a DOM-like system: on clicking the button, it would bubble up aCloseWindow-event, which the Viewer would then catch and close thewindow.
+ 193362 [xavier-list@] Investigate a listener/dispatcher pattern, as used by the Java Swing

Rails Install
193263 [CMcDevitt@aa] ...

Simple regexp: Matching CRLF in a Windows file
193267 [weyus@at .n ] All,
193268 [weyus@at .n ] Apparently just matching on \n works.
193278 [dave@bu t. d] Ruby on Windows automatically replaces \r\n with \n on input and

Install Local Gem files
193275 [CMcDevitt@aa] ...

load unless requires - what are the ramifications
193290 [todd_run@ya ] I very new to Ruby (this is my second week), so excuse the "newbieness"
+ 193292 [Daniel.Berge] Some people are nice about letting tests run from the test or parent
+ 193295 [jim@we ri hh] Oops.  Require will return false if the file is already loaded, not if
  193302 [todd_run@ya ] You're correct!  Definately not what I want!

greatest float smaller than 1.0?
193320 [polypus@ya o] how do i get the greatest float smaller than 1.0?
+ 193322 [a2800276@gm ] Analysis?
+ 193323 [collinsj@se ] 0.999999999999999 ?
| + 193325 [garbagecat10] ...
| | 193328 [ mfp@ac .o g] f = (1.0 - Float::EPSILON)             # => 1.0
| + 193326 [polypus@ya o] i mean is there some portable way of getting the value via some method
|   193327 [garbagecat10] ...
+ 193329 [vjoel@pa h. ] Something like this maybe?
| + 193331 [garbagecat10] ...
| | 193339 [gilesb@gm il] yeah -- this is actually playing with fire, really.
| + 193332 [vjoel@pa h. ] That was completely wrong, please ignore.
|   + 193333 [garbagecat10] ...
|   | + 193334 [Nuralanur@ao] ...
|   | + 193369 [dido.sevilla] The technical term for this unfortunate situation is significance
|   |   + 193371 [Nuralanur@ao] ...
|   |   + 194503 [lutzky@gm il] By the way, the problem in your question lies with calculus. Fact is, in
|   |     194504 [lutzky@gm il] Pardon, you were looking for the other direction :)
|   + 193337 [ mfp@ac .o g] oops
+ 193348 [logancapaldo] 1.0 - Float::EPSILON
| 193363 [taschini.mli] The right answer is that of Mauricio
+ 194523 [robert.dober] ...

Ruby for Rails Rocks!
193335 [pollak@gm il] ...
194634 [Eric.Armstro] I have to add my kudos, as well. It's a spectacular effort.
194645 [gilesb@gm il] ditto, it's very good

bm + net/http sanity check
193340 [steve.debaun] ...
+ 193344 [a2800276@gm ] Maybe consider the relative delta. The GET request should take quite a
+ 193345 [sroberts@un ] Why not? Sounds ok, setting up, using, and closing down a tcp line
  193346 [steve.debaun] Sorry, I should have clarified; I'm benchmarking the same site (server,
  193347 [steve.debaun] Ah ha, that makes more sense.  It didn't occur to me that it would take
  193352 [ruby@ph li .] get() should just download the one page.  It's not going to download the

Asynchronous calls in DRb
193353 [madan.manoha] ...
+ 193355 [drbrain@se m] Throw away your magnifying glass, you're looking too hard.
| 193360 [uncutstone@s] Yes, it is quite easy to implement asynchronous call using thread. Here
+ 193358 [binary42@gm ] Yes. It is actually more simple that you think (Ruby is more magic
+ 193547 [madan.manoha] -Madan.

Is there an equivalent to instance_eval in JavaScript?
193356 [drjflam@gm i] ...
193365 [m-lists@br s] No, I don't think so. But you can probably add it.
193390 [drjflam@gm i] ...

pcap library install on windows without c compiler
193361 [maddern@gm i] I need to find a gem or simple installer for the pcap library for
193376 [Nuralanur@ao] ...
193491 [maddern@gm i] Not really I need to use
193519 [Nuralanur@ao] ...
193546 [halostatue@g] Better to use MINGW/MSYS than Cygwin. Cygwin is ... not a good choice
193550 [Nuralanur@ao] ...
193554 [halostatue@g] It doesn't pretend to be Unix. It provides a shell and a compiler that

alias_method
193367 [limux@12 .c ] module ActiveRecordExtension
193373 [decoux@mo lo] You want probably alias with instance_eval

Make a revised version of design patterns in ruby
193368 [uncutstone@s] Ruby is highly dynamic and extensible. Ruby is duck typed. Interface
+ 193377 [shortcutter@] That might be an interesting thing to do.
| 193413 [uncutstone@s] Yes, you are right. Class WidegetFactory is unnecessary. So an simpler
+ 193416 [gene.tani@gm] ...
  193427 [uncutstone@s] Acctually, I did took a look at ExampleDesignPatternsInRuby
  193432 [jim@we ri hh] The way I understood the examle is that "create_something" IS the
  + 193433 [jim@we ri hh] Oops, Let me correct this.  I see that the create_something does not
  + 193501 [uncutstone@s] Ah, it seems I misunderstood something. I think the name

WEBLOG in RUBY.. Can u help me?
193375 [alkhezzi@ho ] Can you help me in writing (or finding an already written) code to read
+ 193387 [masukomi@gm ] ...
+ 193388 [peter@se an ] Well the standard tool for web server log analysis is analog

Command Line Processing / Pipes
193379 [Stuart.Holde] ...
+ 193383 [chris.hulan@] The following works on Win2k with ruby 1.8.2 (2004-12-25) [i386-mswin32]
| 193400 [Stuart.Holde] Sorry, I forgot about 'cat' being a non-standard cmd. It's on this
| + 193434 [chris.hulan@] type subseq.rb | ruby pipe-test.rb
| + 193437 [aledonne.lis] type input.txt | ruby parser.rb
|   + 193493 [caldridge@gm] It's getting to ruby if a ruby exception is being thrown.
|   + 193517 [pit@ca it in] type r.rb | r.rb
|     193521 [Stuart.Holde] Yes, when I explicitly call ruby rather than rely on the file
+ 193402 [shortcutter@] CYGWIN_NT-5.2-WOW64 PDBXPWSRK38 1.5.19(0.150/4/2) 2006-01-20 13:28 i686 Cygwin
  193407 [Stuart.Holde] The one liners mentioned below both work for me. I encounter the

instance variables for Fixnum?
193381 [pascal_hurni] irb(main):001:0> 1.instance_variable_set(:@foo, 123)
193382 [daniel.schie] Almost everything in Ruby is an object -- even Fixnums. There is only
193385 [pascal_hurni] Yes, that's ok

[OT] Partial functions?
193389 [Daniel.Berge] I'm trying to understand a new feature of Python 2.5 (PEP 309) called
+ 193391 [JoeBowers@bc] Partials are great for deferring part of a computation
| + 193412 [madan.manoha] ...
| | 193651 [binary42@gm ] I did introduce that but it isn't quite right to call them the same
| + 193485 [grzm@se sp t] I've been keen to learn more about closures, but haven't made the
+ 193392 [kiaroskuro@g] ...
+ 193393 [keith@or il ] Hey,
| 193395 [simon.kroege] gem install rubymurray
+ 193396 [maurice.codi] ...

Re: [SUMMARY] Tab Player (#79)
193394 [rossrt@ro co] Putting aside the musical theme for a moment, this quiz boiled down to a
193787 [james@gr yp ] Thanks so much Ross.  Great summary!

Rescue clauses on do/end blocks?
193397 [daniel.schie] I know this has been on the table before, but I really see no reason not
+ 193399 [shortcutter@] Go for it!
| 193415 [daniel.schie] Alrighty then!
+ 193401 [jgbailey@gm ] ...
+ 193404 [rossrt@ro co] File.open('somefile') do |f|
| + 193409 [daniel.schie] The same as there would now; since the rescue clause is not inside the
| | 193423 [rossrt@ro co] Does that mean that with the proposed syntax, to rescue an exception
| | + 193430 [daniel.schie] As I imagine it right now, rescue clauses on do/end blocks would only
| | | 193440 [jesusrubsyou] I agree with Daniel.  It should only rescue exceptions raised in the
| | + 193524 [shortcutter@] No.  You still decide where to catch the exception.  You can do it
| + 193421 [uncutstone@s] What if rescue has more than one sentence? It seems not a good idea.
|   193426 [uncutstone@s] File.open('somefile') do |f|
|   + 193431 [daniel.schie] File.open('pr0n') do |f|
|   + 193478 [matz@ru y- a] Which do you expect from above code?
|     + 193480 [halostatue@g] I expect (a), personally. The only thing that could confuse it is the
|     | 193482 [matz@ru y- a] If (a) is the case, the value from the rescue clause is used for a
|     + 193498 [uncutstone@s] I expect case a. Sorry I didn't carefully check the code I gave,  "Can't
|     + 193527 [shortcutter@] Hm, I beg to differ: the "rescue" is *inside* the block so it can
|       193537 [daniel.schie] I'm on the same page as Robert -- I didn't even think of rescuing
+ 193428 [halostatue@g] foo {
| 193444 [daniel.schie] I think it looks too odd. The do/end and the curly bracket syntaxes are
| + 193455 [dblack@wo bl] I'm not sure I get that distinction -- I mean, I understand that you
| | 193459 [daniel.schie] Maybe it's time we make that distinction. From a syntactical point of
| | + 193464 [drbrain@se m] parse.y disagrees with you.
| | | 193472 [daniel.schie] That's implementation. We ought to be able to abstract away from that,
| | | + 193474 [drbrain@se m] No, ruby itself directly contradicts you.  The language defines only
| | | + 193476 [halostatue@g] Yes, but as I said -- and I know you haven't seen it as I'm writing it
| | + 193475 [halostatue@g] Blocks are blocks. Stylistically, some people prefer braces, some
| |   193538 [daniel.schie] Personally, I wouldn't mind a distinction between the two. Maybe an
| + 193458 [drbrain@se m] Not true.  do/end and {/} are interchangeable except you may need to
| + 193473 [halostatue@g] No, they're not used in different places, not really.
+ 193435 [drbrain@se m] Setting up and tearing down an exception handler for every block
  + 193436 [jim@we ri hh] Couldn't the setup/teardown be done only if a rescue/ensure clause was
  | 193462 [drbrain@se m] ...
  + 193445 [daniel.schie] Wouldn't it be possible to only set up an exception handler for blocks
  + 193486 [hal9000@hy e] I guess I assumed that it would only do the setup if the rescue
    193500 [drbrain@se m] I misremembered what AST would be built.  The setup only occurs when
threads.html
top