330832-340550 subjects 331247-331987

Local online documentation for ruby-1.9.1
331066 [Maurice.Diam] Bonjour =E0 tous,
331084 [matt@ti bi s] I have not tried this with ruby 1.9.1, but with earlier versions of ruby
331527 [Maurice.Diam] Thamk you very much, it works!

case when - symbols or strings?
331067 [shevegen@li ] Picture a small method which accepts one argument. Inside this method is
+ 331069 [gwtmp01@ma .] Hard to generalize but if you coerce to a string
| 331094 [shortcutter@] want to do with this?
+ 331073 [fred@la av .] It checks if the value is a member of the toplevel class Hash or one of
+ 331095 [vjoel@pa h. ] $ irb19
+ 331203 [overlord@gm ] What is that supposed to do?

OCI-8, Oracle : 'ORDER BY' doesn't work with 'bind_param'
331077 [randy11@nu e] I'm testing the gem 'ruby-oci8'/oci8 (1.0.4) under Windows with Ruby
+ 331082 [shortcutter@] You cannot give the column name as a bind parameter.  You either have
| 332636 [shortcutter@] ow"
| 334528 [randy11@nu e] I've been long to reply, I'm working on other things. But I've
+ 331086 [kubo@ji ba .] What you want is "ORDER BY ENAME." But it is equivalent to "ORDER BY 'ENAME=
  331092 [randy11@nu e] Thanks to you Robert and Takehiro for your fast replies :)

[QUIZ] Sliding Puzzle (#196)
331081 [yahivin@gm i] -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
331284 [boesemar@gm ] ...
331358 [boesemar@gm ] ...

reading data files with headers and columns
331090 [yajnaval@gm ] As a noob to Ruby, I need to read a data file with the first few lines
331093 [luc.traonmil] You could start with this basic piece of code (replace <tags> with your
331096 [yajnaval@gm ] Thanks very much Luc, here are a few follow up questions (complete
331098 [luc.traonmil] Well [] only initializes the array as empty, if you want to initialize it
331101 [Rob@Ag le on] If you know how many header lines, I'll assume 3, just read them first =20=
331377 [yajnaval@gm ] Thanks Rob!

Permission denied when running file
331099 [bwinborg@rb ] I am having a problem that I can't seem to track down the attached file
331110 [phasis@gm il] The error message means File.open('C:\Ruby\bin','r') failed.

Ruby on Rails Developer Position
331100 [sleidelm@te ] My name is Sanam with TEKsystems. I have a client in Orange County who

regular expression / gsub question
331102 [mmc_collins@] Do you know how use a regular expression to get only the scripname from
+ 331103 [vjoel@pa h. ] I like using #[] for this because it lets you think in terms of what you
| + 331104 [mmc_collins@] Thanks! This worked nicely. I have never used #[], this is great! Thanks
| + 331132 [shortcutter@] AFAIK it is more robust and also more efficient to do
+ 331133 [elitecoding@] You can also do a filename.split(/_/)[1] which is probably not that
  331139 [bbxx789_05ss] Do you mean "not that efficient" in the sense that ruby programs are
  331140 [elitecoding@] I still believe that

When was the parse method added to the Time class?
331105 [tester.paul@] and only just noticed that it crashes on one particular system. (I
331106 [vjoel@pa h. ] It's not a ruby version issue.
331109 [tester.paul@] Hmm, okay.  I get that.  So why does the "Time.methods.include?
331113 [tester.paul@] a one-line script with the above Time.parse code so that I could run
331121 [justincollin] Probably the newer version of one of your gems stopped including the

File owner attribute method
331107 [mmc_collins@] I want to get the owner attribute of a file from a folder. I have not
331111 [matt@ti bi s] Not sure what an "owner attribute" is, but consider File#stat, perhaps.
331118 [mmc_collins@] What I mean is a file has attributes such as filename, size, modified

Problem With eval and each_index
331116 [_mwryder@wo ] I am trying to set a group of variables to values stored in a tab
+ 331117 [_mwryder@wo ] I just noticed that the above method does set name to "John Doe" which
+ 331120 [matt@ti bi s] Inside a block, local variables are local to the block. So, you're
  + 331150 [cmdicely@gm ] h = Hash[*v.zip(e).flatten]
  | 331152 [matt@ti bi s] Right you are, sorry about that. m.
  + 331166 [_mwryder@wo ] I can see that if I create the variable before running the method the
    331193 [cmdicely@gm ] Ruby blocks are closures, and they therefore capture the environment
    + 331196 [jeff@sc wa c] That was not my understanding.  How does one return a block from a
    | 331212 [cmdicely@gm ] While block are closures, they aren't first-class. You can't return a
    + 331217 [_mwryder@wo ] This is what is confusing to me.  If I use a variable in a function and

OpenSSL::Cipher partially decrypts string with wrong iv
331119 [oliveri.rich] I have an application where I want to require both the correct key and

Fetching cookie???
331124 [saurabh@ci h] Kindly suggest for the following issue
331126 [globyy3000@h] Need to be a little more specific. What are you trying to do with these
331130 [saurabh@ci h] Trying to extract the information of non-localhost cookies, like their
331131 [saurabh@ci h] I'll try to explain it by an example
+ 331155 [globyy3000@h] #Change the directory to where your cookies are located
+ 331156 [globyy3000@h] Oh and as far as the non-localhost thing goes, if you store localhost
  331272 [saurabh@ci h] Thanks Mac,
  331325 [globyy3000@h] Explain what you want to do with these cookies after 'fetching' them. I
  331346 [saurabh@ci h] The solution which you had provided is working for my PC because i know
  331355 [globyy3000@h] Oh ok, that's easy enough. So if you wanted to change to the cookie
  331361 [saurabh@ci h] Thanks Mac

RDoc 1.9 hangs
331125 [rick.chatter] I am trying to generate html docs for 1.9 with the rdoc supplied with
331293 [drbrain@se m] Does it go faster if you install rdoc from a gem?  The RDoc in 1.9.1

language globalization and localization
331127 [vikasg@af at] I am developing a web application(like online music portal) which
331171 [globyy3000@h] By "plugin" I'm guessing you mean Gem.  o_O

win32util packages on ruby1.9
331128 [botp@de mo t] just installed ruby 1.9.1 on windows. and then  installed win32util's =
331135 [phasis@gm il] Two gems win32-open3 and win32-api are looking for msvcrt-xxx.dll.
331242 [botpena@gm i] # Two gems win32-open3 and win32-api are looking for

Read the SWF header
331129 [maran.asteri] Dear folks,
331134 [elitecoding@] Are you looking for something like this?

Cannot fetch from database using if...else
331141 [arunkumar@in] I'm new to ruby and right now i'm trying out some examples involving
+ 331142 [luc.traonmil] Fetch the next row in the result set. DBD Required.
+ 331149 [cmdicely@gm ] Since stats.fetch is a method call, and you want to output the same

How do arrays in Ruby work?
331143 [pwu.380@gm i] As in how they are organized behind the scenes.
+ 331144 [luc.traonmil] slice only returns the value within the range or at index but does not
+ 331145 [rick.denatal] I think you meant either
| 331147 [pwu.380@gm i] That's my mistake, arr.slice!(1) was the intention. But I see what
+ 331178 [miguelregedo] if you have the array a =3D [1,2,3,4,5]

Daemons and Paths
331146 [dabukun@gm i] So I've written a daemon using the 'daemons' gem.  I have essentially
331158 [globyy3000@h] I don't know if this is exactly what your looking for, but how about a
331160 [globyy3000@h] My apologies, correct the line that says directory.join("/") to the
331273 [dabukun@gm i] Thanks Michael.  You're right, it's not exactly what I'm looking for,

[ANN] doodle 0.2.3 Released
331148 [sean.ohalpin] doodle version 0.2.3 has been released!

new to ruby:  uninitialized constant
331151 [atwa5000@gm ] I have a program the simulates the knights tour problem.  I made 2
331153 [justincollin] Do you "require" the files containing the other two classes? Ruby will
331154 [atwa5000@gm ] Yes I did
331213 [justincollin] Then it is hard to tell what is going on without seeing your code. This

has 'ping' been dropped from 1.9.1?
331161 [jayeola@gm i] =begin
331170 [globyy3000@h] if you desperately need it (though yes it seems it wasn't included in
331189 [kbloom@gm il] That's a horrible idea. If the 1.8 version works, include it in your
331200 [globyy3000@h] Hence "not the best solution". And it wouldn't be modifying the

Extract common entries in two arrays
331162 [ibc@al ax ne] array1 = ["q", "w", "e", "r", "t", "y"]
331169 [list.push@gm] array1 & array2

Re: Extract common entries in two arrays [SOLVED]
331163 [ibc@al ax ne] array_common = array1 - (array1 - array2)
331164 [ben@bl yt in] array1 & array2
331165 [ibc@al ax ne] Great!

[ANN] Joggle 0.1.0 Released: Jabber to Twitter Relay
331167 [pabs@pa lo r] Joggle is a Jabber to Twitter relay, written in Ruby.  Tweets (Twitter

[ANN] nokogiri 1.2.2 Released
331168 [aaron@te de ] nokogiri version 1.2.2 has been released!

One Click Installer-Mingw-Swiftiply Problem
331172 [paulf@a2 li ] The windows extension compile situation seems to be a mess!
336248 [rogerpack200] It was a "mingw doesnt like that" bug -- should be fixed with the latest

Can't Install Ruby Builder
331175 [wooingruby@g] Pretty new to ruby and trying to install Builder but not having much
331183 [phlip2005@gm] left corner of the CMD.EXE program. Find Preferences, and turn something like
331249 [wooingruby@g] Thanks a ton for the tips.  However, despite it saying builder is
331254 [phasis@gm il] First check the environment variable "RUBYOPT" with "echo %RUBYOPT%".
+ 331352 [wooingruby@g] That helped, thanks a ton!
+ 331394 [luislavena@g] No

SSLServer crashes when non-essl telnet connection is made
331176 [ecantwell@bl] I have been working with the SSLServer class in Ruby and have run across
+ 331231 [globyy3000@h] It's most likely a problem with the certificate that you're using.
| 331233 [ecantwell@bl] Mac,
| + 331235 [ecantwell@bl] I apologize that I did not include this in my last reply.  Here is how I
| + 331236 [globyy3000@h] Well, generally speaking, telnet protocol by default doesn't use SSL;
|   331281 [romeks@gm il] Before doing this in ruby, it might be better to make sure all is
+ 331287 [hramrach@ce ] You are getting a SSL exception here.
  331333 [ecantwell@bl] Michal,
  331491 [hramrach@ce ] It does not crash. It throws an exception.

Re: Joggle 0.1.0 Released: Jabber to Twitter Relay
331177 [james@la ya ] robust; mine is just a thin layer of glue between the Twitter and

How can I know if a program is running inside irb?
331180 [arcadiorubio] from a certain piece of code, how can I know if it's been run inside
+ 331181 [badboy@he rt] if it is really necessary  (I don't know why it should be) maybe it's an
| 331185 [arcadiorubio] Thanks. It's just a bit of an ugly hack to know whether I should start
+ 331184 [thopre@gm il] 2009/3/15 abc <arcadiorubiogarcia@gmail.com>

Commande % sudo apt-get install ruby irb rdoc
331182 [jean.moser@n] N'ayant pas r=E9ussi =E0 ce jour =E0 utiliser convenablement irb (question
331192 [emmanuel.sur] This is an English-only channel, friend. However, you should find a mail in=
331276 [fred@la av .] Note that there is a french speaking group under the usenet hierarchy,

Basics of Require
331186 [rubfor@re it] I don't have access to an instance of Ruby at the moment and I am not
+ 331187 [phlip2005@gm] You might ought to explain that one. It even runs on wrist watches these days!
+ 331188 [kbloom@gm il] def method
  + 331190 [rick.denatal] There's a very nice, underused method of module which can help with loading
  + 331195 [rubfor@re it] I can't see the logic there. You're saying if the require is inside a
    331198 [matt@ti bi s] The thing to grok here that is a class or module definition is itself

An Update for my "Fan"
331191 [rick.denatal] On the assumption that someone here might actually occasionally read my blog

can I tighten this up with block or eval?
331194 [matt@ti bi s] I have here a class called ClassMaker whose greeter method returns an
331197 [gwtmp01@ma .] Here is one possibility.  Note, I changed ClassMaker to a module
331202 [matt@ti bi s] Actually, I have to keep the architecture I've got - greeter is going to

Why do I need \b in regular expression?
331199 [arghx1@ya oo] OK, I'm still extremely new to Ruby, so if my question is stupid, please
+ 331201 [globyy3000@h] Think of \b as the boundary of the words in a string.
+ 331204 [shortcutter@] It's not stupid at all.  Regular expressions have a bit of a learning
  331228 [arghx1@ya oo] Thank you guy!  You guys are so helpful.  I also did a search on google

[SUMMARY] Rhyming Words (#195)
331205 [yahivin@gm i] This week's quiz had an excellent solution from Eugene Kalenkovich.
334259 [ shot@ho .p ] shot@devielle:~$ ruby -v; irb --simple-prompt

[ANN] rspec 1.2.0 Released
331206 [dchelimsky@g] rspec version 1.2.0 has been released!

[ANN] rspec-rails 1.2.0 Released
331207 [dchelimsky@g] rspec-rails version 1.2.0 has been released!

execle ruby process from C ?
331208 [user@do ai .] there is something wrong
+ 331209 [user@do ai .] I forgot to say that print 'hello' has not effect...
+ 331223 [globyy3000@h] I may be mistaken because 1. I don't have your full piece of code or 2.
+ 331239 [nobu@ru y- a] The second string is concatenated at compile time into
  331241 [globyy3000@h] The HTTP server shouldn't be waiting for stdin because test.rb never
  331246 [nobu@ru y- a] Correct, but OP's code doesn't any arguments to /usr/bin/ruby.

rAtom and Atom::Generation
331210 [dsutch@gm il] I'm attempting to produce an atom feed using rAtom and have run into
+ 331211 [dsutch@gm il] The documentation for Atom::Generator is available at
+ 331221 [mark@th ma z] See the README file for rAtom (http://ratom.rubyforge.org)
+ 368809 [tmanamos@ho ] I had this same problem.  After some playing around (since the rAtom

Keep thread in memory
331214 [craig@ip 0. ] I'm writing a simple UDP listening server. It works great using this
+ 331215 [michael.malo] It does exactly what you think it will do.  It starts a thread, runs the
+ 331219 [shortcutter@] First of all, why are you using a thread here?  Do you have other work
| 331220 [craig@ip 0. ] thanks Robert,
| + 331222 [globyy3000@h] Dunno why you would sleep a program when you don't have to o_O
| + 331227 [craig@ip 0. ] thanks everyone - I found the Daemons wrapper and a simple loop was well
+ 331224 [tommy.nordgr] ctrl-z suspends the current job, and moves it to the background

does IO.read block?
331216 [michael.malo] I have a setup where I am writing to a pipe in one process and reading
331218 [shortcutter@] You do not seem to open the stream in this context, why do you close it
+ 331225 [michael.malo] that code is inside the block passed to fork(), so the write_end needs
| + 331226 [michael.malo] Wait, I just re-read your email.  The looping is done in C.  So that
| + 331251 [shortcutter@] Ah, I see.
|   331303 [michael.malo] I have set STDOUT.sync = true  Is that enough?  It should be, because I
|   331306 [shortcutter@] No, definitively not!  This covers the *sending* side but the locking
|   331321 [michael.malo] pw = IO::pipe
|   331416 [shortcutter@] Why do you open four pipes when three are sufficient?
|   331440 [michael.malo] I'm not running a command as such, I'm running a block of code.  Also, I
|   331451 [shortcutter@] Please take a look at http://pastie.org/419160 for an answer to that as
|   331487 [shortcutter@] Cheers
|   331526 [michael.malo] Thanks, but I have a new theory.  I broke everything down to be as
|   331529 [shortcutter@] But make sure that you file the bug report against the right piece of
+ 331313 [albertschlef] The docs shouldn't be read as a Bible. The docs may not be very precise.
  331417 [shortcutter@] In this particular case the docs are correct to my knowledge.  In other

Ruby Internship
331229 [ben@ku ri .n] I'm a Computer Science junior at Stony Brook University.  I'm looking
331230 [Bil.Kleb@na ] You've missed our Summer 2009 deadline, but there are year-round

Regex returning less number of groups - where is the error?
331232 [kikacilda@ya] I'm trying to build a regex to count the number of modified files by
331234 [phasis@gm il] /(^r\d+.*?)(?:^Changed paths:\n)((?:^\s*[MDA]\s\/[\w.\/-]+\n)+)/m

[ANN] assert2/xhtml specifies your HTML by example
331237 [phlip2005@gm] assert_xhtml now works with RSpec. (Call it ".should be_html_with{}" !)

Re: Regex returning less number of groups - where is the err
331238 [kikacilda@ya] Result 1
331244 [phasis@gm il] /(^r\d+.*?)(?:^Changed paths:\n)|(^\s*[MDA]\s\/[\w.\/-]+\n)/m
331344 [kikacilda@ya] Yep, the simpler regex does the job. Thanks a lot!

Producer-Consumer problem
331240 [michael.malo] I am really struggling with a really intermittent bug.  I have a thread

`&' interpreted as argument prefix
331243 [arunkumar@in] I'm new to rubi and at present i'm trying to write a sample code for
+ 331248 [ryand-ruby@z] that's from hpricot and won't change anytime soon :/
| 331305 [albertschlef] Why two? Getting rid of this bug is one bird. Where's the second?
+ 331250 [phlip2005@gm] ele.instance_variable_set("@#{k}", v)
  331255 [phasis@gm il] Well, I don't think so.
  + 331256 [ryand-ruby@z] yup yup...
  + 331279 [kbloom@gm il] Looks fixed if you get Hpricot version 0.6.211 or later.
    331298 [ryand-ruby@z] I've said it before and I'll say it again: It isn't fixed until it is
    331329 [kbloom@gm il] OK. Somehow I thought that assigning a version number meant it was a
    331466 [kbloom@gm il] Today it was actually released, and an 0.7 gem is now on RubyForge.

Socket hangs when I read after writing!
331245 [ihatespam@ho] sock = TCPSocket.new('host.com', 12345)
331259 [ihatespam@ho] Okay, I can shed some more light on this problem.
+ 331266 [eleanor@ga e] On 16 Mar 2009, at 09:32, Just Another Victim of the Ambient Morality
+ 331270 [shortcutter@] 2009/3/16 Just Another Victim of the Ambient Morality <ihatespam@hotmail.co=
  331317 [ihatespam@ho] Thank you to both Robert and Eleanor McHugh for your help and