191899-194333 subjects 192370-193338

^ garbage-collection question OR ruby-gnome bug?
192157 [cameron.math] My friend and I have been writing an application that makes extensive
192163 [shortcutter ] I can only say something about your short demo piece because I don't
192266 [cameron.math] Hey,

^ range
192165 [0011 hush.co] another code example from my book doesnt work with the ruby interpreter
+ 192169 [  ff ffh.com] Try with [ brackets ]
+ 192170 [syarus gmail] A range is a specification which can be used for making ordered lists
| + 192172 [0011 hush.co] hmm ok i guess the author made a mistake in this book i just wanted to
| + 192175 [shortcutter ] Another nice way to do this is to use inject.  IMHO this
+ 192248 [drbrain segm] Range#length was removed between 1.6.8 and 1.8.mumble.

^ FAQ / Q and A (was Re: Intantiating a class by name)
192174 [benjohn fysh] I'm renaming and resending this post. I should have branched the

^ Simplifying Vim folding
192177 [dougkearns g] G'day folks,
+ 192179 [halostatue g] Enamoured? No. But there are things that I really like being folded --multi-line hash definitions (I wish it extended to multiline arraydefinitions).
| + 192180 [alexandru gl] Me too, I like the way folding works right now, folding pretty much
| + 192603 [dougkearns g] I'll include something in the next release but in the meantime you can
+ 192194 [snowzone5 ho] occasionaly i get frustrated with folding by syntax that most of the
| 192202 [ara.t.howard] i simply bit the bullet and always use marker - it's very convenient if one
| 192215 [halostatue g] The standard folding for Ruby works with here-docs.
| + 192220 [Gennady.Byst] I discovered zC and zO recently and they proved very useful. They will
| + 192223 [ara.t.howard] oh i know - just saying that here-docs should be included in a 'minimal'
+ 192200 [rosejn gmail] I agree with you Doug, folding module, class & method make it easy to
+ 192381 [ mfp acm.org] I've written a plugin that achieves something similar; it's a much improved
  + 192385 [ara.t.howard] you need to use
  | 192388 [ mfp acm.org] I'm matching against /\{\{\{\{/ and /^\s*[#%"0-9]{0,4}\s*\{\{\{[^{]/, so
  | 192389 [ara.t.howard] boy.  reading this post in vim is tough!  there are a lot of folds!  ;-)
  | 192430 [ mfp acm.org] Alright, I thought you meant that {{{ drove rdoc mad, when it's just that
  + 192604 [dougkearns g] This looks interesting; I'll add a note to the vim-ruby docs.

^ Thanks Ruby Quiz!
192184 [charlie cast] The Rails Plugin is a direct result of the ruby quiz.  I just wanted to
+ 192192 [james graypr] Awesome!  What a cool success story!
+ 192205 [matthew.moss] Wow...  neat! You're welcome.
  + 192209 [charlie cast] You're right, I should have asked before using the code.  I assumed that
  | + 192225 [lukfugl gmai] On this point, would it drive away many potential quiz solvers if
  | | + 192227 [james graypr] I don't think I feel comfortable choosing a license for other
  | | + 192256 [matthew.moss] "All quizzes, summaries, solutions, and discussion is assumed to be
  | + 192229 [edder tkwspi] Are you trying to imply that ruby is the same as rude..
  + 192271 [collinsj sea] I know this is really nit-picky, but the "proper" way to say 123 is "one
    192272 [home kerrybu] I'm sure that says to_english, not to_american ;-)
    192273 [collinsj sea] Good call on the distinction...if the OP could take that into
    + 192274 [mike stok.ca] Indeed, there is a difference between a British/European billion and
    | 192275 [steve.debaun] 123.to_slang == "a franklin, a jackson, three washingtons, and some jingle"
    | 192276 [charlie cast] It appears I opened a can of worms.  I see why this was chosen as a ruby
    | 192293 [hal9000 hype] When I was a kid, teachers laid heavy stress on this for some reason.
    + 192277 [charlie cast] Is there a time at all where and is appropriate with integers?  I know
      192287 [ray warmroom] Yes. There is prior art on this. Unfortunately is might be hard to

^ Image Processing Questions
192196 [ruby crazyte] I've been digging around trying to find a good hook for GD and so far I've
+ 192211 [logancapaldo] Seems like a bug in GD2. Have you looked at line 29 of
+ 192222 [dave burt.id] RMagick. I haven't really used GD, but I'm sure RMagick is cooler.
| 192234 [ruby crazyte] I checked that out, but they unfortunately only have bindings for up to
| + 192243 [ara.t.howard] if you simply take the time to compile ruby yourself using msys then not only
| + 192329 [dave burt.id] irb(main):009:0> Magick::Version
|   192352 [ruby crazyte] It's certainly possible that I'm misinterperating what's being said here.
|   192362 [dave burt.id] Well read. Don't use it in production, but I believe it generally works.
|   192425 [cyclists nc.] A number of people reported that the RMagick 1.10.0 Win32 beta gem
+ 192582 [rob mars.org] These warnings are harmless. RDoc doesn't seem to like symbols

^ [ANN] ruby column at linux Journal
192203 [pat.eyler gm] Last week's Ruby column was posted at Linux Journal last night.  There

^ where do you require?
192206 [rosejn gmail] I was reading through some of Why's parkplace code this afternoon, and I
+ 192210 [logancapaldo] require only loads a given file once regardless of how many times
+ 192213 [ mfp acm.org] It will only get loaded once. (In the first call to #require its name will get
+ 192214 [dave burt.id] Require only loads any library once. So, yes, require will be called

^ Re: Compiler for Ruby (OT)
192217 [leslieviljoe] Sent through exchange so it could be Outlook. Outlook makes it almost impossible

^ class << my_instance and class variables
192221 [rblists gmai] When running this code,
192224 [decoux moulo] Are you sure ?
192235 [rblists gmai] I was not sure ;-)
192238 [decoux moulo] Well, no. class variables (i.e @@) are added in the class which is
192244 [rblists gmai] thanks Guy for your explanations!

^ Re: FTP#mget, FTP#mput
192226 [Daniel.Berge] I guess I'm not sure how this is different that just doing something
+ 192230 [ara.t.howard] Dir[pattern] is on the __client__.  globbing for mget most occur against a
+ 192231 [logancapaldo] I'm not sure but I think mget's pattern is supposed to apply on the
  192232 [Daniel.Berge] # Untested

^ Numeric precision problem
192233 [doug dmeharr] Greetings all.
+ 192236 [shortcutter ] => true
+ 192241 [doug dmeharr] Oops!  Never mind.  I some of the numbers in my preceeding message were

^ Error recovery in Racc using error token
192237 [dj omelia.or] I have been unable to successfully use the error token in my Racc

^ Matching $end and $start tokens in RACC
192239 [dj omelia.or] Does anyone know if it is possible to match the $end and $start tokens

^ Newbie question about initialize methods in subclasses
192240 [weyus att.ne] All,
192245 [klancaster19] A.intialize does not get called by default - you do have to call super.
192254 [weyus att.ne] Upon further reflection, my entire problem boiled down to not

^ [Fwd: Re: Thanks Ruby Quiz!]
192242 [charlie cast] My nickname is Typo and that's exactly what happened with this message.
192246 [pat.eyler gm] I think you're making it worse.  ;^)
192247 [charlie cast] Oops! I did make it worse.  I'll just assume that everyone knows what I

^ Asserts in aggregate objects called by a Test::Unit::TestCase
192249 [andrewt reve] charset="us-ascii"
+ 192255 [drbrain segm] See add_assertion in Test::Unit::TestCase and Test::Unit::Assertions
| 192279 [andrewt reve] Thanks for the response Eric. I looked up add_assert but it didn't
+ 192394 [bpettichord ] I finally figured out how to do this this week. This problem has been
  192398 [leavengood g] require 'test/unit'
  192402 [drbrain segm] I've never needed to have all this complexity to reuse test methods.

^ [ANN] new_haven.rb meeting tonight!
192251 [gregory.t.br] The New Haven Rubyists monthly meeting is tonight.

^ changing the type of a variable
192257 [demallien ma] I'm a ruby newbie, although I'm a programmer with 10yrs experience.  I
+ 192258 [demallien ma] Oh, btw; I have just registered myself under the pseudo "demallien"...
| + 192259 [Gennady.Byst] You may need to restart your Rails application so that your changes may
| | 192260 [demallien ma] Without wanting to sound really dumb, how do I restart a Rails app.  As
| | + 192261 [Gennady.Byst] That's it. If it still complains, make sure that you changed it in the
| | + 192262 [halostatue g] You will probably get better results from the Rails-specific list or forum.
| |   192263 [demallien ma] Maybe, but as I said, I'm a newbie when it comes to ruby, and really,
| |   192264 [halostatue g] There is no Ruby VM as you'd understand it. If you have somethingremembering the type of an object -- not a variable; variables aretypeless here -- then it is probably a Rails problem.
| |   192265 [Gennady.Byst] Then you may benefit great deal (and enjoy it, actually) from becoming
| + 192305 [djberg96 gma] And here I was hoping for "femalien".  Oh, well. ;)
+ 192270 [leslieviljoe] If you have restarted webrick, you are probably setting @items to an
+ 192686 [zoso foton.e] Make sure you have actually changed all the "@items =3D 0" occurrences =

^ Slowing threads
192268 [leslieviljoe] I have written a program that simulates three "consoles" that accept
+ 192269 [logancapaldo] If you really want this much fine grained control over the thread
+ 192284 [garbagecat10] It's rarely a good idea to modify the priorities of threads in Unix systems=
| 192289 [leslieviljoe] Thanks. I'll probably have a command put together a list of
+ 192374 [jake.mcarthu] class Thread
  + 192390 [drbrain segm] set_trace_proc will make your program run much slower than you expect.
  + 192563 [leslieviljoe] Thanks Jake, this is a very cool idea! Pretty sure it won't be fast

^ How to matching "[" in string
192280 [sed.nivo gma] How to matching "[" in string with regular expressions?
+ 192282 [james graypr] Says who?  ;)
+ 192283 [mike stok.ca] What do you mean by "don't work"?  What do you expect?  Have you read

^ Re: Thanks Ruby Quiz!Se
192281 [ray warmroom] No.
192285 [collinsj sea] My original point was not that serious...it can be left as-is without a

^ metaprogramming resources and metaprogramming formalisms
192290 [kiaroskuro g] looking for material.

^ Module#add_tracer
192291 [vshepelev im] Problem
192292 [logancapaldo] set_trace_func(proc)    => proc
192294 [vshepelev im] Of cause I know about this. My solution is much more lightweight (because
192295 [logancapaldo] Yours also breaks when someone else overrides the same method and
+ 192299 [vshepelev im] Yeah. It also breaks in dosens of other cases :)
+ 192308 [binary42 gma] So does yours in many cases ;-). Imagine any code that uses
+ 192321 [rossrt rosco] __filename__methodname__
  192384 [transfire gm] You could use binding instead of aliasing which is safer albiet a bit

^ simple newbie question
192301 [wickham_bob ] but I just cant get it work. Its an exercise in Chris Pine's tutorial.
+ 192303 [billk cts.co] puts 'I think ' +  (number.to_i + 1).to_s + ' is a better number'
| 192306 [wickham_bob ] Thanks Bill and Logan,
+ 192304 [logancapaldo] You can call methods on expressions...

^ A more elegant way to do this?
192311 [timuckun gma] Can anybody suggest a more elegant and rubyish way to do this?
+ 192313 [ara.t.howard] array = lambda{|x| x || []}
| 192317 [Gennady.Byst] Array(nil) => []
| 192318 [daniels pron] (conf['hosts'][hostname]['groups']||[]).each { |group|
| 192340 [timuckun gma] Thanks for all your replies.  I knew there was a better way, I keptreading and thinking that I am still not thinking in ruby.
+ 192468 [vjoel path.b] def each_element_of(enum)
+ 192480 [robin nibor.] tab_entries.concat(conf['crontables'][group])
+ 192492 [christoffer.] nil.to_a # => []

^ plz help with binding
192314 [gm.vlkv gmai] def arr_fn() ; arr=[] ; lambda{ arr } ; end
+ 192315 [ara.t.howard] because, in effect, this is what you've done
| 192322 [gm.vlkv gmai] Ara, thanks for your kindness,
+ 192316 [ara.t.howard] class C
| 192323 [gm.vlkv gmai] This is cool!
| 192328 [gm.vlkv gmai] Sorry, guys,
| + 192330 [gm.vlkv gmai] thanks all for your patience,
| | 192339 [benjohn fysh] "variable" is stored per class, rather than per instance?
| | 192355 [gm.vlkv gmai] Do you mean singleton class?
| + 192346 [pit capitain] Sergey, maybe I don't understand what you mean by "implemented on class
| + 192361 [ara.t.howard] yes exactly - you must defer creation of the closure somehow.  it must be an
+ 192325 [pit capitain] Sergey, your code creates the local variable "arr" and the corresponding
+ 192338 [benjohn fysh] ca.arm and cb.arm share the same local because they're the same function.

^ [ANN/ADV] Ruby for Rails now published in paper!
192319 [dblack wobbl] I'm on the road, so I haven't laid eyes on it yet -- but word on the
+ 192341 [has.sox gmai] Congratulations David.
| 192344 [michael.gors] I recieved my paper version two days ago.  Thanks for the great work.
+ 192379 [jmg3000 gmai] Yup. I got mine a day or two ago -- just started reading it.
+ 192493 [tom infoethe] I've got the paper version, great stuff.  It's already helped me clarify

^ [OT] Re: Thanks Ruby Quiz!
192320 [rossrt rosco] Billions are now unified, with even the BBC now using it to mean 1000

^ Creating a method like Array(object)
192326 [farrel.lifso] Array has a nice feature where it can take an object and return an
192327 [farrel.lifso] Whoops! Never mind just realised Array() isn't a class it's a method on Kernel.
192373 [Gennady.Byst] What you can do, though, use [] instead of ().
192380 [sean.ohalpin] You can define a method with the same name as a constant as they're in

^ Writable attributes - how does this work?
192331 [krekna gmail] How does this actually work?
+ 192333 [gm.vlkv gmai] => #<Object:0x24870738>
+ 192334 [ruby philip.] You'll probably get better answers from someone who is smarter than I am,
| 192372 [lukfugl gmai] Correct. Usually. As seen below, = sometimes is just an operator.
+ 192335 [leslieviljoe] Yes! song.duration = 257 calls the duration= method in Song.
+ 192336 [0011 hush.co] Its just passing 257 into the duration method via the new_duration
+ 192337 [0011 hush.co] works basically like
  192350 [krekna gmail] Thanx, it's clear to me now. Thank you all for the quick answers, each

^ FTGL Seg Faults on Win32
192332 [spam2 noreal] I'm trying to use FLGT ruby on Windows XP, but am running into a
+ 192354 [okesly hotma] You could try using the FxRuby OpenGL bindings.
+ 192375 [billk cts.co] That's strange.  I'll try to reproduce that problem here.
  192467 [spam2 noreal] I'm not sure these are what I'm after. I'm adding text support into my
  192483 [billk cts.co] libftgl.lib is not required, no.  I just included it for completeness sake in case
  192578 [xavier-list ] In the process of getting the C++ FTGL demo to run, I noticed the

^ Fowler's "EvaluatingRuby" article
192342 [Bil.Kleb nas] Bil
192358 [leavengood g] Very nice, the usual high-quality Martin Fowler article. It is good
192366 [pat.eyler gm] My favorite response thus far has been a java blogger (no URL, I

^ class << self
192343 [timuckun gma] I was reading through the source code of the DBI module and I saw thisline there.
+ 192345 [rosejn gmail] I asked the same question yesterday...
| 192347 [timuckun gma] Yes. I first tried to inherit from DBI but I couldn't because it's amodule. I then started reading it because it's a great way to learn alanguage.
| + 192349 [rblists gmai] I discovered it yesterday myself
| | 192377 [dave burt.id] Cheers,
| + 192619 [florgro gmai] include() it instead. :)
|   192651 [timuckun gma] I was going to do that but i still haven't quire wrapped my mindaround mix-ins. I decided on a container model and just declared adatabase handle as an instance variable.
+ 192351 [dblack wobbl] class << obj

^ [SUMMARY] Bracket Packing (#78)
192353 [james graypr] As I'm sure you have noticed by now, this was a very popular quiz.  The problem

^ each with arguments
192356 [churchill da] I've found myself writing the following code to address needs I have
+ 192359 [mike stok.ca] Have you looked at Enumerable#each_slice which is included in Array?
| + 192363 [churchill da] exacly what I was looking for. I had checked the ruby docs, but only
| | 192365 [mike stok.ca] Of course it would help if the answer was correct - see Alder Green's
| | 192368 [shortcutter ] You can as well use direct assignment, say if you want just every
| | 192382 [alder.green ] cool, didn't know about that one!
| + 192364 [alder.green ] irb(main):001:0> (1..10).each_slice(3) {|a| p a}
+ 192360 [alder.green ] require 'enumerator'

^ [slightly OT]: ebay4R
192357 [ctmailinglis] Anybody successfully using ebay4R. Having a bit of prob getting past the

^ extract DIV from HTML
192367 [dor octava.c] There is a need to find a specific DIV in a large HTML file (by it's
+ 192371 [okesly hotma] Couldn't you just use a regular expression?
+ 192378 [leavengood g] //div[@class='whatever']
| 192399 [james_b neur] Depends.  If the large HTML file is indeed a LARGE file, then REXML
| 192466 [dor octava.c] Many many thanks to you all,
| 192495 [james_b neur] Please note, though, that "this Forum" is really a Web front-end to an
| 192780 [dor octava.c] hhmmm! will be checked,
| + 192784 [dor octava.c] PLUS - It seems mechanize can not get pages from
| | 192848 [aaron_patter] What error do you get?  All mechanize unit tests are done against
| + 192787 [christoffer.] iconv!
|   192788 [dor octava.c] WOW! It works amazing amazingly well! I steel have a problem that i seem
|   192984 [alex blackke] Are you by any chance trying to get Mechanize to read a Rails app's own
|   193051 [dor octava.c] Exactamondo!
|   193058 [alex blackke] Thought so...  This came up recently on the rails list.  Rails is
|   193406 [dor octava.c] that's right, ... but i still want it ;-) !
+ 192397 [bpettichord ] Actually, i would use rubyful_soup for this. It is awesome!