300930-318954

300767-305330 subjects 301135-304473

^ Help with net-ssh 2.0
300930 [jrajaram gma] I am trying to use net-ssh for executing unix level commands using

^ problem cross compiling ruby 1.9
300938 [maurice.enci] /Desktop/ruby-1.9.0-0# make
300945 [maurice.enci] And what about this?

^ Getting pipe return codes from SYSTEM command
300939 [russell spoi] I'm trying to find the return codes from bash for piped commands. i.e.
+ 300940 [ara.t.howard] you cannot.  this is a bash limitation.
| 300941 [russell spoi] Thanks for the reply. But there is a pipestatus array in bash isn't
| + 300949 [albertschlef] try 'ls | echo; exit ${PIPESTATUS[0]}'
| | 300959 [russell spoi] Magical! thanks :)
| + 300952 [ara.t.howard] that's because you've lost the bash process by the time bash exits.
+ 300944 [albertschlef] If you're using bash then it has an shell variable that records the exit

^ Check if char in string?
300951 [skanemupp ya] str = "you muppet"
+ 300953 [shevegen lin] str = "you muppet"
| 300964 [skanemupp ya] do this
+ 300956 [stefano.croc] Stefano
| 300958 [sandro.pagan] !("ciao" =~ /i/).nil?
+ 300968 [matt tidbits] if str =~ /y/
  300978 [skanemupp ya] but none of that is what i want to do.
  + 300982 [vjoel path.b] Try the suggestion, you may be surprised :)
  + 300984 [dan danfinni] The expression he gave uses the =~ operator, not the == operator.  It will
  + 300988 [matt tidbits] Try it!
  + 300989 [caduceass gm] Along with the other suggestions, it might help you to read up on
  + 300999 [redwiz inwin] ok, you don't know regexp
    301004 [skanemupp ya] but
    + 301006 [vjoel path.b] str =~ /[aeiouy]/
    + 301007 [TimHunter nc] if str =~ /[aeiouy]/
      301013 [caduceass gm] Get a good book on regular expressions.  Trust me, it will seriously
      301017 [caduceass gm] Hmm..hmm (cough).  I was talking to globalrev, not Tim :/
      301036 [skanemupp ya] if str[x].chr =~ /[aeiouy]/
      + 301038 [phasis gmail] if str[x].chr !~ /[aeiouy]/
      + 301048 [allergic-to-] if not str[x].chr =~ /[aeiouy]/ then print "YO\n" end
      | + 301057 [colinb2r goo] If you are only testing if a single character is in a string 'aeiouy'
      | | 301105 [skanemupp ya] ty all for the help. haesob park did what iw anted.
      | | 301112 [phasis gmail] if str[x].chr !~ /[\saeiouy]/
      | | + 301150 [caduceass gm] T24gVGh1LCBNYXkgOCwgMjAwOCBhdCA4OjEyIEFNLCBIZWVzb2IgUGFyayA8cGhhc2lzQGdtYWls
      | | + 301156 [skanemupp ya] book Kalle
      | |   + 301180 [adam.shelly ] It's all in the book...
      | |   | 301236 [skanemupp ya] is there some equally clever way to replace decode?
      | |   | 301237 [phasis gmail] code.gsub(/([^\saeiouy])o([^\saeiouy])/){$1==$2 ? $1 : $& }
      | |   + 301181 [caduceass gm] T24gVGh1LCBNYXkgOCwgMjAwOCBhdCAxMToxMCBBTSwgZ2xvYmFscmV2IDxza2FuZW11cHBAeWFo
      | + 301061 [ashutosh.amb] On May 8, 11:27 am, Jim Cochrane <allergic-to-s...@no-spam-
      + 301056 [robert.dober] Almost seems that you try to prove Robert's theory :(

^ Re: Rails gem site seems borked.
300960 [sonny.chee g] Hey Eric,
301253 [sonny.chee g] Okay... I finally fixed my problem by installing the Linux 64 bit
318938 [mauro.gerens] Since I'm junior in Linux, can you please help me installing 64 bit
318954 [sonny.chee g] I'm no Linux install guru, Meir.  But Google, is your friend (and mine.)

^ precedence of single-line rescue and assignment
300966 [matt tidbits] def boom
300987 [matt tidbits] I think what's really going on here is that what we often see described
300993 [albertschlef] But if `y += boom rescue "fine"` indeed translates into `y += (boom
300996 [jens.wille u] no, it evaluates to '(y += boom) rescue "fine"'. the '+=' binds
301000 [matt tidbits] Right, that's what I said. The mystery is why
+ 301005 [jens.wille u] well, maybe yes. the pickaxe even lists them all as having the same
+ 301023 [robert.dober] And worse
  301034 [matt tidbits] If we think this might be a bug, how do I report it? m.
  301035 [matz ruby-la] I recognized the problem.
  301041 [matt tidbits] Wonderful, thanks! m.

^ hash adding values
300967 [tim.wolak gm] I'm trying to insert account numbers into a hash and add the balances
+ 300972 [sepp2k googl] Yes, there is: String#+ does not expect an array as an argument.
| 300973 [tim.wolak gm] So would it be easier converting it to a string or have the hash hold
| 300975 [cdemyanovich] Oh, you want to store the balances based on the acct. #, then you want to
| + 300976 [tim.wolak gm] Yes, I need to take the accounts that have the same number and leave the
| | 300981 [cdemyanovich] I posted some code just before you replied. Did it help?
| | 300985 [tim.wolak gm] {}
| | 300997 [rabbitblue g] Hash.new { |hash, key| hash[key] = Array.new }
| + 300977 [cdemyanovich] Something like this?
|   300980 [tim.wolak gm] I'm pretty new to ruby as well.  I have the following and its saying
|   300986 [cdemyanovich] Looks like you forgot to change this line
|   + 300990 [tim.wolak gm] Still get the same thing, sorry I must be doing it wrong...
|   + 300995 [s.korteling ] You mean the block form: Hash.new{ [] }
|     300998 [tim.wolak gm] Siep,
|     + 301002 [koflerjim ma] Could you use Hash#collate (together with an Array#sum method) for this?
|     + 301003 [s.korteling ] You're creating a different hash for every line. You probably want one
|       301009 [gthiesfeld g] Did you have a look at the code I posted a few weeks ago for this?
+ 300974 [cdemyanovich] According to docs for Hash.new, you're initializing the Hash and telling it

^ [FA] 1 Registration for RailsConf
300994 [mgregory22 g] I registered for O'Reilly RailsConf, but I can't make it, so I'm

^ rcov segmentation faults on Debian and Ubuntu (not on OS X)
301001 [stephen bend] This has been driving me nuts and I've spent too much time on it.

^ FasterCSV
301008 [kriswindham ] I am wanting to use faster_csv to read two csv files and
301012 [james graypr] require "rubygems"
301015 [kriswindham ] That helps immensely.

^ [ANN] Rawr 0.3.1 Released
301014 [james.britt ] Rawr 0.3.1 has been released.

^ Is rcov stable? (was Re: rcov segmentation faults
301018 [stephen bend] Now I'm getting [BUG] rb_gc_mark(): unknown data type 0x0(0x2a064b8) non
301019 [stephen bend] Is rcov stable? (was Re: rcov segmentation faults
301021 [cmdjackryan ] What do RCov's tests say? Do they segfault, too?
301027 [stephen bend] Thanks for the pointer, and thank you for taking the time to respond.
301069 [cmdjackryan ] Not on the OSes I have used. None of those are Mac OS, though.
301127 [stephen bend] Thanks again for your time Phillip!

^ Ruby Gems ERROR:  could not find rush locally or in a repository
301028 [bparanj gmai] I am on Leopard and when I do sudo gem install rush I get the above
301032 [bparanj gmai] gem sources -r http://gems.github.com/

^ "Real" Differences Between Python & Ruby
301029 [maxcantor gm] I have a question about the difference(s) between Python and Ruby.  I
+ 301031 [martindemell] One often-overlooked point is the design of the standard library. For
+ 301033 [avdi avdi.or] First of all, you seem to be coming at it from the assumption that
+ 301197 [skanemupp ya] dsl as in?
  + 301217 [cmdjackryan ] Domain Specific Language.
  + 301296 [shevegen lin] I could not really continue.
    + 301299 [robert.dober] Really? Python just stands all the time in my way, ok it is the Ruby
    + 301302 [dblack rubyp] Also, a quirk can only be measured in relation to something non-quirky
    + 301305 [maxcantor gm] My usage of the term "quirk" was never intended to be derogatory.  To
      + 301306 [avdi avdi.or] It is?
      | 301311 [maxcantor gm] Is there another language out there that lets you pass a "literal"
      | + 301315 [robert.dober] Of course, with minor syntactic change. It's called Smalltalk IIRC ;)
      | + 301316 [adam.shelly ] well except for the ||, what about c?  Assuming an 'Object' struct has
      + 301348 [ttmrichter g] I'm not sure that this is a meaningful question.  What problems did any
        301349 [znmeb cesmai] Actually, I think it's Turing and Von Neumann that were obfuscated --
        301352 [ttmrichter g] =20
        + 301367 [eleanor game] Which of course drives home the point that all languages are about
        | 301369 [ttmrichter g] Oh, definitely.  I'm not saying that said abstractions and layers are a
        | 301420 [smparkes smp] I am also beginning to really enjoy Erlang's approach to =
        + 301386 [znmeb cesmai] Again, I have to plead ignorance on Turing's contributions to practical

^ How to get to the beginning in irb
301043 [flexaxis gma] I am using OSX. I am using terminal and I use irb. After typing
301046 [bulliver bad] Not sure of a list but 'home' and 'end' are working for me to get to the
301047 [vjoel path.b] If those don't work, try Ctl-A and Ctl-E.
301086 [flexaxis gma] Awesome.

^ Re: Event handling
301045 [banditgsf600] class Cow
301050 [shawn42 gmai] This seems like a decent approach; maintaining a list of listeners and
301059 [george nutru] You can also have listeners register blocks to certain events instead
301158 [banditgsf600] Thanks, I'll check both of the suggested techniques.

^ to check for numericality
301049 [sijo maxxion] I have
+ 301054 [bbxx789_05ss] data = ["00", "aa", "0a", "a0", "02"]
| 301060 [sijo maxxion] Thanks for your reply It worked.At first I tried like
+ 301055 [farrel.lifso] @val = someValue if ( Integer( someValue) rescue Float( someValue )
  + 301062 [colinb2r goo] Well that's two (or three) very useful things I didn't know.
  | 301088 [robert.dober] Sure is ;) you will know that it is an Integer. But I guess you do not
  | 301114 [albertschlef] 'Float' is a class, ins't it? So how can you do "Float(whatever)" as if
  | 301118 [decoux moulo] Because you use it like a method, i.e. you have added () after it
  | 301128 [albertschlef] I see.
  + 301176 [_mwryder wor] How would you fix this so it would work for valid numbers such as
  | 301185 [cmdjackryan ] You just failed i18n. 1.234,56 is a Continental European way to express
  + 301177 [ara.t.howard] simply use 'Float(value) rescue false'

^ Re: rdoc 2.0.0 Released
301071 [larsch belun] I filed it at RubyForge, including another regarding links in the

^ initial stages of scripting
301072 [tardis.tardi] charset="iso-8859-1"
+ 301073 [ttmrichter g] ear 11 project at school, it is necesary for me to program a maths utilit w=
| 301080 [tardis.tardi] charset="utf-8"
+ 301075 [shevegen lin] puts("What is #{num1} + #{num2}/?")
| 301083 [tardis.tardi] If I were to pursue this line of logic, how would I allow the break to have
+ 301077 [eleanor game] I hope the following answers are helpful. The idiom that you'd be
  + 301079 [eleanor game] 1..20.inject(0) |sum, question|
  + 301081 [tardis.tardi] Thanks for the suggestions, but as is evident from this code - I believe - I
    301120 [eleanor game] Well I didn't want to ruin your homework assignment for you so I sort

^ Re: In order to cross platform, Ruby is designed to be interpreted in runtime, so Ruby code is expos
301076 [shevegen lin] Totally agree with you. :)

^ Executing SQL Query through ruby using winole32
301078 [anukul.singh] require 'win32ole'
+ 301191 [jacclapp gma] output = database.ExecuteWithResults('Select * from dbo.tLNPOrderStatus')
+ 301193 [globyy3000 h] Just out of curiosity, is there a specific reason you're using win32ole?
| 301256 [anukul.singh] Mac,
| 301310 [globyy3000 h] Which SQL server are you working with?
+ 301324 [masaki.suket] Sorry, I don't know how to execute a query using SQLDMO.SQLServer,

^ segmented method names
301084 [hegewald irm] charset=US-ASCII;
301098 [sandro.pagan] #function
301103 [rick.denatal] And in Ruby 1.9 you can also use the new hash literal syntax in the
301250 [nobu ruby-la] You forgot a comma between first value and y:.
+ 301271 [hegewald irm] thank you for all the suggestions. The Hash solution seem to be a =20
+ 301276 [rick.denatal] You are correct of course, thanks.

^ A computer science book to learn about interpreter, VM etc
301087 [flexaxis gma] I learned HTML and then I learned programming. Have been a JAVA
+ 301113 [cmdjackryan ] from this object code (C) / byte code (Java) / Intermediary Language (.NET).
+ 301125 [eleanor game] It's probably out of print, but 'Programming Languages - An
+ 301142 [boss airblad] If you're familiar with Java, you should be able to make good progress
+ 301175 [chris.hulan ] ...

^ Any reason why this code should not work - The Ruby Way, p270
301089 [victor.reyes] I lifted the following code from The Ruby way and tried to use it.
+ 301093 [jan.svitok g] -             self.each{|x| k[x]+1 }
| 301099 [victor.reyes] Embarrassing!!!!!!!!! To say the least!
| 301100 [victor.reyes] Yes, Jesus - Thank you!
+ 301094 [funkaster gm] def count
| 301102 [victor.reyes] Thank you Rolando. It was my silly typo!
+ 301095 [jgabrielygal] I think this line should be

^ TDD with Ruby
301091 [aidy.lewis g] Could anyone recommend any sites the describe TDD with Ruby (!Rails)?
+ 301364 [richard.conr] ...
+ 301398 [dev-null pma] Please note the - before rails.

^ Why can't I redefine "<<" method to allow two parameters?
301101 [ibc aliax.ne] SGksIHZlcnkgZXhydGFuZ2U6CgoKY2xhc3MgTXlBcnJheSA8IEFycmF5CiAgYWxpYXMgb3JpZ2lu
+ 301104 [jameskilton ] The << operator is a special case handled by the parser, but you can
| 301115 [jens.wille u] the point is that you can't call an operator with multiple
| 301117 [ibc aliax.ne] MjAwOC81LzgsIEplbnMgV2lsbGUgPGplbnMud2lsbGVAdW5pLWtvZWxuLmRlPjoKPiBKYXNvbiBS
| 301122 [dblack rubyp] This message is in MIME format.  The first part should be readable text,
| 301154 [rick.denatal] We seem to have lost track of what the OP was trying to do,
| 301255 [shortcutter ] irb(main):001:0> class MyArray < Array
+ 301107 [ibc aliax.ne] MjAwOC81LzgsIEnDsWFraSBCYXogQ2FzdGlsbG8gPGliY0BhbGlheC5uZXQ+Ogo+ICBBbnkgcmVh
| 301110 [ibc aliax.ne] MjAwOC81LzgsIEnDsWFraSBCYXogQ2FzdGlsbG8gPGliY0BhbGlheC5uZXQ+Ogo+IDIwMDgvNS84
| 301116 [shortcutter ] As others have pointed out it is not an issue of method #<< but of the
+ 301108 [rick.denatal] The parser sees the << OPERATOR as taking a left and right argument,

^ Download file with mirrors
301119 [djioev gmail] I think to download a file is a simple task but I would like to know how

^ eclipse rdt is painful
301121 [netcam gmail] Yeah the RDT plugin for eclipse work is painful.  It used to be pretty
+ 301124 [djberg96 gma] ooks
+ 301134 [netcam gmail] Yep DLTK is not bad, it doesn't run unit tests in the JUnit panel/view, but
  301390 [netcam gmail] Disable all of the RDT plugins in configuration manager.
  301436 [djberg96 gma] Um, isn't the DLTK for Ruby just RDT? Because, now that I look at the
  301564 [netcam gmail] Nope, RDT is from rubypeople.org and is now dead.  DLTK is an official

^ AUTO: Joe Grastara is out of the office (returning 05/12/2008)
301123 [Joe.Grastara] I am out of the office until 05/12/2008.

^ Comparing String with Symbol
301129 [ibc aliax.ne] SGksIGxvc3RzIG9mIFJ1YnkgbWV0aG9kcyBhbGxvdyBTdHJpbmcgb3IgU3ltYm9sIGFzIHBhcmFt
301131 [rogerpack200] I usually just convert them over
301145 [matz ruby-la] I'd rather use to_sym instead of to_s.
301146 [rogerpack200] I'd use either one except that [quoting Tim Harper]
+ 301147 [matz ruby-la] That's true but there are some other ways for potential DOS attack,
+ 301153 [mneumann nte] This one isn't better, despite being shorter ;-)
| 301161 [albertschlef] A slight improvement is to change '1' to '1.0'. A Fixnum doesn't
| 301164 [mneumann nte] Yes, but it will run out space regardless :)
| 301168 [overlord gmx] No, that depends on how much space is available.
| 301172 [cmdjackryan ] Space is a finite resource. Sooner or later, that code *will* consume
| 301372 [robert.dober] Although recent research seems to agree with you this seems to be a
+ 301366 [ibc aliax.ne] Thanks a lot for that explanation. Finally I'll use only symbols and force=

^ integers with preceding zero don't return as expected?
301133 [rogerpack200] => 3603
+ 301137 [andrea.fazzi] With a preceding zero you are specifying an octal digit.
+ 301139 [list.push gm] A leading zero makes it octal.
| 301140 [rogerpack200] Thanks guys.
+ 301141 [cmdjackryan ] Implicit conversion of an octal number to a decimal, looks like.
threads.html
top