398887-408345 subjects 399263-400301

read in hierarchy file then export in comma delimited format.
399027 [lists@ru y- ] program that reads in a hierarchy file having table, column and data.
399032 [ryand-ruby@z] have
399036 [lists@ru y- ] I am a beginner and not a programmer and needed to simply transpose a

Dotgeek Free Hosting for Learning Ruby
399029 [lists@ru y- ] I was wondering with so many great services as Heroku and Engine Yard

Not Match?
399030 [wbrisett@at ] Either I'm missing it, or I can't be as clever as I want to be. ;)
+ 399031 [art@ar ta lo] charset=us-ascii
+ 399047 [jgabrielygal] There's also !~, which is the opposite of !=
+ 399050 [ruby-talk@la] if !xxx.match(/found/)
  399056 [wbrisett@at ] ...

Doing math in Ruby
399039 [lists@ru y- ] basic concepts. I was wondering if there was a way to take the input of
+ 399042 [lists@ru y- ] ===
+ 399043 [julian@co et] This is not simple. Try simpler.
+ 399045 [josh.cheek@g] If it's just a tool for you to use, then I'd just eval the inputs (does

Unable to open file using pdftk
399041 [lists@ru y- ] (I was asked to create a new one as it was 6 months old)

"Guess the random number" game
399053 [lists@ru y- ] I am new to programing and need some help. I have decided to try doing a
+ 399054 [shortcutter@] The control flow word is spelled "if".
+ 399055 [lists@ru y- ] Ahhh.. Its not easy to be a beginner... :P Thanks robert!!!
| 399057 [shortcutter@] We all went through this... :-)
| 399121 [elihu5991@gm] Wow, Robert. I appreciate your humbleness. Not all seasoned programmers are
+ 399122 [josh.cheek@g] Also, use lowercase variable names (by convention, Rubyists also snake_case
+ 399138 [lists@ru y- ] Thanks very much for your input josh-cheek!

cant change the string
399059 [lists@ru y- ] s=`hostname`
+ 399060 [whitequark@w] Generally, Ruby methods tend to return a new object rather than
| 399061 [lists@ru y- ] thanks that work perfce
+ 399066 [sto.mar@we .] 1.9.3p194 :001 > host_name = 'BD55'

assert All lines
399063 [lists@ru y- ] I'm trying to create a method to assert all lines and if any of them
+ 399065 [matthew@ke w] You could AND them together.  1==1 and 2==3 and 3==3 => false
+ 399068 [lists@ru y- ] If you *really* want what you've written then you'll need something like
+ 399089 [ryand-ruby@z] def assert_all(message, *exprs)
  400775 [lists@ru y- ] Thanks Ryan it works perfectly for me :)

How to patch ruby's gem before an install ?
399072 [lists@ru y- ] got stuck and cann't find appropriate guide how can I patch gem package
+ 399073 [jmassaguerpl] I think you better look for the source code. Gosu is in
| 399074 [lists@ru y- ] Ok, I can use the git sources and maybe install the libs with rake, but
| + 399077 [lists@go fr ] For Gosu, because it has native extension, use the included Rakefile to
| + 399100 [hmaddocks@me] rake release
+ 399075 [lists@go fr ] Why not just clone/fork it from GitHub, apply your patch and commit it,
+ 399078 [matma.rex@gm] Doesn't `gem build` work for you?
| 399080 [drbrain@se m] gem unpack --spec
| + 399081 [lists@ru y- ] I did missed this option. THAT's the answer. Thank you.
| + 399082 [matma.rex@gm] Whoops, thanks for the correction.
+ 411244 [lists@ru y- ] If any of the people coming here still needs this, try my plugin

regix in grep or something like this
399083 [lists@ru y- ] /dev/cciss/c0d11p1
+ 399084 [hassan.schro] `man grep`
+ 399086 [lists@ru y- ] thanks
| 399090 [hassan.schro] Sorry, if you asked that question, it's obvious you *don't* know grep.
+ 399087 [peterhickman] Uh, here we go again. What did you try after your last post. You
+ 399088 [lists@ru y- ] thanks for the solution
| 399108 [sto.mar@we .] A friendly suggestion: please learn *now*! That will save you
+ 399092 [lists@ru y- ] Sorry.. is not it better to give the solution rather then pulling some
  399093 [ryand-ruby@z] here's how you can practice it: http://rubular.com
  399094 [lists@ru y- ] I been to these site before but bit confused about how it works
  + 399095 [wbrisett@at ] It's your friend.
  + 399096 [ryand-ruby@z] in

Error found in installing buildr in ruby
399106 [lists@ru y- ] i found some error by installing buildr in my gem .

Using ruby for scientific computing
399110 [osaut@ai po ] For pedagogic purposes, I am trying to solve simple partial differential
+ 399115 [ml@co va es ] Is the code available on a public repo?
| 399116 [osaut@ai po ] Not yet, but I plan to share it as soon as I am convinced it is usable for my students.
+ 399117 [lists@ru y- ] Because it seems that you emphasize on performance, I think the best way
| 399124 [osaut@ai po ] Thanks for your answer !
| 399139 [lists@ru y- ] Thanks for your pointer to sciruby.  I think it will take them some time
+ 399118 [ryand-ruby@z] differential
| 399125 [osaut@ai po ] Le 8 sept. 2012 =E0 23:31, Ryan Davis <ryand-ruby@zenspider.com> a =E9crit=
+ 399123 [saji@u- iz .] Sometime ago, there was a Google Summer of Code project to port NArray to OpenCL
  399126 [osaut@ai po ] I had not thought of using Open CL. I'll check it. The last commits to =

FasterCSV not working
399111 [lists@ru y- ] FasterCSV.foreach(filename) do |line|
399114 [lists@ru y- ] What version of Ruby are you using? I think in 1.9 FasterCSV is just

Match an ARray Element by if
399127 [lists@ru y- ] a =Array.new
+ 399129 [lists@ru y- ] It's probably a whitespace issue. Use "p sname" instead of "puts sname"
+ 399130 [lists@ru y- ] ["test1\n"]
+ 399131 [lists@ru y- ] Since sname is a completely new array, it cannot contain two strings
| 399132 [lists@ru y- ] its works fine
| 399133 [lists@ru y- ] This makes no sense. Again: Why do you even need an array when you only
| 399134 [lists@ru y- ] ete Ruby version. Maybe 1.8.6? If that's
+ 399137 [lists@ru y- ] I am running bellow script form a server,

Need help with my logic
399141 [lists@ru y- ] We have quite a lot of servers but they all are like bellow format
+ 399142 [lists@ru y- ] server_group = [
| 399143 [lists@ru y- ] Thanks
+ 399145 [lists@ru y- ] require 'socket'
| 399147 [lists@ru y- ] but system hostname is like this (i forgot put -dk )
| 399150 [whitequark@w] Parts of strings which are matched by capturing groups (parenthesized
+ 399146 [lists@ru y- ] given_server = "DK-vk-2.domain.lan"
  + 399148 [lists@ru y- ] thanks
  + 399149 [lists@ru y- ] also could you please explain to me , how it working ??
    399151 [lists@ru y- ] p server_types - [type]

Why does it work? (variable scope)
399157 [ibc@al ax ne] 1)
+ 399158 [shortcutter@] The issue with expectations is that sometimes they aren't met. :-)
| 399161 [ibc@al ax ne] Clear. Thanks a lot to all.
+ 399159 [lists@ru y- ] Local variables are determined purely by the existence of an assignment
  399160 [whitequark@w] Exactly.

Export to CSV has array items under a single row
399162 [lists@ru y- ] I posted this issue over on StackOverflow but haven't received a reply,
399168 [hassan.schro] What method are you calling and what arguments does it expect?
399169 [lists@ru y- ] I suppose you're correct, since I don't really know what I'm doing.  =)
399170 [hassan.schro] TL;DR

Looking for advice on how to report performance issues
399164 [jdmarshall@g] We have a Rails app running on Ruby 1.9.3, and a under Windows we're seeing
+ 399165 [matma.rex@gm] Profile on Linux and on Windows and look for differences.
| 399166 [jdmarshall@g] Hey thanks for the reply.
+ 399167 [lists@ru y- ] Are your 7-8x as long numbers using the
| 399198 [jdmarshall@g] I used that for a couple months (then lost the URL, thanks for reposting
+ 399171 [shortcutter@] And the hardware is comparable?
| 399196 [jdmarshall@g] Comments inline
| 399197 [jdmarshall@g] Oops, correction: 2000s vs 440s vs ~60s
+ 399172 [lists@ru y- ] You say you use MongoDB backend. Are you pointing to the same MongoDB

How to Read a Excel file
399174 [lists@ru y- ] I am trying to read a excel file using ruby but i am not able to read
399176 [lists@ru y- ] this is how i usually resolve this (by using the spreadsheet gem)

hand over block to a submethod
399175 [lists@ru y- ] lets assume I have two methods in class Func
+ 399177 [jgabrielygal] 1.9.2p290 :001 > def test
+ 399178 [shortcutter@] You can reference the block passed to the current method with & and
+ 399180 [lists@ru y- ] cool! thanks to you guys

String iterate through regex matches with possition
399184 [vbosch@gm il] First of all sorry if this a duplicate question ( I have scanned through
+ 399185 [lists@ru y- ] The MatchData object in $~ has a "offset" method to retrieve the start
+ 399188 [shortcutter@] See Jan's reply for obtaining the position.
+ 399200 [lists@ru y- ] str = 'BS HD SP SP EP SP NL EP EP FT BS'
  399210 [vbosch@gm il] Thanks for the answers!! Going to go with Regexp.last_match :-)

installing ruby gem
399186 [lists@ru y- ] I'm learning ruby and I'm trying to install gems but i had some trouble
399187 [lists@ru y- ] Then try to install a gem.
399204 [lists@ru y- ] thank you for helping me..I'll try what you said..is there other way to
399205 [wbrisett@at ] I'm using Mac OS X 10.8 and followed the articles instructions up to =

About choosing Ruby?
399189 [lists@ru y- ] I want to learn a programming langauge and I am stuck between Python and
+ 399190 [matma.rex@gm] The languages are quite similar. You really should just use the one
| 399193 [lists@ru y- ] * Ruby has a much clearer class model, and cleaner separation of methods and instance variables
| 399203 [lists@ru y- ] Perhaps an analogous question would be: "Do you think I should become an
+ 399191 [lists@ru y- ] Ok. But please can you tell me Where Ruby is mostly used after web
| + 399192 [wbrisett@at ] I use Ruby as my general scripting language. When I need to do something (parse
| + 399195 [eliezer@ng e] It depends only on YOU actually.
| + 399201 [lists@ru y- ] Remember that it is not just about how many jobs are out there.  It is
+ 399393 [lists@ru y- ] You have to choose what you like better. It doesn't really matter which
+ 399413 [lists@ru y- ] "I see "Learn Python the Hard way" & "Learn Ruby the Hard way" side by

ODBC Connection
399199 [lists@ru y- ] I have an ODBC (sql server 2005) connection but recently I needed to
399219 [lists@ru y- ] Do you have odbc resource defined in odbc connections.

please help me with making script
399206 [lists@ru y- ] In this example i like to parse birthday and sexe
+ 399207 [echristopher] Are you using Nokogiri or Hpricot? What happens when you try it?
| 399214 [lists@ru y- ] Don't know, this is made in Ruby 1.9.3.
+ 399208 [jfagan365@gm] try modifying your XPath to use the following (worked for me using nokogiri)
| 399215 [lists@ru y- ] Thanx, but its not working, any other suggestion?
| 399216 [peterhickman] Is there a line like 'require "nokogiri"' somewhere near the top of
+ 399217 [ivan.bisevac] 2012/9/12 Charmaine Willemsen <lists@ruby-forum.com>
+ 399242 [lists@ru y- ] See attached script,
  399243 [peterhickman] I see your problem.
  399257 [lists@ru y- ] You're right, I'm not familiar with programming any language. But I like
  399264 [ivan.bisevac] You can hire me on elance if you want :)

Tk with win32ole in XP
399213 [lists@ru y- ] The attached example rbw file will correctly execute "moose" from inside
+ 399278 [lists@ru y- ] may be related...
+ 399285 [lists@ru y- ] Roger, you are a god in human form!

Pathname#to_str withdrawn in 1.9?
399218 [matt@ti bi s] Just getting started experimenting with Ruby 1.9 (1.9.3) and my scripts
+ 399220 [shortcutter@] I interpret "path object is not a string." to mean that a Pathname is
| 399223 [matt@ti bi s] Except that it is. From the core methods section of the Pathname
| 399235 [shortcutter@] Well then...  I don't know.
| 399238 [matma.rex@gm] I think that you should report it as a regression on
| + 399240 [shortcutter@] Well, the method was removed on purpose.  And nobody questions that
| + 399261 [matt@ti bi s] <https://groups.google.com/d/msg/ruby-core-google/2B9CN17ayWs/cea_zdFPgA
+ 399229 [lists@ru y- ] It's definitely a judgment call. Not sure if this helps you, but I think
  399246 [groups@in ox] I'd hazard a guess that the reasoning is because the '+' behavior was
  + 399262 [matt@ti bi s] Interesting point. The amazing thing is how fast I'd internalized this,
  + 399268 [quintus@qu n] I agree, but #+ for Pathname/Pathname concatanation seems a bad choice
    399282 [shortcutter@] Interesting idea!  That looks interesting
    399316 [echristopher] *cringe*

How to run File Operation as sudo
399221 [lists@ru y- ] f=File.new("/etc/fstab","a+")
399222 [lists@ru y- ] Start your script using

Marshaling classes
399224 [lists@ru y- ] Guys, how are you?
+ 399226 [ryand-ruby@z] On Sep 12, 2012, at 16:13 , Dami=E1n M. Gonz=E1lez =
+ 399237 [lists@ru y- ] Unfortunately Marshal.dump doesn't dump even instance variables of a
+ 399258 [lists@ru y- ] Yes! Both advices help me a lot! Finally I've got to require to

[ANN] rdoc-generator-fivefish 0.0.1 Released
399225 [ged@Fa ri MU] rdoc-generator-fivefish version 0.0.1 has been released!

Breaking Down the Block
399227 [lists@ru y- ] Can someone please explain in plain english how this block treats the
+ 399228 [matthew@ke w] t = 0
+ 399230 [lists@ru y- ] Just forget inject() even exists.  It's really quite a pathetic method.
| 399234 [sungpae@gm i] inject is just reduce/foldl from other languages. It is just sugar for
| 399236 [lists@ru y- ] It's also a baby step towards "functional programming" - realising that
+ 399231 [matt@ti bi s] inject(memo) { | memo, enum | block sets memo } => memo
+ 399232 [lists@ru y- ] However, with better variable names, it might be clearer what's going on
| 399241 [shortcutter@] The assignment is totally superfluous.
| 399277 [lists@ru y- ] Whoops.  Yep, otherwise it wouldn't be such a strange method.
+ 399233 [lists@ru y- ] class Array
| 399239 [matma.rex@gm] Sorry, but that's bad practice in best case. #inject doesn't depend on
+ 399377 [lists@ru y- ] This is quite helpful. If we ever meet I owe you each a beer.
+ 399379 [lists@ru y- ] Horrible variable names are the culprit again.
+ 399380 [lists@ru y- ] z = y.select {|a, b| b == y[0][1]}
| 399400 [lists@ru y- ] Wow, so helpful. Thanks for taking so much of your time to explain.
| 399418 [lists@ru y- ] nums_with_frequs = [[30,2]]
+ 399381 [lists@ru y- ] def mode(array)
+ 399429 [lists@ru y- ] Sorry, didn't word my question very clearly.
+ 399432 [lists@ru y- ] Start at the top of the thread.  Read every post, and write down every
+ 399433 [lists@ru y- ] 1) If x = 2, then the statement result = x + 4, is equivalent to result

ruby Range to array that acts like time objects?
399244 [lists@ru y- ] I'm looking for a way to create an array out of a range, but does the
+ 399245 [matthew@ke w] I'd create a class, maybe `class HoursMinutes`, which has @hour and
| 399247 [matthew@ke w] class HoursMinutes
| + 399248 [lists@ru y- ] Thanks Matthew,
| + 399259 [shortcutter@] Your #succ method does not overflow.  I would make the class immutable
|   399266 [matthew@ke w] Actually my #succ did overflow, because the constructor used the
|   399281 [shortcutter@] Oh, I am sorry, I overlooked that.
+ 399249 [sungpae@gm i] Do you just want to throw away values where the mod(100) values are
  + 399250 [lists@ru y- ] (800..900).reject { |n| (n % 100) > 59 } is just what I need. Sweet!
  + 399254 [shortcutter@] We can use Fixnum#divmod here
    399256 [sungpae@gm i] Indeed. I didn't know about divmod.

Re: Range to array that acts like time objects?
399251 [lists@ru y- ] What's the background of this, what do you want to do?
+ 399252 [lists@ru y- ] maybe you want to use Time?
+ 399253 [lists@ru y- ] @Jan E.
  399255 [sungpae@gm i] Databases support native time columns and the various Ruby db connection

399260 [dvohra09@ya ] ...
399267 [quintus@qu n] Successfully re-registered you to the RubyTalk ML. Thanks for using our