408207-409316 subjects 408622-408931

Confusin with Hash default
408427 [lists@ru y- ] I was doing some practice and play with Hash default value as written in
+ 408429 [matthew@ke w] Object references.
+ 408430 [lists@ru y- ] Humm.. Great catch.. Thanks for your help ;
| 408434 [mike@st k. a] Watch out using Hash.new([]) - you have to be aware of what it does.  It =
+ 408436 [lists@ru y- ] Thanks to all for your extraordinary helps... :))
+ 408456 [sto.mar@we .] The documentation is very specific about the difference between

Ruby Desktop Bot
408431 [lists@ru y- ] How can I make a ruby desktop application that can simulate keyboard and
+ 408432 [lists@ru y- ] What end-goal are you trying to achieve?
+ 408433 [lists@ru y- ] I want to make a bot to play a game for me, I rarely play the game but
  408435 [dummey@gm il] Ahh, I am going to sidestep the whole ethical part of the question and

How do I input a variable floating point number into Ruby Programs
408437 [lists@ru y- ] 28977682.9/x
+ 408438 [cliff.rosson] You just did. :)
+ 408439 [lists@ru y- ] I want to input the variable, which changes, from the console and
| 408443 [mike@st k. a] times.
| 408444 [mike@st k. a] times.
+ 408445 [lists@ru y- ] I get the following error message in Ubuntu Terminal
| 408446 [mike@st k. a] That means you don't have the highline gem installed, it is a little =
+ 408447 [lists@ru y- ] It runs but doesn't pause for a input. Here is the Terminal output
| 408448 [mike@st k. a] If you saved the program in weins.txt then try
+ 408449 [lists@ru y- ] IT WORKS! Thank you. I will give you credit.

Error in xoring elements
408440 [lists@ru y- ] Hey guys,
408441 [shortcutter@] Did you mean
408442 [lists@ru y- ] Thanks a lot, its working !

Running wordlist.rb code from "why's (poignant) Guide to Ruby"
408450 [lists@ru y- ] I am just starting Ruby as my first programming language. I have this
408451 [lists@ru y- ] Code_words = {
+ 408454 [rubytalk2dav] Well done!  That one can be a bit tricky to figure out on your own.
+ 408455 [me@wa to ho ] Just to hopefully clear this one up a bit, The Poignant Guide is
  408470 [lists@ru y- ] Thank you Dave! This makes sense now to me.
  408488 [sto.mar@we .] "Learn to Program" is a really nice book, but more addressed to
  408532 [lists@ru y- ] Thanks Marcus!

A working memory profiling solution?
408457 [lists@ru y- ] Dear All,
+ 408458 [shortcutter@] How exactly do you imagine "memory usage by methods" to be measured?  Are
| 408460 [lists@ru y- ] from withing a method or do you have a memory leak?
| 408464 [shortcutter@] For that wouldn't it be sufficient to monitor memory usage of the process
| 408469 [lists@ru y- ] It just came to me how I could easily describe what I want. It's the
+ 408465 [matthew@ke w] does it fall short?  This is the first I've heard of someone (besides
| 408471 [lists@ru y- ] First of all I have apologize for making it sound as if your solution
+ 408681 [rogerdpack2@] What doesn't work about it?
  + 408682 [lists@ru y- ] $ ruby-1.9.3-p125-gcdata test.rb
  + 408683 [lists@ru y- ] rvm reinstall 1.9.3 --patch railsexpress

Need help adding formatting while using "WriteExcel" for spreadsheet
408459 [ruby.student] I am putting together a simple program that basically reads some dated data
408486 [lists@ru y- ] Have you looked at this?
408496 [ruby.student] NOPE, but I will right now.

Ruby on Windows - Ouput char Fixnum on console
408461 [lists@ru y- ] It's my first post here, and I have some
408468 [phasis@gm il] The win32-api gem is not compatible with Ruby 2.0.0.
408491 [lists@ru y- ] - - - -

Sum method through while loops or iteration
408466 [lists@ru y- ] I am trying to create a sum method for an empty array, that will return
+ 408467 [mike@st k. a] return
+ 408472 [lists@ru y- ] irb(main):001:0> a = [1,2,3,4]
+ 408473 [jgabrielygal] You cannot compare an array to an integer. array > 0 doesn't make
| 408474 [lists@ru y- ] [].inject(0) {|total, x| total + x}
| 408476 [jgabrielygal] Good catch !
+ 408479 [tamouse.list] I applaud all efforts to learn how things work. That said, there is a
  408487 [sto.mar@we .] There's no need to use the each_index here at all!

Ruby docs in pdf format?
408475 [lists@ru y- ] I've searched Google for a while and cannot find the official docs in
+ 408478 [atma@co va e] And what do you mean by official docs?
| + 408481 [lists@ru y- ] Your contrary is a little contrived, my friend.
| + 408490 [sto.mar@we .] Probably what you get with `ri` or on ruby-doc.org ...
|   409216 [kiswono@gm i] how about .chm format? see: http://rubyinstaller.org/downloads/
+ 408480 [tamouse.list] Not really. Use calibre or some such to create PDF or other e-reader

A large list of ruby development resources
408482 [lists@ru y- ] 1. Reference, such as popular gems and tools
408502 [tamouse.list] nice :)

rails4 turbolinks question
408483 [uzleepito@gm] It's not specifically a Ruby thing, but a Rails4 Turbolinks one.
408503 [tamouse.list] You should direct this to the rubyonrails-talk list, if you haven't

SharpDevelop And Ruby
408495 [lists@ru y- ] SharpDevelop, I,ve searched google for some days but I couldn't find
408497 [echristopher] I was surprised to see on SharpDevelop's site that it does support

exec iterate through array
408498 [lists@ru y- ] error when running my sctipt... any help is greatly appreciated.
+ 408499 [matthew@ke w] Silly question, but does the user 'root'@'localhost' have LOCK TABLES
| 408500 [sduncan@we a] Aside from the sql permissions, I'm not sure you'll have much luck
+ 408504 [tamouse.list] mysqldump does not dump the INFORMATION_SCHEMA database by default.  mysqldump dumps
  408505 [lists@ru y- ] Thanks everyone

Using Ruby 2.0 TracePoint to simulate an abstract interface
408506 [lists@ru y- ] Inspired on a Metacast (http://www.metacasts.tv/casts/tracepoint), I

Find system package dependency on a gem
408507 [lists@ru y- ] Is there anyway to find the C library dependency when installing a gem

Sinatra/HAML/Neovigator multiple GET parameters problem
408509 [lists@ru y- ] I'm programming a Sinatra Web app based in Max de Marzi Neovigator

Linking with C++ but getting runtime error
408510 [lists@ru y- ] I have downloaded Ruby 2.0.0-p195 sources and built them on Windows
408542 [lists@ru y- ] Ok, so I figured out that the Makefile generated by win32/configure.bat

408516 [paul@th -m l] unsubscribe

Faster primality testing and factorization methods in Ruby
408517 [lists@ru y- ] I have created various implementations of methods to replace prime? and
+ 409217 [kiswono@gm i] $ ruby /tmp/primeszp.rb
+ 409218 [lists@ru y- ] I get the following, on an Ubuntu 64-bit VM (edited to fit the page
  409227 [kiswono@gm i] ah yeah, on 32-bit it's really-really slow.. (trying on my more powerful PC
  409233 [lists@ru y- ] First, thanks to all who have run my code on their systems.
  409243 [kiswono@gm i] $ ruby --version
  409289 [lists@ru y- ] I changed the Miller-Rabin in the gist to a shorter/faster/adjustable
  410359 [lists@ru y- ] Here is  a much faster, and more standard, method for doing primality

#!/usr/bin/env: No such file or directory
408518 [lists@ru y- ] I am new to both linux and ruby.  I am using Ubuntu and Ruby 1.9
+ 408519 [sduncan@we a] ...
+ 408520 [quangduongha] Shebang line should like "#! /usr/bin/env ruby" or "#! <path to your
| 408521 [r.crawfordwi] #!/usr/bin/ruby
+ 408522 [stu@ru yp og] !#/usr/bin/env ruby
| 408523 [stu@ru yp og] Well that's embarrassing. It's hash bang... I had reversed it while typing
+ 408548 [lists@ru y- ] Thanks for the responses.  I should have been a bit more clear about my UNIX skills.  Not great, but I can move around and set permissions and look at things like environment variables.  So I had already set things to execute.  I still can't see what is up.  Here is the code(again) and files and symbolic links & path & permissions
| + 408549 [sduncan@we a] ...
| + 408550 [zettabyte@gm] Change that to: #!/usr/bin/env ruby
+ 408551 [lists@ru y- ] I added /env  (and should have known better) and still get the same errors
| + 408552 [sduncan@we a] which env
| + 408553 [zettabyte@gm] $ ls -la /usr/bin/env
+ 408554 [lists@ru y- ] This works
| 408592 [stu@ru yp og] % ruby test.rb
+ 408598 [lists@ru y- ] I changed my text editor and it works.  Hidden characters?
| 408599 [mike@st k. a] It *might be* the line endings.
+ 408692 [lists@ru y- ] I suspect BOM.

port scanner additional features
408524 [lists@ru y- ] I was developing a port scanner script in ruby. I found some handy

Where did NtInitialize go?
408525 [lists@ru y- ] Various Ruby-C integration scripts found on the Internet mention a call
408546 [echristopher] suggests

Another Ruby-C Integration Question
408526 [lists@ru y- ] I am integrating Ruby with C++ on MS Windows 7 (using Visual Studio). My
408556 [ryand-ruby@z] On Jun 27, 2013, at 04:08 , Muhammad Ali S. <lists@ruby-forum.com> =
408876 [lists@ru y- ] Thanks for the response, Ryan! But it's not ruby_errinfo which is

Ruby 2.0 "invalid multibyte escape" in Regexp
408527 [lists@ru y- ] @data[:VR] = line[1].strip.gsub( /\xB6|\xFF/, '' )
408529 [lists@ru y- ] I think I've found a workaround, but it's not pretty, and I'm not sure

Designing a Cabinet class
408528 [lists@ru y- ] I'm a 6 month newbie to the Ruby programming language. I've been
+ 408530 [fluido@fl id] it is THE sound object-oriented direction to take: the cabinet holds
| 408533 [lists@ru y- ] Carlos,
| 408534 [fluido@fl id] You are mixing environments here. :belongs_to and :has_many are
+ 408531 [lists@ru y- ] @one, @two, @three
+ 408535 [lists@ru y- ] One option would a combination of Hash and Array...
+ 408557 [lists@ru y- ] So I decided to take Carlo's advice and make an effort to create a
| 408558 [fluido@fl id] To remove an item from an array, you have array#delete(object). But
+ 408559 [lists@ru y- ] puts drawer_contents.each {|item| puts item}
+ 408580 [tamouse.list] Good-o!
+ 408649 [lists@ru y- ] So here is my most recent work. I decided to completely set aside the
  408650 [jgabrielygal] Create a new class which contains the drawers. In the initialize

Ruby 1.8.7 patchlevel 374
408536 [shyouhei@ru ] Good day to release a ruby, no?

[ANN] Ruby 1.9.3-p448 is released (includes a security fix)
408537 [usa@ga ba ec] Now Ruby 1.9.3-p448 is released.

[ANN] Ruby 2.0.0-p247 is released (includes a security fix)
408538 [nagachika00@] Now Ruby 2.0.0-p247 is released.

[ANN] flickr_airlift 0.3.4
408541 [beholdthepan] *Like a pork shoulder - this repository begs to be followed and pulled.*
408581 [tamouse.list] Well played, sir.

[ANN] muack 0.7.0 released
408543 [godfat@go fa] ## Muack <https://github.com/godfat/muack>
408582 [tamouse.list] Clearly, this is the follow to the previous pork shoulder, or else
408587 [godfat@go fa] I have no idea which you're referring to, could you point it for me?

Mail mailread.rb
408544 [seti@tq ad a] On Ruby >= 1.9.x it is not.
+ 408583 [tamouse.list] rubygem mail seems to be the one to use nowadays. I'm unclear if it
+ 408619 [Reid.Thompso] i tend to use tmail
  408636 [seti@tq ad a] yes, that's a great gem, great test suite.

Error on installing Ruby 2.0.0 from source
408545 [lists@ru y- ] I am trying to install Ruby 2.0.0 from source on Red Hat 6.
+ 408584 [tamouse.list] Hmm, I just ran a source install and did not run into this, although it
+ 408698 [lists@ru y- ] I would not hesitate to ask directly the RVM maintainer about the
+ 408700 [lists@ru y- ] Uninstall old rubygems.
  408732 [lists@ru y- ] This fixed it!  For some reason it was calling back to the old

Where's this ruby feature documented? ...and the case of an accidentally discovered feature.
408547 [zettabyte@gm] So, while doing some random testing in an IRB session, I accidentally
408555 [justincollin] It was added in Ruby 1.9. It is mentioned somewhat in passing in the
408564 [zettabyte@gm] Sweet, thanks for the info! Glad to know when it was added and where it's

Find elment in array of hashes
408561 [lists@ru y- ] array = {:id=>1, :price =>0.25} # index[0]
+ 408562 [jstewart@fu ] Check out Enumerable#find.
| 408563 [lists@ru y- ] Thanks,
+ 408570 [shortcutter@] ruby <<XXXX
  408577 [lists@ru y- ] I am sorry, I did not understand what you tried to convey. To me it is
  408578 [me@wa to ho ] He means your example code did not produce and array.  Consider the
  408579 [lists@ru y- ] Walton,
  408588 [sto.mar@we .] No, that's still not an array of hashes, that's a couple of
  408590 [lists@ru y- ] Thanks,
  + 408591 [shortcutter@] Nobody will be able to understand your conclusion in absence of the real
  + 408595 [sto.mar@we .] Of course, when your actual hashes use strings as keys,

Re: Find element in array of hashes
408565 [lists@ru y- ] "3" is not the same as 3
408566 [lists@ru y- ] results = @selectedProductsArray.find {|k,v| v[:id] == 3 }
+ 408567 [lists@ru y- ] results = @selectedProductsArray.find {|e| e[:id] == 3 }
+ 408568 [lists@ru y- ] I know it is an array, but inside the array there are two hashes. And
  408569 [lists@ru y- ] How about this?
  408576 [lists@ru y- ] Joel,
  408593 [lists@ru y- ] It's worrying that so many people who put their code problems on here
  + 408594 [sto.mar@we .] At least as worrying is that people attach jpg(!) screenshots of text.
  + 408596 [shortcutter@] Well, maybe someone told them that c&p is bad in programming...
    408597 [matthew@ke w] Taking DRY to the extreme...
    408602 [lists@ru y- ] Sorry guys for not Copyind and Pasting. But at the same time I am so
    408603 [sto.mar@we .] We're always trying to be helpful  :)

Best practice to use Enumerable#Sort and Enumerable#Sort_by
408571 [lists@ru y- ] a = [
408572 [wishdev@gm i] The #sort_by block tells the engine which field to use when sorting an item.
408573 [lists@ru y- ] Thanks for your feed back. Why #sort_by here is faster?
408585 [tamouse.list] You can't go by real time -- you system could have been doing something

[ANN] minitest 5.0.6 Released
408574 [ryand-ruby@z] minitest version 5.0.6 has been released!

[ANN] gauntlet 2.0.2 Released
408575 [ryand-ruby@z] gauntlet version 2.0.2 has been released!
408586 [tamouse.list] (Thanks for all you seattlerb'ers do!)
408687 [ryand-ruby@z] On Jun 28, 2013, at 19:24 , Tamara Temple <tamouse.lists@gmail.com> =

[ANN] Confed Brazil 2013 - From Plain Text Fixtures to Structured Data and HTTP JSON APIs in Minutes
408589 [gerald.bauer] I've updated the plain text football.db fixtures for the

Readline differences from 1.9.2 to 1.9.3?
408600 [lockwood.bry] #!/usr/bin/env ruby
408601 [mike@st k. a] Are you on OS X?

variable names not allowed "?" and "!" but method name does - why?
408605 [lists@ru y- ] We can write a method name as foo! or foo?; but not the same with
408606 [matthias@wa ] ...
408607 [lists@ru y- ] I understand only *English* :).. so the attached script is not helpful for me  :(
408615 [sto.mar@we .] @Love U Ruby: ???   It's only a couple of lines of code.
408641 [matthias@wa ] Sorry ... I wanted to make sure that the UTF-8 stuff is transported
408644 [lists@ru y- ] I am getting error :-

Help needed drawing a Sudoku board with green shoes
408608 [ruby.student] I am planning to write a Sudoku program just for the learning experience.
+ 408614 [ashbbb@gm il] I'm not sure this is the solution you are looking for. But try it out. ;-)
| 408618 [ruby.student] ashbb,
+ 408660 [lists@ru y- ] i thought i had 'translated' my shoes sudoku over to green shoes, but
  408722 [ruby.student] Jake,

no such file to load -- rest_client
408609 [lists@ru y- ] I use ruby in cloudfoundry.but recently got a error in a

[ANN] color 1.4.2 Released
408610 [austin@ru yf] color version 1.4.2 has been released!
408612 [ryand-ruby@z] MY ONE USER! :P

[newbie] Having trouble updating a Ruby gem
408611 [admin@me as ] to ask it, please let me know (or forward). Thanks!
408706 [admin@me as ] but my Apache config was actually pointing to an old copy of the app

[ANN] Invoker - 0.1.1 release, A gem for managing processes in development environment
408613 [hemant@co em] Invoker is a gem for managing processes in development environment. You can

How to get the User_logged in windows with Sinatra
408616 [lists@ru y- ] I need to know the user that is accessing the intranet i created with
+ 408781 [lists@ru y- ] In the server I'm running Ruby 1.8.7, Sinatra and Thin
| 408857 [echristopher] I'm not sure I understand. You want to get the *Windows* username of the
+ 408867 [lists@ru y- ] Yes like... for example in IIS when enabling Windows Authentication
  408878 [ryan@ra to m] I have explored this as well, you'll need to use a web server like

ANN: Sequel 4.0.0 Released
408617 [lists@ru y- ] Sequel is a lightweight database access toolkit for Ruby.

including FileUtils::Verbose crashes Marshal.dump
408620 [lockwood.bry] This is a bug I ran into today. I'm not sure who's responsible for =
408621 [joelvanderwe] That example[1] seems to have been written with brevity in mind. It's ok
408647 [shortcutter@] $ ruby x.rb