381362-383487 subjects 381822-383133

Re: JRuby 1.6.1 released
381619 [chauk.mean@g] Great work.

Get the real object in a Hash key
381622 [ibc@al ax ne] h = {}
+ 381623 [shortcutter@] This is a special optimization for unfrozen Strings as Hash keys.
| 381626 [ibc@al ax ne] Oopss, if I freeze the string before inserting it as Hash key it
| 381632 [shortcutter@] Exactly.  And you don't want to do it.  A Hash is an associative
| + 381636 [ibc@al ax ne] Yes, that seems a good solution.
| + 381637 [kevin.mahler] Well you may want to do it -- that's why Hash#assoc exists. Hash keys
|   381643 [shortcutter@] I did not argue against complex keys.  The issue is with *mutable*
|   381652 [kevin.mahler] You said "And you don't want to do it." In fact doing it has its uses.
|   + 381695 [shortcutter@] Please do not quote out of context: that was referring to the example
|   + 381700 [ibc@al ax ne] I've coded a parser for SIP (similar to HTTP). The parser generates a
|     + 381703 [josh.cheek@g] You don't have to have a hash to implement a hash interface. How about
|     + 381704 [shortcutter@] Now it gets interesting. :-)
|       381706 [ibc@al ax ne] Thanks to both. However the SIP parser is already done. I've coded it
+ 381701 [jakekaiden@y] request = Hash.new{|key, value| key[value] = []}

Looking for a new project? How about JSYNC for Ruby.
381628 [transfire@gm] Ruby lacks a solid JSYNC library. If anyone is looking for a good
381647 [jgabrielygal] Looks like an interesting project, and I would love to contribute, but

[ANN] filename 0.1.0 released
381630 [ d@yt k. nf ] filename 0.1.0 has been released.

Extract a range i.e. svr[100..130] ?
381644 [skolopen@ya ] What best method could extract the range of a given list of servers?
+ 381646 [jgabrielygal] Sorry, if I didn't understand this well. You have a string containing
+ 381657 [skolopen@ya ] This is a definite step in the right direction and I appreciate your
| 381658 [bbxx789_05ss] ...and so what have you tried given the above?
+ 381660 [skolopen@ya ] undefined method `match' for ["svr[100..103].domain.local"]:Array
| 381671 [jgabrielygal] This is because you don't have a string, you have an array. If you
+ 381663 [skolopen@ya ] it might be that my loop is wrong, ill investigate further, thank you
+ 381669 [skolopen@ya ] 7stud,
| 381797 [bbxx789_05ss] puts RUBY_VERSION
+ 381673 [skolopen@ya ] array.
+ 381674 [skolopen@ya ] Here is what i am trying to do.
  381675 [jgabrielygal] split returns an array

improve query
381645 [naina.sydney] below query is giving very long output. Can anyone please let me know if
381649 [naina.sydney] Here is a part of the output of the query, I am looking at improving

[ANN] Executable 1.0
381648 [transfire@gm] Just released Executable v1.0. Executable lets you turn any class into

Re: Extract a range i.e. svr?
381651 [bbxx789_05ss] str = "svr[100..130].domain.local"

[ANN] Rails 3.0.7.rc2
381655 [santiago@wy ] ZOMG I've pushed 3.0.7.rc2 to rubygems.

instance_eval trickiness
381664 [bbxx789_05ss] I think instance_eval() is the trickiest of the eval's to understand.

Problem with displaying command line outputs
381668 [ks1911shoote] I am trying to run some tests, which utilize test::unit. Aside from the
+ 381924 [ks1911shoote] I tried a few more approaches, but they don't work either. I have an .rb
+ 381925 [jakekaiden@y] don't know if this will work in your case, but i've found when doing

chomp behaviour
381677 [angel_steel@] Using 1.9.1
+ 381678 [oscartheduck] What are you trying to accomplish? Bear in mind that, on the command line,
+ 381679 [roylzuo@gm i] ``echo "abc"`` outputs "abc\n", try this instead
+ 381680 [whitequark@w] "gets" returns the whole read string, with trailing newline ("\n").
+ 381681 [mike@st k. a] abc

how to count values in an array using 1.8.6 ?
381682 [skolopen@ya ] How can I count all keys in an array?
+ 381683 [roylzuo@gm i] How about
+ 381692 [dominikh@fo ] I can't quite see what the problem is here.
+ 381693 [ibc@al ax ne] Why??

Mp4 encoding gem?
381690 [will.dl.munn] I'm writing an audio encoding application, I need to encode wav files to
381705 [spoon@ki le ] Not quite what you asked but ffmpeg is solid.  Converts pretty much

Let Ruby read the serial port
381694 [superpelican] I would like to read a serial port. I'm going to connect want to connect
+ 381721 [b.candler@po] Which platform are you running under?
| 381722 [sophrinix@gm] Make sure you have the baud and port number correct.
+ 381726 [josh.cheek@g] Almost a year ago I used http://rubygems.org/gems/serialport successfully on
+ 381780 [regis.aubare] require "mscorlib"

For loops trouble
381710 [zaldivar1841] I am trying to translate a program I have in Java into ruby and having
+ 381711 [josh.cheek@g] numbers = *1..10
| 381712 [josh.cheek@g] I guess, depending on your needs, you might want the index as well, in which
+ 381717 [bbxx789_05ss] a = [2, 4, 1, 9, 6]
+ 381718 [cmdicely@gm ] for (int i=0; a[i] < x; i++) { ... }
+ 381733 [botpena@gm i] there are many ways.

[ANN] Slop 1.5.0
381714 [lee@ja vi .c] Slop

Making a simple parser
381716 [balbif@gm il] To automate some of the tests I have to run, I decided to use ruby to
+ 381739 [bbxx789_05ss] 1)
+ 381750 [jakekaiden@y] well, i don't know how many possible input types you have, but if
| 381751 [balbif@gm il] Initially I thought about taking this approach, but frankly I don't
| 381762 [jakekaiden@y] a very good point - and really what inheritance is for.  good luck
+ 381770 [jgabrielygal] The above doesn't work, because the @children inside the instance
| 381874 [balbif@gm il] aaa, you're right :-) Good point.
+ 381791 [bbxx789_05ss] I'm pretty unclear about what you are trying to do, but maybe this will
  381796 [bbxx789_05ss] And you can get around that problem by letting InputFormat#parse create

Released Win32::Screenshot 1.0.3
381724 [jarmo.p@gm i] I've just released the Win32::Screenshot 1.0.3 gem.

Released WatirSplash 1.2.0
381725 [jarmo.p@gm i] I've just released the WatirSplash 1.2.0 gem.

Understanding the return method
381727 [fs_tigre@ho ] As always, I'm asking simple questions sorry.
+ 381728 [ibc@al ax ne] A ruby method always returns the last object or expression it calls
+ 381730 [vmanis@te us] Don't be sorry, questions need answers :).=20
+ 381731 [jakekaiden@y] hey fily -
+ 381732 [jakekaiden@y] while i was answering your post, vincent answered it much better than
| 381736 [bbxx789_05ss] There's no need to delete your post when someone answers ahead of you-even if you give the exact same advice.  That sort of thing happens all the time.   And sometimes hearing an explanation from a fellow beginner will make more sense than an answer from an expert.
| + 381741 [vmanis@te us] happens=20
| + 381746 [ibc@al ax ne] Sure. In fact, sometimes is really interesting (at least for me) to
+ 381735 [fs_tigre@ho ] Beautiful, got it, thank you all very much for your help, it feels good
+ 381745 [fs_tigre@ho ] All you guys are awesome... thats all I can say

getting error when running rdoc
381738 [pedzsan@gm i] I thought I would past this hear because I don't know if it is an rdoc

Telnet "More?"
381742 [erictetz@gm ] I'm trying to use the telnet library. I don't know Ruby AT ALL
+ 381747 [cmdicely@gm ] It looks like the server is sending something other than the default
| 381761 [erictetz@gm ] Yes, but I'm wondering *why* this happens with the Ruby client. It's
+ 381756 [bbxx789_05ss] Which function are you referring to??
| 381760 [erictetz@gm ] That would be (I thought) the 'out' lambda, but as Christopher
| + 381767 [cmdicely@gm ] Methods (like blocks) aren't objects, though (like blocks) they can be
| + 381862 [bbxx789_05ss] Ahh, I see.
+ 381763 [invalid@in a] I was able to reproduce your problem in Ruby 1.9.2 but not 1.8.7, against an
| 381764 [invalid@in a] I should have written @telnet_option.... not @telnet_options
+ 381831 [b.candler@po] t.cmd is really shorthand for t.puts followed by t.waitfor
| 381857 [invalid@in a] But I found that his code *does* work in 1.8.7 but not in 1.9.2, so it's not
| 381860 [markus@fi ch] Is it maybe a similar issue I faced with Sinatra recently [1]? In 1.9
+ 407232 [lists@ru y- ] solved. the reason is ruby net/telnet library use error newline
  407296 [jlambert@oh ] That's not a bug.  CR+NUL is correct.
  407328 [lists@ru y- ] I captured the network packages of the telnet process of python and

How to implement a music playlist player in Ruby?
381743 [bikudaa@li e] I am fairly new in the music/playlist related programming. I want to
381744 [jakekaiden@y] i don't really know anything about implementing this in a webpage -

Re: To Yield or Not to Yield: An Inferable Question
381752 [b.candler@po] 1. In my experience, very little real-world Ruby code uses
381754 [adgar@ca bo ] ...
+ 381771 [ryand-ruby@z] note
+ 381783 [b.candler@po] Ah, by "optionally" I think you mean "does one thing when a block is
+ 381906 [b.candler@po] However there are some cases where this is done unnecessarily,
  381954 [adgar@ca bo ] yield c=20
  381989 [b.candler@po] You are of course right in your analysis.
  381994 [shortcutter@] The standard and core libraries are full of those (File.open,
  382015 [b.candler@po] I'd forgotten about File.open with a block. That *is* good.

381753 [jkconley@gm ] require 'rubygems'

Undefine Method Only Marks the Method Undefined
381755 [zhangsu@li e] According to the book Programming Ruby by Dave Thomas, "an
+ 381757 [adgar@ca bo ] The difference between undef_method and remove_method is, as you
+ 381758 [josh.cheek@g] I assume because the intuition is that undefining a method on an object
+ 381759 [zhangsu@li e] Thank you - Michael and Josh, now this makes perfect sense to me. It's

[ANN] Mechanize 2.0.pre.2
381766 [drbrain@se m] mechanize version 2.0.pre.2 has been released!  Please test this release =

Tail Call Optimization (Tail Recursion)
381768 [cmhoward@fr ] I did some googling to find out if Ruby supports tail call optimization,
+ 381787 [bbxx789_05ss] Couldn't you test that by creating two recursive functions: one with a
| 381790 [w_a_x_man@ya] def fib n, a = 0, b = 1
| 381798 [default@sp r] it seems like fib(50000) is not only too big for MRI ruby, but also Python
| + 381803 [w_a_x_man@ya] I'm surprised that they are still working. Gambit Scheme takes
| | 381842 [default@sp r] and they still are ;)  as I was not using the same implementation of fib...
| | 381887 [w_a_x_man@ya] ;;  Gambit Scheme
| | 381888 [w_a_x_man@ya] def fib n
| | 381917 [shortcutter@] Just for the fun of it a version with a Hash as "function" for faster
| + 381806 [vmanis@te us] Python
|   381808 [steve@st ve ] Guido has said that any interpreter that implements TCO is not Python.
|   381811 [vmanis@te us] I recall that quote, and it totally mystifies me. Of course, he IS BDFL, =
|   + 381813 [adgar@ca bo ] recursive procedure, but simply invoking another method, and thus using =
|   + 381851 [steve@st ve ] He makes a sensible argument, it's just not the particular set of tradeoffs
|     + 381852 [b.candler@po] Of course you will then lose the backtrace. Also, stack is cheap to
|     | 381855 [steve@st ve ] There are techniques to retain a backtrace, even with TCO.
|     + 381858 [code@ap th o] That occurred to me as a possible reason for making the statement Guido
+ 381789 [steve@st ve ] There's a flag that you can enable to turn it on.

rspec-2.6.0.rc2 is released!
381769 [dchelimsky@g] We're releasing rspec-2.6.0.rc2 as a release candidate as there are some internal changes that we'd like to see put through their paces before doing a final release. Note that the changes I speak of are internal. There are no new deprecations in this release, nor any backward-incompatible changes.

Rakefile and simplecov
381774 [markus@fi ch] I've a Rakefile generated by jeweler. It uses rcov default but that
381786 [steve@st ve ] I'm not super familiar with simplecov, but i just merged a patch that
381793 [markus@fi ch] Thanks, that helped at least get some result. However the coverage

Using the win32api
381775 [bourinax@yo ] I'm trying to use the win32api, in the Sketchup ruby API. then loading
+ 381799 [luislavena@g] ingRuby/html/lib_windows.html.
+ 381832 [bourinax@yo ] re,
+ 381839 [bourinax@yo ] solution : require 'Win32API' :)

net-ssh - execution expired
381779 [simon@li un ] i'm having a problem with net-ssh. i'm trying to run a command on
385653 [jp.billaud@g] Hey,

Need for speed -> a C extension?
381781 [mail@ma sh .] The below code is too slow for practical use. I need it to run at least
+ 381784 [cremes.devli] I pasted the code into a local file and ran it. It completed instantly.
+ 381785 [shortcutter@] Can you be a bit more specific about the slow part or even extract a
+ 381788 [w_a_x_man@ya] Please give a clear description of the algorithm, and then
| 381792 [mail@ma sh .] Here is a working version of the code that can be profiled (though it
| 381794 [ryand-ruby@z] least
| 381836 [mail@ma sh .] They bottlenecks are the iteration over the sequence (while loop at line
| + 381840 [shortcutter@] Frankly, I find your code has a design issue: it seems you mix data
| | 381846 [mail@ma sh .] I am not sure if I understand this. I have tried to copy the behavior of
| | + 381854 [shortcutter@] Maybe on the interface, but you create side effects on the String (Seq
| | + 381856 [shortcutter@] Sorry for the half message, thick fingers hit the wrong key accidentally.
| + 381849 [brabuhr@gm i] What exact version? what platform? how was it installed?
|   381853 [mail@ma sh .] $ uname -a
|   + 381869 [brabuhr@gm i] b/inline.rb:51:in
|   + 381878 [brabuhr@gm i] $ uname -a
|   | 381894 [mail@ma sh .] I keep a log of the ruby compile. It looks like it was build under
|   | 381920 [brabuhr@gm i] Oh, okay.  I wanted to check since your uname above said "10.7.0".
|   | 381921 [brabuhr@gm i] I'm not sure about RubyInline
|   | 381922 [mail@ma sh .] $ ruby -d j.rb ->
|   | 381923 [brabuhr@gm i] "Exception `ArgumentError' at
|   | 381926 [mail@ma sh .] I reverted to ruby 1.9.1p129
|   | + 381928 [cmdjackryan@] If you still have the log for your Ruby compile lying around (and the
|   | | 381956 [echristopher] I just remembered something I heard on IRC the other night, that Ruby
|   | + 381930 [brabuhr@gm i] "This abstract class provides a common interface to message digest
|   |   381931 [brabuhr@gm i] $ cd ext/digest/
|   + 381972 [colinb2r@go ] I hesitate to suggest this, given that if you've compiled and
+ 383269 [mail@ma sh .] Sorry guys, I have been busy with a few other things before continuing
  383274 [shortcutter@] I am referring to http://pastie.org/1808127 : The issue with the code

Rspec Before/After All/Each order of operation
381782 [donvnielsen@] I'm using Rspec for testing.  I'm seeking confirmation of the
381885 [rogerpack200] maybe repost to the rspec group? They're usually quite responsive.

[ANN] Rails 3.0.7 has been released!
381801 [aaron@te de ] wasn't AMAZING enough already, I've decided to make it even better by relea=

Hook into rake for reporting results
381802 [milki@re co ] I'm building an integration tool between software projects and issue
+ 381804 [steve@st ve ] If I was you, I'd look at the code for minitest and or simplecov/rcov.
| 381848 [milki@re co ] I can understand the suggestion for minitest, but simlecov/rcov are
| 381850 [steve@st ve ] help with determinining test results?
+ 381805 [mikaa123@gm ] I guess you could simply analyze the output of a `rake test` task.
  381847 [milki@re co ] I think this could work, but I'm not sure if it would destinguish

[ANN] pg 0.11.0
381807 [ged@Fa ri MU] Version 0.11.0 of pg, the PostgreSQL database driver, has been released.

Re: Using the win32api/Open file
381809 [wirachmatc@l] ...

4 RoR Developers Needed + FREE Bacon!
381810 [lwarrenii@gm] I=92ll be brief! I have 4 open RoR Developer positions working out of
381818 [percent20@gm] Not really interested in the positions, but how do we get the bacon?
381827 [shortcutter@] Cheers
381859 [code@ap th o] =2E . . and: do I need to go to Virginia to get it?

Win32OLE word objects
381812 [yo_la_trante] I'm fairly new to Ruby (and coding in general)and I'm having problems
+ 381814 [rubfor@re it] I would have thought you could use your VBA code more or less verbatim.
+ 381819 [yo_la_trante] Thanks, sometimes it's the simple answer. The link to this file really

effect of variable
381815 [jimsyyap@gm ] I am a total noob when it comes to programming. These last few days, I
+ 381816 [sduncan@we a] Put the text variable back in, and try this at the end after the puts
+ 381817 [adgar@ca bo ] Yep - that was there in case you wanted to use the actual text of the
+ 381889 [jimsyyap@gm ] thanks!

help me on this ruby programm
381820 [sree253@gm i] Write a program to create employee record with configurable number of
+ 381821 [vmanis@te us] That sounds like an exercise in a programming course. I'm sure many of =
| 381823 [sree253@gm i] i want to know, i want to create a class with above objects and pass the
| + 381825 [vmanis@te us] What code have you written so far?
| + 381861 [code@ap th o] =20
|   381882 [vmanis@te us] to
+ 382424 [color.circle] would be better if you read the book