314883-412134 subjects 315239-346109

define anonymous module with closure
315093 [  i@0x 9. om] x, y = %w(x y)
315095 [ara.t.howard] x, y = %w( x y )
315097 [  i@0x 9. om] =A0
315101 [ara.t.howard] x, y = %w( x y )
315107 [quixoticsyco] ...if you are constrained to 1.8.6.

WIN32OLE Question
315098 [btrichardson] I'm currently using the win32ole api to access an application on a
315132 [masaki.suket] Unfortunately, I think it is impossible.
315135 [btricha@gm i] Thanks for the reply.  I've thought about this approach, but after
315204 [botp@de mo t] # Thanks for the reply.  I've thought about this approach, but after
315297 [btricha@gm i] Not sure I understand the usefulness of samba4 for solving my current

[ANN] camellia_rb 1.1
315103 [sugano@ar e-] camellia_rb version 1.1 released.

basic Regex question
315104 [greg.hauptma] dumb question perhaps, but how do I do a Ruby based regex expression
315105 [botp@de mo t] # dumb question perhaps, but how do I do a Ruby based regex expression
315108 [greg.hauptma] excellent - thanks heaps

Gem  program  -- cannot install libxslt-ruby-0.3.6.gem
315110 [heller@de ps] I am trying to install some version of libxslt-ruby on my  CentOS 4.7
315117 [b.candler@po] Well, the latest is available at
315160 [heller@de ps] /usr/local/share/bard-spock/spock update.rdf -i
+ 315165 [b.candler@po] Have you done 'require "rubygems"' ?
| 315176 [heller@de ps] It is not my code.  I guess I will need to 'blindly' hack
+ 315191 [mark@th ma z] How exactly does libxslt help you do this?
  315192 [heller@de ps] It is used by the 'spock' program, which is written in Ruby as a CLI
  315313 [mark@th ma z] Maybe that will help?
  315330 [heller@de ps] Sort of. I needed additional munging around with links to make the

IRB error using curl command.
315113 [snayler0@ho ] Gday all.

SuperClass and Modules
315114 [shyl.sk@gm i] I am very much new to Ruby
315115 [ei04065@gm i] Multiple inheritance has one big problem usually denominated as "the
315116 [jcoglan@go g] ...
315118 [shyl.sk@gm i] Thanks James and Pedro,
315122 [jcoglan@go g] ...
315483 [shortcutter@] +1

Problem with getting RegEx to work
315119 [henrik415@gm] All,
+ 315120 [b.candler@po] The question-mark in (.*?) makes the capture "ungreedy". It matches as
| 315123 [henrik415@gm] So this wasn't a Ruby question at all.
+ 315121 [w_a_x_man@ya] * means zero or more, so Ruby gives you

How to clean an xml files from non-utf-8 chars?
315124 [krzysieq@ga ] ...
+ 315126 [b.candler@po] str.gsub(/[\x80-\xff]/,'?')
| 315134 [Rob@Ag le on] You can have bytes in that range as the first byte of a well-formed
| + 315138 [krzysieq@ga ] ...
| + 315144 [b.candler@po] That's why I said "if you really don't care" ... it strips all valid
+ 315136 [mark@th ma z] Look at http://www.botvector.net/2007/11/encoding-problems.html,
+ 315137 [james@gr yp ] If you can figure out the encoding they are actually in, I recommend
  + 315169 [jeremy@hi eg] This is the approach we have take on some of our code, basically we wanted to
  | + 315174 [gregory.t.br] Iconv.conv("UTF-8//IGNORE", old_encoding_name, data)
  | + 315175 [james@gr yp ] //TRANSLIT is better than that.  It tries to translate the
  + 315270 [krzysieq@ga ] ...
    + 315304 [gregory.t.br] If there is no way of telling the original encoding, the input data
    + 315315 [mark@th ma z] er
      315383 [krzysieq@ga ] ...
      + 315394 [gregory.t.br] Silly question, but did you set $KCODE = "U" while processing your data?
      | 315396 [krzysieq@ga ] ...
      | + 315399 [gregory.t.br] It tells Ruby that you are working with UTF-8 ;)
      | + 315400 [james@gr yp ] It's a global variable that affects how Ruby 1.8 handles characters.
      + 315397 [mark@th ma z] How is the XML file created? If you know in advance which parts of the

Threads preventing garbage collection?
315125 [b.candler@po] I wondered if someone can explain the following behaviour to me.
+ 315139 [shortcutter@] There is no guarantee that all collectible objects are indeed
| 315142 [b.candler@po] OK, please consider my question rephrased as "why are these objects not
| 315149 [shortcutter@] You probably just did not allocate enough new objects to make the GC
| 315150 [b.candler@po] Your version only works because the threads are dying after 2 seconds.
| 315151 [ara.t.howard] but that it expected?  you have a Foo which referes to a Thread which
| + 315155 [shortcutter@] Good point!
| + 315164 [b.candler@po] Foo ------------>
|   315177 [ara.t.howard] but threads *do* hold their context
|   315195 [b.candler@po] Could you define "context" in this, erm, context? :-)
|   315213 [ara.t.howard] nope - we'll have to wait for matz!  ;-)
+ 315152 [sean.ohalpin] The threads are not garbage collected until they terminate and so the

Ruby system programs
315127 [pshussain@gm] Hai all,
+ 315128 [wieczo.yo@go] Heya!
+ 315130 [framefritti@] You do not specify the OS you are working with (Windows, Linux, ...).
| 315131 [b.candler@po] There is also http://snmplib.rubyforge.org/
+ 315140 [znmeb@ce ma ] Yes, but it is operating-system dependent. For most flavors of Unix,
  315141 [pshussain@gm] Dear Edward,
  315143 [b.candler@po] Google is your friend.

Generating a semi-random, but legal, filename
315145 [djberg96@gm ] I thought this would be a fun brain teaser. In short, I need a way to
+ 315146 [b.candler@po] Aside, for those who aren't aware, there is tempfile.rb in the Ruby
+ 315157 [phasis@gm il] To be fair, MS Windows supports _mktemp() function.
+ 315180 [lloyd@2l ve ] def getRandLetter
  315183 [lloyd@2l ve ] def randomFileNameSuffix (numberOfRandomchars)
  315205 [djberg96@gm ] 5.

Re: Statistician III (#177)
315147 [matthew.moss] No takers, eh?

irb shell exit
315153 [scottharper2] I am totally new to programming so this may sound stupid, but I would
+ 315154 [nathan@na ha] It looks like you typed irb twice.  Once to get into the shell, and once while in the
| 315159 [cdj@go -i c.] Sometimes I open a parentheses without closing it, or a DO without an
| 315162 [tpreal@gm il] Your exit is not really executed, because as you see, you are without
| 315163 [scottharper2] The problem was that I didn't type end.  I feel very stupid now.  Thanks
+ 315167 [h.bekel@go g] Note that "exit" is just another ruby function that simply exits the

xUnit-style output from test/unit?
315156 [cohen.jeff@g] Anyone know if there's a way to transform test/unit output into xUnit
315161 [djberg96@gm ] Appears to be actively developed. I haven't tried it myself, though.
315280 [cohen.jeff@g] e.org/readme.html

Calling a Method
315166 [ron.green@gm] If I have a file that contains a method that takes one parameter. and
+ 315168 [nathan@na ha] I'll be interested to see if there is a better way to do this...
+ 315170 [h.bekel@go g] Is this what you mean?
  315171 [nathan@na ha] Nice. I should have looked at the Ruby man page.  -r makes sense.
  315197 [ron.green@gm] Thanks Nathan.

RMagick > image crop or clipp with 4 cornres coordinates
315172 [xu87785@gm i] newbie for Rmagick...
315173 [serabe@gm il] If you want something general, look at the methods define_clip_path

gem install weirdness
315178 [rogerpack200] For some reason gem is installing v 0.9.0 by default [0.12.0 is the

Getting Ruby to output a windows command to text (log) file.
315179 [tmcneil@ve o] Hey folks,  I'm trying to create a program to ping one of my company's
+ 315184 [erikveen@gm ] `cmd` =3D> string
| + 315188 [tmcneil@ve o] Thanks much Erik!  I still need to study that link / see if I can figure
| + 315190 [tmcneil@ve o] hrm,  I've tried looking over the documentation in the link you
|   315196 [s.korteling@] f.puts system('ping').to_S
|   315272 [tmcneil@ve o] Thank you!  that was the bit that made the difference (backtick instead
+ 315187 [coder68@ya o] If you need to also get at stderr .. take a look at popen3

Singleton class's original class
315181 [pbrannan@at ] irb(main):001:0> class Foo
+ 315185 [ara.t.howard] it might not be a class... but will this work?
| 315277 [pbrannan@at ] It would, except that calling #singleton_class isn't the only way to get
| 315316 [ara.t.howard] yup - i was afraid you'd say that...
+ 315194 [tpreal@gm il] In general, an eigenclass (or singleton class) can be an eigenclass of
  + 315230 [jens.wille@u] thanks, absorbed ;-)
  + 315322 [pbrannan@at ] irb(main):001:0> class Base; end
    + 315324 [jens.wille@u] irb(main):006:0> ObjectSpace.each_object(sc) { |c| p c if
    + 315331 [tpreal@gm il] You're right. I was thinking about "regular" object's eigenclasses and
      315339 [jens.wille@u] not sure what you mean by that. but it fails for the singleton

Configatron 2.0.0 Released
315182 [markykang-ru] The Configatron configuration library has undergone an extensive rewrite

which Class called my Class?
315186 [zach.buckhol] I have a script that queries servers in our environment to assist with
315193 [tpreal@gm il] If I understand correctly what you want, try using the command +caller+

give me advices about method name
315198 [kwatch@gm il] I'm wondering what method names are appropriate for my library.
315210 [phrogz@ma .c] In English, the all* methods should pluralize their nouns...
315215 [kwatch@gm il] Thank you, Phrogz.

open-uri fetches outdated content vs. curl
315200 [dhchoi@gm il] ================
315216 [shortcutter@] i) Both approaches use different paths to the server, namely a different
+ 315267 [dhchoi@gm il] Thanks for these suggestions. The problem actually just cleared itself
+ 315811 [dhchoi@gm il] I used net/http to do the same thing, but this time I printed out the
  315825 [shortcutter@] Daniel, thanks for the update!  This is interesting stuff.  The

Forum/Discussion board in Ruby
315201 [rajat79@gm i] ...
315208 [stephen.celi] There is Beast and El Dorado. I haven't heard much about Beast

Reseach paper on Ruby. Need references.
315203 [suneelgv@gm ] I'm doing masters in computer science. I'm required to submit a research
+ 315247 [rick.denatal] ...
+ 315323 [lloyd@2l ve ] When I ran the search I got lots of papers back.  Perhaps it is the
+ 315325 [ara.t.howard] not a great one, but since you are grasping...
| 315332 [suneelgv@gm ] Thank you everyone for taking time to search and reply. The instructor
| 315336 [dave@pr gp o] You might ask your instructor how the first 10 papers got published if
| + 315338 [xeno.campano] I think the idea is that it is very easy these days to steal papers and automate
| + 315374 [znmeb@ce ma ] Then again, you might try not being snotty to someone who controls what
|   315395 [gregory.t.br] Oh, I don't know.  If someone doesn't make these obvious statements
|   315410 [martindemell] Well, there's all the difference between a research paper and a survey
+ 315414 [marcelo.maga] Did you try Google Scholar?  Without you mentioning the five papers you
  315421 [suneelgv@gm ] I did try Google Scholar. But didn't find any thing that has been

http net PUT
315207 [justin.macca] i'm trying to mimic a curl command Im using in ruby
315248 [mail.list@fi] not exactly what you want but close and i  know it works...

[ANN] Grammar 0.8.1 - a performance release
315209 [eric.mahurin] ...

The mystery of File::append
315211 [sentinel.200] $ ri File::append
315217 [stefano.croc] It's part of the facets library. Unfortunately, ri doesn't show the name of
315218 [sentinel.200] Aah, thanks. Yes, I used facets last year...
+ 315220 [stefano.croc] According to the facets documentation, a simple
+ 315258 [transfire@gm] require 'facets/{class|module}/{method_name}'

inits.c confused me
315219 [liumengjiang] i am reading the ruby source, but the follow inits.c confused me.
315246 [rmagick@gm i] It's a function declaration. Init_Array is an external function that is
315291 [liumengjiang] since It's a function declaration, and in array.c the init_array define
315309 [rmagick@gm i] _ is a macro that is defined in defines.h. It's purpose is to support
+ 315355 [liumengjiang] I see, thanks Tim!
+ 315360 [liumengjiang] 5.26 Prototypes and Old-Style Function Definitions
  315515 [rick.denatal] ...
  315637 [liumengjiang] now i known the _((void)) is a macro. another question if there is a

Suggestion for string parsing
315221 [emanuelef@ti] I would like to know if there's a better way to parse a string and
+ 315222 [botp@de mo t] # var1 = $1
+ 315223 [chris.lowis@] Are the parameters always delimited by commas ? In which case you could
| 315224 [emanuelef@ti] Thans for answering,
| 315227 [botp@de mo t] # I was thinking if there some kind of c sscanf,
| 315231 [emanuelef@ti] Thanks
| + 315253 [emanuelef@ti] is there a way to use the scanf to parse a string not knowing how many
| | 315255 [b.candler@po] I'd still use Regexp.
| | 315262 [emanuelef@ti] thanks,
| | + 315266 [b.candler@po] %s is terminated by whitespace. You have no way of telling scanf that
| | + 315268 [lloyd@2l ve ] Well, you can always write a BreakApart() algorithm but I must agree
| |   315274 [emanuelef@ti] I'm quite new to Ruby and I can understand that athere are better way to
| |   + 315276 [james@gr yp ] I believe there's a bug in your regex.  I assume you don't really mean
| |   + 315279 [b.candler@po] If you don't actually need to match the data against a pattern, then
| |   + 315320 [lloyd@2l ve ] AHA!  I understand, or I at least flatter myself that I do.  how about
| + 315363 [botp@de mo t] # >> line.scanf("%6s=%6s,%d,%d,%d,%d")
+ 315327 [w_a_x_man@ya] s =3D "Client=3DMPEG-4,390000,700000,24000"
  315393 [lloyd@2l ve ] You are right, William.  That is cleaner.  nice!

Problem installing Qt4 gem on Windows
315225 [d_rems@ya oo] Shouldn't windows gems be precompiled?
315282 [pilz@os -d .] binaries are included in the Windows qt4 gem, but gem forces to use
315371 [d_rems@ya oo] I have instaled Microsoft Visual C++ 2008 Feature Pack Redistributable
+ 315372 [pilz@os -d .] So, it works :) It's needed cause, i compiled Qt 4.4.1 and qtruby with
+ 315454 [luislavena@g] You're getting the building native extension issue since the gem

Preserve insert order in a Hash
315226 [emanuelef@ti] I would like to know if it's possible to insert values in a Hash and
+ 315228 [botp@de mo t] # I would like to know if it's possible to insert values in a Hash and
| + 315229 [tpreal@gm il] Could anybody explain why this feature was added? Isn't it going to slow
| | + 315232 [emanuelef@ti] well, basically I just need a Hash to use String as indexes like
| | | + 315233 [rasputnik@he] Can't you just sort them on the way out?
| | | | 315234 [emanuelef@ti] thanks
| | | + 315235 [yu.ching.tie] a  = []
| | | | 315236 [emanuelef@ti] I think this is not my case, I need a Hash as I explained
| | | | 315242 [billk@ct .c ] Here's an implementation for ruby 1.8 ... I apologize for the lack of tests.
| | | | 315298 [emanuelef@ti] Thanks a lot! That worked perfectly
| | | + 315251 [b.candler@po] What do you want to happen if sourceInfo["var2"] is assigned a second
| | |   315265 [rick.denatal] ...
| | + 315237 [matz@ru y- a] Useful for some cases, especially for keyword arguments.
| |   + 315252 [rick.denatal] ...
| |   | 315261 [matz@ru y- a] You're right.  Thank you for pointing out.
| |   + 315254 [nobu@ru y- a] And the performance of iterations improved a little, but
| + 315408 [lloyd@2l ve ] Well, that is not *entirely* true.
+ 315302 [ara.t.howard] gem install orderedhash
  315305 [jimrails@gm ] ...
  315307 [ara.t.howard] require 'rubygems'

steping back with a debugger
315238 [etaern@ya oo] Does ruby have a debugger with the capability of steping back , so that
315243 [rick.denatal] ...
315245 [giel@de ek t] What debuggers do you use?
315273 [etaern@ya oo] ruby -rdebug
315281 [djberg96@gm ] I wonder if it will be possible in Maglev. :)
315283 [etaern@ya oo] steping back in time would be a great feature for the debugger to have.
+ 315286 [huw@da kn on] In Ruby In Steel you can navigate the call stack. This lets you
| 315290 [etaern@ya oo] That looks awesome ! Thanks :)
+ 315295 [rick.denatal] ...