237803-243893 subjects 238252-246803

^ Algorithm Help - Grid Space Calculations
238045 [gavin refine] I have a problem, and I'm hoping someone will find it interesting
+ 238051 [rubytraining] I haven't fully read your code other than to get a general sense of
+ 238056 [martindemell] include Math
  238059 [gavin refine] Excellent, thanks! :)
  238064 [martindemell] $grid_spacing = [high, low].min_by {|i| ($grid_spacing - i).abs}
  238066 [gavin refine] Though it would be computationally inefficient compared to what it
  238068 [martindemell] True, but it would hurt to do that :)

^ Apache and instant rails
238058 [hanan_mneimn] How could I launch Instant rails with Appache
238067 [ml.chibbs gm] As installed, when you run InstantRails.exe, both Apache and MySQL are

^ Adding Math.log2 and Math.logn to the core library.
238061 [gavin refine] In a world of humans and finance, it's quite common to need base-10
+ 238082 [keynan howe.] perhaps it would be wiser to add
| 238104 [gavin refine] Other than changing the order of parameters (which I'm personally
| 238110 [m_goldberg a] Well, I can find examples with the base first or second. Perhaps for
| + 238118 [rubytraining] Math.log calls the log in the standard math library, which I suspect
| | 238128 [m_goldberg a] If there's too much of a performance penalty for this, I would have
| + 238150 [matz ruby-la] 1.9 Math.log does work so.
+ 238094 [m_goldberg a] I second the motion.
  238099 [martindemell] And while we're at it, I'd really like to see log aliased to ln
  238101 [gavin refine] Thank you, yes. I thought I was the only one for whom "log" implied

^ Win32Ole question...
238065 [Carey.Nation] charset="US-ASCII"
238089 [jan.svitok g] AFAIK, Win32OLE can't do that (at least in Ruby 1.8 branch). There's a
238187 [Carey.Nation] Ah, ok, thanks.  Guess I'm a little dense.  I couldn't find anything
238264 [jan.svitok g] 1. ruby-oneclick installed

^ histogram of histograms
238069 [clsnyder gma] Brazil,	10
+ 238071 [martindemell] #------------------------------------------------------------------
+ 238072 [shortcutter ] I would do that in stream mode, i.e. not first read all and then
+ 238073 [dblack wobbl] my_hash will actually become an array at that point :-)
+ 238084 [w_a_x_man ya] hash = Hash.new(0)

^ Problems generating scaffolding
238074 [damnbigman g] I'm trying to write a rails application using Postgres for my back-end.
238075 [damnbigman g] Sorry I forgot the error I'm getting
238078 [phurley gmai] Not trying to be rude, but rails specific questions are best handled
238079 [damnbigman g] Sorry not really thinking right now.

^ question regarding adaption from swig/wrapper-interface from perl->ruby
238076 [tammo tammo-] actually I am fighting with the adaption of the interface to ruby. A lot of

^ Defining <<
238077 [lukeivers gm] I'm not 100% how exactly to search to find out if someone else has posed
+ 238080 [keynan howe.] on occasion this space
| 238081 [keynan howe.] on occasion this space
+ 238083 [gwtmp01 mac.] The syntax rules for the << operator don't allow it to take multiple
  238085 [shortcutter ] class Hash
  238145 [SimonKroeger] Yeah, i like

^ Patterns of semantic contradictions?
238097 [robert.dober] I just could not resist to post a stupid remark - which was taken very
+ 238103 [ara.t.howard] hmmm.  hard to say without context, but i generally squirm at any regex that
| 238136 [robert.dober] that is very good advice in practice and it is also an excellent example for
+ 238211 [ snk gna.org] gsub seems out of place here; it feels like using a flat-headed

^ Terminal emulator library
238098 [spambeware g] I'm looking into writing a terminal-emulator based database interface with

^ HELP:  Ruby profiler crashes under MacOS X
238102 [theosib gmai] I'm trying to run the Ruby interpreter with profiling enabled, but
238105 [theosib gmai] One thing I should point out:  "ruby --version" reports 1.8.5.
238419 [tim.pease gm] There is definitely something odd about your setup.  The ruby version

^ HELP: Installed libxml via Fink, can't 'require' it.
238106 [theosib gmai] I'm using MacOS X, and I've installed libxml via Fink.  Although
+ 238107 [theosib gmai] Oops.  I made a mistake.  I didn't install it using Fink.  I installed
+ 238109 [TimHunter nc] Have you enabled rubygems? That is, does your script include
  238181 [theosib gmai] I had done that.  Still didn't work.  However, in the mean time, I

^ Wanting clarification for string delimiters
238108 [subs surfula] %q, %Q, %w, %r, %x all begin a string which terminates with the
+ 238113 [stonelists g] According to the "Programming Ruby" book the delimiter can be any
+ 238133 [wonado donne] The delimiter can be any nonalphanumeric or nonmultibyte character.In addition,
  238134 [subs surfula] Thanks Andy & Wolfgang.

^ Accessing helper module constants in rspec contexts.
238111 [peter.havens] I'm trying to learn rspec, and came across something unexpected with
238127 [dchelimsky g] Thanks for posting this - you may have actually shed some light on the
238197 [peter.havens] Ah, okay. Thanks a lot for the pointer. I should have searched the
238217 [dchelimsky g] No problem.

^ How to manipulate binary file
238119 [lmxbitihero ] I love Ruby very much and now Ruby is my first language.But now I meet a
+ 238129 [m_goldberg a] <code>
+ 238130 [m_goldberg a] I should also mention that >> is a bit-shift operator, too. Works the
+ 238422 [tim.pease gm] As mentioned before, you can use the >> and << operators to perform

^ Error while trying to use Socket#accept_nonblock
238131 [gethemant gm] #Server
238270 [vjoel path.b] Typo?

^ method to get (Linux) user home path
238138 [_nospam_seti] i am trying to create a file in ~/.myopts/myopts.yaml but, no go.
+ 238140 [martindemell] ENV['HOME']
+ 238156 [erikveen gma] These are my personal implementations of Dir.home and Dir.temp.
| 238163 [B.Candler po] ruby has the latter included as standard.
+ 238160 [_nospam_seti] ENV hash has it all...
+ 238284 [_nospam_seti] Thank you, Martin, Erik and Brian.

^ Willing to take a pay cut to work with ruby
238146 [me mikehogan] Would you consider taking on an experienced software developer as a
+ 238149 [richard.conr] Well theres lots of places that will hire good talent for cheap. But
+ 238310 [johnwilger g] My recommendation would be to take a 100% pay cut and contribute some
  238312 [johnwilger g] I hope it was obvious that I meant to say you should do so in your

^ how to get a character for ANSI value
238147 [santosh anti] How to get a character for ANSI value.
238151 [gethemant gm] 10.chr

^ DRY or not ...
238158 [josselin wan] as a new(ru)bie I always wonder when trying to DRY such code is good or
+ 238170 [twifkak comc] params[:new_title] = if params[:new_title].blank?
| + 238175 [twifkak comc] Heh. Big fat bug. Right at the beginning. *cough*
| + 238184 [dblack wobbl] That doesn't embody the same logic, though.  If params[:new_title] is
+ 238171 [eeklund gmai] Seems to me like this should likely be an object, with
  238511 [josselin wan] Thanks to all  .. getting clear

^ access to constants from instance_eval
238159 [dchelimsky g] It seems that Ruby won't allow me to directly access class constants
+ 238161 [dblack wobbl] foo doesn't have any constants; only Foo does.  instance_eval changes
| 238166 [lists bertra] irb(main):001:0> class C ; X = "i" ; end
+ 238165 [james graypr] => nil

^ Can I rescue Errno::ECONNREFUSED?
238162 [alex blackke] I'm trying to put a little robustness into a Rinda::Tuplespace setup,
238182 [alex blackke] Never mind - it turns out I was trying to rescue the wrong exception

^ get username on windows
238168 [Gilbert.Rebh] how to access the username on windows,
238169 [rmagick gmai] ENV['USERNAME'] works for me.

^ General Approach to Data Validation
238172 [olsonas gmai] Hey all-
238178 [pit capitain] Drew, I would try to perform the comparison inside the database,
238185 [olsonas gmai] Pit -
+ 238190 [B.Candler po] 1. sort both the datasets by the primary key (or SELECT ... ORDER BY)
| 238199 [olsonas gmai] I think you've hit the nail on the head with this. It will drastically
+ 238198 [pit capitain] Drew, I don't think doing it on the client is the right tool for this
  238203 [olsonas gmai] This is the exact approach I originally wanted to take. I would be very
  238226 [gwtmp01 mac.] A while back (last year?) I asked why ActiveRecord didn't support
  238324 [ezmobius gma] ActiveRecord will start to consume a huge amount of memory and cpu
  238331 [ara.t.howard] hey ezra-
  238336 [ezmobius gma] Hey Ara-
  238402 [olsonas gmai] Ezra -

^ [ANN] spreadsheet-excel-
238177 [hannes.wyss ] This is a highly recommended release for all rubygem-installations of

^ Grouping similar attributes
238186 [dominicson g] How would one group attributes which came from an array/db?
+ 238193 [B.Candler po] d = {
+ 238206 [james graypr] => Person
+ 238230 [sunrayson gm] This can help you too...
  238325 [dominicson g] Looks good. that would've been nifty if there was a function to automate
  238333 [dominicson g] btw, I'm going with Brian's technique as it's the least to type : P and

^ [ANN] SimpleHTTP initial release
238188 [a2800276 gma] I just got through putting together a little wrapper around Net:Http
+ 238192 [zimbatm oree] cool !
| 238224 [robert.dober] Agreed looks very useful.
| 238290 [a2800276 gma] Hmm, sounds like we might have been colleagues... :)
| 238361 [robert.dober] I do have problems with the proxy, without a proxy simple_http works just
+ 238319 [botp delmont] # SimpleHttp - a simplified wrapper around Net::Http
+ 238320 [botp delmont] # SimpleHttp - a simplified wrapper around Net::Http
| + 238321 [botp delmont] mea culpa. sorry for the double post. i thought i made a typo on addressing..
| + 238332 [botp delmont] #    2a. toggles like eg
+ 238377 [a2800276 gma] Thanks everyone for your replies!
| 238383 [robert.dober] I'll try to get something through to you offlist, thx a lot.
+ 238388 [twifkak comc] 1. SimpleHttp.get "blahblah", :proxy => 'feem'
  238407 [a2800276 gma] The class `get` method already takes a hash which gets escaped and

^ Re: Ruby and Open Sound Control (OSC)??
238189 [fugalh ziane] I have one that is 99% ready for consumption. I'll try to wrap it up
238195 [fugalh ziane] Oh, and check out the docs (such as they are) at
238385 [fugalh ziane] darcs record # record your changes locally

^ system (cmd) on windows
238191 [Gilbert.Rebh] 1.
238196 [B.Candler po] No, you have to go entirely one way or the other. That is, either split out

^ Ruby as a configuration language
238194 [no such.thin] I'm writing an automated software building framework in Ruby. The software
+ 238200 [neoneye gmai] There is a Ruby replacement of make, that can give you some
| 238210 [ snk gna.org] I agree. If you're going to build a DSL for your particular domain, I
| 238215 [PBooth marke] You should take a look at Capistrano - its pretty amazing what it does
+ 238201 [gavin refine] Some people will suggest YAML. That's certainly a reasonable way to
| 238202 [gavin refine] Oops, I missed that baseurl was a method call there. Then you might
+ 238234 [B.Candler po] I did something a bit like this, using Rake, for building mail software. You
+ 238260 [no such.thin] Thanks to all of you who responded. I thought that instance_eval would be the
  238267 [vjoel path.b] You could evaluate the whole config file inside of a scope (for example,

^ rubyscript2exe.rb issue
238204 [vinod.patil1] I have created some script which runs fine when i ran it from the
238233 [sunrayson gm] Are you running the exe on the same machine where you have generated the

^ What is really a class instance variable compare to a class variable ?
238205 [ruby_admirer] class A
238213 [dblack wobbl] Every instance variable you ever see belongs to whatever object is, at
238365 [ruby_admirer] David,
+ 238373 [B.Candler po] (1) An instance variable is only visible to that object. It doesn't matter
+ 238374 [dblack wobbl] - instance variables
  + 238376 [ruby_admirer] Brian, David,
  + 238379 [alexander fo] not to hijack the thread or anything, but since it about class variables.

^ auto indentation in ruby electric mode
238207 [dannyyuan gm] I'm learning to use Emacs to program Ruby. The ruby-electric-mode
+ 238220 [fxn hashref.] By default, in Emacs that is accomplished with C-j (newline-and-
| 238232 [dannyyuan gm] Neat! Thank you very much, Xavier!
+ 238283 [james.d.mast] Here's what I picked up from a website about a month ago (and my left
  + 238339 [fxn hashref.] Just in case, if mapping RET globally is fine just put this single
  + 238634 [dannyyuan gm] Thanks, James! I'm happily using this code in my emacs now. I'm not

^ Watir - Where can I get the latest copy of JavascriptClick.htm?
238208 [n00spam comc] I recently installed Ruby Version 1.8.5p12 and Watir-1.4.1 on a laptop
+ 238676 [bpettichord ] This question was answered on the wtr-general@rubyforge.org mailing
+ 238677 [bpettichord ] For more information on Watir 1.5, see http://www.io.com/~wazmo/blog/
  239568 [n00spam comc] Bret,
  239681 [bpettichord ] You are running the right version.
  239928 [n00spam comc] The core tests ran flawlessly;
  240134 [n00spam comc] As an FYI, Ruby itself failed some its Unit Tests.  Is this a known

^ gtk2 on windows
238209 [slamboy gmai] For anyone else who wants to play around with the examples in the gtk2

^ Newbie problem with modifying array correctly
238212 [kreatix gmai] I have an array with subarrays containing integers, and want to make
238219 [chris.hulan ] I believe the problem is you process each row separately in the first
238253 [kreatix gmai] Wow, thanks! That makes a lot of sense, now that I've spent half an hour

^ Ruby on Rails Professional
238214 [nikhiljohn m] We are looking for ruby on rails professionals to work with us.

^ Library for constructing terminal emulator interface
238216 [spambeware g] Absolute know-nothing newbie here; please pardon my ignorance of everything.

^ Testing Float equality (was: Negative Float conversion to Fixnum)
238218 [aaraines gma] class Float
238221 [james graypr] assert_in_delta().

^ Survey about Architecture and Design Patterns
238223 [joerg.rech g] Dear software practitioners, consultants, and researchers,

^ Help optimizing
238225 [lukeivers gm] I'm going to cross-post this from the Rails group, because some of the
+ 238227 [lukeivers gm] s/to_uri/to_params
+ 238228 [gavin refine] I realize the code is there, but I'm having trouble figuring out what
| 238229 [lukeivers gm] For {:test => 'testing'} the return should be test=testing
| + 238235 [gavin refine] So, the parent attribute is really just for the recursive calls?
| | 238238 [lukeivers gm] Yes.
| + 238237 [lukeivers gm] tries to do it in as short a space as possible: here's what I got (and
|   238280 [SimonKroeger] That wasn't fair at all (you know i couldn't resist, do you?) :)
+ 238240 [shortcutter ] Use << instead of += in all places.
  + 238243 [shortcutter ] that bring most benefits together with using <<.  The pattern is
  + 238246 [lukeivers gm] This one was great: using two functions as I did in one of the earlier
    238247 [lukeivers gm] Oh, and I used str.concat: should I have used something else?
    238423 [shortcutter ] I'd use << - in that case you can also use StringIO and IO objects (i.e.

^ [SUMMARY] String Equations (#112)
238231 [james graypr] This quiz is much more difficult than it looks.  There are an infinite number of

^ Class-tree variables
238236 [unet rexx.co] There's been a lot of blog traffic lately about class variables vs.
+ 238239 [dblack wobbl] I think that's a typo; I don't see any class variables in your code.
| 238244 [unet rexx.co] Yes, sorry.  I meant "class instance variables" (and also
+ 238248 [gwtmp01 mac.] Ruby's class variables already have this behavior, sort of.
| 238254 [dblack wobbl] Also you wouldn't want to use class variables to maintain state for a
| 238268 [gwtmp01 mac.] My bad, pay attention to the code, not the comments.  Comments should
+ 238258 [vjoel path.b] This is a solution to a slightly different problem (inheritance of

^ Your favorite bit of ruby code?
238242 [carl.lerche ] I'm just curious what your favorite bit of ruby code is? Do you have
+ 238245 [wonado donne] Well, in german ruby forum I use since longer time as part of my signature
+ 238255 [john.carter ] # Ruby is Objects all the way down and open for extension...
| + 238256 [jameskilton ] Can't say I've used this bit of code anywhere, but it's the same feature as
| + 238328 [ramalho gmai] That's a very nice little demo of Ruby's charm, John.
|   + 238329 [ramalho gmai] ######
|   + 238545 [john.carter ] I truly wish I could claim it was Mine....
|     238547 [robert.dober] It was me(1) who said: "When stealing, steal only from the best" ;)
+ 238257 [john.carter ] It's the  IO.read().scan(%r{}mx){|m| ...} paradigm here I love...
+ 238259 [john.carter ] Ok, I have run out of time to list them all in detail...
+ 238338 [transfire gm] class Functor < Proc
| 238348 [erikveen gma] 2 or 4?
| 238360 [transfire gm] yes that's a typo -- it should be 4.
| 238364 [erikveen gma] In general, AFAIK, an initialize can be skipped if all it does
| 238382 [transfire gm] Oh right. Yes, it can be removed in this case. I incidently left it b/
+ 238340 [hhausman gma] # of course, it's imperfect, as is everything.
| 238341 [pit capitain] Harold, the output might not be useful, but at least it's interesting.
| 238345 [hhausman gma] I do!
| 238369 [pit capitain] Thanks for the picture and the interesting read. In return, here's a
| 238378 [hhausman gma] Ah! I knew (and was secretly hoping) that would happen. :P
+ 238344 [listbox juli] within_transaction do | cursor |
+ 238353 [svolkov comc] ###
+ 238363 [robert.dober] Without hesitation my favorite is http://rubyquiz.com/quiz67.html
+ 238418 [olsonas gmai] 34.times{k=0;puts ($*.map!{|i|k+k=i}<<1)*" "}
+ 238421 [dblack wobbl] I love tons of it but one idiom I've always thought was particularly
+ 238466 [bofh softmed] require 'irb'
| + 238473 [rodrigo.berm] This snippet contains some of my favorite ruby features
| | + 238479 [james graypr] => [10, 20, 0]
| | + 238544 [drbrain segm] ruby -run -e rm /usr/bin/perl
| |   238546 [robert.dober] I just recently needed a telnet tool fast on a customer machine with Python
| + 238519 [B.Candler po] I've no idea how this works; it has to rate as cool Ruby, even if it isn't
|   238524 [bofh softmed] 3) PREFACE
+ 238483 [gwtmp01 mac.] I can't remember where I first saw this bit of code but I was able to
+ 238488 [ilmari.heikk] class String
+ 238490 [dan-ml dan42] This is one I particulary like from my personal library. It allows me to do
+ 238494 [lists bertra] I like a lot the implicit return values.