224995-231105

224793-226498 subjects 225266-226198

^ preserve mtime when using FTP?
224995 [eegreg gmail] I am using Net::FTP to copy files, but the file stats are not
225003 [nospam nosit] But FTP can't set the mtime on remote files, it can only retrieve it.
225023 [eegreg gmail] Unless I am mistaken I don't think sftp will preserve the file
225090 [nospam nosit] Not the sftp I'm thinking of. In any case, you can use ssh to force a reset

^ Assoc method on large array
224997 [greg.kujawa ] I am trying to invoke the assoc method on a large array. It seems to
+ 225000 [greg.kujawa ] I narrowed down the result set so that it's only a few records. For
+ 225002 [nospam nosit] Code?
  225015 [greg.kujawa ] require 'dbi'
  225081 [shortcutter ] You need an Array of Arrays.  But resultSet is the return value of
  225120 [greg.kujawa ] When I try resultSet.class in irb I get back an Array. And the
  + 225121 [greg.kujawa ] I also get this error when trying to sort other array of arrays that
  | 225122 [greg.kujawa ] I figured out this one glitch. Pilot error on my part. Some values of
  | 225125 [shortcutter ] Why don't you let the DB do the selection?  Why don't you use a Hash?
  | 225129 [greg.kujawa ] I didn't let the DB do the selection because I was querying different
  | 225178 [nospam nosit] In the case of records from different databases on different servers, I
  | 225193 [greg.kujawa ] You got it. In the case of trying to sort things based on a particular
  + 225123 [james graypr] But you're sure that's not just inspect() tricking you with an Array-

^ Fwd: [urug] Re: Reminder: Meeting tonight 14 Nov 2006
225024 [pat.eyler gm] Just in case there are folks here on ruby-talk that aren't on our

^ Excellent Ruby refactoring articles on rubyist magazine -- Also, does nyone know license of code on site?
225025 [dsisnero gma] The site http://jp.rubyist.net/magazine has an ongoing code analysis and

^ Rails problem with select
225027 [raw mlyniec.] $ ls -la

^ touch
225041 [bpettichord ] I need to "touch" a file from my ruby script. (This is a unix-based
225043 [ruby philip.] What's wrong with FileUtils.touch() ?
225046 [bpettichord ] That looks good. Thanks.

^ [ARRAYS] Bidimensional Arrays? (opened)
225042 [flaab_mrlinu] I'm just new at ruby and I have a weird issue probably really dumb but i
+ 225044 [tim.pease gm] The ruby Array class is always a one dimensional array. You can create
+ 225045 [TimHunter nc] The easiest way to define a multidimensional array in Ruby is to define

^ question about rspec assigns
225050 [daniel flyin] I'm using rspec for a Rails project and keep seeing the "assigns" method in
225052 [wilsonb gmai] Assigns is a feature RSpec borrows from the regular Rails test/unit helpers.
225055 [daniel flyin] Thanks!

^ Windows package task, windows cannot fork
225056 [dsisnero gma] task it gave me an error that windows cannot fork.  Looking online, I find
+ 225060 [reid.thompso] That's wrong.  Cygwin's tar works fine with gzip.  Trying to run
+ 225065 [phurley gmai] If you are trying to avoid cygwin (and its path handling can be a good
| 225218 [dsisnero gma] Thanks Patrick
+ 225067 [gregory.t.br] I have no troubly using msys on windows.

^ first ruby program, how do I make it faster?
225057 [jigaboophelp] would like some hints on how to speed it up.  When I looked for a
225066 [eegreg gmail] each will normally profile high because it will be called in multiple

^ Enterprise Ruby Conference
225064 [joe theedgec] EdgeCase is proud to announce erubycon, the first conference

^ Design problem with 'inject'
225069 [dr garyboone] Ruby's inject has a design that can lead to hard to find bugs. The
+ 225071 [marcel verni] next sum if i == 3
| + 225074 [farrel.lifso] Whoa! That is good to know.
| + 225084 [shortcutter ] In this case I would not even resort to #next.  This seems much more
+ 225072 [shyouhei tra] next sum if (i == 3)
+ 225073 [farrel.lifso] I agree using next with inject can be dangerous and probably should be
+ 225075 [lutherfire y] You should use a '+' instead of a '+='. The return value of the block
| 225086 [dr garyboone] Those are several good suggestions.
| + 225103 [M.B.Smillie ] I think it could be that I'm just too familiar with the whole
| + 225116 [dblack wobbl] I think you're well advised to know that if you're using inject :-)
+ 225083 [pit capitain] Gary, that's not true. The version of inject you use (with an explicit
+ 225135 [ara.t.howard] this last part is dead wrong, the semantics of inject have __nothing__ to do
| 225143 [shortcutter ] Small correction: if called *without arguments* the first invocation
| 225151 [ara.t.howard] wow - you learn something every day - that's great!
+ 225142 [lukfugl gmai] Others have already posted clarifying the semantics of inject and
| 225176 [GENIE prodig] Agree 100% on the use of select
+ 225145 [gregory.t.br] There were lots of good responses to this post already, but if you're
+ 225161 [w_a_x_man ya] [1,2,3,4,5].reject{|n| n==3}.inject{|s,n| s+n}
+ 225267 [shortcutter ] (1..10).inject(0) {|sum, i| i == 3 ? sum : sum + i}
+ 225310 [louis.j.scor] The assignment to sum is useless.  Only the return value matters to inject.

^ Problem linking on a Bluegene-L
225076 [crb002 gmail] I am trying to get mpi-ruby-0.4 working on a Bluegene-L system. I
225128 [jeff schwabc] On "a" BlueGene/L?  How many of them do you think there are?
+ 225152 [ilmari.heikk] The TOP500 lists 28, so at least that many.
| 225283 [jeff schwabc] No, those aren't BlueGene/L's, they're other BlueGenes.  The BlueGene/L
| 225530 [jeff schwabc] My failure to understand:  Other BlueGenes based on the L architecture
+ 225378 [crb002 gmail] No clue on the official name IBM calls it. It's one cabinet (1024 nodes)

^ how can I dynamically get the source of an object's method?
225082 [david intern] I've been wondering if it's possible to get an object to print out the
225126 [james graypr] This isn't easy in the general sense with Ruby, because you can use

^ hoe send_email task (Was: Re: directory_watcher 0.1.1)
225085 [drbrain segm] $ mail drbrain@segment7.net

^ [was parsing unknown options] OptionParser documentation improvements
225094 [vincent.four] I think that it would be a great idea. Personnaly, I always found that

^ [File -> Lines -> Chars] Logic issue (open)
225095 [flaab_mrlinu] Just a simple question from a newbie =)
+ 225099 [vincent.four] ary = File.open(file).readlines.map {|l|
+ 225101 [nospam nosit] The program below reads lines and creates an array of arrays (a
+ 225102 [farrel.lifso] You can use each_byte to iterate over every character of a string.

^ [ANN] FastRI 0.2.0: full-text searching, smarter search strategies
225109 [ mfp acm.org] FastRI is an alternative to the ri command-line tool. It is *much* faster, and
225303 [gabriele.mar] I like fastri :)
225332 [ mfp acm.org] Sorry, it's not in 0.2.0, but you can find it in HEAD; just get
225443 [botp delmont] # > I like fastri :)
225680 [ mfp acm.org] oh, I'd never used that with ri (actually, I didn't use ri that much, for the

^ [METHODS] Var types as parameters
225111 [flaab_mrlinu] I want to pass an array as a parameter to a method. But the values of it
225112 [farrel.lifso] Could you show us the code which is doing this?

^ Re: Var types as parameters
225117 [flaab_mrlinu] - The user inserts a string of 15 signs.
225119 [dblack wobbl] When you to the to_a, you're going to end up with an array of one

^ Cursor position in a Gtk::TextBuffer
225118 [ramsayw1 com] I have not had great luck asking Gtk questions on this site, but I

^ Converting SVG files to images
225127 [djberg96 gma] I was just playing with the Ruby svg-graph library, and it seems to work
+ 225130 [vincent.four] You can try convert, from ImageMagick. Basically convert anything to
| 225134 [farrel.lifso] And then you can install RMagick and control it from Ruby.
| 225141 [djberg96 gma] Thank you Farrel and Vince - I'll take a look.
+ 225136 [kou cozmixng] In <455B2538.9080508@gmail.com>
  225140 [djberg96 gma] Thanks Kou, looks interesting.  I couldn't get cairo to build on my
  225155 [phurley gmai] I have a hunch that Kou's solution will work much better. In the
  225165 [djberg96 gma] Indeed.  I've discovered that running 'convert' over the .svg file
  225172 [phurley gmai] I just shelled out to inkscape and used command line parameters to

^ converting a signed float into unsigned float
225137 [dipesh_bathe] I know this is simple, but i am unable to find how to do this. I have an
225139 [jeff schwabc] irb(main):001:0> (-3.14).abs

^ Re: Nitro + Og 0.40.0
225144 [fabian fabia] Everyone looking for docs, have a look at the new, redesigned Oxyliquit
231060 [invalid gmx.] Just trying to get to know something about Nitro, so now replying to an
231091 [kashia.buch ] Oxyliquit.de resides on a (very) crappy virtual server.  When you see a
231105 [invalid gmx.] Thanks for these.  I'll definitely turn up on IRC or mailing list, to see

^ Windows command & unicode
225149 [m44rt3n yaho] I have a problem using unicode characters in the windows command.

^ Re: Windows command & unicod
225153 [wilsonb gmai] I believe the Windows command prompt displays text using the system
225156 [halostatue g] Please search the archives. There was a discussion about the
+ 225158 [support chil] That's because the DOS console is expecting characters
+ 225185 [m44rt3n yaho] Thanks, this got me on my way.

^ ruby odbc and binding OUT parameters in stored procedures
225154 [christopher.] is it possible using ruby-odbc (0.9993) to bind OUT (and/or INOUT)

^ Group names in regular expressions
225159 [donn cmscms.] /^(\(?(?<area>[0-9]{3})\)?)?(\-| )?(?<exch>[0-9]{3})(\-|
+ 225173 [nospam nosit] [ 1,2,3,4 ].each do |exch|
+ 225177 [djberg96 gma] With Ruby's builtin regex engine? No. With Oniguruma (or the Ruby 1.9

^ Regexp with Ruby
225162 [m_ratheepan ] I have to replace in a File the image tags with an other!
+ 225163 [hgs dmu.ac.u] [trimmed]
| 225167 [m_ratheepan ] rubyscript
| 225196 [kbloom gmail] Works for me with datei_new.scan(/(<img.*?>)/m) (the .*? performs a
+ 225171 [nospam nosit] As another poster has pointed out, you aren't showing enough code for an
  225175 [gethemant gm] If i were to do this..I would use hpricot.

^ Using diff.rb
225164 [impalapete20] Has anyone ever had any luck getting this to work on a web app.  I am
225194 [halostatue g] ... so what is diff.rb and where did it come from?

^ compiling ruby/tk on 64 bit Redhat?
225166 [fkchang2000 ] I"m wondering if anyone has successfully done this.  I'm trying to
225930 [nagai ai.kyu] Please try "--with-X11-lib=/usr/X11R6/lib64".
225950 [fkchang2000 ] That did the trick.
226018 [nagai ai.kyu] Please try "ruby -r mkmf -e 'create_makefile("tkutil")'".

^ SVG::Graph::Pie question - labels and padding
225174 [djberg96 gma] Ruby 1.8.5

^ *Fast* way to process large files line by line
225179 [dagrawal cs.] I am using ruby to analyse a huge (around 60G) amount of my networking
+ 225180 [farrel.lifso] Could you not parrallelise the processing of each file? Perhaps using
| 225181 [dagrawal cs.] Did you mean parrallelizing across multiple files or parrallelizing the
| + 225182 [farrel.lifso] I think this
| | 225183 [farrel.lifso] Whoops! make that
| + 225188 [farrel.lifso] Also try running your code with some sample data through the ruby
| + 225201 [jan.svitok g] Maybe it's possible to preprocess the files with grep or something
+ 225186 [drbrain segm] Have you profiled?  Where is your time really coming from?
+ 225205 [shortcutter ] First I have a question: why do you read those files in parallel in the
| 225214 [devesh.agraw] First a couple of stupid things that I am doing, then a couple of more
| + 225226 [nospam nosit] / ...
| + 225265 [shortcutter ] Using regexps inline is the most efficient way in Ruby.  You can find
| + 225268 [aldursys gma] Can't harm to try. I use it for uploading large files and it helps
|   225269 [shortcutter ] I beg to differ: it can actually harm to apply an optimization measure
|   225308 [znmeb cesmai] Just for the sake of amusement, I did a traceroute to see what the
|   225325 [shortcutter ] Which code?  I saw only the pseudo code from the first posting.  Is
|   225448 [znmeb cesmai] I was referring to the pseudo-code.
|   225451 [ara.t.howard] ed.  that quote is aweomse.
+ 225227 [ara.t.howard] <snip commentary>
+ 225246 [znmeb cesmai] Basically what you are describing here looks like a poorly specified

^ help getting dirwatch 0.90 running
225184 [cremes.devli] I'd like to play around with dirwatch but I can't seem to get it running.

^ Fully justified/center justified output
225199 [user example] ruby?
+ 225204 [ruby philip.] str.center(integer, padstr) => new_str
| 225213 [juozas tuesd] If you're printing to terminal, you'll need to know the terminal width
| + 225219 [m.fellinger ] h, w = `stty size`.split.map{|e| e.to_i}
| + 225221 [user example] Yeah I think that's what I want from what I can see.
| | + 225223 [m.fellinger ] read the documentation of Array... especially #join
| | + 225224 [nospam nosit] / ...
| + 225258 [jan.svitok g] Not always. You can manually specify different size (at least in XP+
+ 225247 [halostatue g] Check out Text::Format. It will even work with Text::Hyphen to

^ Fwd: Multidimensional Arrays
225200 [Smgspices ao] <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

^ Re: Multidimensional Arrays
225202 [tim.pease gm] Array.new( size, obj )
225209 [Smgspices ao] Thanks. That works great. I read and tried to understand the documentation
225212 [flaab_mrlinu] U might just use this.

^ [Gui] Which GUI is available with Ruby?
225211 [flaab_mrlinu] Othew newbie question :)
+ 225217 [halostatue g] Please google for this. I have seen four discussions about this in the
+ 225220 [ jupp gmx.de] OS(s)?

^ class method call via the singleton or not
225216 [transfire gm] Little bit of conundrum. I have a variables that tracks information

^ Re: Which GUI is available with Ruby?
225225 [ramsayw1 com] I've used Tk and Fox (http://www.fox-toolkit.org/), both of which are

^ encoding question
225229 [rubyeu yahoo] How can I change the behaviour with encoding in srings to use a
225250 [halostatue g] Iconv, if you've got it. Note that this is dangerous unless you know

^ Rails view as PDF... suggestions?
225232 [jbrains762 g] I am about to do some research tomorrow, but if any of you has an
+ 225235 [ara.t.howard] look at this too
+ 225238 [kou cozmixng] 1. make a SVG for template with Illustrator, Inkscape and so on
  + 225343 [gilesb gmail] require "pdf/writer"
  + 225357 [jeff.barczew] You can also use MasterView to generate xml (for SVG or to use with XSL-FO).

^ "Snapshotting" of a ruby-gnome application
225240 [shevegen lin] Using Gtk::Image and Gtk::Pixbuf, and a widget where you can move
225241 [kou cozmixng] You can do with Gdk::Drawable and Gdk::Pixbuf.

^ [ANN] Ruby-VPI 11.1.1
225242 [ snk gna.org] Ruby-VPI is a Ruby interface to Verilog VPI. It lets you create

^ need to fetch a zip file from url and unzip it
225244 [phil.swenson] require 'open-uri'
225254 [nospam nosit] Well since you are trying to unzip a ZIP file, I suggest you read about the
225301 [phil.swenson] Isn't Zlib for gzip?  I'm trying to access a zip file.
225305 [jan.svitok g] The string you have is the content of the zip file. To make it a file

^ Catching attr_accessor with set_trace_func
225245 [wilsonb gmai] class User
225257 [nobu ruby-la] You can't now.
225259 [nobu ruby-la] Sorry, it was wrong.
225298 [wilsonb gmai] Thank you. That explains why it wasn't traceable.
225304 [nobu ruby-la] What do you expect when the receiver isn't assigned to any
225307 [wilsonb gmai] Something indicating that would be fine. I don't need a handle on

^ basic mistake?
225248 [badluck105 y] class BookStore
225249 [hal9000 hype] At least two mistakes here... move the @bookstore line
+ 225252 [steviedizzle] def initialize(*books)
+ 225285 [spielmann co] Which is what (s)he intentionally did ("i commented it out since it
  225289 [chris.hulan ] Hal is correct, moving it into initialize solves the problem.
  225313 [badluck105 y] hehe, i knew it was some basic mistake. thank you all very much. so is it wrong to declare a
  + 225315 [dblack wobbl] It's wrong to initialize a variable in one scope and try to use it in
  + 225322 [lukfugl gmai] # NOTE: no enclosing class

^ Alternative/mirror for gems.rubyforge.org
225251 [kkurman hotm] I am having problem installing some gems, is there any mirror for the
225253 [steviedizzle] There isn't, but it seems like rubyforge is down and (hopefully) will be back up soon.
225282 [drnicwilliam] Posted via http://www.ruby-forum.com/.

^ finding which OS?
225261 [lister pikkl] is there a way to find which OS Ruby is running on?
+ 225262 [farrel.lifso] irb(main):001:0> PLATFORM
| 225278 [a99.googlegr] puts RUBY_PLATFORM
+ 225367 [luke madstop] luke@midden(0) $ irb
  + 225371 [ara.t.howard] can you explain that?  custom .to_s?
  | 225376 [luke madstop] Facter is meant to be a collection of mechanisms for retrieving a
  | 225400 [ara.t.howard] okay - it makes perfect sense then
  | 225421 [luke madstop] Okay. *whew*
  | 225428 [ara.t.howard] yes!  i'll take it.
  + 225374 [pubmail call] myhome = ENV['HOME']

^ newbie question about attr_reader
225263 [rao.ravi.m g] Why cant i have an attribute reader for a class variable.
+ 225264 [satish.talim] The reason being that in Ruby, instance variables are exposed to the outside
+ 225275 [dblack wobbl] Class variables are shared among many objects (the class, its
| 225480 [fxn hashref.] David, technically is there any relationship between the attribute @x
| 225491 [dblack wobbl] Yes; they're the same @x.
+ 225284 [ktalanet yah] The reason is because you are exposing @var1 not @@var1 and with
threads.html
top