354035-357801 subjects 354392-355433

^ yield self if block_given?
354248 [rubynewbee g] class AngstyNamedPerson
+ 354249 [rubynewbee g] I tried below, it can work,
| 354250 [ayumu.aizawa] Yes it does.
+ 354269 [lists bertra] I would like to tell it superfluous as in all regular cases the

^ [ANN] MountainWest RubyConf Proposal Deadline Extended
354259 [blowmage gma] We decided to extend the deadline for MWRC 2010 proposals by a couple days.

^ [ANN] mongrel_service 0.4.beta2 Released
354264 [luislavena g] mongrel_service version 0.4.beta2 has been released!

^ "Dummy" IO object to push and pull data?
354265 [gohegdeh com] I'm relatively new to advanced Ruby programming, and I seem to be in
+ 354266 [ryand-ruby z] ri StringIO
| 354273 [gohegdeh com] objectA = StringIO.new("")
| + 354276 [sophrinix gm] Depending on your application, fakefs might be worth while.
| + 354291 [shortcutter ] If your scenario is such that for any particular thread you are always
| + 354303 [b.candler po] Ah, then you want something with a real underlying O/S file descriptor.
|   354308 [b.candler po] Oh, and there is also IO.pipe, which is unidirectional under most Unix
|   354309 [gohegdeh com] I've tried pipes, but it seems to always think there's data to be read.
|   354311 [vikkous gmai] My recollection is that on windows, select only works on sockets. It
|   354352 [gohegdeh com] To make sure that I've been using it right, select is supposed to check
|   + 354353 [vikkous gmai] It returns an _array_ of arrays of ready file handles.
|   + 354354 [tony medioh.] I'd again ask if you're trying to do I/O or thread synchronization here.  It
|     354358 [gohegdeh com] Well, it seems the problem is primarily occuring with Open3.popen3
|     + 354383 [b.candler po] Sorry, I've read that several times and I still don't understand. Can
|     | 354402 [gohegdeh com] My apologies: I'll see if I can elaborate a bit...
|     | + 354403 [gohegdeh com] Hm, let me give an example of what this would output. The process that
|     | + 354404 [b.candler po] Perhaps it would be helpful to distinguish symptoms from your assumed
|     | | 354408 [gohegdeh com] I've actually tried these myself; it doesn't get past the stdin.puts
|     | | 354415 [gohegdeh com] # Required support, go to process dir
|     | | 354429 [b.candler po] But that message never appears in the output you showed - and this line
|     | | 354434 [gohegdeh com] Then nothing else happens. I'm 90% sure this is because Windows, being
|     | | + 354438 [b.candler po] It returns you to a command prompt? How odd.
|     | | | 354439 [gohegdeh com] Oh, my apologies, I had put the user info there to show that I was
|     | | | 354451 [b.candler po] OK. I've now got a Windows XP box beside me. I tried the threaded
|     | | | 354466 [gohegdeh com] Ah, that'd be it. Everything works fine now - Thank you all for your
|     | | + 354460 [shortcutter ] Actually part of that functionality is in Ruby itself because IO uses
|     | |   354463 [b.candler po] I agree that's a good idea, but I don't think it actually makes a
|     | + 354428 [vikkous gmai] Ah, that's right. On windows, there's a special method you have to use
|     | | 354431 [vikkous gmai] Except when I actually read the msdn link above, I see it only works
|     | + 354454 [shortcutter ] That can't normally be, because the thread runs independently of the
|     |   354457 [b.candler po] He's right, and I have replicated the problem. It occurs with with 1.8.6
|     |   354458 [pg thimian.c] PS C:\Scripts> ruby -v
|     + 354396 [shortcutter ] I gave an example using Queue (also a tool for thread synchronization)
+ 354279 [gohegdeh com] I've been using a workaround that seems to work fine, but certainly
+ 354310 [tony medioh.] If this is all just for thread synchronization, you shouldn't be using IO

^ Rounding float in ruby via .round
354268 [shevegen lin] .round does not want arguments. Is there a reason why not?
354270 [pg thimian.c] Hmmm..
+ 354271 [xenogenesis ] <=3D 1.8.7
| + 354272 [marnen marne] It shouldn't be too hard to write that behavior into 1.8.7...
| + 354280 [phrogz mac.c] if Float.instance_method(:round).arity =3D=3D 0
|   + 354281 [phrogz mac.c] Note that this gives you a Float as the result, which you may need to
|   + 354282 [phrogz mac.c] Bah, should have tested. Of course the original round returns a
+ 354293 [colinb2r goo] I didn't know 1.9 had extended Float#round. That's useful. Thank you

^ Re: How to get the directory of the current script?
354274 [kjohnson ham] File.dirname(File.dirname(__FILE__))
354275 [pg thimian.c] require "futils"
354304 [b.candler po] Note 1: the process's current working directory is in general unrelated

^ A problem while using RadRails to debug
354278 [lxybhbh gmai] I met a problem while using Aptana RadRails to debug a program.

^ how to access something within an array
354284 [rupert peakl] I have this array...
+ 354286 [marnen marne] That array contains one entry, a Yahoo::GeoPlanet::Place object.
| 354290 [anoiaque gma] You should have an accessor , try  : geo_planet_object.woe_id .
| 354300 [marnen marne] But don't.  Introspection is dangerous in this case, and should not be
+ 354301 [b.candler po] thing = arr.first
| 354305 [marnen marne] Good point, although that's not terribly reliable if method_missing
+ 354317 [josh.cheek g] It appears the object has a reader for woe_id (based on

^ Re: Happy new Year
354285 [sureshkkgvr ] Happy New Year to every one.

^ block.call
354287 [rubynewbee g] please see the code below, why passing a block to a function then call
354292 [shortcutter ] Because, as the error message says, this is not valid Ruby syntax.  You
354295 [rubynewbee g] thanks.
354296 [jeffpeng net] An incoming code block will be converted into a Proc object and bound

^ [ANN] posix_mq - POSIX message queues for Ruby
354289 [normalperson] POSIX message queues allow local processes to exchange data in the form

^ can't understand for this each
354294 [rubynewbee g] Please take a look at below.
+ 354297 [josh.cheek g] An English translation might read "For each key value pair in the hash, add
+ 354298 [lists bertra] `Hash#each' is not `Array#each'. It is descibed in
+ 354302 [b.candler po] Would it help if you think of it as "self.each" ?
  354315 [rubynewbee g] oops that's right.

^ Is it possible to redirect $stderr to a Logger isntance?
354306 [ibc aliax.ne] =20
354307 [tim.pease gm] instance (as=20
354388 [ibc aliax.ne] we

^ [ANN] Mail 1.5.0
354312 [raasdnil gma] Mail has been screaming along in development over the past month.

^ [ANN] gem_file_conflict_checker (0.2.1) -- clean 'em up
354313 [rogerpack200] Pleased to announced the initial release of the

^ [ANN] rdp-arguments -- named arguments for 1.8 and 1.9!
354314 [rogerpack200] Though I can't take much credit for this (the original author is maca
354318 [m.fellinger ] The README is wrong about install, github doesn't build gems anymore,

^ [ANN] posix_mq 0.2.0 - notify fix + FreeBSD support
354319 [normalperson] POSIX message queues allow local processes to exchange data in the form

^ use ruby for what?
354321 [rubynewbee g] May I ask, what jobs are you using ruby for?
+ 354323 [jeanjulien.f] Well, on my part, I mainly use it for scripting purpose: updating part
+ 354324 [mo_mail ongh] Lots of data processing, quick proof-of-concept work, enterprise
+ 354326 [pg thimian.c] Prototyping, I've written a desktop app in it (a proper one, too!),
| 354330 [uwe kubosch.] We use Ruby (mostly JRuby) for
+ 354331 [shortcutter ] I use it for automation tasks which are too complex for Bourne Shell
+ 354333 [lists bertra] Some years ago I even saw an /sbin/init (pid=1) written in Ruby.
+ 354335 [jason.trebil] Well, if'n you build it, then someone has to test it.  And where I work, =
+ 354356 [phrogz mac.c] * Web Dev using Ramaze (my sites) and Sinatra (on Heroku).
+ 354376 [dido.sevilla] T24gU3VuLCBKYW4gMywgMjAxMCBhdCA0OjQ0IFBNLCBSdWJ5IE5ld2JlZSA8cnVieW5ld2JlZUBn
+ 354389 [zigzag.chen ] #1. Rails for webdev

^ [Ruby Appliance] Status update
354325 [pg thimian.c] A (very slightly edited) post can be found on my blog, too. [0]

^ please find this problem
354327 [ashok.bhanda] Address already in use - bind(2) (Errno::EADDRINUSE)
+ 354328 [jeffpeng net] That means a socket can't bind to an address/port.
| 354329 [jeffpeng net] sorry forgot to mention, this happens due to the address/port have been
+ 354447 [superxain gm] You may have started another mongrel / web server on the same ip:port

^ Few clarifications on recursion
354334 [atma convale] charset=us-ascii
+ 354337 [jeanjulien.f] I've tested the code works fine.
+ 354338 [josh.cheek g] In Ruby, the last line of a function is returned. In this case, the last
| 354340 [atma convale] charset=utf-8
| + 354341 [pg thimian.c] Depends on what was thrown into it, and what was done to it in the
| + 354350 [hutch-lists ] <http://se.inf.ethz.ch/people/meyer/down/touch/index.html>
+ 354339 [pg thimian.c] In a nutshell, recursion means performing the same action until a
  354342 [shortcutter ] Actually that description is true for loops (aka iterations) as well.
  354344 [pg thimian.c] The actual difference is: recursion gives me headaches, iteration
  354345 [b.candler po] But while this particular example is one which can easily be written

^ Ruby in Lisp, preLisp
354336 [rulilupy gma] Lisp,
+ 354343 [shortcutter ] I am sorry, yes.
| 354417 [hramrach cen] approach
| 354531 [headius head] As someone who's been working on a Ruby impl for the past 4 years, I
| 354583 [albertschlef] Can you give one or two examples (for an edge-case)?
| 354586 [ryand-ruby z] A few easy ones off the top of my head are Array#pack, String#unpack, =
+ 354426 [ninja slapha] That would speed up that specific example, but I don't think you could do it

^ Re: Status update
354346 [b.candler po] It would be interesting if you have a clean upgrade solution: that is, I
+ 354362 [pg thimian.c] I'll include that in our not-quite-ready-for-the-public-yet wiki as
| 354413 [b.candler po] Everything within the VM image: the O/S, the ruby version, the gems,
| 354422 [walton vyper] A teaching tool is exactly what this is aimed at. While we have talked
| 354481 [rogerpack200] ubuntu
| 354482 [aldric trevo] For any and all kinds of suggestions on what to include, please head to
+ 354409 [aldric trevo] I would note that Phillip's original purpose for this VM is actually for

^ A small internationalization issue?
354347 [hypermeister] I am a Puerto Rican using Ruby, so the apps I develop are mostly in
354349 [gregory.t.br] What version of Ruby are you running?   What encoding are your files
354357 [hypermeister] windows 7.  I use the scite text editor included with that ruby
354405 [gregory.t.br] If you're using Ruby 1.8.6, be sure to set $KCODE="U"
354839 [hypermeister] you said, but it didn't work either.  I still see incorrect characters.
354849 [gregory.t.br] at

^ [ANN] Prawn 0.7
354348 [gregory.t.br] [This announcement is about Prawn, a totally sweet pure ruby PDF

^ [ANN] sunaku's Ruby wmiirc - YAML imports
354351 [sunaku gmail] This is a Ruby[1] and YAML[2] based configuration of the wmii[3]

^ RSS and images
354355 [galtenbergs ] Using the default Ruby RSS parser, which format is best suited to
354401 [kou cozmixng] In <b002dd1e5a048702c14ecb5650bd0a1a@ruby-forum.com>
354421 [galtenbergs ] Thanks for the reply back.
354456 [kou cozmixng] In <8aa4c207fd0960ecab2085d82aa90ba9@ruby-forum.com>

^ Re: rdp-arguments -- named arguments for 1.8 and 1.9!
354359 [rogerpack200] oops my bad.

^ bitwise shift help
354360 [kvetch gmail] way to determine if a bit is set in a number. For example,
+ 354361 [kvetch gmail] Actually I suppose the bit check should read
| + 354363 [a99.googlegr] Fixnum[n]
| + 354372 [vikkous gmai] There's nonzero?, which ought to be a tad faster than >=1. So, write
|   354440 [kvetch gmail] Awesome thank you Caleb and Axel.
+ 354444 [lists bertra] As in SQL, 0 does not yield false. SQL's NULL is different from

^ Re: Can Ruby be a keylogger on Win/Mac?
354364 [sienna1987 g] Posted via http://www.ruby-forum.com/.

^ undefined method `conf' for IRB:Module
354365 [rheluani gma] my ruby installation. I posted in the Dradis forums but noone answered,
354366 [pg thimian.c] Not necessarily a broken Ruby install, but it could be that SVN HEAD is
354373 [rheluani gma] Thanks for your prompt answer, Actually I had the same problem with
354374 [pg thimian.c] A happy accident. :)
354423 [rheluani gma] It'll take me some time to move things to 1.8.6, but I'll try that in a
354424 [pg thimian.c] Apparently. But the Dradis developers are probably more knowledgeable

^ [ANN] Ron 0.1.2 Released
354367 [vikkous gmai] Ron version 0.1.2 has been released!
354890 [joelvanderwe] The use of Class#- is very nice and tidy!

^ [ANN] Sequence 0.2.3 Released
354368 [vikkous gmai] Sequence version 0.2.3 has been released!

^ [ANN] Reg 0.4.8 Released
354369 [vikkous gmai] Reg version 0.4.8 has been released!

^ [ANN] RubyLexer 0.7.7 Released
354370 [vikkous gmai] RubyLexer version 0.7.7 has been released!

^ [ANN] RedParse 0.8.4 Released
354371 [vikkous gmai] RedParse version 0.8.4 has been released!

^ how to capture all conditions using regex
354375 [rubynewbee g] irb(main):001:0> x="123 456 789"
+ 354377 [rubytalk che] The regex itself seems okay...
+ 354378 [jeanjulien.f] 123
+ 354379 [jgabrielygal] irb(main):001:0> x=3D"123 456 789"
  354380 [rubynewbee g] Thanks all for the quick response.
  354397 [shortcutter ] Note that even with #scan you have two options: you can either take the

^ Is ruby's regex slower?
354381 [rubynewbee g] comparison. :-)
+ 354382 [ayumu.aizawa] Its interested ;)
| + 354385 [rubynewbee g] Thanks for the reminding, I got your meanings.
| | 354398 [shortcutter ] "Compiling" regular expression does not bring any advantages.  In fact,
| + 354390 [w_a_x_man ya] regex = /href="http:\/\/(.*?)\/.*" target="_blank"/
|   354416 [rilindo gmai] Wait, you are parsing HTML with regex?
|   354437 [kyleaschmitt] Thank you.  It's been far too long since I've read Coding Horror.
+ 354384 [josh.cheek g] It seems like most of the time would be spent loading the environment and
  354387 [wybo servaly] #!/usr/bin/ruby
  354433 [rogerpack200] You could try ruby 1.9 and see if it helps the speed.
  + 354435 [marnen marne] Better yet, there's Oniguruma.
  + 354448 [murphy rubyc] not very.
  | 354453 [marnen marne] I think that's only done when study is called, but I could be wrong.
  | + 354455 [murphy rubyc] You can improve it then :)
  | + 354461 [shortcutter ] The question is: does it matter for most practical purposes - and: do
  |   + 354476 [marnen marne] No.  That's why I haven't learned Python yet, although between the speed
  |   | + 354478 [rogerpack200] Yeah no kidding.  Somehow speed just hasn't "felt" like the ruby
  |   | + 354532 [headius head] ilar
  |   | | 354550 [marnen marne] Devil's advocate: *is* Ruby the right tool the job for thoses cases?
  |   | | 354593 [shortcutter ] Before you can make that judgement you need to find out the reason for
  |   | | 354599 [jeffpeng net] I have sounded many guys talking about the flawed design when they
  |   | | + 354602 [shortcutter ] I'm sorry, I really don't understand how your reply relates to my
  |   | | + 354632 [jose.halesga] charset=US-ASCII;
  |   | + 354533 [shortcutter ] Well, 1.9 *has been* improved dramatically in the area of performance
  |   + 354508 [albertschlef] Why does everybody say that CPUs are fast nowadays and that "it dosn't
  |     + 354511 [wyhaines gma] That's such a red herring that I'm not even sure how to address it.
  |     | 354512 [jeffpeng net] Those show the statistics for a small application IMO.
  |     | + 354516 [wyhaines gma] Sure.
  |     | + 354537 [phrogz mac.c] 200 million page views a day is an average of 2,300 page views a
  |     + 354524 [pg thimian.c] I have a Core2Dual, with each core clocking in at 2GHz. This is a
  |     + 354535 [shortcutter ] Dunno about everybody else.  I did not
  + 354628 [rogerpack200] You could also try
    354730 [headius head] And --server, and as recent a JVM version as you can get :)

^ regex =~ string or string =~ regex?
354386 [rubynewbee g] string =~ regex.
354399 [shortcutter ] The first version invokes method Regexp#=~ and the second version
+ 354418 [marnen marne] Interesting.  Whereas I prefer the second because I think
+ 354419 [wyhaines gma] es

^ How to know the childs PID of a given process?
354391 [ibc aliax.ne] es.=20
354400 [shortcutter ] times.=20
354407 [ibc aliax.ne] Thanks a lot. The fact is that I'd like not to modify the program whose=20
354410 [djberg96 gma] ut
+ 354411 [ibc aliax.ne] ed
+ 354412 [ibc aliax.ne] gem install sys-proctalbe --platform linux   # Linux