325974-333106

325776-412266 subjects 326135-350613

replacing callcc by catch/throw
325974 [thomas@fa n.] in his book ``The Ruby Programming Language'' Mats discourages from
+ 326020 [b.candler@po] Well, I don't really understand what's going on, but I observe from the
| 326092 [thomas@fa n.] I've looked for the simpliest example to demonstrate the diffence.
| 326146 [b.candler@po] OK, I see the problem now. If you use the same symbol everywhere, this
| + 326202 [thomas@fa n.] That's not enough. Now recursion comes into place: multiline_tail can
| | 326243 [b.candler@po] Oh yes - sorry for being dense. So the attraction of callcc is it
| + 326359 [thomas@fa n.] The lexicographical scope lets one see, if a locally created object is
+ 326223 [charles.nutt] In an almost totally unrelated vein, I just committed support for
| 326263 [robert.dober] My question is, and apologies if I am being stupid here, what is the
| 326302 [charles.nutt] We pass more specs? :)
+ 326244 [akr@fs j. rg] The argument of catch is optional in Ruby 1.9.
  + 326246 [b.candler@po] ... and I see that even with an explicit tag, it doesn't have to be a
  + 326358 [thomas@fa n.] Fine! I like that much more than it is in Ruby 1.8. Imagine a Ruby
    326405 [robert.dober] Bad design IMHO
    326440 [charles.nutt] The funny thing is that that's basically what the "downward" callcc

Super User Can't Change UID?
325983 [james@gr yp ] Why would the super user not be able to switch UID's?
+ 325984 [michel.boave] This works on my gentoo without any problem. Try to became root and
| 325985 [james@gr yp ] $ sudo sh
| 325993 [Rob@Ag le on] It works for me on Ubuntu and Mac OS X also.
| 325998 [james@gr yp ] Were you using Apple's bundled Ruby or something you compiled?
| 325999 [Rob@Ag le on] Apple's /usr/bin/ruby.  (I'd answered before I saw your
| 326000 [james@gr yp ] $ sudo ruby_dev -r etc -ve 'Process.uid = Etc.getpwnam("james").uid'
| 326001 [ezmobius@gm ] It fails for me on my self compiled ruby 1.8.6 on osx but the built
+ 325992 [james@gr yp ] Another data point on this odd issue:  Apple's bundled Ruby (I'm on OS
| 326029 [djberg96@gm ] Are you on 10.4.x?
+ 326005 [djberg96@gm ] I seem to recall that setreuid() is busted on OS X, 10.4.x anyway. I
  326047 [james@gr yp ] I'm on Mac OS X 10.5.6.
  326057 [ezmobius@gm ] Does something like this not work for you?
  326064 [james@gr yp ] This worked.  Thanks so much Ezra.

how can I switch over an array ?
325987 [lyon2003@ly ] def call(char,value)
+ 325994 [matt@ti bi s] when *" #!@$%".split("") -- extend string as desired
| 325995 [dblack@ru yp] Yes, it will.
+ 326008 [shortcutter@] PATTERN = [
| 326013 [lyon2003@ly ] The one with
+ 326019 [b.candler@po] SPECIAL = /\A[#{Regexp.escape(" #!@$%^&*(){}[]'\"<>,.?;\r\n")}]\z/
+ 326045 [apeiros@gm .] @map = Hash.new { |map, char| proc { |value| puts "don't know what to do
+ 326061 [w_a_x_man@ya] def call char, value

how to iterate on date ranges
326004 [revathy.p@an] If user enters, 2 date parameters.i want to find all the folders between
326006 [phasis@gm il] require 'date'
326007 [Rob@Ag le on] Why iterate a range of Strings when you can just use Dates!

## Rabbi caught on tape with 17 stripper hidden video
326010 [lettus.belie] Right here http://rabbishare.blogspot.com/2009/01/rcmp-obstructed-paramedics-firefighter.html

Discover BSSIDs of Surrounding Access Points
326015 [btrichardson] I'd like to write a Ruby plugin to query the Skyhook Wireless API for

regexp multiple matches
326021 [faivrem@gm i] /(\d+),(\d+)(;(\d+),(\d+))*/
+ 326024 [dblack@ru yp] What's the string?
+ 326025 [andrew@an re] Mickael
  326034 [faivrem@gm i] And is there a way to keep previous matching ?
  + 326046 [andrew@an re] What about tackling it from a completely different angle
  | 326048 [faivrem@gm i] Sure, that's what I've just done :)
  + 326055 [Rob@Ag le on] => /(\d+),(\d+)(;(\d+),(\d+))*/

how to get an absolute address of a link
326022 [lyon2003@ly ] Is there some URL lib that I can use to get the absolute address of a
326049 [lparravi@gm ] You can use URI.join
326052 [lyon2003@ly ] Very nice ! Thanks ! I was wondering if it would handle joins with

load a local gem while an older lib version still exists
326023 [edrd.dantes@] I have installed the mechanize 0.9.0.gem on ubuntu.
326030 [perfectly.no] Assuming the gem name is "mechanize", put this

Defining an ActiveRecord class within a method of another class
326027 [glenn_ritz@y] ...
+ 326031 [lyon2003@ly ] irb(main):042:0> class Res
| 326033 [lyon2003@ly ] Sorry , I pasted the same thing twice
+ 326043 [jgabrielygal] instance methods of the Results class. (The instance methods of the Result=
+ 326065 [b.candler@po] Class.new(superclass) should do what you need without need to eval

Pushing up to Module or Class?
326035 [Shak@sh k. o] Yes, this question has been asked many times all over the Internet so I'm a
326039 [shortcutter@] I tend to view class inheritance in Ruby as "is a" relationship while

MiniTest & Test::Unit::TestResult in Ruby 1.9.1
326036 [jamesmead44@] It looks like Test::Unit::TestResult [1] has disappeared in Ruby 1.9.1. Is
326038 [james@gr yp ] This is correct.  Test::Unit has been retired.
326071 [transfire@gm] Retired? I beleive it is still an active project, only it is now a
326073 [james@gr yp ] Yeah, my bad.  I should have said it has been retired as a standard

[ANN] backup.rb
326040 [funkaster@gm] ;-)

MiniTest / Test::Unit
326041 [jamesmead44@] I'm struggling to understand the combinations in which MiniTest and
326053 [gregory.t.br] You can also gem install test-unit -v 1.2.3 on 1.9.1 to get back the
326181 [jamesmead44@] 2009/1/28 Gregory Brown <gregory.t.brown@gmail.com>

function inside a function
326042 [jason.lillyw] def function_a(x = 1)
+ 326044 [jgabrielygal] The problem here is that when you write function_a, this is actually
+ 326054 [CHubas7@gm i] In ruby, function_a is a method call (with no arguments), and as a
  + 326059 [jason.lillyw] Perfect. Thank you!
  + 326062 [b.candler@po] Or, if you really want to do this with def'd methods, you can use

"adding" two hashes
326066 [bryson@ma li] I'm wondering if it is possible to "add" the values of two hashes
+ 326067 [ben@bl yt in] irb(main):007:0> a = {:a => 1}
+ 326068 [Rob@Ag le on] => {:key_two=>200, :key_one=>100}
+ 326069 [rmagick@gm i] No built-in way, but it would be easy to use hash1.each_key to iterate
  326077 [Rob@Ag le on] => {:key_two=>500, :key_three=>400, :key_one=>100}

Ruby on Solaris 10 performance problems
326070 [colmac@gm il] We just installed ruby on a
+ 326081 [djberg96@gm ] What version of Ruby?
| 326153 [colmac@gm il] ruby 1.8.7 (2008-08-11 patchlevel 72) [sparc-solaris2.10]
+ 326156 [shortcutter@] SPARC processors are slow, raw CPU speed is not among the strengths of
| + 326157 [colmac@gm il] ...snip... IMHO it's a dead technology.
| | 326159 [shortcutter@] I don't say that Sparc machines or Solaris operating systems do not
| + 326240 [rubfor@re it] CISC processor commands are more powerful, so you need
+ 326188 [mark@th ma z] I wonder what kind of performance you'd get if you used JRuby 1.1.6+
| 326213 [colmac@gm il] java runs 7 times slower on this RISC platform, just going to drop it.
| 326342 [charles.nutt] 7 times slower than what? Non-RISC?
+ 326211 [overlord@gm ] What machine are
  326214 [colmac@gm il] at this point it does not matter. really the only question was why it is
  326239 [pbooth@no oi] ...
  326242 [shortcutter@] I am not sure I understand what you mean by that since you seem to
  326275 [colmac@gm il] Thanks Peter and Robert for all your insights about his subject. This
  + 326338 [shortcutter@] That sounds extremely long.  I'd dig into that issue. Do you have
  | 326532 [pbooth@no oi] I'd second Robert's comment. If your web app takes 5 seconds to build a
  + 326351 [colmac@gm il] This illustrates the importance of complete disclosure of information

problems with rubygems while debugging
326072 [mail@no -s i] $ ruby -rdebug test.rb
326091 [abc3def@gm i] ruby -rubygems -rdebug test.rb
326475 [mail@no -s i] thank you very much, that's it.

yield vs. return
326076 [klochner@gm ] I couldn't find any meaty discussions on this topic, so maybe it's
+ 326078 [stefano.croc] yield and return do completely different things, and you can't use one in=20
| 326080 [klochner@gm ] On Jan 28, 3:21=A0pm, Stefano Crocco <stefano.cro...@ali
| 326145 [shortcutter@] 2009/1/28 klochner <klochner@gmail.com>
+ 326083 [fred@la av .] Depends on what you do with it.  I kinda like to use yield in "builder"
  326085 [klochner@gm ] thanks Fred, this sounds sane to me.

Errno::ENOMEM reading a device in Ruby, not in Java though
326079 [rogerpack200] Question on how to avoid an Errno::ENOMEM
+ 326132 [matz@ru y- a] Strange.  ENOMEM is not listed among errors that read(2) can raise.
+ 326137 [phasis@gm il] The another difference between ruby and java is read buffer size.
  326179 [matz@ru y- a] I didn't know that.  In that case, you have to pre-allocate reading

Issue with 'OptionsParser' and my brain
326082 [Aldric Giaco] So, I followed the tutorial and got this far..

Bitwise question
326084 [abarringer@b] ...
+ 326086 [pjb@in or at] (def check(permissions,bits)
| + 326088 [Rob@Ag le on] class Integer
| | + 326100 [pjb@in or at] Simplier?  A class, two methods, a lot of operations, a lot of memory!
| | | 326116 [dblack@ru yp] as_bits is just there to provide information for the sake of
| | + 326115 [dblack@ru yp] Thanks for the reminder about Integer#[], one of those cool Ruby
| |   326128 [no@sp m. le ] 9547[0..-1]
| |   326130 [abarringer@b] Thanks guys, the answers provided contained what I was looking for. I =
| + 326089 [dblack@ru yp] Possibly more efficient since it short-circuits on the first failed
| + 326094 [albertschlef] That what happens when one spends his time typing parenthesis instead of
|   326102 [pjb@in or at] Bit 0 is the first bit.  2^0 = 1
|   326114 [albertschlef] I stand corrected.
|   326117 [dblack@ru yp] I could imagine wanting to handle the [] case conservatively. If the
+ 326098 [apeiros@gm .] requested_bits.all? { |bit| permissions[bit] == 1 }

[ANN] sys-proctable 0.8.0
326087 [djberg96@gm ] I'm happy to announce the release of sys-proctable 0.8.0.

Compiling mysql-ruby-2.8 problems
326090 [abc3def@gm i] I am trying to compile mysql-ruby-2.8
326112 [abc3def@gm i] I have compiled it (had wrong environment), but still don't understand
+ 326162 [abc3def@gm i] Getcha. 'main' stands for 'int main()' and actually does nothing here,
+ 333058 [krazonline@g] I m very knew to Ruby, and I m also having similar issue. i.e.
  + 333084 [jazzezravi@g] In case you are working in Windows then do this.
  + 333106 [abc3def@gm i] 1. Start > Visual Studio 2008 > Visual Studio Tools > Visual Studio

Studying the object model
326093 [albertschlef] I'm looking for some study aid. I want to understand Ruby's object model
+ 326118 [satish.talim] The Pragmatic screencast - Episode 1: Objects and Classes ($5.00, 29
+ 326131 [m.fellinger@] (it's free, unlike the screencast)
+ 326133 [justincollin] I think you want something more visual than this (?) but you can always
  326144 [shortcutter@] Here's an easy way to get a visual graph of the currently defined

error with regular expression inside eval block
326096 [barunio@gm i] I'm seeing strange behavior with Ruby 1.8 when I try to evaluate a
326097 [ibc@al ax ne] eval %Q{'1' =~ /^[\\d]+$/}
326099 [barunio@gm i] Ah, thanks that worked. I wonder why extra escaping is needed just
+ 326147 [b.candler@po] It's not in a block, it's just inside a string. There are two types of
+ 326160 [shortcutter@] It's not a block - it's a doubly quoted string!

proper use of classes
326101 [tomcloyd@co ] Greetings...
+ 326119 [dblack@ru yp] instance.some_method(data)
| 326149 [tomcloyd@co ] Uh, yes. I had undervalued this possibility, about which I did know. I
| 326155 [dblack@ru yp] "Class" and "method" are not commensurate. They're categorically
| 326161 [b.candler@po] Good example. Similarly, methods which act on the filesystem, but don't
+ 326158 [shortcutter@] You might want to have a look at all those patterns around - they
| 326191 [tomcloyd@co ] David, Brian, Robert - THANKS!
| 326251 [dblack@ru yp] I definitely would not discourage exploration of this kind. I'm 100%
| 326360 [tomcloyd@co ] Ah. Now I understand. I actually never positing that at all. I didn't
| + 326362 [pjb@in or at] First you write a problem statement.
| | 326432 [tomcloyd@co ] Pascal,
| + 326365 [shortcutter@] IMHO there is an important distinction though which makes Fortran
|   326431 [tomcloyd@co ] Robert - I absolutely agree, and I can to that (or THOSE)
+ 326194 [martindemell] One thing that might help is an object to encapsulate the environment
  326205 [tomcloyd@co ] Wow. Martin that's a fascinating idea. Terrific notion. Gonna try to

[ANN] rdoc 2.3.0 Released
326103 [drbrain@se m] rdoc version 2.3.0 has been released!

[ANN] rdoc_html_templates 2.3.0 Released
326104 [drbrain@se m] rdoc_html_templates version 2.3.0 has been released!

[ANN] rdoc_chm 2.3.0 Released
326105 [drbrain@se m] rdoc_chm version 2.3.0 has been released!

RDoc 2.3 now with Darkfish, without CHM and extra HTML templates
326106 [drbrain@se m] This release of RDoc brings some big changes. Most notably Michael =20
+ 326121 [vjoel@pa h. ] It does look nice, except for source code display. The bg color is gray,
| 326122 [mike.gold.44] I appreciate the effort, it's just the colors do seem odd.  The
+ 326129 [m.fellinger@] ^ manveru
+ 326150 [martindemell] The RDoc documentation is a pretty bad sample, since the majority of
| 326168 [drbrain@se m] On Jan 29, 2009, at 3:24, Martin DeMello <martindemello@gmail.com>
| 326178 [martindemell] Will sift rubyforge for candidates. Prawn looks pretty good in terms
| 326180 [gregory.t.br] Now that prawn has been split out into various extensions, prawn-core
| 326224 [drbrain@se m] sudo gem rdoc --all --no-ri
+ 326250 [no@sp m. le ] Thanks, I think it's an improvement. Still has a way to go IMO, however...
| + 326262 [james@gr yp ] I whole heartedly agree with that.
| | + 326264 [transfire@gm] How could anyone NOT agree? Since the file page often contains nothing.
| | | + 326265 [gregory.t.br] Oh, that's a very interesting thought.  +1
| | | | 326266 [james@gr yp ] Yeah, I agree.  That would be nice.
| | | + 326322 [drbrain@se m] more -t and vim -t work very well for me...
| | + 326308 [drbrain@se m] Try the quicksearch at the top of the class index
| |   326315 [radek.bulat@] section FILES: bullet_toggle_minus.png (I think that all .png files
| |   326324 [martindemell] I've filed a bug for this
| + 326318 [drbrain@se m] If you don't file a bug it won't get fixed.
|   326355 [no@sp m. le ] Done. I wasn't familiar enough with RDoc to be sure it was a bug,
|   326429 [drbrain@se m] If you think it could possibly be a bug, best to file it!
+ 326259 [transfire@gm] (Sigh. the Google Group mirror is acting up again, so i will be replying
| 326320 [drbrain@se m] I'm confused, the default RDoc template never had a sidebar.  If you
+ 326566 [rogerpack200] I do like how the new sample looks.
| 329503 [drbrain@se m] I restored a method index from the main page in RDoc 2.4.
| 329534 [rogerpack200] Thanks for doing that.
| 329552 [drbrain@se m] $ curl -I http://rdoc.rubyforge.org/RDoc/RDoc.html#M000417
| 329557 [matt@ti bi s] You didn't read what he said. He said that on that page are links to
| 329718 [drbrain@se m] ah, oops! fixed, RDoc 2.4.1 forthcoming shortly.
+ 326750 [stefano.croc] Very well done! I'm glad that at last we can have rdoc documentation without
  327192 [ged@Fa ri MU] That's my fault -- I hard-coded the path in the templates. I've added

Change Gempath at Runtime
326108 [me@mi ha lb ] I have a problem with my host. I have several gems installed through
326109 [drbrain@se m] ...

Search for string in folder names
326123 [revathy.p@an] I will be getting some string through params[:first_name].and i want to
+ 326124 [andrew@an re] Dir.glob("/path/to/base/dir/*#{search_string}*")
+ 326125 [azimuth-ruby] def getNames(param, directory = Dir.getwd)

Funny Videos
326126 [tomekwojciec] Free videos, humor, comedy, features to upload, share, rate and watch

Real life use of each_cons?
326134 [f.mischa@gm ] I've been going through the enumerable/enumerator methods that I'm
+ 326138 [gregory.t.br] I think you may have been confused by my ugly code there.  I have
| 326139 [gregory.t.br] Technical Blaag at: http://blog.majesticseacreature.com
| 326140 [f.mischa@gm ] Interesting. Thanks a bunch Gregory. Traversal had occurred to me as a
| 326142 [gregory.t.br] Already done.
+ 326143 [shortcutter@] Useful applications are those where you need a moving window over a
threads.html
top