[#360120] Rake 0.8.7 needs Ruby 1.8? — Jaime Stuardo <jstuardo@...>
Hello..
[#360123] socket programming...lsof? — Derek Smith <derekbellnersmith@...>
Hi All,
[#360154] rdoc-data 2.5.1 Released — Eric Hodel <drbrain@...7.net>
rdoc-data contains core ri data for use with RDoc 2.5
[#360155] rdoc 2.5 Released — Eric Hodel <drbrain@...7.net>
rdoc version 2.5 has been released!
[#360170] Is there a method to set variable to NaN or Infinity? — Alex DeCaria <alex.decaria@...>
Is there a built-in method to set a floating point value to NaN or
[#360172] phuby 1.0.0 Released — Aaron Patterson <aaron@...>
THIS IS NOT A JOKE. I AM VERY SERIOUSLY RELEASING PHUBY.
[#360205] Re: Dynamic Method Calls — Matt Mencel <MR-Mencel@...>
This did it...thanks for the assistance... :)
[#360221] Its a bird, its a plane, its.. um, an Attribute based System? — thunk <gmkoller@...>
absolute last word from me forever on this as things are....
[#360236] Autocalculate field in a form — Naomi Mathes <naomi.mathes@...>
Hi,
[#360239] “arch -i386 ruby” not loading into 32-bit mode in 10.6.3 — Richard Fairbanks <lists@...>
<2.33GHz MBPC2D running OS X 10.6.3>
Richard Fairbanks wrote:
[#360241] scope question — Harry Kakueki <list.push@...>
Maybe I'm missing something obvious here, but...
[#360253] Fill a table in ruby — Brk Anl <banil86@...>
Hi,
[#360255] Puts - not putting 'all' content on display console — Dave Balmer <dave@...>
I am using Ruby 1.86 to process a 7,000+ record file and using Regular
[#360264] A little help needed — Tom Stone <s1ay3r44@...>
Hi,I'm new here.
On Fri, Apr 2, 2010 at 9:42 PM, Tom Stone <s1ay3r44@gmail.com> wrote:
Oh! I see!
> So it's a variable that is automtically given to each instance of that
[#360275] combined ranges... — Roger Pack <rogerpack2005@...>
Anybody know if there's an easy way to accomplish the equivalent of
On 4/2/10, Roger Pack <rogerpack2005@gmail.com> wrote:
Will this work:
David Springer wrote:
On Fri, Apr 2, 2010 at 6:33 PM, Roger Pack <rogerpack2005@gmail.com> wrote:
You can splat objects with to_a everywhere.
Here, I worked on it I came up with:
On Sat, Apr 3, 2010 at 2:30 PM, Intransition <transfire@gmail.com> wrote:
[#360300] hash key with multiple values — Lucky Nl <lakshmi27.u@...>
Hi ,
[#360331] ThunkGen released! — Andrea Dallera <andrea@...>
Ahem...
On Apr 6, 3:43=A0pm, Josh Cheek <josh.ch...@gmail.com> wrote:
[#360332] Tk delay — Jesse Jurman <e.j.jurman@...>
I am somewhat new to Ruby and Tk, I have made a couple of simple
Jesse Jurman wrote:
On Sun, Apr 4, 2010 at 3:40 AM, Jesse Jurman <e.j.jurman@gmail.com> wrote:
[#360366] $SAFE=0 for setuid? — Rick Ashton <expiation@...>
Hi
> From most documentation I see that $SAFE is automatically set to 1 if
Jonathan Nielsen wrote:
On 04/04/2010 06:32 PM, Rick Ashton wrote:
Robert Klemme wrote:
Rick Ashton wrote:
Brian Candler wrote:
[#360401] When {integer:0} <> 0 ??? — Richard Fairbanks <lists@...>
Greetings, folks!
Richard Fairbanks wrote:
Brian Candler wrote:
Richard Fairbanks wrote:
Thank you, Jes炭s and Brian, that was what I needed!
[#360405] Long-standing bug in logger or monitor? — Matthew Bloch <matthew@...>
Hi there,
[#360406] /usr/bin/ld: cannot find -lruby — Venkat Akkineni <venkatram.akkineni@...>
Hello
The problem is that ruby-opengl need to compile some C code to make the
[#360418] Novice school teacher seeking help in programming — Hilary Bailey <my77elephants@...>
I will like to know how to use programming languages to create a
On Mon, Apr 5, 2010 at 5:23 PM, Hilary Bailey <my77elephants@gmail.com> wrote:
Jes炭s Gabriel y Gal叩n wrote:
On Tue, 6 Apr 2010, Hilary Bailey wrote:
Matthew K. Williams wrote:
On Mon, Apr 5, 2010 at 4:36 PM, Hilary Bailey <my77elephants@gmail.com>wrot=
Richard Conroy wrote:
[#360446] Copying all Files with New Name — Hawksury Gear <blackhawk_932@...>
Hi,
[#360447] ruby and networking crashes app on windows — mortee <mortee.lists@...>
Hi!
[#360493] Custom Exceptions — Leslie Viljoen <leslieviljoen@...>
Hi everyone
[#360500] Parse the data in an array index in ruby — Brk Anl <banil86@...>
Hi,
[#360510] Maximum number of sockets — Jes俍 Gabriel y Gal疣 <jgabrielygalan@...>
Hi,
I'd have thought that you'd hit a limit of 1024 because of fd_set (man
On Tue, Apr 6, 2010 at 10:33 PM, Brian Candler <b.candler@pobox.com> wrote:
[#360545] pass a password to ssh — Roger Pack <rogerpack2005@...>
Anybody know how to pass a password to ssh?
Hello,
[#360549] Singularity Alert for OO AI in Ruby & Javascript — Mentifex <mentifex@...>
The Amazon sales rank for the renegade AI4U
[#360553] Creating an exe on Mac OS X — Jesse Jurman <e.j.jurman@...>
I've created a Ruby Program with Textmate, but now I need to create it
On Tue, Apr 6, 2010 at 6:39 PM, Jesse Jurman <e.j.jurman@gmail.com> wrote:
Andrew Mcelroy wrote:
On Tue, Apr 6, 2010 at 10:19 PM, Jesse Jurman <e.j.jurman@gmail.com> wrote:
[#360556] Visibility in tests — Bernhard Brodowsky <brodowsb@...>
Hi, I'm new to this, forum, but I really love Ruby and I hope this is
[#360562] Heroku progamming — thunk <gmkoller@...>
[#360595] modifying a Hash in one process when .each is running in another — Nathan <njmacinnes@...>
I want one process to continually loop through a list of objects (in
Nathan Macinnes wrote:
Thanks for the clarification... My application is network based, and
On Wed, 7 Apr 2010, Nathan wrote:
Depending on how memory efficient you want to be you could also try.
Nathan Macinnes wrote:
[#360609] Getting output of program with some DRb for good measure — Christopher Dancy <christoforever@...>
I'm running a DRb service which accepts a string<file name> and than
[#360630] Dissapearing data from array — Noé Alejandro <casanejo@...>
Hi all.
[#360651] Is it possible, a fully general Enumerable#recursive ? — Intransition <transfire@...>
For the last couple of days I've been trying to write an Enumerable
On Wednesday 07 April 2010 04:49:15 pm Intransition wrote:
On Thu, Apr 8, 2010 at 5:51 AM, David Masover <ninja@slaphack.com> wrote:
On 04/09/2010 08:53 PM, Intransition wrote:
On Sun, Apr 11, 2010 at 10:55 PM, Robert Klemme
2010/4/12 Robert Dober <robert.dober@gmail.com>:
> On Apr 12, 11:08 am, Robert Klemme <shortcut...@googlemail.com> wrote:
On Mon, Apr 12, 2010 at 6:00 PM, Caleb Clausen <vikkous@gmail.com> wrote:
On Apr 7, 5:49=A0pm, Intransition <transf...@gmail.com> wrote:
On 4/9/10, Intransition <transfire@gmail.com> wrote:
[#360660] Complicated output parameter in WIN32OLE — Mitchell Hashimoto <mitchell.hashimoto@...>
Hello,
[#360663] Best practice for saving settings in separate file — Oyvind Pettersen <pettersen.oyvind@...>
I'm currently building an application that relies on a rather large set
[#360664] Hash name increment on iteration? — Shaz <shazamjad@...>
Is it possible to add to the name of a hash while running through an
On 8 Apr, 08:44, Brian Candler <b.cand...@pobox.com> wrote:
Shaz wrote:
[#360681] how to use ri in my computer? — Pen Ttt <myocean135@...>
pt@pt-laptop:~$ ri Integer#times
Hello Pen,
sudo find / -name 'ri'
[#360693] Ruby newbie - Trying to understand variables — Sask Khan <kayote.80+rubyf@...>
Hey guys,
[#360699] simple text parsing — Remington Splettstoesser <remi500@...>
Hello Everyone,
[#360705] Reading data from MS Exchange — Dani Dani <laguna53@...>
Hi, is there a possibility to read MS Exchange data from an ROR/Ruby
[#360728] importing config files — Derril Lucci <derril.lucci@...>
Hi everyone,
[#360731] read and write stock prices to file using arrays — Peter Miller <feurry@...>
I'm trying to write a script that will take stock ticker symbols from a
On Fri, Apr 9, 2010 at 2:34 AM, Peter Miller <feurry@gmail.com> wrote:
> ticker = []
[#360738] match at least one element of array to another — Kenneth Eunjung <ken70r@...>
Hi is there a simple way to return true if at least one element of an
[#360750] How to capture output of linux command — Damjan Rems <d_rems@...>
[#360760] The Ruid Concept, with question — thunk <gmkoller@...>
The Ruid Concept
Charles,
[#360783] Ruby-warrior : Teaching AI concepts with Ruby — Aldric Giacomoni <aldric@...>
I think this project doesn't get enough attention :-)
Aldric Giacomoni wrote:
Bill Kelly wrote:
People,
On Apr 9, 5:17=A0pm, Ryan Davis <ryand-r...@zenspider.com> wrote:
[#360793] Need a short nontrivial example program — Josh Cheek <josh.cheek@...>
I'm a member of the ACM at my university (Wichita State), and we are allowed
[#360813] global variable in ruby — Amishera Amishera <amishera2007@...>
Trying to use some global variable
[#360820] Question about parsing URL in Ruby — Vlad Gerasimov <refermaker@...>
[#360833] how to analyse web with nokogiri? — Pen Ttt <myocean135@...>
how to analyse web with nokogiri?
[#360855] Arcadia ruby ide 0.8.1 — Antonio Galeone <antonio.galeone@...>
Arcadia is a Light Integrated Development Environment (IDE) for Ruby
[#360857] Detect if 2 ranges share elements — Derek Cannon <novellterminator@...>
Probably a simple problem for most of you out there:
[#360884] Text Fighting (Gladitorial) Sim — Garret Dupont <wizardofozz@...>
I am attempting to create a gladitorial fighting sim. It will be able to
[#360889] Method call within a class — Li Chen <chen_li3@...>
Hi all,
[#360893] Finding an icon for a file in Linux — John Bentley <pcguy49@...>
Hi,
[#360910] attr_accessor, but for a boolean — Albert Schlef <albertschlef@...>
Let's say I have this code:
On Mon, Apr 12, 2010 at 10:00:06AM +0900, Albert Schlef wrote:
On 12 April 2010 11:10, Aaron Patterson <aaron@tenderlovemaking.com> wrote:
[#360922] Comparing Arrays — Derek Cannon <novellterminator@...>
Hello everyone, another easy question from a beginner: How do you create
Hello Derek,
[#360923] how to open dbf file with ruby? — Pen Ttt <myocean135@...>
there is a dbf file , can i open it with ruby?
[#360936] Non empty string complained to be 'nil' in equality check — Kannan Jay <kannan_jayaprakasam@...>
I have the below code
[#360956] Fwd: Automated image combining to improve page load speeds — Tony Arcieri <tony.arcieri@...>
We're working with a slow embedded browser and trying to eek as much
[#360967] My application doesn't work well — Bruno Santana <bruno_r_santana@...>
Hi everybody,
I'm not so good in English but I understood that I shoud show you my
[#360981] Method to groom a string to floating point representation — Alex DeCaria <alex.decaria@...>
I have a program that asks for the user to enter a string that
On Mon, Apr 12, 2010 at 9:34 PM, Alex DeCaria <alex.decaria@millersville.edu
Josh Cheek wrote:
On Tue, Apr 13, 2010 at 6:20 AM, Alex DeCaria <alex.decaria@millersville.ed=
Josh Cheek wrote:
On Wed, Apr 14, 2010 at 8:33 AM, Alex DeCaria <alex.decaria@millersville.edu
Hello,
>
[#360993] how to delete the first two characters of each row? — Pen Ttt <myocean135@...>
how to delete the first two characters of each row?
[#361011] Memoize and GC — Intransition <transfire@...>
I have a quick question. I just re-read:
On 4/13/10, Intransition <transfire@gmail.com> wrote:
[#361015] How to find multiple matches in a string — Alex DeCaria <alex.decaria@...>
I know how to use regular expressions to find the first match of a
Hei,
[#361024] QTKit glitchy on Snow Leopard Server - Help! — Spencer Rogers <spencerevanrogers@...>
I have written a script to pull a frame image from a QuickTime Movie. It
I can't identify your problem in the code,
Hmmm good idea. It seems the timeScale comes out at 600 on either
QTTime and QTTimeRange are C Struct...
[#361027] Gem help — H- 16 <s1ay3r44@...>
I'm trying to DL a gem but I keep getting this message:
[#361029] Detect whether a key is being held before script execution? — Thomas Wilson <t.wilson775@...>
Hi All!
[#361038] I thought spaces didn't matter around operators — Sarah Allen <sarah@...>
I had understood that operators, like minus (-), had special "syntactic
Sarah Allen wrote:
Brian Candler wrote:
[#361055] Who maintains ruby-talk? — Tony Arcieri <tony.arcieri@...>
Among other things, the ruby-talk MLM is rampant with security
2010/4/14 Tony Arcieri <tony.arcieri@medioh.com>:
On Wed, Apr 14, 2010 at 6:21 AM, Robert Klemme
On Wed, Apr 14, 2010 at 9:52 AM, Tony Arcieri <tony.arcieri@medioh.com>wrote:
On Wed, Apr 14, 2010 at 9:08 AM, Josh Cheek <josh.cheek@gmail.com> wrote:
I have just rescanned my ruby-talk inbox folder - I can't see any'off
Tony Arcieri wrote:
On Wed, Apr 14, 2010 at 4:18 PM, Justin Collins <justincollins@ucla.edu>wrote:
On Wed, Apr 14, 2010 at 11:54 PM, Tony Arcieri <tony.arcieri@medioh.com>wrote:
On 4/15/2010 12:00 AM, Tony Arcieri wrote:
On Thu, Apr 15, 2010 at 10:50 AM, Walton Hoops <walton@vyper.hopto.org>wrote:
On 4/15/2010 10:57 AM, Tony Arcieri wrote:
On 4/15/2010 11:27 AM, Walton Hoops wrote:
Tony Arcieri wrote:
A long time ago, (15.04.10), in a galaxy far, far away, Justin Collins wrote:
Just last week I was having problems managing my subscription via the
On 2010-04-14, Josh Cheek <josh.cheek@gmail.com> wrote:
On 2010-04-14, Josh Cheek <josh.cheek@gmail.com> wrote:
On 2010-04-15, Josh Cheek <josh.cheek@gmail.com> wrote:
[#361075] Undefined method `ire' with rubygems on mswin32 — Aa Wilson <aawilso1@...>
I've just recently installed the latest stable ruby 1.9.1 and rubygems
[#361082] REXML Attribute and Quotation Control — Eric Bonnema <eric.bonnema@...>
I am using REXML to open an XML file, modify some elements, and write a
[#361125] How to use AutoIt in Ruby — H- 16 <s1ay3r44@...>
I know for a fact that one can use AutoIt in Rubybut I don't know ho to
H- 16 wrote:
[#361141] Is this good OOP structuring? — Derek Cannon <novellterminator@...>
Hello everyone. I'm trying to get a hang of object-oriented programming
On 15.04.2010 02:46, Derek Cannon wrote:
On Thu, Apr 15, 2010 at 8:00 AM, Robert Klemme
>class CourseController
On Thu, Apr 15, 2010 at 11:39 PM, Derek Cannon
2010/4/16 Josh Cheek <josh.cheek@gmail.com>:
Robert, I think you were meaning to thank Josh! Anyway, thanks very much
2010/4/16 Derek Cannon <novellterminator@gmail.com>:
Thanks Jesus and Robert for your responses.
[#361142] Is there a way to make class and object constants in Ruby? — Xeno Campanoli <xeno.campanoli@...>
I am reading up in other areas, and it occurs to me much of the items I have as
Am Wed, 14 Apr 2010 20:00:54 -0500 schrieb Xeno Campanoli:
[#361166] Automatic indentation — Michel Demazure <michel@...>
Hi all,
[#361169] Blocks and local variable creation — John Lane <ruby-forum@...>
Hello,
On Thu, Apr 15, 2010 at 12:17 PM, John Lane <ruby-forum@jelmail.com> wrote:
[#361171] Win32 Service: Access Denied when creating service — Rajiv Abraham <rajiv.abraham@...>
Hi,
[#361174] 1.9's New Methods — Intransition <transfire@...>
First a big shout-out to Marc-Andre Lafortune and his <a href="http://
[#361190] my vim and cream can't work! — Pen Ttt <myocean135@...>
i have installed vim and cream,Make install ruby myself.
[#361200] Formal methods — Bernhard Brodowsky <brodowsb@...>
Hi, I want to try to prove some parts of my programs formally. Does
On 4/15/10, Bernhard Brodowsky <brodowsb@student.ethz.ch> wrote:
Caleb Clausen wrote:
On Sat, Apr 17, 2010 at 12:08 AM, Bernhard Brodowsky
[#361204] own exception classes — Bernhard Brodowsky <brodowsb@...>
Hi,
[#361213] DRb: execute method but dont wait for it to finish — Christopher Dancy <christoforever@...>
Basically I want to execute a method on a drb service but not wait for
[#361223] Reading Ruby-Talk in Atom or RSS — steve ross <cwdinfo@...>
The recent "moderation" thread raised several questions in my mind. I'm =
On 4/15/2010 1:00 PM, steve ross wrote:
[#361269] DB to CSV — Mitja Čebokli <mitja.cebokli@...>
Hello,
Further hacking reveals that this might be a better option to create the
[#361279] Writing a parser — Martin Hansen <mail@...>
Hello there,
Martin Hansen wrote:
Ah, yes, that is how a hash works :). Now I am interested in getting my
Martin Hansen wrote:
@Ryan,
> And you chose ruby? Ruby isn't exactly known for speed. And I can
2010/4/17 Martin Hansen <mail@maasha.dk>:
@Robert,
[#361322] iconv transfer code — Pen Ttt <myocean135@...>
in my computer(ubuntu9.1+ruby1.9):
Pen Ttt wrote:
On Apr 18, 2010, at 4:22 AM, Brian Candler wrote:
James Edward Gray II wrote:
On Apr 18, 2010, at 12:14 PM, Brian Candler wrote:
On 18 April 2010 22:17, James Edward Gray II <james@graysoftinc.com> wrote:
Benoit Daloze wrote:
[#361324] Documenting Rakefile using rdoc — Jean-Julien Fleck <jeanjulien.fleck@...>
Hello there,
On Apr 17, 2010, at 00:34, Jean-Julien Fleck wrote:
Hello Eric,
On Apr 19, 2010, at 07:11, Jean-Julien Fleck wrote:
Hello Eric,
[#361333] Dont know where to look :( — Tiger Big one <woo_@...>
I get this error
On Sat, Apr 17, 2010 at 2:47 PM, Tiger Big one <woo_@hotmail.co.uk> wrote:
[#361340] Trouble with Pushing Arrays to Arrays — Derek Cannon <novellterminator@...>
Hello everyone! I'm having some trouble with pushing an array to another
[#361346] what is String#ord? — Xavier Noria <fxn@...>
Ruby 1.9 docs for String#ord say:
[#361350] Undifined local variable or method error — Simbolla Simbolla <vinod236@...>
Hi all,
[#361366] Elegant Solution to a Seemingly Simple Problem? — Derek Cannon <novellterminator@...>
Hello everyone. It's me: Derek, again! Sorry for writing a novel here,
For your contemplation:
Sure, I'll post HTML examples. In this non-simplified version, there are
[#361396] ruby 1.9+ , floats, and decimal — botp <botpena@...>
> 0.2-0.1
On Sun, Apr 18, 2010 at 8:07 PM, botp <botpena@gmail.com> wrote:
On Mon, Apr 19, 2010 at 1:24 AM, Christopher Dicely <cmdicely@gmail.com> wrote:
On Tue, May 11, 2010 at 11:09 AM, Roger Pack <rogerpack2005@gmail.com> wrot=
>>> => "0.999999999999999999999999999999999999E0"
On Tue, May 11, 2010 at 11:37 AM, Roger Pack <rogerpack2005@gmail.com> wrot=
[#361400] Life without Method Overloading? — Derek Cannon <novellterminator@...>
How do Ruby programmers handle method overloading? In Java, I could
[#361428] ya config file parser — Roberto Cm <roberto.tomas.cuentas@...>
I'm wondering how to extend the config-yaml parser at
[#361436] Rainbows! 0.91.1 - use a less-broken parser from Unicorn — Eric Wong <normalperson@...>
Rainbows! is an HTTP server for sleepy Rack applications. It is based on
[#361440] Net::Ping::HTTP inconsistencies — Daniel Waite <rabbitblue@...>
I have multiple websites that are "up". That is, they are accessible via
[#361454] DrX, an object inspector — "Mooffie n/a" <mooffie@...>
DrX is an object inspector (and a source-code browser).
El martes 20 de abril, Mooffie n/a escribi坦:
David Espada wrote:
On Tue, Apr 20, 2010 at 10:44 PM, Mooffie n/a <mooffie@gmail.com> wrote:
On Wednesday 21 April 2010 11:20:12 pm Charles Oliver Nutter wrote:
On Sat, Apr 24, 2010 at 10:38 AM, David Masover <ninja@slaphack.com> wrote:
On Sunday 25 April 2010 02:41:07 am Charles Oliver Nutter wrote:
[#361459] [RFC] Proposing a Ruby Packaging Standard — Christian Neukirchen <chneukirchen@...>
Hello,
Final comments for now, I promise ;-)
Hi,
Thomas Sawyer wrote:
On 21/04/10 at 14:01 +0900, Suraj Kurapati wrote:
Lucas Nussbaum wrote:
On 21/04/10 at 14:55 +0900, Suraj Kurapati wrote:
[#361512] Module "re-opening" — tilde <tildeNO@...>
Hi there, first time arond here for me, and first step with ruby ^^
[#361527] cannot find header-files — Michael Myers <skully@...>
I am working here on Solaris and i have ruby-installation.
[#361528] Ruby 1.9.1, Threads and "[BUG] The handle is invalid." — John Briggs <aazman.w@...>
Hi!
On Apr 21, 2010, at 9:25 AM, John Briggs wrote:
[#361534] Bug? variable changes without assignment — Bob Gustafson <bobgus@...>
I seem to have uncovered a bug. The program below defines a series of
On Wed, Apr 21, 2010 at 5:37 PM, Bob Gustafson <bobgus@rcn.com> wrote:
Jes炭s Gabriel y Gal叩n wrote:
[#361535] Function accepting argument list or array — Thomas Allen <thomasmallen@...>
How would I write a function that treats fn(:a, :b) the same as it
[#361540] When to use a db? — Moya Pilot <a3794202@...>
Dumb question but I am reading in a constant stream of lines via
[#361568] Ruby 1.91.376 hangs when launched with python pExpect — David Rodriguez <david.francisco.rodriguez@...>
Hi
David Rodriguez wrote:
Hi Roger
[#361573] HOW TO Track How Many Recipients Open Your Mail IN RAILS — Tony Augustine <augustine.mathew99@...>
HOW TO Track How Many Recipients Open Your Mail IN RAILS?
On 4/21/2010 10:54 PM, Tony Augustine wrote:
[#361578] Test::Unit examples and OptionParser — Martin Hansen <mail@...>
Hello,
[#361581] If-Else within a loop going through array elements... — Saeed Bhuta <saeed.bhuta@...>
Hi All,
[#361587] Best way to write this method? — Derek Cannon <novellterminator@...>
Could my code below be more Ruby-esque or simpler (using Ruby methods I
If you guys need some better clarification as to what these methods do:
2010/4/23 Derek Cannon <novellterminator@gmail.com>:
You are right about my initial coding being incorrect. I noticed it
On Fri, Apr 23, 2010 at 6:53 PM, Derek Cannon
On Apr 23, 2010, at 3:31 PM, Robert Dober wrote:
On Sat, Apr 24, 2010 at 2:08 AM, steve ross <cwdinfo@gmail.com> wrote:
[#361601] Sinatra without RubyGems — "XY$" <kwicher@...>
Hi
[#361616] change to a newly created directory — John William <johnwdale@...>
Ruby Beginner
[#361627] What is the difference build and new? — Manoj Kumar <manojs.nitt@...>
What is the difference between
[#361634] A problem with work. — Rachel Lovelock <bpor5374@...>
Hi guys!
So, anyone?
You may have more luck posting to a more specifically 'sketchup'
[#361639] What is wrong with this few lines of code — Damjan Rems <d_rems@...>
[#361676] ncurses-ruby install failing on OS X Snow Leopard — "R. Kumar" <sentinel.2001@...>
ncurses-ruby 1.2.4 is failing on Snow Leopard 10.6.3 (ruby 1.9.1). I am
I recommend ffi-ncurses.
Michael Fellinger wrote:
On Tue, Apr 27, 2010 at 1:23 PM, R. Kumar <sentinel.2001@gmx.com> wrote:
[#361681] #object_hexid — Intransition <transfire@...>
Can anyone write a reliable Kernel#object_hexid, a method that returns
[#361684] error to gem install mysql — Pen Ttt <myocean135@...>
in my console:
[#361688] Segmentation fault at raise exception. — O01eg Oleg <o01eg@...>
I get segfault at any Ruby exception with C API:
Hi,
It's a initialization code:
Hi,
Here ALL my code: http://bin.mypage.sk/FILES/mud.tar.bz2
Ok, now we have code. Next, how can we compile it?
I use `autoreconf -fi`
Hi,
Thanks. Do I have to use this wrap for each thread which use ruby code?
[#361710] Metaprogramming - Array initialization — "Paul A." <cyril.staff@...>
Hi,
Paul A. wrote:
Agree with Joel. Use the block form of the new method, or you'll get
Very instructives and helpful answers. Many thanks!
[#361715] Defining your own typecaster — Josh Cheek <josh.cheek@...>
Hi, how do you define your own typecaster?
[#361732] wxruby install problem — Pen Ttt <myocean135@...>
pt@pt-laptop:~$ sudo gem install wxruby
[#361736] Populate (an array or a matrix) from a vector — "Paul A." <cyril.staff@...>
Hello,
[#361747] Did 1.9 deprecate NUM2INT? — Jeremy Henty <onepoint@...>
I just upgraded to 1.9 and now my extension won't compile, complaining
[#361753] Semi global variables — Don French <dhf0820@...>
I have an application where multiple objects are created processing
[#361755] Networking: select() blocks for seconds (> timeout) — Raul Parolari <raulparolari@...>
I am using Ruby (as a prototype version) to communicate with a network
Raul Parolari wrote:
On 4/25/10, Raul Parolari <raulparolari@gmail.com> wrote:
Caleb Clausen wrote:
On 4/27/10, Raul Parolari <raulparolari@gmail.com> wrote:
I have some final results on the problem described.
Roger Pack wrote:
Roger Pack wrote:
Wow Raul,
Mark T wrote:
Raul Parolari wrote:
Brian Candler wrote:
[#361759] connect mysql:show tables — Pen Ttt <myocean135@...>
require "mysql"
[#361770] Ruby networking: Errno::ECONNREFUSED: Connection refused - connect(2) on Ubuntu 9.1 — "Bill McLean" <bill@...>
All,
[#361774] regular expressions — Kevin Austin <nitsuanivek@...>
I'm writing a script that is looking through a file for the following
[#361788] Net::HTTP and numerical adress — unbewusst.sein@... (Une B騅ue)
if i use :
[#361798] RUBY EVAL FUNCTION — kevid <alumsimportant@...>
Hi all,
[#361799] Missing base64 library in Ruby1.9, cannot run cloudkit — Bejvas Jod <bejvas.jod@...>
Hi,
[#361815] win32 ruby1.9 regexp and cyrillic string — Nikolay Khodyunya <nickolayho@...>
#coding: utf-8
[#361819] Visitor pattern — Bernhard Brodowsky <brodowsb@...>
Hi,
[#361830] Problem with require 'gemname' — Keith Carter <kmarplecarter@...>
Howdy folks,
Keith Carter wrote:
[#361880] flt gem for arbitrary precision — Giampiero Zanchi <cidza@...>
ciao a tutti (hi to hall)
[#361885] navigate through folders — Andrei Caragea <dracoola4u2001@...>
Hello everyone,
[#361896] Use of STDOUT.flush after puts — Alex DeCaria <alex.decaria@...>
I've seen several examples on this forum where folks have used
Dave Baldwin wrote:
On Thu, Apr 29, 2010 at 9:16 AM, Siep Korteling <s.korteling@gmail.com> wrote:
On Thu, Apr 29, 2010 at 1:28 PM, Robert Dober <robert.dober@gmail.com> wrote:
On Thu, Apr 29, 2010 at 2:31 PM, hemant <gethemant@gmail.com> wrote:
On Thu, Apr 29, 2010 at 10:56 PM, Robert Dober <robert.dober@gmail.com> wro=
On Thu, Apr 29, 2010 at 8:25 PM, hemant <gethemant@gmail.com> wrote:
On 29 April 2010 21:06, Robert Dober <robert.dober@gmail.com> wrote:
Hi
On 4/29/10, hemant <gethemant@gmail.com> wrote:
On Thu, Apr 29, 2010 at 4:24 PM, Caleb Clausen <vikkous@gmail.com> wrote:
[#361899] Overload the normal behavior of an object/instance in string — Walle Wallen <walle.sthlm@...>
Long story short. I'm trying to overload the normal behavior of an
[#361945] installing a ruby gem with a native extension — aj <mailtome200420032002@...>
I am new to ruby. I want to install a ruby gem which tries to build a
[#361962] Return values of modifiers — Michel Demazure <michel@...>
This is logical, but no very useful :
2010/4/30 Michel Demazure <michel@demazure.com>:
Robert Klemme wrote:
Hi --
David A. Black wrote:
Sure, it would be nice while/until loops return value of the last iteration,
Benoit Daloze wrote:
On Sat, May 1, 2010 at 8:38 AM, Michel Demazure <michel@demazure.com> wrote:
Robert Dober wrote:
Michel Demazure wrote:
Michel Demazure wrote:
On Sat, May 1, 2010 at 9:30 AM, Michel Demazure <michel@demazure.com> wrote:
Robert Dober wrote:
What I meant is:
[#361963] Switching dynamically between methods (inside modules) — "Paul A." <cyril.staff@...>
Hi,
On Fri, Apr 30, 2010 at 12:50 PM, Paul A. <cyril.staff@gmail.com> wrote:
Oh BTW, traits do exactly what you want, maybe you want to check out
To me, this problem cries out for delegation rather than inheritance
2010/4/30 Rick DeNatale <rick.denatale@gmail.com>:
[#361983] Inverse of stream parser — Brian Candler <b.candler@...>
I plan to parse a huge XML document (too big to fit into RAM) using a
On Fri, Apr 30, 2010 at 6:26 PM, Brian Candler <b.candler@pobox.com> wrote:
> Would you care to use JRuby?
On Fri, Apr 30, 2010 at 2:32 PM, Brian Candler <b.candler@pobox.com> wrote:
On Sat, May 1, 2010 at 12:04 AM, Tony Arcieri <tony.arcieri@medioh.com> wrote:
[#361988] File.read(fname) vs. File.read(fname,File.size(fname)) — Alex Dowad <alexinbeijing@...>
Hi, this is my first post on ruby-forum. Hope this is useful to someone!
[#361989] Cann't require UTF-8 files. — O01eg Oleg <o01eg@...>
When I require file with UTF-8 encoding I get error:
On 4/30/10, O01eg Oleg <o01eg@yandex.ru> wrote:
> Are you using ruby 1.9? If so, then you need to add a magic encoding
On Mon, Feb 14, 2011 at 2:30 AM, Fernando Perez <pedrolito@lavache.com>wrote:
On Feb 14, 2011, at 12:48 AM, Josh Cheek wrote:
On 02/15/11 10:08, Eric Hodel wrote:
[#361990] Encrypting/Decrypting files wirh ruby. — Demetris Constantinou <demec@...>
I have been searching the internet to find a way to encrypt files and
[#362006] get browser name and version — Mmcolli00 Mom <mmc_collins@...>
Hello
[#362008] Setting to Ruby 1.9 in Ubuntu... — Xeno Campanoli / Eskimo North and Gmail <xeno.campanoli@...>
I tried installing a bunch of ruby 1.9 stuff on my Ubuntu laptop last night, but
On 4/30/2010 1:36 PM, Xeno Campanoli / Eskimo North and Gmail wrote:
Jason Roelofs wrote:
Walton Hoops wrote:
Re: [QUIZ] Music Theory (#229)
Introduction
*This summary was written by Jean Lazarou.*
This quiz has some tricky aspects; translating a chord symbol to the notes
that it comprise may be ambiguous. The rule to follow when interpreting a
chord symbol may be different from one person to another and still be
correct.
As an example take the C major chord, one may expect three notes (C, E and
G). On a guitar you can produce 6 notes, on a piano you can produce 10
notes. Would you only play three notes? Another example: Cb on the piano
results in hitting the B key. Should a chord like Ab-Cb be rendered as Ab-B=
?
Have a look at the thread of discussion=85
Therefore, I am not considering all interpretation differences. I am not an
expert and I would probably be wrong.
Terminology
In the hope to make the summary clear, let=92s first present the terminolog=
y
we use.
The =91thing=92 the solution program expects as input is a chord symbol.
The chord symbol has a specific syntax. It starts with a note name, a lette=
r
from A to G, that we name the chord root. We can assign a pitch to the note=
,
a flat or a sharp. We write a flatted note by adding the lower case letter
=91b=92 and a sharped by adding the =91#=92 symbol.
After the root note follows the quality and the extension, they are a
limited set of strings defining what notes to include in the produced chord=
.
The rule to apply to get the notes is the same whatever the root note is. W=
e
are going to call it the modifier (Evan=92s term) or chord modifier.
Scales are sequences of notes, the basic sequence is for instance the C
major: C D E F G A B. We use degree to refer to the distance between notes,
for instance in the C scale, G is at a higher degree compared to C.
Solutions analysis
We see two trends in the solutions: three solutions defined classes, like
Note, and two went for a straight implementation of the solution. The
solutions with classes are intended to be musical APIs. They check if the
script is used as a main script to run in interactive mode. Typically code
expecting to run both as a utility and as a main script contain code like:
if __FILE__ =3D=3D $0
# used as main script
end
All the solutions parse the chord input and validate it in some way. They
all use regular expressions but in different ways.
Ben Rho
Ben=92s code, that parses the chord symbol, uses an array notation where th=
e
index is a regular expression that returns a matching string or nil:
value =3D "hello"
p value[/hel/] # =3D> "hel"
p value[/aa/] # =3D> nil
(not common to me)
He uses nested if statements with different regular expressions to validate
the chord symbol and builds the result at the same time. Using the root
note, he creates a note list as an array of possible notes sorted by degree
(either with sharps, either with flats). To define the array he uses a
standard array, then rotates the sequence so that the root note becomes the
first. The code looks like:
# define an array of note sequence
note_list =3D (%w(ab a bb b c db d eb e f gb g))
# map the note list to produce a rotated list
rotated_list =3D note_list.map { ... }
He uses a hash object that defines the =91chord library=92. The chord libra=
ry
maps the modifier to an array of indexes. The indexes give the sequence of
elements to select from the note list to build the chord. Each index being
an offset from the previous one.
Basically as the note list expresses all the semitones, the first index
gives the number of semitones between the root note and the first not to
appear in the chord. The next one gives the number of semitones between the
second note and the third one, and so on.
Because adding indexes may result in overflowing, he use a modulo 12 to
restart from 0.
David Springer
David=92s solution is pretty similar, except that his indexes are not
cumulative, they all give the offset from the root note.
He has a more complete list of modifiers.
Two differences are worth to notice. David does not use the regular
expression literals, supported by Ruby. He explicitly uses the Regexp class=
.
To combine alternative patterns he uses the union method:
sharps =3D Regexp.new("^[ACDFG]#")
flats =3D Regexp.new("^[ABDEG]b")
naturals =3D Regexp.new("^[A-G]")
get_root =3D Regexp.union(sharps,flats,naturals)
The second difference is that David does not rotate the arrays containing
the scale, to move the root note at the first position. He addresses the
items using modulo, after computing the position of the root note. He also
uses negative indexes to mark optional notes.
Evan Hanson
Evan defines several classes: Note, Chord and Key. He also extends the
Map class
with class level methods
He creates a Chord instance with the chord symbol as parameter. The
initializer parses the chord symbol and actually creates the result.
Because he accepts a combination of any number of modifiers, he tries to
match as much strings as possible, by removing one character from the
modifier string at a time, until it finds some match. Evan uses a hash
(dictionary) with the supported modifiers. The code searching for all the
modifiers looks like:
# duplicate entry so that next lines do not destroy the original modifier
mod =3D original_modifier.dup
# search for the longer match...
until chords_dictionary.include?(mod) or mod.empty? do
mod.slice! -1 # remove last character
end
# retrieve the value associated with the modifier, if any
x =3D chords_dictionary[mod] unless mod.empty?
The values stored in the chord dictionary are arrays of method names. The
methods must be sent to a Note object. The methods return a note at some
interval (or distance) from the root note. Calling all the methods produces
the chord.
At the end he uses the uniq! method of the Chord class to remove any
duplicate note.
Brian Candler
Brian introduces one class, named Note. The class level scale method return=
s
the chord and the scale. A Note object has two attributes: the note
expressed as an index (A note is 0) and the distance from A (as semitones).
The scale method uses another class level method named parse. The parse met=
hod
returns a Note instance and the chord modifier. Again, the code validates
the modifier with a dictionary. The dictionary provides the scale in an
array of numbers, each number gives the number of semitones between the roo=
t
note and each note. Actually, dictionary entries may contain two other
arrays to add more notes in the scale and the notes making up the chord. Th=
e
code converts the array of semitones to an array of notes (strangely the
method making the conversion is also named scale but is not in the same
scope, instance method here).
Brian=92s dictionary contains a pretty complete list of modes.
Once he gets the scale, he selects the notes for the chord.
An interesting usage in parse is the call to new to create an instance. As
the method belongs to the Note class, the new method, with respect to the
current self, is the one in the class object.
def parse str
# skip code
[new(note, semi), $3]
end
Using new this way, instead of calling Note.new has the advantage of making
easier class renaming or copy-pasting code.
Jean Lazarou
The last solution is mine. It contains three classes: Note, Chord, and
Interval.
The Interval represents a distance and is expressed as a number of degrees
and a number of semitones. A Note has a name, an index (like Brian=92s inde=
x,
0 is A) and the pitch.
The Chord class parses a chord symbol in the initializer. It does not build
the solution, it stores the elements of the chord definition. The parsing
uses only one regular expression with the group options to retrieve each
element:
# only part of the real regexp
if @chord_symbol =3D~ /^([A-G])([#b]{0,1})(maj|m|mi|min|){0,1}$/
puts "root note #{$1}"
puts "pitch is #{$2}"
puts "quality is #{$3}"
end
As you see in the example above the expression has 3 groups: *[A-G]*, *[#b]=
*
and*maj|m|mi|min*.
The Chord class has a dictionary providing arrays of intervals. When it
comes to generate the chord, the code calls the to_a method. to_a creates a=
n
array by adding each interval to the root note. The Note class overloads th=
e
add and subtract operators:
def + interval
# code here
end
def - interval
# code here
end
I also added tests to test the chord parsing, adding intervals to notes and
the chord generation. To make the tests easier to read I created constants
named A, B, C, etc.
Finally, I added a script to run a GUI version displaying the notes using
the score notation, see screenshot. It uses Swiby as the GUI layer on top o=
f
Java/Swing, that=92s why I wrote the solution as an API.
Comments
Reading the code with classes was not very easy.
I will not start a debate about API design, still I think some questions
should help in writing APIs:
- What are the benefits of using them?
- Should they be easy to understand?
- Should they be intuitive to use?
- Should they be helpful?
- Should they allow doing different things or only a specific one?
- Should the code extend existing classes?
Let=92s try to look at the solutions with the questions in mind.
Should they be easy to understand?
Brian=92s Note class contains a class level method named parse, it parses a
string and creates a Note object.
Should they be intuitive to use?
Evan has a class named Key. It contains a method named include? taking a
note as parameter and easy to guess what it is supposed to do: it returns
true if the given notes belongs to key.
Should they allow doing different things or only a specific one?
My Note class allows to add intervals to calculate another note. The featur=
e
is used to build the chord, it could also be used to generate sequences of
notes by applying rules like *oriental music* style or *jazz* style.
Should they be helpful?
The solution make use of their APIs and do not contains unused feature,
obviously they are helpful.
Conclusion
So, Steve, I would suggest that you make use of Brian=92s solution because =
it
seems to support more chords. But, I think you can rather easily improve or
enhance any of the solutions to meet your needs.
Music Theory (#229) - Solutions<http://rubyquiz.strd6.com/quizzes/229.tar.g=
z>