256859-261010 subjects 257323-266662

Ruby script that will restart a Windows server...
257086 [ryangs@ma .c] I have been researching on how to write a script that will restart a
257088 [jan.svitok@g] it depends whether you want a local restart or a remote one.
257089 [ryangs@ma .c] Thanks for the reply Jano.
257091 [damnbigman@g] ...
257095 [ryangs@ma .c] I just found that.  Using that is probably much simpler than trying to
257159 [shortcutter@] cygwin also has a package with a reboot / restart command.  And you can

[ANN] Gecode/R 0.3.0
257090 [ruby-talk@lo] Gecode/R version 0.3.0 has been released.

Getting an <iframe> in Watir
257097 [ jack@ss co ] I am new to Ruby and Watir. I need to access a frame (iframe) in a
257247 [list.rb@gm i] ...

SslRequirement module
257099 [ryansobol@gm] This is a question is about the SslRequirement rails plugin.  However,

Encoding of strings received from db
257101 [zorglub76@ya] I swear I searched this forum and couldn't find the solution!
257162 [AEtzold@gm .] Dear mare,
257170 [zorglub76@ya] Unfortunately it doesn't, because rails has some kind of configuration
+ 257174 [AEtzold@gm .] Dear Marko,
+ 257180 [grzm@se sp t] I think your issue is that your Ruby script doesn't know what
  257195 [zorglub76@ya] Thanks a lot, guys!

oniguruma : can't get it to search for \ (backslash)
257103 [deanholdren@] I can't seem to get Oniguruma to look for a single backslash, am I
257107 [dan@fl en ra] In a regex literal a backslash is a metacharacter, so you need two

Fun about inspect
257105 [vshepelev@im] By some complex reasons, I've made an interesting conclusion: for
+ 257109 [sonoflilit@g] I've given up on #inspect.
+ 257160 [shortcutter@] No, they don't.  See below.
| 257230 [vshepelev@im] There is a bit of misunderstanding. I'm not talking about some "strict
+ 257167 [erikveen@gm ] In one specific situation, I use a journal to resemble a small

how to get data from database as string
257118 [maung@at -o ] How can i read a cell from database and retrieve as a string in ruby
257173 [B.Candler@po] There are working examples in the documentation at
+ 257191 [maung@at -o ] Thank you for your response, Brian. Actually what i am trying to do is
| 257283 [AEtzold@gm .] Dear Maung,
+ 257284 [B.Candler@po] r = cursor.fetch    # fetch just one row
  265834 [maung@at -o ] What about if I want to fetch multiple rows? Any suggestion would be

Arguments into method calls?
257120 [disaffected@] I'm working on a program that takes user input via command line, then
257123 [TimHunter@nc] Check out the __send__ method, which lets you call a method whose name
257168 [vasudevram@g] You can create a hash that has the method names (as strings) as keys,
257169 [vasudevram@g] Forgot to add this (which I checked online before writing the previous

Guess what this will do...
257122 [john.carter@] Without cheating (trying to run it) what will this pair of files do under Linux....
257196 [pi@pi os .u ] Linux....

Note to Self: Moving ruby, $:. Don't _do_ that.
257124 [john.carter@] With gcc you can build & install in /home/myname/opt/gcc and then tar it
257130 [m.fellinger@] ./configure --prefix=/opt --enable-shared --enable-pthread
257232 [john.carter@] Sigh! Tried that, didn't work quite. Something somwhere tries to

Help Installing a Ruby Module
257126 [whiteqt@gm i] I downloaded roscar from RubyForge in hopes of sending automated AIM
257153 [leslieviljoe] ...

DateTime problem
257128 [coolwong85@y] DateArray = ["Apr", "2", "2007"]
+ 257129 [mike.cahill@] teach-a-man-to-fish answer: check http://ruby-doc.org/stdlib/   , under Date
+ 257134 [m_goldberg@a] Something like this?
| 257138 [vjoel@pa h. ] Same idea, but slightly simpler...
| 257141 [m_goldberg@a] Yes, that's better. But don't you need a 'require "time"' at the
| 257145 [vjoel@pa h. ] I think my irb required time ... (1.8.6).
+ 257149 [alin.popa@gm] tt = Time.parse(da.join(" "))
+ 257166 [doodpants@ma] day   = 01

Very easy question GET METHOD
257136 [drhenner@gm ] so I have an ID at the top of my page.  but how do i access the #?
+ 257139 [has.sox@gm i] ...
+ 257140 [drhenner@gm ] yep..  i told you it was easy.. thanks...

[ANN] singapore.rb meeting for June 2007
257144 [bianster@gm ] ...

including modules - ordering question
257147 [tennisbum200] module A
+ 257148 [alexg@ku cr ] Perhaps I'm missing something, but haven't you answered your own
| 257192 [tennisbum200] Well, basically Im looking for a solution where order doesn't matter.
+ 257156 [fred@la av .] Not sure how (if) it would work, but can't you just define an empty

[ANN] bee 0.4.0 Released
257154 [michel.casab] Bee is a build tool running YAML files. These build files have a clean

[RAILS] Send request to add application in Face Book using Rails
257155 [arunagrawal8] ...
257163 [gregory.t.br] Please do not cross-post (send a message to more than on ML

Get Set-Cookie from Soap response
257161 [msims@in el ] I'm a newbie to Ruby but need to do a couple of soap requests over
336136 [tcblues@gm i] I have the same problem, did you solve it?

RegExp & File read help
257164 [levandon@gm ] ...
257171 [AEtzold@gm .] Hpricot is a good choice.
257182 [dblack@wo bl] irb(main):017:0> Regexp.new(/a-z/).match("a")
257190 [levandon@gm ] Thanks for your help. I don't have it solved yet, but you both have

CGI.escape accepts only ISO-8859-1 input?
257177 [martin.stabe] I'm not able to convert a string to ISO-8859-1.
+ 257179 [martin.stabe] require 'iconv'
+ 257183 [showaltb@gm ] message = Iconv.new('ISO-8859-1', 'UTF-8').iconv(message)

Re: snmp error
257178 [B.Candler@po] The trouble is that you are printing the raw 6 byte string (note that hex 67

missing kEND for if statement, but not for a case statement?
257184 [onebitcipher] ...
257185 [cdcarter@gm ] The "else if" construct is elsif in ruby.  doing else if will start an
257187 [onebitcipher] ...

net/http for Googles Authentication api
257189 [stone1549@gm] def process_token(token)
257194 [dzwell@gm il] A 404 not found is not something that a server usually spits out when

Bad Smells sing in a rails application
257193 [pedro.delgal] Sometime ago, i read the slides  "when V is for Vexing: Patterns to

Is there a ruby source code formatter?
257201 [vfcforums@gm] Is there a ruby source code formatter somewhere out there?
+ 257212 [gavin@re in ] ...
+ 257213 [rubylearner@] ...
| 257266 [rubylearner@] ...
+ 257302 [chris.hulan@] I've been using http://www.arachnoid.com/ruby/rubyBeautifier.html

Regexp rescue method
257202 [th8254@ya oo] How would I write a rescue method to recover from a failed regexp
257211 [TimHunter@nc] I don't think that raises an error. You'd have to check for a nil result
257218 [james@gr yp ] I took the question to mean, how would I recover from a malformed
257226 [florian.assm] I can't catch it even with rescue Object... wow.
257285 [B.Candler@po] That's not surprising. Malformed regexps are a *parse* time error. Parsing

ActiveRecord (not necessarily rails)
257207 [nephish@gm i] ...
+ 257214 [igor.sutton@] <code>
| 257215 [nephish@gm i] ...
| 257216 [donald.ball@] You could probably do that using class_eval, but it wouldn't last past
| 257221 [nephish@gm i] ...
| 257223 [donald.ball@] I suspect you'd be much happier if these related attributes inherited
| + 257229 [dblack@wo bl] Foo.has_many :bars
| | + 257240 [nephish@gm i] ...
| | + 257326 [gregory.t.br] And even if you couldn't,
| + 257625 [caduceass@gm] To shawn: I haven't used ActiveRecord yet, but there are probably ways
+ 257380 [showaltb@gm ] has_many is a class method.

ruby zoomify
257208 [donald.ball@] Howdy folks. I just finished the first version of my ruby zoomify

RCR 13
257209 [poopdeville@] day.  I intend to withdraw it for now, but I would still like to

Fwd: Please Forward: Ruby Quiz Submission #129
257220 [james@gr yp ] ...

copying files to remote machine
257222 [tmac@ea ys r] Hey all,
257261 [webs.dev@gm ] This issue has been discussed on the mail list before.  I would

Punch Card Tales (was Re: Regexp to split name?)
257225 [rick.denatal] Rick DeNatale

Ajax with Ruby problem
257228 [galecho@gm i] I'm a newbie to both Ruby and Ajax. I'm trying to use Ruby to handle the
257233 [ondemannen@g] Try renaming the script to test2.cgi and see if that helps.
257234 [galecho@gm i] Tried both the approaches but neither worked.
257241 [dangerwillro] Make sure your shebang line is correct and that your Apache knows
257245 [galecho@gm i] I'm pretty sure the shebang line is correct. I verified by doing "which
+ 257252 [list.rb@gm i] ...
| 257256 [dangerwillro] sounds like it is all about the Apache configuration.
+ 257270 [ondemannen@g] Download the "web developer" plug-in for Firefox and enable while
  257273 [galecho@gm i] Damn.. I really dont believe this!!
  257312 [dangerwillro] John Joyce
  257329 [galecho@gm i] No, I dont think just pre-pending "/cgi-bin" would do any magic. Here's
  257403 [galecho@gm i] I'm sorry to spam the board like this, but I had to correct myself on
  257696 [dangerwillro] Thanks for posting your solution! It may be useful to somebody else.

Is there a nifty ruby hack for this set of commands?
257235 [vfcforums@gm] I have this sequence of commands to write a list of values to a file
+ 257236 [ezmobius@gm ] [header_commands, mysql_commands, dir_commands,
+ 257237 [has.sox@gm i] ...
+ 257239 [botp@de mo t] # f = File.new(configfile, File::CREAT|File::WRONLY, 0700)
+ 257264 [gavin@re in ] File.new( configfile, File::CREAT|File::WRONLY, 0700){ |f|
| 257286 [shortcutter@] File.open configfile, File::CREAT|File::WRONLY, 0700 do |f|
+ 257563 [vfcforums@gm] Thanks for all the examples.
+ 257568 [apeiros@gm .] You're almost there

File permissions w/Dir.mkdir
257238 [dangerwillro] Dir.mkdir(file_name, 755)
257242 [pi@pi os .u ] Dir.mkdir accepts octal numbers, which is standard notation for this

More Regexp and file load problems
257243 [levandon@gm ] I am struggling here and would be most appreciative of any help.
+ 257258 [botp@de mo t] # file = File.new('/Users/donlevan/Desktop/DDRs/Apple Dealer Price
+ 257260 [webs.dev@gm ] You use an xml library, possibly rexml

Hash banging #! - Distributing precompiled sharable linux binaries
257244 [john.carter@] This may, in a very odd set of circumstances, be useful to somebody....
257309 [kbloom@gm il] Guess what. JRuby of all things runs into this problem[1], and they

Array Problem, sort Array
257246 [coolwong85@y] [code]
+ 257248 [list.rb@gm i] ...
| 257249 [coolwong85@y] if the array include the "nil", it cannot sort, why??
| + 257250 [list.rb@gm i] ...
| | 257251 [list.rb@gm i] ...
| + 257255 [botp@de mo t] # if the array include the "nil", it cannot sort, why??
| | + 257262 [gavin@re in ] ...why wouldn't it be? Sorting an array of any 1 element should always
| | | 257271 [botp@de mo t] # > A little digression for everyone though...
| | | 257311 [dangerwillro] Let's do some philosophy!
| | | + 257319 [Rob@Ag le on] This thread continues to remind me of a comment made by a colleague
| | | + 257320 [gavin@re in ] On Jun 28, 7:53 am, John Joyce <dangerwillrobinsondan...@gmail.com>
| | | + 257399 [botp@de mo t] # > # > A little digression for everyone though...
| | + 257280 [fred@la av .] => ["a", "b", nil]
| |   257290 [botp@de mo t] # > solution: a) convert elements to some common class (string
| |   + 257322 [dblack@wo bl] ...
| |   | + 257325 [juapdiaz@gm ] ...
| |   | + 257402 [botp@de mo t] #   class C; end
| |   |   257460 [dblack@wo bl] ...
| |   |   257549 [botp@de mo t] On Behalf Of dblack@wobblini.net
| |   + 257463 [fred@la av .] We're in an object paradigm here.  We're trying to sort an array of one
| |     257550 [botp@de mo t] # and only one object ; the nature of this object doesn't enter into the
| + 257263 [gavin@re in ] my_array.compact.uniq.sort
+ 257275 [coolwong85@y] [code]

when to Run the garbage collector?
257253 [gpygood@12 .] GC.start
257259 [gpygood@12 .] Thank you.
257268 [sylvain.joye] It may be difficult to benchmark (or profile for that matter) code under
257406 [mick@ho li s] Given that the GC runs during real world operation, and that benchmarks are generally about
257489 [sylvain.joye] vice.

Re: LSRC Name Picker (#129)
257257 [CHubas7@gm i] Here is my sollution, using Tk. It is not very fancy, as uses very

RCR: hybrid case expression
257265 [webs.dev@gm ] I always use a case expression with the target/comparison style, but

signal handler problem
257269 [rubylearner@] ...

Ruby versus Java threading ?
257272 [surfunbear@y] This paragraph is part of the Java Performance tunning newsletter
+ 257287 [shortcutter@] The major - and crucial - difference between current Ruby's threads and
| 257308 [znmeb@ce ma ] I'd say jRuby is the answer here -- it uses the JVM threads which in
+ 257288 [snail@ob me ] <surfunbear@yahoo.com> writes
+ 257301 [james@gr yp ] I see you already have some great answers, but this might be worth a
+ 257307 [aurelianocal] Well, you can use JRuby. Which is a Ruby implementation that runs ontop of a JVM and uses the threads provided by the JVM (the Java ones).
+ 257315 [rasputnik@gm] With Ruby, you tend to do parallel operations with processes instead

Can i calculate the data number in array?
257276 [coolwong85@y] [code]
+ 257277 [gpygood@12 .] d=["a", "a", "a", "b", "b", "c", "c", "c","d", "d", "e"]
| 257278 [gpygood@12 .] But,I think ruby's Hash is not ordered,so...
+ 257279 [AEtzold@gm .] Dear Cool,
  257289 [shortcutter@] Yes, I'd agree.  Having tuples as return value is better because then
  257291 [robert.dober] Shame on you!!! ;)
  257294 [shortcutter@] Um, why?  Somehow I don't get the joke, sorry. :-)
  257314 [robert.dober] Really or are you metajoking?anyway to get out of recursive joke mode,
  257367 [shortcutter@] Umpf!  I actually overlooked that one.  Somehow I read it as (a||[]).

change path for require
257281 [mihai.bulhac] how can i change the path for require?
257282 [fred@la av .] require "tst/requiered_file.rb"

pretty_print woes
257292 [ronald.fisch] I like the formatting one gets by
257297 [shortcutter@] irb(main):009:0> puts "foo\"bar".pretty_inspect
257306 [ronald.fisch] Thanks a lot! Nearly perfect!! (Actually, I use pretty_inspect.chomp,
257310 [dangerwillro] Actually, puts is adding that \n to the string, but your result is
257370 [shortcutter@] irb(main):001:0> "a".pretty_inspect

Dynamic sort_by criteria, making it DRY...
257293 [josselin@wa ] I am presently using a sort_by on my array
257296 [shortcutter@] buddies = user_buddies.sort_by {|it| it.send @criteria}
257368 [josselin@wa ] Thanks Robert cannot be dryest....  I am so ashame of my solution that

splitting a string
257295 [lars.andren@] I've got a problem when trying to split a string after the thrid
+ 257298 [stefano.croc] str.scan(/(?:[^\/]+(?:\/|$)){3}/)
| 257303 [lars.andren@] Thanks a lot both of you! I can use Stefanos method since I only want to
| 257331 [robert.dober] In that case you can do
+ 257299 [shortcutter@] Depends on what you want to do, i.e. which part(s) of the string you

IO.write problem on "raw" Windows
257300 [freeunli@ya ] prg = "c:\\path\\to\\some\\program" # for cmd
257304 [B.Candler@po] I expect the _other_ program is blocking, because you're not reading its

Processing rc  file - critical comment asked
257305 [ronald.fisch] I have already a solution for my problem, but I would be glad if some

need help posting a base64-encoded binary via xml-rpc
257313 [phildog.thom] xml-rpc. But it isn't working. Everything seems to work but the
257317 [phildog.thom] ...

Bad file descriptor error using Net::HTTP
257316 [brian.wil.gr] I am trying to access a .net page via my ruby app and pass it a couple
257318 [djberg96@gm ] s = timeout(@open_timeout) { TCPSocket.open(conn_address(),
257321 [brian.wil.gr] Dan,
257324 [djberg96@gm ] That's peculiar. Firewall or proxy issue perhaps? Maybe you need