190311-378284

190025-190931 subjects 190450-191501

Ruby for command line applications
190311 [nospam@ho ma] I am a Linux administrator and I use Perl for scripting.
+ 190312 [jake.mcarthu] Of course, you can expect a bias on this mailing list, but I will
| + 190316 [khaines@en g] I would argue that point.  Back in 2002, when I was first learning Ruby, I was
| | + 190318 [jake.mcarthu] Perl => quick hacks; Ruby => engineered solutions. Yes, if you
| | | 190412 [deanwampler@] I find that if I have non-trivial structured data to manage, I've
| | | 190417 [charlie@ca t] ...
| | + 190319 [stuart@fo tw] ...
| |   190324 [khaines@en g] But that's not what I am talking about.   It had nothing at all to do with a
| + 190317 [james@gr yp ] Could you given a small example program in Perl that is lengthier in
|   + 190320 [pat.eyler@gm] I don't have any of my early Perl to Ruby conversions anymore (and
|   | 190325 [mapsetah2000] Great!
|   | + 190337 [mguterl@gm i] ...
|   | | 190343 [jake.mcarthu] You know, this Rails craze is scaring me. I love Rails, but Ruby is
|   | | 190346 [leavengood@g] I agree.
|   | + 190339 [wilsonb@gm i] #/usr/bin/env ruby
|   + 190323 [dblack@wo bl] s/// stuff is shorter than sub(//,'') stuff.
|     + 190327 [james@gr yp ] I don't lose too much sleep over a couple of characters.  I was
|     + 190328 [ara.t.howard] plus
|       190329 [jake.mcarthu] ... This discussion is over.
+ 190313 [wilsonb@gm i] Ruby is incredibly well-suited to this.
+ 190315 [pat.eyler@gm] This is exactly the space I came to Ruby from (and still spend most of my time
+ 190321 [rtilley@vt e] I use both. I like them both. IMO, Ruby is more flexible than Python.
+ 190424 [jmg3000@gm i] They're both good choices. I'm fairly new to Ruby, but here's my 2 cents.
| 190427 [jmg3000@gm i] By the way, there are, of course, other plusses for Ruby that are
| 190746 [Eric.Armstro] I think the consistency comes down to how many
| 190767 [chneukirchen] .oO(And that's probably the only thing Ruby and Forth have in common.. }:-))
+ 190472 [m4@po it .s ] I'm new to ruby but have years of experience with perl and python. I
+ 190754 [drosihn@gm i] I started to use perl for scripting maybe 10 to 12 years ago, when I
+ 190816 [znmeb@ce ma ] Well, I don't know anything about Python and not a whole heck of a lot

Magic Quotes in Ruby?
190330 [nathan.olber] (I thought I posted this question just a bit ago but I can't find it
190331 [luke@bl ns a] irb(main):004:0> s = "ab\"c\""
190332 [nathan.olber] Well, I'm glad you're paying attention to the obvious things, because I
190333 [jgbailey@gm ] ...

Extending Methods
190334 [geoffstanley] I'm working on a plugin system for a IRC client I'm currently making.
+ 190335 [james@gr yp ] Can you please explain why inheritance and super are bad here?  They
| 190338 [geoffstanley] I don't want to use inheritence and super because that would mean each
| + 190340 [logancapaldo] class Plugin
| + 190341 [dharple@ge e] 1) Use Class#inherited
|   + 190342 [dblack@wo bl] Although....
|   + 190715 [geoffstanley] Thanks for all the responses!
|     + 190790 [logancapaldo] # Changing Foo, so we temporarily disable warnings
|     + 190821 [pit@ca it in] Object.instance_eval { remove_const :Foo }
|       191726 [geoffstanley] This works nicely. Thanks!
+ 190350 [ara.t.howard] class Module
+ 190362 [sylvain.joye] You can use Module and super
  190370 [pit@ca it in] Super! :-) I didn't know that idiom. Thanks for sharing!

Trying to stir conversation in the rrobots community
190336 [gregcoit@gm ] I'm new to ruby, but enjoying learning it a great deal. And rrobots
190373 [simon.kroege] well there was some talk about new feature in february but all
+ 190418 [tom@in oe he] Nope, not yet... we're trying to avoid that to help keep RubyForge nice
+ 190420 [steve@wa ts ] Perhaps something that would be more maintainable would be to create
| 190445 [SimonKroeger] that would be great without a doubt, but I'm not able to provide an
+ 190498 [gregcoit@gm ] Simon,

Q about the FasterCSV
190347 [eric.wenbl@g] ...
+ 190348 [botp@de mo t] # test.csv
+ 190349 [logancapaldo] Remember its "comma-separated", fiddling around I discovered that
  190356 [eric.wenbl@g] ...
  190361 [botp@de mo t] # In the csv file,
  190364 [dave@bu t. d] No, it's not a bug. CSV is a simple delimited format. It's delimited by
  190367 [botp@de mo t] # No, it's not a bug. CSV is a simple delimited format. It's
  + 190369 [eric.wenbl@g] ...
  + 190386 [james@gr yp ] FasterCSV is intentionally a strict parser.  For one thing, that
  + 190423 [dave@bu t. d] Thanks, I think. (I don't know how many Rubyists Microsoft has - I don't
  | 190425 [james@gr yp ] You should modify the above line too.  It takes both to correctly
  | 190428 [dave@bu t. d] I looked at this, but I deduced from [1] that a number of fields equal
  | 190433 [james@gr yp ] Good points all around.  Dave knows this code better than I do,
  | 190446 [dave@bu t. d] Thanks, but credit to you -- IIRC part of your stated aim for FasterCSV
  | 190516 [botp@de mo t] # Oh, I don't want the patch. It's a terrible idea! "foo, bar, 'baz'"
  | + 190517 [botp@de mo t] # > Good points all around.  Dave knows this code better than I do,
  | | 190527 [james@gr yp ] To me, the problem is solved.  For the record, that problem was that
  | | 190528 [botp@de mo t] #
  | | 190531 [gregory.t.br] I think both CSV and FasterCSV can do this.  Same rules apply though,
  | | 190532 [botp@de mo t] # I think both CSV and FasterCSV can do this.  Same rules apply though,
  | | 192017 [eric.wenbl@g] ...
  | | + 192019 [ara.t.howard] a,"""bc""d"
  | | + 192021 [dave@bu t. d] 1) Commas (,) separate fields. (You can pick a different delimiter if
  | |   192029 [eric.wenbl@g] ...
  | + 190526 [james@gr yp ] There's no problem with the space, correct.  The quote after it is
  + 378273 [abua66@gm il] I'm trying to upload data into the database and I've done so using
    378284 [james@gr ys ] I'm not totally sure I understand the question, but loading data with =

[ANN] open4-0.4.0
190351 [ara.t.howard] URIS

Q: how to undefined a class after declaration?
190352 [imadzen@ya o] E.g. using irb, I created class A and then class B, later I realized
190353 [logancapaldo] irb(main):001:0> class A
190354 [imadzen@ya o] Thanks Logan Capaldo. It works.
190355 [logancapaldo] remove_const just removes the constant named 'B'. Your instances

object available in one class but not another?
190366 [gregcoit@gm ] Playing around more with rrobots.
190382 [dave@bu t. d] I'm going to ignore your question in hope that this advice is as useful
190483 [gregcoit@gm ] Dave,

from block to code (also: how to get the bindings of a block)
190368 [kiaroskuro@g] Does anyone know how to convert a block to a string representation of
+ 190383 [dave@bu t. d] Read the source file?
| 190400 [kiaroskuro@g] how would I know what is the source file and lines associated with a block?
| + 190413 [dave@bu t. d] OK, here are some practical options. (Sorry for the previous comment. I
| | 190416 [kiaroskuro@g] The quiz is a great resource, thanks.
| + 190434 [banshee@ba s] Does ParseTree solve your problem?
|   190641 [kiaroskuro@g] ...
|   190655 [dave@bu t. d] "The end" meaning "return the block's local variable binding" is a very
+ 190793 [drbrain@se m] lib/r2chacks.rb in ZenHacks has this.
  190798 [kiaroskuro@g] ...
  + 190902 [drbrain@se m] I doubt your problem is really that special.
  | 190909 [kiaroskuro@g] ...
  | + 190910 [lukfugl@gm i] This is my big question; why do you need the equal signs? I see
  | | 190913 [kiaroskuro@g] ...
  | | + 190926 [ara.t.howard] it would be tough to convince me that people wouldn't find this syntax
  | | | 190927 [kiaroskuro@g] ...
  | | + 190948 [rossrt@ro co] In return for keeping the equals signs, would the users let you get away
  | |   190950 [kiaroskuro@g] ...
  | |   + 190951 [james@gr yp ] In a word:  yuck.  :)
  | |   | 190956 [kiaroskuro@g] ...
  | |   + 190955 [rossrt@ro co] Without looking, I'd guess def the; binding; end ? (Quick look, done
  | |   | + 190957 [kiaroskuro@g] ...
  | |   | | 190961 [rossrt@ro co] Hmm, not really. I guess if you really have to have the superfluous
  | |   | | 190963 [james@gr yp ] That's the best variation of the binding trick, in my opinion.
  | |   | | 190983 [rossrt@ro co] Yeah, couldn't agree more. The whole thing seems kind of clunky and
  | |   | + 190986 [chneukirchen] recipe "english breakfast" do |take|
  | |   |   190987 [kiaroskuro@g] ...
  | |   |   190992 [chneukirchen] Ideally
  | |   |   191062 [kiaroskuro@g] ...
  | |   + 190971 [binary42@gm ] If you really want the = look you can capture the binding with the
  | + 190935 [drbrain@se m] def recipe(name, &block)
  |   190939 [kiaroskuro@g] ...
  + 190937 [logancapaldo] I dunno know about the binding (maybe you can use method_missing +
    190940 [kiaroskuro@g] ...

I have some problem with convert to symbol, in Hash object
190371 [iiskakov@is ] => {"fax"=>"80233923293", "name"=>"Ilyas store",
+ 190372 [botp@de mo t] # I want to convert "name" to :symbol
+ 190378 [shortcutter@] Hash[*str.scan(/store\[([^\s,]+)\s*\]=\s*([^,]+)/).map{|k, v|

Trouble migrating formula from JavaScript to Ruby
190374 [ingoweiss@gm] I am trying (unsuccessfully) to migrate a formula (for calculating
+ 190375 [botp@de mo t] # dlng = p2_lng - p1_lng
| + 190377 [reid.thompso] is dlng a typo, the first formula uses dlon?
| + 190426 [ingoweiss@gm] Turned out that I needed to convert the numbers to radians. Here is the
+ 190376 [kiaroskuro@g] is it possible that you need to make numbers explicitly float? eg: 2 --> 2.0

Pickaxe 1 & 2 - Worth the upgrade?
190379 [doug.bromley] ...
+ 190384 [botp@de mo t] # I was just wondering if it would be worth me buying the
| 190429 [warrens@ac c] Plus, if you get the PDF, then they refresh it for free when there are changes.
+ 190388 [rmagick@gm i] Yes, the 2nd edition includes material about Ruby 1.8 that isn't present

Rake default == -T
190381 [transfire@gm] Is it possible to make the default task the same as using the -T
190385 [james@gr yp ] I assume you could make a task that shells out to rake -T.
190389 [transfire@gm] Thanks, James. Turns out that doesn't work so well. But your suggestion spark an
+ 190402 [Bil.Kleb@na ] This doesn't work for me, viz,
+ 190403 [taschini.mli] task :tasks do
  190430 [Bil.Kleb@na ] Works for me now.

[SUMMARY] Text Munger (#76)
190387 [james@gr yp ] Obviously, this is not an overly difficult problem.  Here's a small, but pretty
190395 [dblack@wo bl] "Are you kiddin'?!" he exclaimed :-)
190397 [james@gr yp ] I meant that scrambling long runs of punctuation didn't really seem
190401 [dblack@wo bl] I gues "Are you kiddin'?!" is a bit of a stretch -- though possible --
190408 [james@gr yp ] You bring up some good points.
190411 [robert.dober] ...
190415 [james@gr yp ] If I understood the question correctly, David is trying to show that

Day number delta
190390 [lindsay.boyd] How can I calculate the number of days between two Date objects?. This
+ 190399 [lindsay.boyd] (Date.parse(date2.to_s) - Date.parse(date1.to_s)).to_i
+ 190405 [khaines@en g] delta = a - b
  190407 [taschini.mli] require 'date'

"Unrequire" a file ?
190391 [tuka@yo n. e] after making changes to a particular file,
190394 [halostatue@g] ri Kernel#load
190398 [vincent.isam] Well, you could also remove the file from the array $", and rerequire
190431 [tuka@yo n. e] many thanks for your input.

Where are the Test::Unit meta tests?
190392 [thiago.arrai] I suppose Test::Unit has tests for testing itself, but I can't find
190432 [Bil.Kleb@na ] Regards,
190440 [thiago.arrai] Thanks, Bill.

(none)
190393 [Hinnerk.Ries] I have an installation problem with openSSL

Sorting with Hash
190396 [u_dinesh@ya ] I have a hash like this and i want to sort. After sorting i want the key
190404 [simon.kroege] h = { "c" => 20, "b" => 30, "a" => 10  }
190406 [simon.kroege] Sorry, after reading your post again I guess I haven't

help help help!
190409 [speechexpert] How to unsubscribe?
190410 [matthew.moss] That's because they're at the top, in the headers.
190414 [jmg3000@gm i] The main Ruby mailing lists page (

Last (more or less) call for Google Summer of Code mentors!
190419 [dblack@wo bl] As you know, Ruby Central is participating this year as a Google
190422 [pollak@gm il] ...

Integration/Antidifferentiation Program
190435 [SleepJunk13@] I'd like to write a program to integrate derivatives to save time on
+ 190437 [jesusrubsyou] Hm... you'll probably strengthen your derivation and integration skills
| + 190439 [klancaster19] ...
| + 190441 [steve@wa ts ] I agree.  Matt didn't say how he wants to solve them, but if he wants to
| + 190442 [SleepJunk13@] I can integrate and derive perfectly fine. It's more of "I just want to
|   + 190447 [logancapaldo] I think you're going to have to look at the source of some other
|   | + 190448 [edder@tk sp ] Maxima is an open source symbolic solver/integrator, so you could start
|   | + 190449 [stuart@fo tw] Just for normal college/university level calc1&2, you will need
|   |   190458 [SleepJunk13@] After hearing all of this and talking to a co-worker (programmer who has
|   + 190675 [znmeb@ce ma ] Basic symbolic differentiation is a piece of cake. It's usually done as
+ 190486 [gilesb@gm il] First of all I'd like to disagree with everybody who told you you'd be
| 190495 [SleepJunk13@] Thanks a lot for that book, I'll have to check the book store and read
| 190500 [SleepJunk13@] So.. I have no idea where to start.
| 190502 [curi@cu i. s] Maybe you should figure out a format for storing polynomials, make a
| + 190505 [jjhartley@at] Come on, Google is your friend.  I searched for "symbolic differentiation" & found several hits to projects & code libraries which do exactly what you are wanting to do.  Granted, a number of these are written in languages other than Ruby, but you should still be able to understand them well enough to get an idea of where to start on your own.
| + 190676 [znmeb@ce ma ] Hmmm ... there's actually a C++ library for writing computer algebra
| | 190682 [stuart@fo tw] As this is a calc student, I would assume he want to write the whole thing.
| + 190705 [chneukirchen] Christian Neukirchen  <chneukirchen@gmail.com>  http://chneukirchen.org
+ 192005 [bodanger@vt ] I've been thinking about doing something like this myself, just for
| 192011 [znmeb@ce ma ] A look at Axiom or Maxima (open source) or Derive (closed source but
| 192013 [gilesb@gm il] I know nada about calc, but for what it's worth, it's used as a
| 327011 [thedickster@] Hey, has anyone successfully created a program with Ruby that uses
| 327024 [znmeb@ce ma ] I'm not sure what you mean by Ruby "using" maxima. Maxima is a
| 327035 [thedickster@] By "using" maxima, I mean accessing maxima via a pipe in Ruby. I am
| + 327043 [micathom@gm ] AFAIK the maxima gui itself passes the code on to an inferior lisp
| + 327045 [znmeb@ce ma ] There are a number of web apps that do this sort of thing -- live math
|   327123 [thedickster@] For reinventing the wheel...the best candidate for copying is WMI (uses
|   327125 [znmeb@ce ma ] Sage is an outstanding project, even though it is written in Python. :)
+ 327246 [dido.sevilla] There's apparently an algorithm out there that can do symbolic

Gateway and the new ruby-talk-google archive
190436 [transfire@gm] Though everyone should know about the status of the news<->mail
190444 [florgro@gm i] There also is http://news.gmane.org/gmane.comp.lang.ruby.general
190463 [jesusrubsyou] Not to forget http://www.ruby-forum.com (which I use).
190511 [transfire@gm] Which actually would be a great place for gateway to the newsgroup too.

OT: Vim->Ruby and back ?
190438 [Meino.Cramer] sorry for this offtopic mail, but I asked this on the vim-user
+ 190443 [reid.thompso] I pulled this from the web, or the mailing list, somewhere..... a google
| 190515 [Meino.Cramer] Thanks a lot for that trick, Reid ! :)
| + 190521 [gregory.t.br] map <C-R> :!ruby %<CR>
| | + 190522 [gregory.t.br] sorry... did not fully read your post.  I don't know how to load it
| | + 190524 [Meino.Cramer] I inserted the above mapping into $HOME/.vimrc .>
| |   190525 [gregory.t.br] hmm... looks like it needs to be run against a saved file.  :(
| |   + 190540 [pit@ca it in] How about
| |   + 190573 [ mfp@ac .o g] * F7 in visual mode evaluates the selected area; temporary files are used so
| + 190552 [ruby@an hr p] } > > Hi,
|   190556 [ruby@an hr p] }
+ 190541 [rossrt@ro co] I've wanted this myself, but never quite got there.
threads.html
top