## 402378-411517

402205-408251 subjects 402586-403068
```
[ANN] Bacon 1.2, a small RSpec clone
402378 [ruby-talk@vu] Today, after over 4 years, I'm proud to release Bacon 1.2.
402392 [ryand-ruby@z] On Dec 21, 2012, at 03:24 , Christian Neukirchen =

Tinytds - Save binary as file
402387 [lists@ru y- ] I'm learning Ruby and I'm trying to save to disk some content that is in
+ 402389 [fluido@fl id] If you want to write binary (i.e. unadulterated) content, you must add
+ 402405 [tamouse.list] Can you show the table schema?
+ 402493 [lists@ru y- ] "wb" didn't work.
| 403813 [chris.hulan@] See here
| 403815 [theodore.kar] unsubscribe
+ 403809 [lists@ru y- ] Posted via http://www.ruby-forum.com/.

simple division: -9 / 5 = -2 what?
402394 [lists@ru y- ] \$ irb
+ 402395 [rubyinfo@ap ] I believe ruby followed c in the convention of integer/integer => integer
| 402399 [sto.mar@we .] No, 9 / 5 => 1 !
| 402400 [af17g11@gm i] integer
| 402401 [sto.mar@we .] for integers a and b, a/b returns floor(a/b).
+ 402398 [lists@ru y- ] p -9.divmod 5
| 402429 [lists@ru y- ] a = -9
| 402430 [matma.rex@gm] Why? -9 / 5 = -2 with a remainder of 1, because -2 * 5 + 1 = -9.
| + 402433 [fluido@fl id] #include "stdio.h"
| | + 402434 [matma.rex@gm] Both are right. You can perform the division is two ways: one that gives negative remainders and one that doesn't. The precise behavior of Ruby implementation is documented here: http://www.ruby-doc.org/core-1.9.3/Numeric.html#method-i-divmod
| | + 402437 [lists@ru y- ] So did I until I translated a C++ homework assignment to Perl, then to
| + 402436 [lists@ru y- ] How can my intuition be wrong when you are not asking in what way I
+ 402432 [hackandg@gm ] You are looking for (0.0-9)/5 or -9.0/5 or -9/5.0  To ruby numerals are =

POLS and string-handling
402412 [lists@ru y- ] I have programmed in various languages previously, but am new to Ruby.
+ 402416 [echristopher] In Ruby parlance, it's a reference; but essentially correct.
+ 402418 [tamouse.list] Better get used to it. Ruby treats *everything* as an object, or
+ 402419 [martindemell] = is a built in piece of syntax to bind a variable to an object.
+ 402420 [lists@ru y- ] Well, you called strings as "primitives"; did you use JavaScript? :)
+ 402422 [lists@ru y- ] x = "hello"
| 402446 [shortcutter@] Maybe a bit more illustrative: executing the _same_ string literal
+ 402423 [lists@ru y- ] result = 9.5426.round 3
+ 402441 [lists@ru y- ] Thanks for all the replies.  I notice also that I can force changing of
| + 402442 [flo@an er gr] On Dec 24, 2012, at 12:55 AM, Paul Magnussen <lists@ruby-forum.com> =
| + 402445 [lists@ru y- ] Incorrect.
| + 402447 [shortcutter@] my_string_a = "Fred Shufflebotham"
|   402448 [lists@ru y- ] And this is a huge breath of fresh air compared to, say, Perl, where
+ 402451 [lists@ru y- ] Wow, everbody has been so kind and helpful to a newbie.  I shall save

402413 [lists@ru y- ] How do I add headers to a proxy request using Net/Http?

beautifier
402421 [hawat.thufir] Or, is there a better one?  This is the only one I could find.

Ruby Error in CfBackup script for Rackspace upload
402428 [lists@ru y- ] I am getting a small error when I am running the backups

Ruby game server woes
402440 [lists@ru y- ] The following is a bit of a brain dump, as I'm thinking about things I
+ 402444 [fluido@fl id] Did you actually try to add a C extension? It is something that has to
+ 402450 [lists@ru y- ] Thanks for your reply, it has been more food for thought.  To answer
| 402453 [fluido@fl id] Well, this is what I *obtain* from writing in Ruby+C. The why is a bit
+ 402452 [lists@ru y- ] Ey guys, I'll enter my head just a little to ask a little simple
| 402454 [fluido@fl id] If you want both the server and client to be Ruby-based, the DRb
+ 402455 [lists@ru y- ] Thank you Carlo, I'm reading it.

Character encoding in 1.9
402459 [lists@ru y- ] I have some code in 1.8 that would strip certain special characters out
+ 402462 [nbeyer@gm il] Check out the Regexp documentation, specifically the 'new'/'compile'
+ 402464 [lists@ru y- ] line = "hello\377\373\001 \377\374\001 \377\375\001world"
+ 402465 [lists@ru y- ] line = "hello\377\373\001 \377\374\001 \377\375\001world"

"Open" dialog of Windows
402460 [lists@ru y- ] Windows. I didn't find nothing, just a snippet of code that doesn't
+ 402463 [botpena@gm i] i cannot answer the win32ole part, but, ..  regarding gui dialogs, you may
+ 402469 [lists@ru y- ] That's cool botp but I'm trying to not use any external gem rather than
+ 402476 [lists@ru y- ] Is this what you're looking for?
+ 402479 [lists@ru y- ] It is completely in english, as I said, the app is in spanish language.
| 402496 [lists@ru y- ] Doesn't the windows dialog correspond to the language currently in use in the operating system?
| 402497 [lists@ru y- ] If you mean the #FXFileDialog from FXRuby then NO. I've tested it. If
+ 402527 [lists@ru y- ] I'd suggest looking into how that dialog is created and whether it's
| 402533 [lists@ru y- ] Well, FXRuby is basically a wraper to the C++ Fox framework, so the
+ 402540 [kieran.tully] Short answer: see http://www.ruby-forum.com/topic/168114
402552 [lists@ru y- ] Same OS and Ruby version.

Word Pluralization and Conversions from Numbers like 1,2,3,4,5
402461 [lists@ru y- ] Anyone knows if standard ruby has this available?
+ 402472 [shortcutter@] I am guessing that translation and natural language handling are not
+ 402502 [transfire@gm] ...

How do I install Ruby on my Ubuntu 12.10 partition.
402466 [lists@ru y- ] I already have Ruby installed on my Windows 7 partition.
+ 402467 [bhaveshlette] -> Following commands to install Ruby with RVM
+ 402468 [lists@ru y- ] it works without RVM!
| 402470 [kiswono@gm i] without rvm, and newer than ruby-full (1.9.3.194), use brightbox's ppa
+ 402474 [lists@ru y- ] Thanks guys! So now how do I run a simple Ruby program inside Ubuntu?
| 402475 [lists@ru y- ] \$ ruby interactive.rb
| 402498 [lists@ru y- ] Thanks a lot guys. Derrick, /usr/bin/ruby is right. So I edited the file
| 402501 [lists@ru y- ] 1. You are using that command in the same location of the file.
+ 402481 [lists@ru y- ] duckhai you are wrong again its
| + 402482 [matt@te hn r] I recommend "sudo synaptic" and use the GUI interface to choose the
| + 402483 [lists@ru y- ] "wrong again"???  what does that mean?
|   402484 [me@da id wd ] NEITHER of you are wrong. You won't run into nasty problems. What nasty =
+ 402485 [lists@ru y- ] when you install ruby yourself, its mostly put under /usr/local/bin ...
| 402487 [me@da id wd ] That should point out instinctively that the user is responsible for =
+ 402486 [hawat.thufir] Unless doing guided install you should read all sub-sections under the

[ANN] Ruby 1.9.3 patchlevel 362
402471 [usa@ga ba ec] According to this time, as usual, Ruby 1.9.3-p362 is released.

[ANN] RubyInstaller 1.9.3-p362 released
402477 [luislavena@g] In combination with the rest of the RubyInstaller team, I'm very

Accumulate total count for each month
402480 [lists@ru y- ] I have a file that contains a list of STRING datetime like
+ 402488 [lists@ru y- ] require 'date'
+ 402489 [fluido@fl id] Why not use the year+month as the hash key? From your DateTime object,
+ 402491 [lists@ru y- ] (1..12).each do |month|
| 402492 [fxn@ha hr f.] If that is all there is to it, a simple split would work
+ 402494 [lists@ru y- ] Wow, thanks everyone.
+ 402495 [shortcutter@] Better use Date since you want to count occurrences at dates.
402508 [lists@ru y- ] 1.rb:10:in `block in <main>': undefined local variable or method `k' for
402530 [shortcutter@] Typo when ad hoc refactoring names

When to use Hashed Parameters for method calls.
402503 [dummey@gm il] I am currently having an internal debate on refactoring some code right now
402504 [ryand-ruby@z] Don't question the type of arguments... Question the number of arguments. 8 j=
+ 402505 [dummey@gm il] I should probably also note that I am working on a chunk of legacy code so
| 402507 [hmaddocks@me] I get the impression from what you said there are no tests for the method you want to refactpr. If so then I understand your fear.
| 402531 [shortcutter@] ms because they hide the interface, but I occasionally use them because som=
| 402566 [hmaddocks@me] Yes, this is a good compromise, but it always feels odd to me to create such a short lived object. Though I guess the params Has is a short lived object too.
| 402567 [shortcutter@] Maybe if you start reasoning about that Struct you find out it's not
+ 402506 [fluido@fl id] Specifically, if you need 8 arguments to specify a situation, it may

Ruby Association Certified Ruby Programmer
402510 [lists@ru y- ] How well respected is this certification in the industry: Ruby
+ 402511 [jonanscheffl] Short version: there isn't a respected certification in the ruby community.
+ 402512 [lists@ru y- ] Not even going to get into huh.
| + 402513 [keystonelemu] ... Or that they're compensating for lack of experience. Cookie cutter
| + 402517 [rubytalk2dav] The problem is, even at the same level of scoring on a certification
+ 402514 [lists@ru y- ] Okay, no doubt, but everybody starts off inexperienced.
| 402516 [keystonelemu] Not a problem. This is a long standing conundrum. I just have no faith in
+ 402515 [rubytalk2dav] Generally speaking, Rubyists don't regard certifications very highly
| 402536 [rubytalk2dav] Something seems to have gotten lost.  I meant "much of which is
+ 402518 [lists@ru y- ] aaa, thanks Dave for the lengthy response. Valid points. I'm still going
| + 402535 [rubytalk2dav] Heh.  You're welcome.  But... brevity is the soul of wit, and my reply
| + 411516 [lists@ru y- ] Hey!
| + 402532 [   ar@le .m ] Yes -- it's chaired by Matz himself.
| | 402534 [peterhickman] Well I am very disappointed in that case, but that leaves questions 2 and
| + 402538 [matt@te hn r] I have noticed that this list has been taking on a rather nasty tone
|   402544 [shortcutter@] I wouldn't call it "nasty" - still the tone has degraded.  There are a
|   + 402547 [carlos.agari] I agree. I've seen some people being a bit too uneducated to newcomers and
|   + 402553 [peterhickman] They are less requests for help than demands that we do their work for
|     402554 [jonanscheffl] There are a lot of ways to express that idea without implying the asker is
|     402557 [peterhickman] I have no desire to be nice, I want to make sure that I communicate. Lets
+ 402543 [lists@ru y- ] @Peter Hickman
| + 402545 [shortcutter@] But there similarities do already end.  Perl does not have OO from the
| + 402546 [matt@te hn r] Rails is a framework and DSL based on Ruby.  It is specialized to the
| + 402551 [peterhickman] For it to be "standard" then everyone (or at least most) people need to be
+ 402562 [lists@ru y- ] No Peter is right. I'm not that great of a programmer I'll admit. I
+ 402563 [peterhickman] With that attitude you will become a better programmer. Well that and a
+ 402644 [jgabrielygal] Well, I beg to difer. Over the many interviews for Java developers
411517 [lists@ru y- ] Indeed!

using shebang with rvm?
402519 [lists@ru y- ] What would be the appropriate path to use after a shebang in the first
+ 402520 [me@da id wd ] Its no different with RVM than without. RVM is just a set of scripts =
+ 402521 [lists@ru y- ] he means
| 402522 [me@da id wd ] Correct. My apologies.
+ 402523 [lists@ru y- ] Thanks, but most shebang files I have seen include an absolute path to
+ 402524 [me@da id wd ] Of course, because you use a FULL path. By not using #!/usr/bin/env ruby =
+ 402525 [me@da id wd ] This is the difference.
+ 402685 [stu@ru yp og] It's primarily for portability. Using env more or less defeats
402686 [lists@ru y- ] Thanks, Stu, the entire note was very helpful.
402689 [stu@ru yp og] Wes ~

Toward Ruby 2.0.0 (was: [IMPORTANT] 2.0.0 release plan)
402529 [ko1@at ot ne] (I post this message as a substitute of Endo-san, release manager of

[ANN] parslet 1.5.0
402537 [eule@sp ce c] parslet is many peoples favorite parser construction toolkit. It uses a

api in json or xml format
402539 [lists@ru y- ] is there any API for historical dates on web that returns data in xml or
402550 [matma.rex@gm] Wikipedia has a nice API that can return values in a variety of formats. You'll have to process the wikitext yourself, though.

Permission denied?
402541 [lists@ru y- ] Hey Derrick,
+ 402542 [atma@co va e] You changed the "permissions" of the file but didn't make the file "executable".
| + 402548 [hassan.schro] Uh, no; 755 *is* executable mode for user/group/world. Something else
| | 402622 [atma@co va e] Yeah you're right. My bad, I'll die and go to hell for that.
| | + 402623 [atma@co va e] No it's not, you actually *need* 700 .. oh my ... :-( I need to spent some time in cli.
| | + 402629 [hassan.schro] I'm saying that a user not familiar with a CLI environment is best
| + 402549 [lists@ru y- ] I'm really surprised by that!  Why did changing the permissions to 755
+ 402576 [nohappiness@] 2012/12/28 Kaye Ng <lists@ruby-forum.com>

numeric?
402555 [keystonelemu] I've found a bit of an annoyance trying to find out if a number is numeric
+ 402556 [jonanscheffl] You might be better off to ask yourself why you need the type checking
| 402559 [peterhickman] Problem all strings will convert to integers.
| 402577 [lists@ru y- ] In these cases, I just double convert i.e.
| + 402578 [keystonelemu] I've seen a similar solution as well. I've just monkey patched string with
| + 402579 [lists@ru y- ] Have to say that that's very cleaver. Very good solution.
|   402589 [shortcutter@] Use an Integer and deal with the exception.
+ 402558 [tony.arcieri] Float(string) is your best bet. Why is this inadequate? Are you trying to
| 402560 [keystonelemu] I can't control null returns on certain statements considering it retrieves
| 402561 [keystonelemu] Trust me, I wish there was a cleaner way to handle this instead of this
+ 402564 [lists@ru y- ] I think we need more information, the return values are fixeds? what are
| 402565 [keystonelemu] Sorry, I wasn't very clear. I was typing most of that from my Phone.
| 402568 [shortcutter@] What's wrong then to use Float() as suggested?
| 402569 [keystonelemu] I've already sorted them into classes and objects, so instance variables
| 402590 [shortcutter@] The more I think about it the more I do believe it is responsibility
| 402595 [lists@ru y- ] Yes that ensure a proper work, but he says that at any time can enter a
| 402599 [shortcutter@] And where is the problem with my approach?  Does it prevent getting
| 402603 [keystonelemu] It uses ssh and SNMP to retrieve data. They return different strings, all
| 402613 [transfire@gm] ...
+ 402690 [lists@ru y- ] while new_sock = sock.accept

penetration testing in ruby language
402570 [lists@ru y- ] im a professional in computer security but bignner in ruby language, and
+ 402571 [matt@te hn r] metasploit.com
+ 402572 [carlos.agari] testers-PAPER.pdf
+ 402607 [lists@ru y- ] thank you for your help :)
402610 [nitayart@gm ] Tutorials on the subject seem to be scarce. However, you can just dive into

Case statement anomaly?
402573 [lists@ru y- ] language_name = "C"
+ 402574 [carlos.agari] Paul, the "begin ... end" syntax is meant for exception handling. For
+ 402575 [lists@ru y- ] begin
+ 402598 [lists@ru y- ] Thank you both.
402600 [lists@ru y- ] a = 1

Ruby Koans regarding Hashes.
402580 [lists@ru y- ] I am trying to understand this, so let me know how I do.  :)  I know
+ 402581 [lists@ru y- ] Well seems that if you don't assing an explicit value to a hash key then
+ 402582 [lists@ru y- ] Well seems that if you don't assing an explicit value to a hash key then
+ 402583 [lists@ru y- ] 1) You never write
| 402606 [lists@ru y- ] That makes sense, and I got that same uselessness feeling when I saw the
+ 402584 [lists@ru y- ] hash = Hash.new do |hash, key|
+ 402614 [lists@ru y- ] string = "Hello world, hello mars, goodbye world."
| 402621 [lists@ru y- ] Hey, I said "currently have no idea"!  :)  Very cool example.
+ 402615 [lists@ru y- ] You said you know C++ and perl.  They both employ the concept of
+ 402619 [lists@ru y- ] I don't know if you know it or not but ruby's built in methods can have
| 402627 [lists@ru y- ] Yep, read about it in section 4.4 of "The Ruby Programming Language",
+ 402620 [lists@ru y- ] ref1 = []
+ 402624 [lists@ru y- ] It wasn't the reference part that was confusing, just the contents of
402631 [lists@ru y- ] Hash.new { |hash, key| hash[key] = [] }
+ 402633 [lists@ru y- ] To be consistent, instead of using @hash in to_s(), the code should use
+ 402634 [lists@ru y- ] hash = Hash.new  # no argument to new
402636 [lists@ru y- ] To be clear, the block does not execute when new() is called.   The Hash
402641 [tamouse.list] Great discussion here! I now understand how to use that hash block in

Ruby-debug and Windows 7
402585 [jrs.idx@nt w] I am new to Ruby. I have Ruby 1.93 on Windows 7 Home Premium.
+ 402587 [lists@ru y- ] ruby-debug on Windows and 1.9.x is a problem many people have. If you
| 402969 [rogerdpack2@] Hope it gets accepted upstream some day :)
| 402978 [jrs.idx@nt w] Ruby-debug and Windows 7
| 402979 [rogerdpack2@] Yes, it "should" just work, sorry for the run around in this case.
+ 402591 [lists@ru y- ] Am very much new to Ruby too. I'm learning ruby through a
+ 402608 [lists@ru y- ] I'm stuck on the new version at trying to do something very simple.
402968 [rogerdpack2@] are you referring to the windows explorer "right click in a folder ->
```