310838-311831 subjects 311258-344337

^ Re: What's the easiest way to check if param[:y] exists?
311018 [forum josh.c] I tried it on IRB, but it doesn't seem to work.
311022 [forum josh.c] You're right, I just saw that I don't need such a nested hash... ;-)

^ How do I unsplat something?
311020 [patrickli_20] Is there any easy to unsplat an item?
+ 311026 [shortcutter ] What result are you trying to get?
+ 311027 [shadowfirebi] # this do?
  + 311029 [patrickli_20] Yup that does nicely. Thanks very much.
  | 311032 [jbarnette gm] Are you sure you want to flatten that far? Why not just arrayify?
  + 311058 [avdi avdi.or] Just a warning, #flatten is not the inverse of splat, because it
    311061 [patrickli_20] {"a"=>2} to become [{"a"=>2}]
    311065 [cmshea gmail] There was a ruby quiz that included implementations of a single-level
    311068 [shadowfirebi] def unsplat(thing)
    311071 [patrickli_20] lol yeah. Shadowfirebird's hack is the one i'm currently using. I just

^ Exiting .each early
311030 [myrddin gmai] I want to return part of a sorted array efficiently. The built in
311031 [shortcutter ] Exactly with break. :-)
311045 [myrddin gmai] For some reason I thought break wouldn't work in this context... stupid

^ WIN32OLE -- cannot terminate Excel process
311044 [djlewis tria] I've read all the forum stuff on getting the Excel process to
+ 311047 [btricha gmai] You could kill the excel process... not sure how clean that is though.
| 311074 [djlewis tria] Yup, thought of that, and will do it if I can't figure out how to
| 311076 [btricha gmai] require 'win32ole'
| 311090 [djlewis tria] OK, thanks.  Process.kill works nicely, if I know the processID. But
| 311092 [btricha gmai] Weird... maybe ProcessID is an application-by-application type thing.
+ 311091 [david.mullet] excel = WIN32OLE::new('excel.Application')
  311093 [adam.shelly ] I can see how you can free up object memory with
  311101 [djlewis tria] Thanks for all the suggestions.  One of my problems was due to running

^ extract value of the hpricot elem
311048 [junkone1 gma] url="http://www.nasdaq.com/aspxcontent/shortinterests.aspx?
311062 [ruby thomasz] It's often easier to simply go directly to what you want with XPath.

^ Hpricot and xpath
311050 [chen_li3 yah] I want to find the path to a tag I am interested using hpricot.
+ 311053 [ruby thomasz] Look carefully. It's not defined for nil. Which means that
| + 311055 [phlip2005 gm] Oops - .header would have been a class, and #header is for an id. I got them
| + 311057 [chen_li3 yah] Here is the result after I change to css selector or xpath;
|   311059 [ruby thomasz] #!/usr/bin/env ruby
|   311063 [chen_li3 yah] My version is 0.4. Since I can not install the new version remotely.
|   311069 [chen_li3 yah] Thank you all for the help.Now it works after install to the 0.6
|   311078 [chen_li3 yah] I find that in my code 'xpath' only works if the attribute is 'id'. How
|   311103 [phlip2005 gm] Do you see the nil in that line? Where is the nil coming from? Is the method
|   311109 [chen_li3 yah] or nil:NilClass (NoMethodError)=0A>Do you see the nil in that line? Where i=
|   311115 [phlip2005 gm] That's just the thing. I studied the crap out of HTML, XHTML, and light CSS, and
+ 311056 [phlip2005 gm] You gotta learn what those errors look like. If you have a 'nil' where you don't

^ String manipulation: cut, insert, column editing...
311060 [toki84 gmail] Is it possible to use ruby like awk, sed or cut in unix to editing
+ 311108 [shashank_hi ] I don't think this would be the best solution, but you could map 1 =>
+ 311116 [rubytraining] line.
| + 311547 [toki84 gmail] Thanks a lot for the code, it works great and it's really clear.
| + 311549 [dblack rubyp] ...
+ 311122 [shortcutter ] These are quite different tools but yes, you can use Ruby like them

^ File redirects in Ruby? Was Re: Sigh! I'm depressed. Debian vs  Rubyand the backtick and subshells
311077 [john.carter ] There are two reasons I use ``.
311121 [shortcutter ] Well, define it once and include it in all scripts where you need it.

^ Re: ActiveRecord error with Rails 2.1.0 using include statem
311084 [ginkod gmail] oops. sorry. I realized it was the wrong place.

^ What's wrong with "exec"?
311087 [happy.go.luc] I use NETBEAN IDE 6.1. I tried to run CCC.exe by calling exec. But,
311105 [shashank_hi ] Try passing the entire path of the file.exe.

^ regular expresson isue
311104 [neeraj.jsr g] I have following regular expression to parse time.
+ 311106 [shashank_hi ] You want to match from the beginning of the string. So put a ^ before
+ 311112 [botp delmont] # ([0-9]|0[0-9]|1[012]):([0-9]|0[0-9]|[1-5][0-9])\s*(am|pm)
| 311123 [shadowfirebi] Sorry to be the awkward one, but maybe you should consider handling
+ 311125 [shortcutter ] This seems overly complex, especially your minute matching. This can

^ Definition of "Support levels", 1.9.1 supported platforms and recruitment for platform maintainers
311117 [yugui yugui.] Ruby committers had the Ruby developers camp 20080811
+ 311118 [znmeb cesmai] 1. You might want to change that to "Lenny" -- I believe it will be
+ 311119 [transfire gm] FWIW,
+ 311146 [cohen.jeff g] Thanks for this kind of email.  It helps me understand the rationale

^ RSpec output contains ridiculously excessive line returns
311124 [me elliottca] I don't know where else to send this, or I wouldn't bother the general

^ [ANN] webgen 0.5.2 released
311126 [t_leitner gm] Hey everybody!

^ Ruby 1.9, YAML & encodings
311129 [fred lacave.] I'm trying to migrate a project to ruby 1.9.

^ Subclassing, using an alternativ constructor
311130 [misk gmx.net] ...
+ 311139 [michael.c.li] Why not follow the example of the superclass and use 'default' instead
+ 311176 [pit.capitain] Christian, Class#new calls Object#initialize, not the other way round.

^ Jruby Application distribution
311132 [zyzygy telst] Apologies if this is a FAQ but I've not been able to find it.
+ 311147 [james.britt ] Absolutely.  Look at the rawr library.
+ 311214 [charles.nutt] James already mentioned Rawr, but I wanted to jump in and mention that

^ Regular expression: anything except
311133 [gunther.thev] <TEXT id=''>blabla</TEXT>
+ 311135 [hassan.schro] This example isn't consistent with the following ones -- do you
| 311136 [gunther.thev] I had just found the solution, and I was posting it.
| 311150 [ruby thomasz] < TEXT id="foo">blabla</TEXT>
+ 311137 [ruby thomasz] Sure. Since it looks like XML, I recommend using an XML parser. It not
+ 311138 [njus larshau] /<TEXT[^>]*>/

^ Refresh Machine
311140 [spectra debi] Recently I had to deal with external data sources that had to be =20
311166 [brinvertia m] Great code. You forgot to mention that "object" should implement

^ truncate float to 2 decimals
311141 [junkone1 gma] how do i truncate the float to 2 decimals
+ 311143 [ara.t.howard] just use the normal math way
| 311320 [w3gat nwlaga] puts (((float * 100.0).round / 100.0).to_i)
+ 311144 [rmagick gmai] Do you really want to change f?
+ 311145 [james graypr] => "0.91"
+ 311163 [transfire gm] require 'facets/float/round'

^ Ruby projects code organization
311142 [happynoff fr] I'm finishing the first version of a project. I want to prepare it to
+ 311162 [transfire gm] Beyond that, Hoe, a popular project management tool, defines a minimal
| 311188 [tim.pease gm] Author's plug ... try out Mr Bones if Hoe is not your style ...
| 311198 [happynoff fr] Ok :) Thank you both, I'll look a your links, 'seems nice.
+ 311204 [me elliottca] I'd suggest something a little shorter than what others have - these

^ How to do this?
311151 [pikseli NOUU] Dear sirs,
+ 311157 [dhchoi gmail] This doesn't completely answer your question, but you can define a +
+ 311159 [adam.shelly ] Most (maybe even all) built-in + operators return a new object, so I'd
  311255 [pikEISPAMMMs] Thank you Daniel Choi and Adam Shelly. I will now build the simple

^ script for wrapping and unwrapping text?
311152 [dhchoi gmail] I'm interested in storing, say, wiki pages as flat files that can be
+ 311173 [transfire gm] class String
+ 311203 [me elliottca] I was working on something similar to this last night - it may be able

^ array in ruby
311153 [leonard.yera] I have this array, in irb I write @mercados
+ 311155 [dhchoi gmail] It looks like you have an array of arrays. So @mercados[1] returns and
+ 311156 [ryand-ruby z] No. You're not seeing (or writing above) the extra "[". You have an

^ Windows Mechanize error?
311154 [jeremywoerti] I am writing a web scarping tool using mechanize. When I'm on my PC, it

^ Potentially issues with "system" command (Nuby)
311165 [thomas.luede] This question is a little complicated, so I'll try to describe the
311169 [thomas.luede] Just as clarification, I'm not doing anything process-wise (nothing like
311179 [thomas.luede] Sorry, one last clarification.  If I write a three line code running the
311182 [dave pragpro] What's the termination status in $?. That may tell you why your
311184 [thomas.luede] I'm pretty new at this - what is the command to do so?
+ 311186 [shortcutter ] Place a "p $?" in the line after your system command.
| 311194 [thomas.luede] I'm running on HP UX-11, with ruby-1.8.7-p22.  The underlying UNIX shell
| 311241 [shortcutter ] Not Windows, that may make troubleshooting easier since on Windows
+ 311189 [dave pragpro] running or terminated system process. The built-in variable $? is
  311192 [thomas.luede] #<Process::Status: pid=1132,exited(1)>

^ changing an instance variable
311172 [jason.lillyw] def initialize(x, y)
311175 [sepp2k googl] Why?
311177 [jason.lillyw] The reason is because I have big, long algorithms inside these methods
+ 311180 [tommy.morgan] ...
| 311187 [jason.lillyw] exactly what I needed. Thank you for helping me in my feeble quest to do
+ 311190 [shortcutter ] That is the most reasonable solution if I understand you correctly.

^ Redefine "method" method
311178 [ibc aliax.ne] since "method" is a Ruby method present in any class I would like if it could
+ 311183 [tommy.morgan] ...
| 311185 [ibc aliax.ne] Of course, but I'm doing a SIP protocol application, in which a core concept
| 311195 [tommy.morgan] ...
| 311199 [ibc aliax.ne] Enough arguments to remain using "sip_method" :)
+ 311191 [shortcutter ] could=20
  311193 [ibc aliax.ne] Thanks.

^ Comparing TCP sockets
311196 [ibc aliax.ne] io_1 = io
311207 [drbrain segm] No.
311210 [ibc aliax.ne] Thanks.

^ Odd behaviour of custom "inspect" method
311197 [john sinodun] Can anyone explain this for me?
311208 [ryand-ruby z] => ....
311236 [john sinodun] Interesting.  I had assumed it was an artefact of me using the '.'
311237 [john sinodun] Actually, I've solved it - it's a bug in Wirble.colorize.  I'll put in a

^ case statement and ranges
311200 [miniskirt yo] case amount
+ 311202 [ara.t.howard] case 42
+ 311206 [mental rydia] ...
+ 311209 [ryand-ruby z] I agree that your second example doesn't feel right... I prefer
| 311212 [caduceass gm] Don't use this; it's just for fun...
+ 311217 [vjoel path.b] Infinity = 1/0.0
  311218 [me elliottca] ...
  311219 [vjoel path.b] If it goes in core it should really be
  + 311220 [caduceass gm] Infinity + Infinity
  | 311223 [vjoel path.b] That seems right, or at least that's what I get counting on my fingers.
  + 311221 [me elliottca] ...

^ Is Ruby has something equivalent to ctypes in Python?
311213 [sgwong513 ho] I would like to load dll and create complex c datatype structure for the
+ 311216 [charles.nutt] On Rubinius and JRuby, you can use FFI. I'm hoping someone can do an FFI
| + 311247 [sgwong513 ho] Is the FFI for Rubinius and JRuby compatible? It would be great is all 3
| | 311329 [charles.nutt] It is compatible between JRuby and Rubinius, and will be in a production
| | 311347 [eoga elctech] Until a uniform solution is done, you can give a try to
| + 311350 [oga_emmanuel] In the meanwhile you could try http://www.dyncall.org/. Seems pretty
+ 311316 [ap0xsf gmail] ...

^ Are square brackets not allowed in a URI?
311224 [ihatespam ho] ...
311227 [m.fellinger ] Browsers always (un)escape URLs for readability, take a look for

^ [ANN] meow 2.0.0 Released
311225 [aaron tender] meow version 2.0.0 has been released!

^ How can I use Berkeley DB with Ruby?
311226 [ploy.sukacha] I'm a Thai student. My teacher ordered me to use Berkeley DB in the term
+ 311240 [wujciol gmai] Try tu use dbm (This is a Ruby extension to DBM library (including
| 311259 [wujciol gmai] # ruby dbm acess
+ 311360 [drbrain segm] ...
| 311362 [ploy.sukacha] The links for download is not working right now!!
+ 311682 [ploy.sukacha] Anyone can help me more?

^ [OT]    Re: Are square brackets not allowed in a URI?
311228 [ara.t.howard] On Aug 13, 2008, at 10:12 PM, Just Another Victim of the Ambient

^ Multithreading in ruby
311229 [kajamohaidee] We people are new team for ruby. we trying to pput multithreading in our
+ 311230 [saurabh.purn] ...
| 311233 [charles.nutt] As has been discussed here many times before, neither Ruby 1.8.6 nor
+ 311231 [jdinkel gmai] Use the Thread class.  Just be aware that Ruby 1.8.x uses green threads.
  311234 [charles.nutt] Ruby 1.9 has native threads, but they do not run in parallel and Ruby is
  311250 [g.graziosi g] On Aug 14, 7:17=A0am, Charles Oliver Nutter <charles.nut...@sun.com>

^ Mutithreading to implement near 7000 to 10000 mssage per min
311235 [kajamohaidee] we want to process 7000 to 10000 message and store it to the Database
+ 311244 [ttmrichter g] ...
| + 311246 [shortcutter ] 1. use Ruby to create a CSV file or similar which is then loaded into
| + 311254 [znmeb cesmai] Yes ... Erlang / Mnesia should be able to handle this, and then you
|   311310 [ezmobius gma] I'd say use rabbitmq with the ruby amqp library, this will allow you
+ 311311 [ara.t.howard] buffer them and insert them in a transaction 1000 at a time.  even
  311312 [martindemell] Do any of the ruby db libraries offer support for doing this efficiently?
  311323 [ara.t.howard] pretty much all of them
  311326 [jeremy hineg] If your standard of performance is 10,000 records inserted in a minute, any
  342551 [femtowin gma] tion,

^ to chech the url is valid when using Net::HTTP.get_response(
311238 [diwakar angl] I am using Net::HTTP.get_response( URI.parse( url ) ) to get the reponse

^ Kajamohaideen
311239 [kajamohaidee] Sir/Madam

^ Is it possible to extract data out of memory using Ruby?
311242 [erik ruby-la] Is it possible to extract data out of memory using Ruby?
311243 [pit.capitain] Erik, to read and write longs (4 bytes) I use the DL standard library
311267 [erik ruby-la] So if you would like to look at the 'in memory' representation of a Ruby
311366 [pit.capitain] Erik, you have to look at the C source code of Ruby to find the

^ [ANN] rmmseg-cpp 0.2.6 released
311245 [pluskid gmai] rmmseg-cpp version 0.2.6

^ [ANN] JRuby OpenSSL 0.3 released
311248 [ola.bini gma] Version 0.3 of JRuby OpenSSL has been released.
311270 [james.britt ] Great work!

^ Access Denied error in Watir 1.5.3 (Using Ruby 1.8.6)
311253 [samiran.sil ] Dear Friends,
311433 [shawn42 gmai] ...

^ Idiom of removing a particular character from a String?
311256 [danielsson.l] Is there any particular idiom for removing a particular character from a
+ 311261 [ruby anthrop] str[index..index] = ""
| 311286 [danielsson.l] str = "hello"
| 311354 [ninja slapha] For what it's worth, I've been using Object#tap (1.8.7 or higher) in
| 311374 [danielsson.l] Agreed, Object#tap looks very nice. Thanks for the info.
+ 311264 [michael.c.li] irb(main):022:0> rem = "foobar"
| 311290 [danielsson.l] The "problem" is that slice does not return the resulting string but
| 311373 [shortcutter ] irb(main):011:0> s = "abcdef"
+ 311292 [ara.t.howard] don't do it by index
+ 311299 [ymendel pobo] On Aug 14, 9:21=A0am, "Lorenzo E. Danielsson"
+ 311460 [apeiros gmx.] str[0...index]+str[index+1..-1]
+ 311477 [uzimonkey gm] There have been some good solutions posted already.  However, I don't

^ Starting new process on Windows!
311257 [damnbigman g] ...
311260 [wujciol gmai] Try to use ruby threads. Example
311262 [damnbigman g] ...
311306 [adam.shelly ] My first thought was you could make your own fork-like functionality.
311313 [damnbigman g] ...
311402 [damnbigman g] ...
311412 [adam.shelly ] system "start #{myapp}"
311416 [damnbigman g] ...