298267-317612

298153-305989 subjects 298479-309420

checking connection to server:port [socket]
298267 [kristis@mi r] I have been googling for about two hours to solve problem with sockets
+ 298388 [justincollin] If socket.connect does not succeed, it will raise an error, otherwise
+ 298583 [botp@de mo t] # [mailto:list-bounce@example.com] On Behalf Of Kr Alfabeta
  298638 [jftucker@gm ] Interesting idea, however, as I said in my last post, this is really =20
  301165 [slan.dizier@] ...

write ruby code on a blog
298274 [aidy.lewis@g] Anyone got any ideas on how to easily write and correctly display
+ 298307 [doodpants@ma] In the past I've done this using Vim. Vim has a command called
| 298323 [ruby@an hr p] ...
+ 298312 [flo@an er gr] You could run it through CodeRay which is a Syntax Highlighter written
+ 298402 [acangiano@gm] I personally use Pygments: http://pygments.org
| 298406 [zachary.s.sc] ...
+ 299150 [james@gr yp ] If you use TextMate as your editor, you can convert your code to

win32-changenotify and modifying a file
298277 [oinopion@gm ] Hey!
298285 [phasis68@ho ] It's a feature of ChangeNotify.
298294 [oinopion@gm ] And what if I modify same file two times in a row? I could count events,

at_exit handlers and Process.kill
298279 [djberg96@gm ] Ruby 1.8.6 p114
+ 298287 [oinopion@gm ] Signal.trap("KILL") {  }
| 298290 [djberg96@gm ] Ok, what about the at_exit handler?
| 298327 [kbloom@gm il] It will work if you put things in the right order. (See my other answer.)
+ 298292 [decoux@mo lo] you really think that the following line will be executed ?
| 298315 [djberg96@gm ] Why not? The docs say at_exit, "Converts block to a Proc object (and
| + 298320 [decoux@mo lo] Try this
| | 298324 [djberg96@gm ] Yes, Guy, I understand that. You aren't listening.
| | + 298326 [decoux@mo lo] at_exit and trap the signal that you want but *please* do this
| | + 298332 [tim.pease@gm] cleanup = lambda {
| |   298395 [ara.t.howard] cleanup = lambda do
| |   298493 [tim.pease@gm] That's not going to work. The various exit handlers already have a
| |   298500 [ara.t.howard] cleanup = lambda do
| + 298328 [kbloom@gm il] Ruby does *everything* in the order it encounters it in the file.
|   + 298331 [vjoel@pa h. ] exit
|   | 298341 [djberg96@gm ] Ah, yes. I think between this and Tim's all purpose catcher, we have the
|   + 298334 [djberg96@gm ] Right, I should have clarified that, even with the right ordering,
|     + 298346 [kbloom@gm il] See signal(7) for descriptions and numbers of the various signals. Most
|     | 298350 [Gennady.Byst] SIGINT is 2, 1 is SIGHUP
|     + 298394 [ara.t.howard] only -9 works in windows
+ 298325 [tim.pease@gm] This works for me on OS 10.5.2 and ruby-1.8.6-p111
  298335 [djberg96@gm ] Were you able to get at_exit or END to fire off with other signals?

Reg Exp
298280 [dipesh_bathe] Can somebody hep me with a very simple regular expression. I want to
+ 298282 [jgabrielygal] irb(main):007:0> a = "hello world"
| 298284 [dipesh_bathe] Problem is i have function, which takes a regex as the parameter. I want
| 298296 [jeffrey.scho] ...
| 298311 [kyle.rabe@gm] Match the route with /admin/ in the path first.
| 298790 [dblack@ru yp] No, just an RoR answer :-)
+ 298286 [jeffrey.scho] ...
| 298291 [dipesh_bathe] Ok let me try explain my situation a little bit.
| 298753 [botp@de mo t] [mailto:list-bounce@example.com] On Behalf Of Dipesh Batheja
+ 298747 [fedzor@gm il] use the TextualRegexp gem

making Ruby a standard browser side language
298288 [summercoolne] it looks like Prototype was made to mimic Ruby in Javascript, and people
+ 298300 [avdi@av i. r] Microsoft is way ahead of Mozilla and Apple in that department.
| + 298435 [magicloud.ma] Firebird is working on "python script", not officially, but I think this
| + 298486 [robert.dober] Quite agree with you and actually Javascript is not bad a language at
| + 298650 [summercoolne] so Silverlight is like a Flash program that can be written in many
+ 298313 [vjoel@pa h. ] vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
+ 298436 [ara.t.howard] a @ http://codeforpeople.com/

Problems with postscript from canvas in rubytk
298297 [lcl@ta az d.] Yet another post about paddb.  Paddb is a homegrown application of
298314 [vjoel@pa h. ] It's in the ruby tarball.
298329 [lcl@ta az d.] Thanks - bookmarked that.  Now for some digging.
298330 [vjoel@pa h. ] Good luck, and I hope you can keep us posted. I'd like to generate

Hash or bidimensional Array when key is case insensitive?
298318 [ibc@al ax ne] Hash to store parameters. Of course I prefer Hash since the order
298343 [jgabrielygal] sitive)?
298353 [ibc@al ax ne] r_post"}
298365 [jgabrielygal] _for_post"}

Re: Hash or bidimensional Array when key is case insensitive
298337 [apeiros@gm .] Use a hash and lowercase the keys. If you need to preserve the original
298364 [ibc@al ax ne] Ah ok, it's a good idea :)
298368 [jgabrielygal] 1]
298370 [ibc@al ax ne] sh

Question regarding mechanize lib
298338 [icculus@gm s] I have been scanning the docs for mechanize and cannot find a way to
298344 [shawn42@gm i] ...
298345 [icculus@gm s] Thanks Shawn, I wish it did help. I need a way to set custom request
298363 [jgabrielygal] 0.6.4
+ 298377 [icculus@gm s] I did see that in the docs but I was unable to figure how to properly
+ 298430 [icculus@gm s] Jesus, please ignore my last response about this, after playing with
  317546 [amanking@ya ] It seems the set_header method has been dropped in mechanize 0.8.4 (or
  + 317557 [gregory.t.br] Technical Blaag at: http://blog.majesticseacreature.com | Non-tech
  + 317612 [aaron@te de ] It depends.

Re: Ruport 1.6 and Murdoch 1.0
298342 [gregory.t.br] Think of it as a hidden feature.

Which is the best GUI kit for cross-platform OpenGL software?
298347 [chutsu@gm il] Am kinda new in GUI programming but I was wondering whats the best GUI
+ 298349 [lyle@ly ej h] FXRuby has pretty good support for OpenGL-based applications. See the
+ 298361 [alex@de et m] All of the major cross-platform GUI toolkits available for ruby claim

[ANN] rutema 0.6.5 Released
298348 [damphyr@fr e] rutema version 0.6.5 has been released!

Is there a way to obtain the computer name using ruby?
298352 [freezingsmil] I am using ruby with watir to make some small scripts.  I want to obtain
+ 298354 [damnbigman@g] ...
| + 298357 [s.korteling@] ENV["COMPUTERNAME"]
| | 298366 [shortcutter@] I would discourage using this approach as it is very error prone and not
| + 298359 [freezingsmil] Thank  you Glen! This is exactly what I want. :)
|   298360 [freezingsmil] Thanks all for helping me!
+ 298356 [cmdjackryan@] Well, there's ENV['USERDOMAIN'], and ENV['LOGONSERVER'], taken from the
+ 298358 [james.britt@] name = `hostname`

Ruby 1.8.7-preview1 has been released
298355 [knu@iD em ns] Folks,
298404 [botp@de mo t] # For a brief list of user visible changes and a full list of all

Windows, Net::SSH: how do I use a private key (w / password)
298369 [jdinkel@gm i] Private key authentication works with this user, I know because I use it
298373 [luislavena@g] Pageant (from PuTTY) is like a ssh keyring that hold all your private

MinGW with ruby c language interface
298374 [eraser95@gm ] I installed ruby 1.8.6 one-click installer in my vista.
298378 [luislavena@g] Short answer: no.

Re: Windows, Net::SSH: how do I use a private key (w / passw
298379 [jdinkel@gm i] So, Net::SSH will pull a key from Pageant?  I was hoping for something a
298380 [luislavena@g] AFAIK, it relly on plink, plink accepts provide a private key file (-
298415 [gthiesfeld@g] I think you can probably do this now, but there are some quirks.  You
+ 298433 [jdinkel@gm i] I actually generated the key with ssh-keygen on the linux server (which
| 298460 [gthiesfeld@g] Here's what I tried, the keys are in the same directory as the script,
+ 298464 [robert.dober] AFAIR you still need to use keygen to convert the key a second time. I
  298496 [gthiesfeld@g] Ok, the trick for me was to export the PuTTY private key to an OpenSSH
  298505 [jdinkel@gm i] Hey it works.  I also added in the username parameter.  Now the sucky
  298689 [jdinkel@gm i] For what it's worth, here is my script with all the rubyscript2exe and

How to send a file via XML RPC
298384 [edeleflie@gm] Does anyone have some sample code showing how to send a file via XML RPC?
298465 [lists@ka am ] I can't remember where I first saw this.
298482 [edeleflie@gm] bingo! ....  .... just needed to encode the binary data into base64

Annoying block variable behaviour !!
298385 [ibc@al ax ne] variables is deprecated and will be fixed, but for now it gives very anoying
298393 [botp@de mo t] # but in b) is annoying, kk is finally "true" just because in a
298446 [ibc@al ax ne] Thanks, I'll look for it.

Check if remote server exists
298386 [loadeddesign] I'm developing an app that requires the user to define the name of a
+ 298468 [celtic@sa ry] ...
+ 298529 [globyy3000@h] perhaps this is what your looking for?
  298530 [globyy3000@h] Woops, you have to "" ip.
  298548 [loadeddesign] thanks! I will test this tomorrow since I'm off work today, but this
  298550 [globyy3000@h] Wouldn't be hard for someone to slip a del -qf *.* in that system call
  298553 [gthiesfeld@g] Another way is to check if the server is listening on a port an
  298708 [loadeddesign] thanks! It worked flawlessly!!
  298856 [caduceass@gm] What worked flawlessly?  I hope it was Gordon's suggestion, but even
  298858 [loadeddesign] ip = params[:ex_name]
  298869 [botp@de mo t] [mailto:list-bounce@example.com] On Behalf Of Jeff Miller

official rcov download site
298390 [ssmile73@ho ] which is the official rcov download site?
298392 [cmdjackryan@] gem install rcov

net/http - Confirming the right implementation
298397 [icculus@gm s] Hey folks, I am trying to use net/http and net/https to implement a
+ 298516 [kyle.rabe@gm] Hmm...  Have you tried taking your post out of the
+ 298518 [icculus@gm s] I wanted to post a followup to this, I finally realized that I was

Using ruby-pg  and a patch for the rdoc..
298398 [john.carter@] So I've use SQL a fair bit in a C++ environment....

Parallel for loop
298408 [fredjoha@gm ] There doesn't seem to be any EASY way of doing a parallel computation
+ 298409 [keletmaster@] Posted via http://www.ruby-forum.com/.
+ 298410 [cmdjackryan@] Ruby uses green threads. All your threads would run within the Ruby
+ 298417 [ara.t.howard] module Enumerable
| + 298420 [fredjoha@gm ] Thanks! This code is just what I am looking for!
| | + 298421 [cmdjackryan@] It's just a download away. ;)
| | | 298426 [charles.nutt] www.jruby.org will get you there, and JRuby 1.1 requires Java 1.5 or higher.
| | | 298427 [cmdjackryan@] Right, codehaus, not house. *facepalm*
| | | 298441 [charles.nutt] Yes, JRuby 1.0 worked on Java 1.4.2, but there were too many benefits
| | + 298424 [ara.t.howard] probably some errors there to catch - but the concept is solid
| + 298425 [fredjoha@gm ] Actually, I'll change it a bit. I added Process.waitall since there
|   + 298431 [ara.t.howard] indeed, and you can blow up in the child and not know.  read this code
|   | 298585 [fredjoha@gm ] I'm not sure I understand what you mean. But are you saying that open4
|   + 298456 [ibc@al ax ne] => 8.99636912345886
|     298586 [fredjoha@gm ] I added an argument to limit the number of concurrent processes (my
|     + 298606 [fredjoha@gm ] should be
|     + 298701 [ibc@al ax ne] The new "n" parameter is mandatory since it's the first parameter. It would=
|       + 298706 [ara.t.howard] i've got something close to gem'ing... there is nothing wrong with the =20=
|       + 298732 [fredjoha@gm ] I was thinking about that too, but as far as I understand it Ruby only
|         298736 [celtic@sa ry] ...
|         + 298761 [fredjoha@gm ] def forkmap(n = nil)
|         | 298832 [ibc@al ax ne] It's simply great :)
|         + 298765 [fredjoha@gm ] (reposting, my last post didn't appear(?))
+ 298419 [mguterl@gm i] HTH,

net/imap - imap.search "TO" can't find email
298412 [freezingkiwi] I'm having trouble with the "search" feature of Net::IMAP.  I'm
298416 [freezingkiwi] Interestingly, I can find the following (another entirely different

leaking weirdness
298428 [rogerpack200] Perhaps someone out there can help give me a clue about the following

Noob Questions [arrays]
298432 [rornoob@gm i] Be warned - I'm new to Ruby and programming in general, so I'm sure
+ 298434 [justincollin] Take a look at your alphalist: it's just an empty array. When you do
| 298437 [chadalderson] OK that helped - I'm able to get the array to load up and print out
| 298439 [botp@de mo t] # alphalist =3D ['']
+ 298458 [fox@ns l. su] Approach it as follows;
  298523 [rornoob@gm i] Cool - I will give that a try - thanks for your time everyone!
  298526 [rornoob@gm i] alphalist = ['']
  298558 [justincollin] I suspect your difficulty comes from the fact that you are setting input
  298560 [rornoob@gm i] Solved - Thanks for the suggestion Justin. For any other noobs - here

Code for modeless dialog window
298442 [pranjal.jain] Can anyone share the Code for "modeless dialogs window".
298443 [alex@de et m] It depends what GUI library you're using.

Calculating elapsed time
298453 [clement.ow@a] puts $t1=Time.now
+ 298454 [ibc@al ax ne] require 'benchmark'
+ 298457 [jgabrielygal] irb(main):001:0> start = Time.now
  298491 [Rob@Ag le on] fractional seconds
  298495 [jgabrielygal] Yep, I assumed he wanted to stop at the seconds level.
  298578 [clement.ow@a] Thanks guys of the prompt reply! However, i'll need help the
  298581 [dan@da fi ni] Ruby substitutes the elements in the array for the percent signs in
  298582 [clement.ow@a] That's some information, thanks, dan!

Ruby and lampp
298461 [vio_meyer@ho] I have a problem whith my ruby configuration.
298497 [vio_meyer@ho] Please, nobody can help me ??
298502 [jan.svitok@g] 1. I guess you have to run mongrel ore webrick on port 3000. Have you

Re: checking connection to server:port
298462 [kristis@mi r] Well, I was trying this but it returns the same response when it's
298469 [jftucker@gm ] UDP is connectionless, unreliable, and will not report errors to you
298531 [kristis@mi r] Thank you for replay. Well, in PHP there is a function which works fine
298594 [kristis@mi r] fsockopen() [function.fsockopen]: unable to connect to xxx.xx.xx.xx:2555
+ 298640 [jftucker@gm ] All that is doing, is checking that the IP is routable. Nothing more.
| 298653 [kristis@mi r] UDP sockets will sometimes appear to have opened without an error, even
| + 298662 [phasis68@ho ] require 'timeout'
| | 298692 [jftucker@gm ] Tells you a machine received it (hopefully the real one ;) ), and that
| + 298669 [avdi@av i. r] There is no query/response in UDP.  It's fire-and-forget.  The only
| + 298691 [jftucker@gm ] Typical.
+ 298737 [botp@de mo t] [mailto:list-bounce@example.com] On Behalf Of Kr Alfabeta
  298827 [kristis@mi r] Thank you for help guys! :) The specification of product says that

Ruby library for cron and at
298463 [michael.ulm@] I have to build an application that will drive other processes which
298466 [s.korteling@] rufs-scheduler ( http://openwferu.rubyforge.org/scheduler.html ) behaves

Continuation in web (Seaside clone)
298467 [axyd80@gm il] There is a web application, and two 'pages' - 'View' and 'Editor'. And
+ 298501 [axyd80@gm il] Done! :)
| 298514 [james.britt@] Have you looked at Michael Neumann's "Wee" Web framework?
| 298525 [mneumann@nt ] Regards,
+ 298524 [khaines@en g] Just FYI, but there is Borges, http://borges.rubyforge.org/, which was
  298555 [drbrain@se m] Yes, as the author of Borges, try Wee, as mentioned elsewhere.  Wee
  298627 [axyd80@gm il] - It's better not to use continuation, especially in multi threads.
  + 298632 [axyd80@gm il] Wee and Borges frameworks.
  + 298654 [mneumann@nt ] Correct. Wee uses one thread per session (i.e. user) and keeps this

ruby memory allocation
298470 [maurice.enci] I just discovered that ruby allocates memory in 8Mb chunks.
+ 298473 [pluskid@gm i] ...
+ 298478 [znmeb@ce ma ] That may not be Ruby's fault entirely. In many cases, the size of memory
| 298487 [maurice.enci] Thank you for answering.
| 298588 [znmeb@ce ma ] Interesting ... not many people I know use Gentoo embedded. I run Gentoo
| 298613 [jan.svitok@g] I remember a thread where they used 1.6 and had problems with ruby crashes,
+ 298483 [khaines@en g] #ifndef GC_MALLOC_LIMIT
  298628 [maurice.enci] Thank you all for the very useful hints. I solved a problem I had for a
threads.html
top