382904-383918 subjects 383304-384003

Optimize write of large file
383059 [yoann6@gm il] I have data to process and to write into files progressively. The data
+ 383062 [mbj@se ni .n] Ruby and the glibc the kernel etc are doing buffering already.
+ 383071 [jeremy@bo p.] As mentioned, the file writes are already being buffered by lower
+ 383080 [yoann6@gm il] You're right, doing the buffer myself does not make it faster. For
| + 383085 [shortcutter@] No, more does not help more.  With modern operating systems you never
| + 383088 [mbj@se ni .n] IMHO the primary speed bottleneck is the disk drive itself and the "possible"
+ 383184 [yoann6@gm il] Thanks for your answers, I'll let the OS optimize this on its own then

Git configuration file: .gitconfig
383075 [kmandpjlynch] Good morning,
+ 383078 [hassan.schro] It's optional; but if you want one, create it.
| 383083 [kmandpjlynch] Thank you Hassan...
| + 383087 [shortcutter@] Cheers
| | 383106 [kmandpjlynch] ...sorry, this was a topic in the AWDWR book - I should of posted my
| + 383089 [cmdjackryan@] RTFM. Or at least a git tutorial one site over on github.
|   383118 [kmandpjlynch] ...ok, will do - sorry...
|   383122 [cmdjackryan@] No need to apologize all the time. :)
+ 383095 [ibc@al ax ne] And the question about Ruby is...?
  383104 [kmandpjlynch] ...sorry, I thought Git was the preferred version control manager of Rails
  383109 [code@ap th o] s=20
  383117 [kmandpjlynch] ...thanks for the helpful words...

Shell pipeline in Ruby?
383093 [hramrach@ce ] how do you write an equivalent of
+ 383101 [jos@ca no k.] Have you checked out Open3.pipeline?
| 383126 [hramrach@ce ] I have checked all the stuff I could find once but did not find a solution.
| 383132 [stu@ru yp og] There is also popen4 which I believe also gives you the pid with std -
| 383134 [hramrach@ce ] It provides stderr but not the pipeline which cannot be constructed in
+ 383107 [bbxx789_05ss] puts `cmdA | cmdB | cmdC`
+ 383181 [rogerpack200] Enjoy.
| + 383190 [hramrach@ce ] Unfortunately, this does not work.
| | 383204 [rogerpack200] Try it now, fixed the bug.
| + 383206 [rogerpack200] Unfortunately it appears the wiki formatting is mangled in firefox, but
|   383225 [hramrach@ce ] Changing the last line to
+ 383192 [shortcutter@] $ ri Open3.pipeline_r Open3.pipeline_start
| 383203 [hramrach@ce ] Again, like in Open3.pipeline the :err argument used in the example is
| 383208 [shortcutter@] Each cmd is a string or an array. If it is an array, the elements are passed
| 383219 [hramrach@ce ] It's not quite clear that Process.spawn description also applies to
+ 383216 [hramrach@ce ] OK, thanks for all the replies.
| 383251 [b.candler@po] Since you are doing this on a real operating system, there's no need to
| 383309 [hramrach@ce ] I don't use Ruby for that.
+ 383252 [b.candler@po] Here is a ruby 1.9.2 version with close_on_exec=. I leave it as an
+ 383328 [hramrach@ce ] Thanks for all the replies.

Mechanize retrieve headers
383096 [rob_gar_esp@] I'm using mechanize for web inspection, when I get a URL I get a refresh
383165 [bbxx789_05ss] The Mechanize docs follow the ruby tradition: they suck.  So I would
383172 [code@ap th o] Do you actually use Ruby, or just complain about it and insult people who

Jruby -v failing with possible Java version issue
383098 [ruby.student] I installed jruby 1.6.1, as fully described below.
+ 383100 [matt@te hn r] I dug into this a few months ago.  It looks like the IBM implementation of
+ 383102 [matt@ha ps a] I'm not sure if the IBM Java supports all the flags which Sun/Oracle java
  383108 [ruby.student] root@myserver # which java
  383115 [matt@ha ps a] 1.4.2 won't work.  You need java 1.6.  FWiW, Java 1.4 was sunsetted a
  383125 [ruby.student] But I have 1.6, I installed it.
  + 383129 [cmdjackryan@] Yes, you can. Just make sure to install OpenJRE/OpenJDK to its own
  + 383136 [matt@ha ps a] That may be the case, however, when you ran java -version, it says 1.4.2
    383221 [ruby.student] OK gents, I installed Java 1.6 and pointed to it via the JAVA_HOME
    383264 [headius@he d] Just saw this thread today...
    383282 [ruby.student] Charlie,

Email Parsing
383140 [piratej74@li] How would I only pull links from the email's body and not the full
+ 383143 [b.candler@po] "Links" to me implies that this is an HTML email. In that case, just
+ 383152 [piratej74@li] That worked out well thank you very much.
+ 383159 [ryand-ruby@z] BTW... we're discussing stabbing you in the 'indenting "end"' thread. :)
  + 383167 [cmdjackryan@] def stab
  + 383174 [code@ap th o] I, for one, would really rather not be stabbed in the indenting end.

indenting "end"
383144 [code@ap th o] def foo(bar)
+ 383145 [ryand-ruby@z] Find them.
| + 383146 [serialhex@gm] +1 on that remark! :P
| | 383148 [code@ap th o] Oh, good -- I'm not the only one.
| | 383155 [shortcutter@] LOL
| | 383157 [code@ap th o] Maybe I'm just lucky.
| + 383149 [sduncan@we a] I find this indenting gets best results, and more groupies.
|   383154 [code@ap th o] That's perverse.
+ 383150 [johnf@bi sb ] I've never seen this even once except when it was a mistake, but maybe
| 383153 [code@ap th o] No -- mostly just in code by relatively new Rubyists, such as questions
+ 383160 [drbrain@se m] $ ./ruby19 -v -
| 383175 [code@ap th o] Excellent!
+ 383163 [cmdicely@gm ] Is this is "real" code (e.g., source of gems, etc.) or in snippets? If
  383168 [spoon@ki le ] Agreed.  Cut n paste is a bitch that will rape your syntax.  It has no
  383179 [paradisaeida] Hang the indents!

[ANN] isolate 3.0.1 Released
383164 [ryand-ruby@z] isolate version 3.0.1 has been released!

Re: rubygems-update 1.8.2 Released
383169 [rogerpack200] As an interesting note,
383193 [ryand-ruby@z] Unfortunately, that's a rails gem-hack issue... (I suspect).
383298 [rogerpack200] I've noticed that the "gem which" command seems to have changed.
383299 [ryand-ruby@z] 3006 % gem unpack ruby-prof
383396 [rogerpack200] Ok that makes sense, though causes a bit of confusion.

[ANN] io_splice 4.0.0 - zero-copy pipe I/O for Linux and Ruby
383180 [normalperson] The splice family of Linux system calls can transfer data between file

ruby.exe crashing on windows xp
383182 [glory.lo778@] I am using ruby 1.9.2p180 and with rails 3.0 but I am getting ruby.exe
+ 383198 [cmdjackryan@] What is the GNU Database Manager thingy that's running on your machine?
+ 383228 [rogerpack200] crash log?
+ 383233 [glory.lo778@] Thanks for the prompt response.
| + 383234 [cmdjackryan@] In my short exploration of using Rails 3 with MongoDB on Windows, I
| + 383245 [luislavena@g] I don't see nothing strange in your gem list, bson_ext has a fallback
|   383292 [glory.lo778@] Yes, the crash still occurs.  I did install Devkit with my rails so I
+ 383297 [rogerpack200] Run it through gdb and see what the backtrace is?
  383324 [luislavena@g] I didn't ask the popup information, perhaps wasn't clear but I'm
  383346 [glory.lo778@] OK guys here it is.  I am still very new to all this and I wish things
  + 383348 [cmdjackryan@] For future reference: The second URL is *your private commit URL*. No
  + 383354 [cmdjackryan@] There are no routes matching /video in this test app, nor are there
    383366 [glory.lo778@] Thanks Phillip.
    383424 [cmdjackryan@] Indeed. An update made the source work. :)
    + 383429 [glory.lo778@] It is too bad the problem is isolated to my machine :(  It crashes
    + 383440 [luislavena@g] On May 17, 10:43=A0pm, Phillip Gawlowski <cmdjackr...@googlemail.com>

help on threads synchronization
383186 [zdyu2000@gm ] How to make two threads do something in turn, i.e., A => B => A => B
+ 383191 [shortcutter@] =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
+ 383197 [jakekaiden@y] how about using a GLib::Timeout instead of threads?  threads can gum
+ 383202 [zdyu2000@gm ] Thanks Robert and Jake. I must use threads. Actually my original problem
| 383211 [shortcutter@] Why?
+ 383296 [zdyu2000@gm ] Robert,
| 383300 [shortcutter@] Did you ever hear of blocking queues?
+ 383302 [zdyu2000@gm ] Thank you Robert!

Re Re: Shell pipeline in Ruby?
383194 [lionel.orry@] # convert pdf to ps and send it to a printer.

helping others is a nice habit
383195 [shobadevi75@] shoba.1915@rediffmail.com

helping others is a nice habit
383196 [shobadevi75@] shoba.1915@rediffmail.com

Calcul XOR : array , times.
383201 [ruby.aix@gm ] a = [1, 0, 1, 1, 0, 0, 1]
+ 383214 [list.push@gm] Sorry, I did not look for a problem with your code. I did it another way.
+ 383226 [bbxx789_05ss] You want Array#cycle.
  383227 [bbxx789_05ss] a = [1, 0, 1, 1, 0, 0, 1]

Ruby socket does not get reply
383217 [rob_gar_esp@] begin
+ 383223 [bbxx789_05ss] If the server is expecting 'line oriented input', then the server will
+ 383230 [rogerpack200] This call (read) blocks until the other end of the connection closes it.
  383231 [bbxx789_05ss] ===
  383247 [rob_gar_esp@] socket.write("HELO " + session + "\r\n")
  383253 [bbxx789_05ss] Just be aware that ruby is going to convert a "\n" to "\r\n" on windows,
  + 383254 [bbxx789_05ss] One way to avoid the newline conversion is to use the actualy ascii code
  + 383293 [gwtmp01@ma .] windows,=20

Any working translation framework available for Ruby
383235 [hramrach@ce ] I am not a believer in translations but given that I can write
383237 [cmdjackryan@] Well, you'll *have* to create different messages for
383250 [hramrach@ce ] Yes, it looks good.

Find Ruby /bin/ location
383236 [developer@wi] Today's my last day at work, and my boss wants me to move a Ruby library I
+ 383239 [cmdjackryan@] - "HKEY_CURRENT_USER\Software\RubyInstaller\MRI\1.9.2\InstallLocation"
+ 383249 [sutniuq@gm .] require "rbconfig"
  383255 [developer@wi] That's exactly what I was looking for. Thanks to both of you.

no such file to load only in ruby 1.9.2
383238 [jamesbirtles] gem_name.rb
+ 383240 [cmdjackryan@] Did you try
+ 383241 [ryand-ruby@z] testing
+ 383242 [jamesbirtles] Thanks for the replies
  383244 [ryand-ruby@z] The last part you need to know is that 1.9 dropped '.' from the default =

[ANN] rdoc 3.6 Released
383243 [drbrain@se m] rdoc version 3.6 has been released!
+ 383331 [matt@ti bi s] Looking good.
| 383333 [sutniuq@gm .] Read the RubyGems 1.8 announcement.
| 383530 [matt@ti bi s] I did that and it didn't help. m.
+ 383361 [lists@ka am ] $ ri Array
  + 383367 [ryand-ruby@z] If you're on 1.8, you'll need to install rdoc-data and follow the =
  | 383425 [lists@ka am ] post-install instructions.
  + 383368 [mt.lenik@gm ] If you're using RVM I belive that running `rvm docs generate` (or

RubyKaigi2011: CRuby Committer Invitation Program
383248 [shintaro.kak] To all CRuby commiters,

search nearest to elements in array (hash)
383257 [excanoe@gm i] I'm interesting, what is the best way to find nearest element in array
+ 383258 [serialhex@gm] 'nearest' as in ["foo", "needle", "bar", "baz"] with "foo" & "bar" being the
+ 383259 [bbxx789_05ss] data = [1.1, 4.2, 3.1, 2.6, 6.1, 5.0]
| + 383261 [martindemell] You're sorting when all you want is the minimum
| + 383262 [bbxx789_05ss] data = [1.1, 4.2, 3.1, 2.6, 6.1, 5.0]
+ 383260 [martindemell] Depends - if there's a comparison function, and your array is sorted
+ 383268 [excanoe@gm i] thank you guys!

pik update list known
383265 [flebber.crue] Is there any way to make pik update the the list of known.
383267 [flebber.crue] I have used pik to install ruby1.9.2-p136.
383294 [flebber.crue] No one really using pik?
383325 [luislavena@g] pik is installed in C:\Users\Luis\Tools\bin

[ANN] isolate 3.0.2 Released
383266 [ryand-ruby@z] isolate version 3.0.2 has been released!
383334 [normalperson] I'm not sure if this is a bug in RubyGems itself or Isolate, but I

Counting how many times the same elements occurs in an array?
383270 [nedpointsman] There's probably a fairly simple way to do this.
+ 383273 [johnf@bi sb ] You didn't mention what a particular xml_event object looks like, but
+ 383275 [shortcutter@] irb(main):002:0> a = Array.new(10) { rand(4) }
+ 383278 [nedpointsman] I'm sure your solutions are better than mine, what I ended up doing;
  + 383280 [shortcutter@] This is dangerous: in Ruby false and nil are treated as boolean false.
  + 383289 [bbxx789_05ss] After asking for advice on a computer programming forum, the chosen
    + 383290 [adam@ap es o] If it isn't touted as the Perfect Solution to the problem, then it's much
    + 383291 [developer@wi] Agreed, I'm not a huge fan of the solution. John and Robert's are much more straightforward, reusable, and elegant.

Ruby Future Or?
383271 [piratej74@li] I was thinking today and I was wondering if ruby has a future when
+ 383272 [johnf@bi sb ] I guess it depends on what you mean by "having a future". Ruby's never
+ 383276 [shortcutter@] If I could answer your question I would be in possession of a crystal
| 383277 [no@sp m. le ] ahh, but did s/he answer you? :-P
| 383279 [shortcutter@] Yes, she did! :-)
+ 383284 [joelvanderwe] Well, what kind of code _do_ you want to write? There are still some of
+ 383287 [code@ap th o] I haven't used Rails in five years.  I use Ruby daily.
+ 383288 [stu@ru yp og] Python and Ruby are pretty much in the same boat. Python won't be the
| 383343 [djberg96@gm ] My prediction? Javascript eventually kills the other dynamic languages
| + 383344 [spiralofhope] I agree, but only in the sense that there are some fantastic tools[1]
| | 383349 [schang@wx .n] I disagree with Daniel. Program languages cannot be predicted. Distrust
| | 383359 [djberg96@gm ] If you want to equate 15 years of experience, job trending and tech
| + 383345 [stu@ru yp og] Seeing that I was referring to UNIX shell scripting I don't see how
| + 383373 [code@ap th o] =2E . . just as soon as a new version of JavaScript that doesn't include
| + 383376 [ralf.mueller] Sorry, but this argument just does NOT count (for me). It's leads to the question: Why develop something new?
|   383379 [rimantas@gm ] I'd love to see a beautifully designed language like Ruby doing client side
+ 383301 [eldestdamphy] Been coding in Ruby since 2001 and I've never done Rails while I have
+ 383303 [spiralofhope] I was thinking today and I was wondering if apples have a future when
| 383335 [code@ap th o] Ahh, now that's a different question.
| 383342 [wyhaines@gm ] It depends. We (Engine Yard) employ several people for whom Ruby
| 383374 [code@ap th o] 1. Did you hire them for their Ruby-not-Rails skills, or hire them for
| 383439 [wyhaines@gm ] 1) Yes. For some jobs, the Ruby is what is important, not the Rails.
| 383450 [code@ap th o] Awesome.  That's one!
+ 383347 [zach.dennis@] I found it interesting to see Walter Bright (creator of D) comment in an
| 383435 [i_cenov@bo e] This is my first post here, I am C firmware programmer and and touched
+ 383413 [bbxx789_05ss] Do you really think all those cascading 'ends' in Ruby (that you can
| + 383414 [sduncan@we a] Hrm, peach or nectarine, peach or nectarine ...
| + 383418 [code@ap th o] I have no problem locating a missing "end".  In fact, the "end"s make it
| | 383419 [cmdjackryan@] 'sides, when keeping methods short and sweet, you don't lose track of
| + 383422 [steve@st ve ] If you have more than two or three ends, your code sucks. It's a feature,
| | 383426 [developer@wi] I think that kind of canonical generalization isn't strictly true, *especially* if you work with lambdas or heavy algorithms. I'm a huge fan of abstraction, especially in Ruby and Lisp, but to say that code should never be nested this much is (by my standards) not a good generalization.
| + 383431 [cmdicely@gm ] I've never had much problem with getting the "ends" right in Ruby, but
+ 383456 [axyd80@gm il] He-he, I guess Rails for Ruby is the same as JEE is for Java :)
+ 383481 [shevegen@gm ] Sure ruby has a future.

Problem with the classify method from active support
383281 [g.marcilhacy] I am create a gem and I have encounter a problem using active_support
+ 383283 [fxn@ha hr f.] The way to load Active Support changed with AS 3.0.0. I suspect your
+ 383285 [g.marcilhacy] Thanks for the tip, it's working.
+ 383286 [g.marcilhacy] Thanks again I have been able to fix this but I am encountering a new