315113-315825

314925-336656 subjects 315250-346109

^ IRB error using curl command.
315113 [snayler0 hot] Gday all.

^ SuperClass and Modules
315114 [shyl.sk gmai] I am very much new to Ruby
315115 [ei04065 gmai] Multiple inheritance has one big problem usually denominated as "the
315116 [jcoglan goog] You cannot have multiple inheritance without the diamond problem -- that
315118 [shyl.sk gmai] Thanks James and Pedro,
315122 [jcoglan goog] This is likely just my opinion, but it's mostly a question of semantics, of
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 gaz] I have a problem. I'm trying to parse with ruby some test results from
+ 315126 [b.candler po] str.gsub(/[\x80-\xff]/,'?')
| 315134 [Rob AgileCon] You can have bytes in that range as the first byte of a well-formed
| + 315138 [krzysieq gaz] Hey,
| + 315144 [b.candler po] That's why I said "if you really don't care" ... it strips all valid
+ 315136 [mark thomasz] Look at http://www.botvector.net/2007/11/encoding-problems.html,
+ 315137 [james graypr] If you can figure out the encoding they are actually in, I recommend
  + 315169 [jeremy hineg] 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 graypr] //TRANSLIT is better than that.  It tries to translate the
  + 315270 [krzysieq gaz] Unfortunately, there's no way telling the original encoding. I would rather
    + 315304 [gregory.t.br] If there is no way of telling the original encoding, the input data
    + 315315 [mark thomasz] er
      315383 [krzysieq gaz] Ok, I tried all previous suggestions, neither worked (gsub idea, TRANSLIT,
      + 315394 [gregory.t.br] Silly question, but did you set $KCODE = "U" while processing your data?
      | 315396 [krzysieq gaz] Sill answer, but what is $KCODE ?? I'm relatively new to Ruby, so this tells
      | + 315399 [gregory.t.br] It tells Ruby that you are working with UTF-8 ;)
      | + 315400 [james graypr] It's a global variable that affects how Ruby 1.8 handles characters.
      + 315397 [mark thomasz] 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 cesmai] 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 gma] 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 gmail] To be fair, MS Windows supports _mktemp() function.
+ 315180 [lloyd 2live4] def getRandLetter
  315183 [lloyd 2live4] def randomFileNameSuffix (numberOfRandomchars)
  315205 [djberg96 gma] 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 natha] It looks like you typed irb twice.  Once to get into the shell, and once while in the
| 315159 [cdj goh-inc.] Sometimes I open a parentheses without closing it, or a DO without an
| 315162 [tpreal gmail] 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 goog] 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 gma] 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 natha] I'll be interested to see if there is a better way to do this...
+ 315170 [h.bekel goog] Is this what you mean?
  315171 [nathan natha] 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 gmai] newbie for Rmagick...
315173 [serabe gmail] 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 velo] Hey folks,  I'm trying to create a program to ping one of my company's
+ 315184 [erikveen gma] `cmd` =3D> string
| + 315188 [tmcneil velo] Thanks much Erik!  I still need to study that link / see if I can figure
| + 315190 [tmcneil velo] hrm,  I've tried looking over the documentation in the link you
|   315196 [s.korteling ] f.puts system('ping 192.168.1.74').to_S
|   315272 [tmcneil velo] Thank you!  that was the bit that made the difference (backtick instead
+ 315187 [coder68 yaho] If you need to also get at stderr .. take a look at popen3

^ Singleton class's original class
315181 [pbrannan atd] irb(main):001:0> class Foo
+ 315185 [ara.t.howard] it might not be a class... but will this work?
| 315277 [pbrannan atd] 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 gmail] In general, an eigenclass (or singleton class) can be an eigenclass of
  + 315230 [jens.wille u] thanks, absorbed ;-)
  + 315322 [pbrannan atd] 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 gmail] 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 gmail] If I understand correctly what you want, try using the command +caller+

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

^ open-uri fetches outdated content vs. curl
315200 [dhchoi gmail] ================
315216 [shortcutter ] i) Both approaches use different paths to the server, namely a different
+ 315267 [dhchoi gmail] Thanks for these suggestions. The problem actually just cleared itself
+ 315811 [dhchoi gmail] 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 gmai] Do you guys know of a good Forum/Discussion board written in Ruby on Rails?
315208 [stephen.celi] There is Beast and El Dorado. I haven't heard much about Beast

^ Reseach paper on Ruby. Need references.
315203 [suneelgv gma] I'm doing masters in computer science. I'm required to submit a research
+ 315247 [rick.denatal] Hmm, this looks like it might be a chicken-and-egg problem.  Ruby doesn't
+ 315323 [lloyd 2live4] 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 gma] Thank you everyone for taking time to search and reply. The instructor
| 315336 [dave pragpro] 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 cesmai] 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 gma] 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] I mainly put performance into this release.  Benchmarking JSON parsers from

^ 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 gmai] 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 gmai] _ 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] I believe that the  Ruby source needs to compile with compilers besides gcc,
  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 delmont] RnJvbTogTWUgTWUgW21haWx0bzplbWFudWVsZWZAdGlzY2FsaS5pdF0gDQojIHZhcjEgPSAkMQ0K
+ 315223 [chris.lowis ] Are the parameters always delimited by commas ? In which case you could
| 315224 [emanuelef ti] Thans for answering,
| 315227 [botp delmont] RnJvbTogTWUgTWUgW21haWx0bzplbWFudWVsZWZAdGlzY2FsaS5pdF0gDQojIEkgd2FzIHRoaW5r
| 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 2live4] 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 graypr] 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 2live4] AHA!  I understand, or I at least flatter myself that I do.  how about
| + 315363 [botp delmont] RnJvbTogTWUgTWUgW21haWx0bzplbWFudWVsZWZAdGlzY2FsaS5pdF0gDQojID4+IGxpbmUuc2Nh
+ 315327 [w_a_x_man ya] s =3D "Client=3DMPEG-4,390000,700000,24000"
  315393 [lloyd 2live4] You are right, William.  That is cleaner.  nice!

^ Problem installing Qt4 gem on Windows
315225 [d_rems yahoo] Shouldn't windows gems be precompiled?
315282 [pilz osp-dd.] binaries are included in the Windows qt4 gem, but gem forces to use
315371 [d_rems yahoo] I have instaled Microsoft Visual C++ 2008 Feature Pack Redistributable
+ 315372 [pilz osp-dd.] 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 delmont] RnJvbTogTWUgTWUgW21haWx0bzplbWFudWVsZWZAdGlzY2FsaS5pdF0gDQojIEkgd291bGQgbGlr
| + 315229 [tpreal gmail] 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 cts.co] 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] FWIW, Ruby 1.9 seems to keep the original insertion order, reassiging a
| | + 315237 [matz ruby-la] Useful for some cases, especially for keyword arguments.
| |   + 315252 [rick.denatal] If I remember correctly, it's been a while since I looked at the code, 1.9
| |   | 315261 [matz ruby-la] You're right.  Thank you for pointing out.
| |   + 315254 [nobu ruby-la] And the performance of iterations improved a little, but
| + 315408 [lloyd 2live4] Well, that is not *entirely* true.
+ 315302 [ara.t.howard] gem install orderedhash
  315305 [jimrails gma] If scale is needed this has been implemented by Takuma Ozawa as a very
  315307 [ara.t.howard] require 'rubygems'

^ steping back with a debugger
315238 [etaern yahoo] Does ruby have a debugger with the capability of steping back , so that
315243 [rick.denatal] If by stepping back you mean "undoing" execution, then no.   In general, I
315245 [giel degekst] What debuggers do you use?
315273 [etaern yahoo] ruby -rdebug
315281 [djberg96 gma] I wonder if it will be possible in Maglev. :)
315283 [etaern yahoo] steping back in time would be a great feature for the debugger to have.
+ 315286 [huw darkneon] In Ruby In Steel you can navigate the call stack. This lets you
| 315290 [etaern yahoo] That looks awesome ! Thanks :)
+ 315295 [rick.denatal] There are a few specialized debuggers which allow time-travel to one degree

^ undefined method `element_name', dubble inherit
315239 [giel degekst] Dear all,

^ Marketing On Internet
315240 [marketingsre] The majority of people fail online. Why do so many people fail online?

^ Re: gem_original_require no such file to load
315241 [j2malik hotm] I'm having exactly the same problem but on a Mac.  I've tried the

^ rexml error
315244 [rakaur malki] Any time it parses anything that has "xmlns:xml" defined, it spits out
315317 [mark thomasz] REXML doesn't check to see what
315337 [rakaur malki] That ticket is wrong. It's fine to define it as the default namespace.

^ at_exit handler *except* for fatal runtime error
315249 [synergism gm] How do we execute a handler (I assume via at_exit) when a program
+ 315256 [aff28 delete] Inspect the value of $! (or $ERROR_INFO) in your at_exit handler. This
+ 315264 [b.candler po] "divide by zero" isn't a fatal error - you can catch it. But if you call
| 315293 [DAMisener gm] In our particular case we are creating run-time at_exit{} handlers
| 315312 [ara.t.howard] you can do this
+ 315306 [shortcutter ] exiting
  315308 [DAMisener gm] But out above example we want to suppress the  file rename for any
  315333 [shortcutter ] Oh, come on.  You can easily use that information to build what you want.
  315380 [robert.dober] Hmm maybe not Robert, my feeling is that they should not do what they
  315708 [DAMisener gm] Actually inverting the logic isn't that easy (at least for me)
  + 315709 [ara.t.howard] there is : 'rescue'
  + 315710 [ara.t.howard] class TentativeFile
  | 315721 [DAMisener gm] output=3DTentativeFile.new.open('temp.tmp','w')
  | 315729 [ara.t.howard] you've got to play with code at least a little!
  + 315722 [shortcutter ] It rather seems that you're making *your* life too hard. :-)
    315725 [DAMisener gm] ideas e.g.
threads.html
top