169082-379616

168905-195288 subjects 169314-172185

Re: Shuffling an array, sort_by{rand}'s bias (was Re: need some Ruby
169082 [schmitt@nu .] So I suggest the following 'pythonic' solution ;-)
169091 [ mfp@ac .o g] arr.sort_by{rand}
169100 [schmitt@nu .] that is not equivalent to my solution.
+ 169108 [michael.ulm@] I would have thought those two functions do the same thing
| 169124 [schmitt@nu .] If you use random as sorting key, the result of a<=>b
| + 169125 [decoux@mo lo] run
| | 169135 [schmitt@nu .] Thanks. As I told you before I'm new to ruby ;-)
| + 169157 [surrender_it] Are you sure of what you say? AFAIK
| + 169171 [steve@wa ts ] Ok, I think I've beat sort_by{ rand } on large Arrays , by about 30%.  I
|   + 169172 [vjoel@pa h. ] 2**30 - 1 is reliably a fixnum (though I guess it might not be the
|   + 169173 [steve@wa ts ] OOPS!
|     169176 [steve@wa ts ] Here's another shot.. still faster than sort_by{rand} on my system, and
|     169182 [ mfp@ac .o g] This is not equivalent to
|     169209 [steve@wa ts ] Oops.. I thought too much like C.  Now I understand that the loop is
+ 169127 [billk@ct .c ] No, Array#sort_by does the 'decorate-sort-undecorate', aka.

ArachnoRuby -- a professional Ruby IDE
169085 [janchrister.] I compared ArachnoRuby with Komodo, using my solution for RubyQuiz #57.
+ 169094 [curt.hibbs@g] ...
+ 169185 [nightphotos@] You're very welcome!
| + 169188 [phurley@gm i] I will second the recommendation. I really like ArachnoRuby and have
| + 169190 [hankgong@gm ] ...
| | 169197 [nightphotos@] Yes, I used RDE for a year or more before ArachnoRuby was available.
| | 169237 [hankgong@gm ] ...
| | 169368 [nightphotos@] The Ruby program was only a few hundred lines, but it took a long while
| + 169219 [basi_lio@ho ] As a total noobie, I am still unfamiliar with Ruby syntax. ArachnoRuby
| | 169221 [curt.hibbs@g] ...
| + 169276 [janchrister.] ArachnoRuby -- a professional Ruby IDE
|   169340 [nightphotos@] Hey Christer,
|   + 169344 [mark.ericson] ...
|   | + 169347 [Patrick.Benn] You can use Search->Lookup selection, but it's nothing more than an
|   | | 169446 [zdennis@mk e] This isn't a ArachnoRuby thing persay, but it applies to any up and coming ruby IDE.... how would
|   | | + 169452 [janchrister.] Good question!
|   | | + 169764 [jussij@ze se] The Zeus for Windows IDE handles this case by displaying dialog
|   | + 169363 [phurley@gm i] I do not think this is in the current editor. In any case it would not
|   |   169367 [the.mindstor] I am a user of Arachno for quite a while and I am quite happy with it,
|   |   169373 [nightphotos@] Yes, it would be nice to see a new release.  I had an email exchange with
|   |   169382 [jeff.darklig] ...
|   + 169355 [janchrister.] Wayne!
|     169366 [nightphotos@] Hey Christer,
+ 170108 [ronjeffries@] Arachno seems nice at a quick glance. I don't agree with Lothar that
  170125 [tsumeruby@ts] Perhaps a waste of time to some people, but documentation comes very good to
  170173 [ronjeffries@] Or even an old programmer who would like to know how to use Arachno well.
  170339 [phurley@gm i] I understand what you guys are saying, but if given the choice between
  170386 [faker@ya oo ] I think it should be free or have documentation. I don't think I should have
  + 170441 [nightphotos@] Actually, it's US $59, with volume discounts starting at 2 licenses.
  + 170472 [snowzone5@ho] i'm productive with both komodo and arachno-ruby...i didn't need to
    170476 [janchrister.] tony,
    + 170528 [jeff.darklig] ...
    | 170534 [pertl@gm .o ] I personally think it's a pain...
    + 170537 [snowzone5@ho] i much prefer the debugger in arachnoruby. i often need to debug
      170552 [gene.tani@gm] agreed, if you're doing perl, C, python, PHP, java etc you have 6

Gems Install All Dependencies Option
169093 [transfire@gm] Is there a way, or can a way be made to install all dependencies
+ 169095 [francois@ba ] gem install GEMNAME --include-dependencies
| + 169109 [jim@we ri hh] For future reference:  http://docs.rubygems.org/read/chapter/10#page33
| + 169180 [gavin@re in ] You know what would be nice?
+ 169113 [dblack@wo bl] gem install -y
| 169206 [guslist@fr e] yes | gem install GEMNAME
| 169242 [gregory.t.br] wow... I didn't know that existed. Cool!
| 169272 [hgs@dm .a .u] It doesn't exist on all unix flavours.
| 169502 [gsinclair@gm] #!/usr/local/bin/ruby -w
+ 169114 [transfire@gm] Thanks!

How can I find __LINE__ on the execution stack ?
169097 [janchrister.] I would like to be able to display the line number in my simple assert.
169103 [bob.news@gm ] irb(main):007:0> def test
169105 [janchrister.] Thank you Robert!
169126 [bob.news@gm ] You're welcome.
169146 [janchrister.] Robert, I guess this is a minimalistic approach. I will see the info I

Looking for a PostScript or EPS module
169101 [kibleur.chri] I'm looking for a ps (or eps module) in Ruby, like EpsGraphics2D in

Ruby compiler question
169104 [mccarthyjame] Hey just wondering, is there a plan to add a compiler to the future
+ 169107 [janchrister.] Posted via http://www.ruby-forum.com/.
+ 169116 [james_b@ne r] Yes.  See YARV.
+ 169122 [blargity@gm ] Yes.  Ruby 2.0 will be byte compiled.  Google for YARV.

Re: Iterating over test data in unit tests
169117 [schmitt@nu .] I'm looking for a module for accessing newsgroups via nntp.

NNTP was [Re: Iterating over test data in unit tests]
169119 [decoux@mo lo] It's best to look in RAA

Recursive Rake
169128 [tanner.burso] ...
+ 169133 [rubikitch@ru] I use Rake to make HTMLs from RDs, to upload a package to the server,
+ 169153 [jim@we ri hh] There was a recent discussion about this on the Rake mailing list.
| 169177 [tanner.burso] ...
+ 169175 [langstefan@g] Perhaps you want to try Rant, which is an alternative to Rake.

Screen scraping an html text contents into a file
169149 [basi_lio@ho ] I'm looking for a screen scraper that will extract text contents off
+ 169161 [vanek@ac .n ] curl www.apple.com > mytextfile
+ 169179 [ruby.brian@g] $ w3m -dump www.ruby-lang.org
| 169212 [basi_lio@ho ] Can't find a w3m binaries for windows xp. I'll continue to look.
+ 169181 [gene.tani@gm] i think open-uri and Rubyful_soup are pretty straightforward.  I like
  169183 [ef@al m. it ] No need for a commercial product.  wget does all that.
  169208 [basi_lio@ho ] Thanks for the info on wget and curl. Both are powerful page
  169211 [joevandyk@gm] $ lynx -dump www.rubystuff.com
  169215 [basi_lio@ho ] Can't find windows xp binaries of w3m, snarf, also tried cUrl, wget,
  169235 [sjc2000_uk@y] I will throw something like this together in Ruby over
  169267 [martindemell] Nope, according to the OP's requirements, you also need to render the
  169269 [sjc2000_uk@y] By rendering the html, my interpretation of this was
  + 169273 [ruby.brian@g] E.g. Tables and frames. So better use links2 or w3m for the task.
  | 169285 [sjc2000_uk@y] Ah, yeah, forgot all about those nasty little things.
  + 169293 [martindemell] Even without things like tables, the significance of various whitespace
    169331 [leavengood@g] of the HTML as text. As others have said, what we really need is some

simple scope question
169159 [noSpam@no pa] Is it possible to place another file within the same scope
+ 169163 [ara.t.howard] i assume you are making a config file?  why not use yaml?
+ 169167 [vjoel@pa h. ] The best solution I've found is to read file1.rb and module_eval it's
  169203 [dave.burt@gm] You can't get quite the same scope. Check out Joel's "Script" library

ldap install problem
169162 [szot.shaun@g] Trying to install ruby-ldap on solaris x86 I keep recieving an error
171106 [lists.ruby-t] I feel your pain. I tried compiling it on Solaris 10 SPARC using some slightly
171160 [greg.kujawa@] Do you have Cyrus SASL or the like already installed? The default Ruby

[ANN] Net::SFTP 1.0.1
169166 [jamis@37 ig ] versions 1-5. It is dependent upon the Net::SSH library.

1.8.4: nightly smapshot results.
169168 [hgs@dm .a .u] I've just tried to build the nightly snapshot with GCC 4.0.2 on

[Newbie] Variable score
169191 [vnpenguin@gm] I'm newbie to Ruby. I'm trying to write a small script to parse a text
+ 169192 [ezra@ya im h] var1 = ''  #initialize to striung or whatever else you expect the
+ 169195 [desmarm@gm i] Are you certain that you've matched regexp1 before you've matched regexp2?
+ 169256 [pit@ca it in] Do regexp1 and regexp2 match on the same line of data? Or could it be

Re: Variable score
169194 [akonsu@gm il] But this is not true, the variables should be visible on the scope of
169196 [ezra@ya im h] Ahh yes you are right. I misread the source.
169275 [clr9.10.rand] as others have pointed out, create a reference to var1,var2 before the

Question concerning multiline regexps and best practice
169199 [oliver.andri] I am currently moving an application from Python to Ruby for a training
+ 169200 [akonsu@gm il] unless i do not understand the question, a regex option that allows
| 169205 [oliver.andri] Well, to better describe what I am currently dealing with, I post a
| + 169210 [akonsu@gm il] the best that i could come up with is to remove new lines from your
| + 169214 [akonsu@gm il] (var = <<TARGET).gsub!(/\n/, '')
| + 169216 [surrender_it] foo #foo
| + 169220 [w_a_x_man@ya] msg_rx = %r{
|   169259 [oliver.andri] Thank William and Gabriele! This is exactly what I have been looking
+ 169207 [ef@al m. it ] The cleanest solution is to make a regular expression that can work

Ruby 1.8 fcgi.rb Pipe Closed Exception
169224 [bheinz@ne ti] Anyone have any ideas on this?  This is running a rails app with

Interfaces in Ruby?
169228 [cohen.jeff@g] I'm new to Ruby - actually new to dynamically typed languages in
+ 169229 [gregory.t.br] You can use Mixins (Modules) and the query the mixins.
| 169233 [james@gr yp ] We generally use respond_to?() for this, but I must stress be REALLY,
+ 169297 [florgro@gm i] As others have already noted in Ruby we generally do the simplest thing

In need of help. Win32Ole objWMIService.Create?
169230 [caldridge@gm] objWMIService.Create takes a parameter which is set to the pid of a
169308 [dave@bu t. d] The _invoke method takes an array of values and an array of types. Your

time difference calcualtion
169231 [uval@rz un -] I would like to calculate the difference between two times in seconds
+ 169232 [hal9000@hy e] require 'time'
+ 169234 [dave.burt@gm] require 'date'
+ 379614 [abhidsm@gm i] Try https://rubygems.org/gems/time_diff/stats
  379616 [wyhaines@gm ] Just keep it simple.  You can do math with Time objects, and the unit

[ANN] RbDynamicMethod first drop
169238 [drjflam@gm i] ...

Mixins and variables
169239 [johannes.fri] I can't figure out how to set an instance variable with a mixin method
+ 169240 [daniels@pr n] class TestClass
| 169244 [johannes.fri] OK, thanks. Can I force "x=(whatever)" to mean a method call instead
| + 169245 [dblack@wo bl] You have to give the explicit receiver 'self'.  The thing is, local
| | + 169246 [daniels@pr n] self.x= will be a method call.
| | + 169247 [johannes.fri] Thanks.
| + 169248 [gwtmp01@ma .] It is a parsing problem.   Because ruby supports zero argument methods
|   169296 [florgro@gm i] Hm, and a syntax error as well, if I'm not wrong.
|   169310 [gwtmp01@ma .] My bad.  I really should cut and paste into irb...
+ 169300 [james@gr yp ] attr_accessor :x

nuby: method defined in two classes
169253 [botp@de mo t] I have the ff code below. It works but you can see that i have duplicated the "is_odd?" method on both Fixnum and Bignum. I am just asking for something more cleaner/elegant...
+ 169257 [vjoel@pa h. ] Why not define #is_odd? on Integer?
+ 169258 [transfire@gm] Integer#odd?
  169264 [botp@de mo t] #From: Trans [mailto:transfire@gmail.com]
  169265 [botp@de mo t] Joel VanderWerf [mailto:vjoel@path.berkeley.edu]

snmp with s2nmp or rubyonrails
169254 [hemtirik@ya ] ...

Test::Unit Console Runner
169260 [listrecv@gm ] Is there anyway to pass options to the (wonderful!) Test::Unit Console
169262 [pit@ca it in] Looking at the output of "testrb -h" there seems to be no built-in way
169266 [jeff.darklig] ...

[ANN] Amrita2 1.9.6
169268 [takunakajima] ...

One-Click Ruby Installer
169270 [kishor.gurtu] Any idea when this will be updated to 1.8.3?
169280 [curt.hibbs@g] ...
169311 [gregory.t.br] Will this version have a fix to the YAML problem?
169313 [curt.hibbs@g] ...

wxruby and threads
169274 [kozlov.y@gm ] I trying to write a small GUI application.
+ 169283 [alex@de et m] I don't know exactly how ruby's threads interact with wx's scheduling. Perhaps you could try adding an evt_idle handler to your example?
| 169286 [kozlov.y@gm ] It seems, what this code make new thread every time when on_idle
| 169290 [alex@de et m] Yes. It was just an example. If you want to run a previously defined thread, the following works for me (CVS HEAD, Wx 2.6.2 unicode, OS X 10.3, Ruby 1.8.2)
| 169291 [kozlov.y@gm ] Could you post the full text working example ?
| 169301 [alex@de et m] See below - note it doesn't really matter where you create the thread - it could be passed into the App's constructor. It's just in on_init for simplicity.
| 169515 [kozlov.y@gm ] Not worked.
+ 169284 [neil@ha ub .] Ruby threads aren't system threads.  When you're in the Wx main loop,
  169287 [kozlov.y@gm ] Ok. I suspected like this.
  169289 [kozlov.y@gm ] Aha.

where is the Content Assist of RDT?
169277 [could.net@gm] ...
+ 169278 [could.net@gm] ...
| 169279 [could.net@gm] ...
| 169329 [leavengood@g] You aren't posting twice to the list, you are just seeing Gmail put in
| 169494 [could.net@gm] ...
+ 169282 [rosco@ro co ] In my experience it's not as comprehensive as with e.g. Java, partly
  + 169493 [could.net@gm] ...
  + 169495 [could.net@gm] ...

Build array of possible combinations
169288 [th-dev@on in] I'm looking for an easy way to convert a string representing a
+ 169385 [trashcan@ho ] Unpaired parentheses ! (I was a compiler in a previous life, I just
+ 169425 [nightphotos@] First, we write a method that converts the input string from infix to
  169872 [th-dev@on in] thanks a lot for your suggestions. This is really an interesting
  169909 [malte__@gm -] => false

Switch User Agent
169295 [amatbcn@ho m] UAProof of an HTTP request that I'm sending out. (To pretend that my
169298 [gene.tani@gm] I haven't seent the term UAproof before, but the open-uri and Net::HTTP
169299 [gene.tani@gm] ...
169303 [amatbcn@ho m] Sorry mate I meant User Agent (I'm a bit new to the world of ruby and

Win32OLE: Output parameters, Dispatch IDs
169304 [dave@bu t. d] x1 recently asked about an issue with a WMI script that had an output parameter.
169510 [caldridge@gm] I have not been able to figure anything out yet myself.
169520 [dave@bu t. d] I figured.
169779 [caldridge@gm] ObjectSpace.each_object(Array) do |arr|
169803 [dave.burt@gm] pids = []
169805 [caldridge@gm] I find it strange that the win32ole package cant handle out params.
169817 [dave@bu t. d] That's the thing, though, it _does_ explicitly handle out params. The only
169830 [masaki.suket] Sorry for being too late to reply.
+ 169834 [masaki.suket] WIN32OLE researches type library to get info on method.
+ 169886 [dave@bu t. d] No need to apologize! And you're not even late - the thread's still warm
  170029 [caldridge@gm] <trim>

profiling question
169307 [skaes@gm .n ] During profiling some code using ruby 1.8.2 and standard profiler, I
169316 [matz@ru y- a] It's a bug.  I have checked in the fix to the CVS repository.
169320 [skaes@gm .n ] Wow. That was quick. Thanks very much.

Where is RUBYOPT set?
169312 [williamerubi] Checking the RUBYOPT environment variable at a command prompt reveals
169321 [kyosuke@se n] I do have it in System variables on W2k.
169365 [curt.hibbs@g] ...
169383 [jeff.darklig] ...
169388 [curt.hibbs@g] ...
169404 [jeff.darklig] ...
threads.html
top