[#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:
[QUIZ][SUMMARY] Ruby BASIC (#228)
This summary was written by Jean Lazarou.
We received no solution for this quiz. Therefore we are going to
present the one we wrote.
The basic language reference we consider is the one from Dartmouth
college (back in October 1964). The language is rather simple, it only
computes numbers. It does not contain any string handling, except for
output printing. The variable naming is limited to a single letters
followed by an optional digit. It does not support interactive input.
The language
Let us start with a short description of the language. For a deeper
specification see annex or get the Dartmouth College=92s document.
Each line of a basic program is a statement. Most statements are
instructions to execute.
A line must start with a line number. After the line number comes a
word denoting the type of the statement. Basic has fifteen statement
types:
DATA
DEF
DIM
END
FOR
GOSUB
GOTO
IF
LET
NEXT
PRINT
READ
REM
RETURN
STOP
Our implementation does not support the DEF and DIM statements.
Source code does not require lines to be ordered. Basic uses only
capital letters and spaces are optional. Expression must appear on a
single line.
The END statement must be the highest numbered statement, including
the data statements. A number must contain up to nine digits with an
optional minus sign and an optional decimal point.
As basic programs have no input statements, a program uses the data
statements for data input.
A simple program
Next program outputs the first ten square roots.
10 LET X =3D 0
20 LET X =3D X + 1
30 PRINT X, SQR(X)
40 IF X <=3D 10 THEN 20
50 END
The parser
We are going to write a parser and an interpreter. Separating the
parsing phase from the interpretation (or the run) makes writing tests
easier, we separate the syntaxical aspects from the running aspects.
Parsing basic code is not very difficult, the syntax is not complex.
We use a regular expression to validate each line.
01 unless line =3D~ /^(\d+)
*(DATA|DEF|DIM|END|FOR|GOSUB|GOTO|IF|LET|NEXT|PRINT|READ|REM|RETURN|STOP)
*(.*)$/
02 raise error_message("INVALID STATEMENT", line_number, line)
03 end
The regular expression matches a string starting with digits, followed
by optional spaces, one of the valid basic keywords, optional spaces
and anyhting. We use regular expression=92s groups so that if the line
matches our rule the global variables $1 contains the line number, $2
contains the statement and $3 the rest of the line. We discard any
space in between.
After validating the statement type, we need statement specific
validation. We use a hash table that maps the statement type to a
method that parses each statements.
01 STATEMENT_PARSERS =3D {
02 'DATA' =3D> :parse_data,
03 'END' =3D> :parse_end,
04 'FOR' =3D> :parse_for,
05 'GOSUB' =3D> :parse_gosub,
06 'GOTO' =3D> :parse_goto,
07 'IF' =3D> :parse_if,
08 'LET' =3D> :parse_let,
09 'NEXT' =3D> :parse_next,
10 'PRINT' =3D> :parse_print,
11 'READ' =3D> :parse_read,
12 'REM' =3D> :parse_rem,
13 'RETURN' =3D> :parse_return,
14 'STOP' =3D> :parse_stop
15 }
Each parse method needs the statement line number and the rest of the
line (the part to parse). It also needs the current position in the
script and the whole line to be able to generate a valuable error
message.
01 statement =3D self.send(method, line_number, line, $1.to_i, $3)
02 statements << statement
The parser sends the message (the parse method) to it self. If the
parse method successfully parses the statement it returns a Satetement
object. We add the statement object to the statements array.
Once the parser consumes all the input program, we need to sort the
satements because the basic language does not require the statement to
be ordered.
01 statements.sort!
The sorting works because the Statement objects provide an
implementation of the comparison method (<=3D>). The comparison method
compares the line numbers. Here is the Statement base class.
01 class Statement
02
03 attr_reader :line, :arguments
04
05 def initialize line, type, arguments =3D nil
06 @line, @type, @arguments =3D line, type, arguments
07 end
08
09 def <=3D> other
10 @line - other.line
11 end
12
13 def to_s
14 "#{@line} #{@type} #{@arguments}".rstrip
15 end
16
17 end
We are not going to present all the parse methods, as an example we
are going to look at parse_goto which is rather simple. A goto
statement looks like: 10 GOTO 90. Which means: the effect of line 10
is to jump at line 90.
01 def parse_goto line_number, source, statement_line, arguments
02
03 scanner =3D BasicScanner.new(arguments)
04
05 scanner.skip_spaces
06 to_line =3D scanner.scan_line
07
08 raise error_message("MISSING TO LINE", line_number, source)
unless to_line
09
10 scanner.skip_spaces
11 raise error_message("INVALID 'GOTO' STATMENT", line_number,
source) unless scanner.eos?
12
13 GotoStatement.new(statement_line, to_line.to_i)
14
15 end
We use the BasicScanner class which derives from the StringScanner
class. The reason for extending StringScanner is to add methods, like
skip_spaces, that makes it easier to read the code, not to mention
that regular expressions are not easy to read.
The arguments parameter is a string containing everything following
the basic statement type. We first skip spaces (line 5), then we try
retrieving the line number to go to (line 6). If we don=92t find a line
number, we raise an error (line 8). Otherwise we skip trailing spaces
(line 10) and check if we reached the end of the input (line 11).
Finally, input was a valid GOTO statement and we return a
GotoStatement.
Expressions
When a statement expects an expression the parse methods use the
parse_expression method.
parse_expression
a number (a floating point value) for literals,
a string for operators (+, -, *, /, ^), parentheses and built-in functions
a symbol for variables
The array of tokens is still an infix expression. The reason is that
we can easier implement the to_s method use by the to_s method of a
Statement object which produces a valid basic source code.
The to_a method returns the array of tokens.
Expression
Testing the parser
Testing the parser is easy, here are some examples.
Testing the expression parsing.
01 expr =3D @parser.parse_expression('INT(X/Y) + 2')
02 assert_equal ['INT', '(', :X, '/', :Y, ')', '+', 2], expr.to_a
Testing converting the expression to the postfix version.
01 expr =3D @parser.parse_expression('SQR(4) + INT(Y/2) * 3')
02 assert_equal [4, 'SQR', :Y, 2, '/', 'INT', 3, '*', '+'], expr.to_postf=
ix
Testing that spaces are optional.
01 def test_program_witout_spaces
02
03 program =3D <<PROGRAM
04 10PRINT"HELLO"
05 20END
06 PROGRAM
07
08 statements =3D @parser.parse(program)
09
10 assert_equal 2, statements.length
11
12 assert_equal '10 PRINT "HELLO"', statements[0].to_s
13 assert_equal '20 END', statements[1].to_s
14
15 end
We use the to_s method of the Statement objects which returns a
canonical string to make the test is easier to read. (notice that
reading source code without spaces is not easy =96 line 4)
The interpreter
Now that a parser returns an array of Statement objects, executing the
program is easy. We loop through them and keep track of the program
position (we need a bit more, see later). The interpreter uses a
runtime object which stores the programs=92s variables and the program
position. Here is the main loop of the interpreter.
01 def run_statements statements
02
03 runtime =3D create_runtime(statements)
04
05 while runtime.running?
06
07 statement =3D statements[runtime.program_pos]
08
09 statement.execute(runtime)
10
11 runtime.program_pos +=3D 1
12
13 end
14
15 runtime
16
17 end
The runtime object has also a running state.
The interpreter expects the statement objects to implement the execute
method (line 9). The statement classes in the parser file
(basic_parser.rb) do not offer execute methods, we re-open the classes
here in the interpreter file (basic.rb). Therefore our files are
shorter and the separation of responsibilities does not imply doubling
the set of classes.
At the end of the method (line 15) we return the runtime to the
calling code so that it can access the variables.
The runtime object
Let us fisrt look at the runtime class layout.
01 class Runtime
02
03 attr_accessor :program_pos
04
05 def initialize console, data
06 end
07
08 def running?
09 end
10
11 def next_data
12 end
13
14 def end
15 end
16
17 def print line
18 end
19
20 def [] var
21 end
22
23 def []=3D var, value
24 end
25
26 def each_var
27 end
28
29 def save_pos name, subject
30 end
31
32 def restore_pos name
33 end
34
35 end
A Runtime instance needs a console where the output is sent and an
array of all the data available for the read statements.
The program position can be read or changed, for instance the GOTO
statement changes it. Notice that the program position is an index in
the program=92s array of statements, not the source code line number.
The next_data returns the sequence of data or nil when all the data is cons=
umed.
The end method puts the state to program ended.
The print method is used by the PRINT statement.
The [], []=3D and each_var give access to the current values of the
program=92s variables.
The last methods, save_pos and restore_pos are used to save the
current program position and to retrieve the saved position. A name is
accociated with each save, it is useful to validate the correct
sequence of the NEXT statements and the RETURN statements. The saved
positions are pushed on a stack and must be consumed in reverse order.
Creating the runtime object
The create_runtime method instantiate a Runtime object.
It loops through all the statements creating:
a map table, mapping the basic line numbers to the index in the array
of statements
a collection of the goto-like statements (GOTO, GOSUB and IF)
an array of all the data found in the statements
After the first loop, it starts a second loop to set the mapped line
number to the program position for all the goto-like statements. The
test to find what statements are goto-like is done by searching all
the objects that respond to the program_pos=3D message, needed to set
the actual program position.
Turn the Statement objects into runnable objects=85
In the interpreter file we re-open the Statement classes and add the
execute methods. The default implementation does nothing (some
statements like DATA and REM just inherit the no-operation execute).
01 class Statement
02
03 def execute runtime
04 end
05
06 end
One interresting thing in Ruby is that we do not need to redeclare
inheritance when we re-open a class. Therefore, if we ever need to
change the class hierarchy we only need to change it at one place. If
we declared the inheritance we would have to give exactly the same.
We are going to look at the STOP and the GOSUB statements.
01 class StopStatement
02
03 def execute runtime
04 runtime.end
05 end
06
07 end
(We do not repeat that the class derives from the Statement class.)
The implementation for stop is very simple, it only needs to notify
the runtime that the program stops running (line 4).
The gosub is just a bit more complicated.
01 class GosubStatement
02
03 def execute runtime
04 runtime.save_pos :gosub, self
05 runtime.program_pos =3D @to_program_pos
06 end
07
08 def program_pos=3D line
09 @to_program_pos =3D line - 1
10 end
11
12 end
We ask the runtime to save the current program position, because when
we later meet the return statement we must continue at the next
statement relative to the current position. We register the save
position with a special name, the :gosub symbol (line 4). And we set
the position where we want to jump (line 5). Actually we set the goto
index =96 1 (see the way we store the line index at line 9).
Saving the current position prepares the runtime for a later use when
the interpreter meets the return statement.
01 class ReturnStatement
02
03 def execute runtime
04
05 gosub =3D runtime.restore_pos(:gosub)
06
07 raise "UNMATCHED 'GOSUB' AT LINE #{@line}" unless gosub
08
09 end
10
11 end
Testing the interpreter
The tests that validate the interpreter look like:
01
02 require 'test/unit'
03 require 'basic'
04
05 class TestBasic < Test::Unit::TestCase
06
07 def test_print_one_string
08
09 program =3D <<BASIC
10 10 PRINT 'HELLO'
11 20 END
12 BASIC
13
14 @basic.run program
15
16 assert_equal 1, @console.lines.length
17 assert_equal ["HELLO"], @console.lines
18
19 end
20
21 end
The test requires the unit test framework and the interpreter (line
3). We call the interpreter, at line 14, with the program. Next we
assert we printed out one line (at line 16) and the output content
(line 17). The console attribute is a false console that stores all
the printed lines. The interpreter needs a console and calls its print
method. We create a test console.
01 class TestConsole
02
03 attr_reader :lines
04
05 def initialize
06 @lines =3D []
07 end
08
09 def print line
10 @lines << line
11 end
12
13 end
The test setup creates the interpreter.
01 def setup
02 @console =3D TestConsole.new
03 @basic =3D BasicInterpreter.new(@console)
04 end
If the interpreter was as follow, the test would pass.
01 class BasicInterpreter
02
03 def initialize console
04 @console =3D console
05 end
06
07 def run program
08 @console.print "HELLO"
09 end
10
11 end
$>ruby basic_test.rb
Loaded suite basic_test
Started
E
Finished in 0.000369 seconds.
1) Error:
test_print_one_string(TestBasic):
NoMethodError: undefined method `run' for nil:NilClass
basic_test.rb:14:in `test_print_one_string'
1 tests, 0 assertions, 0 failures, 1 errors
Using programs for tests
We wrote some basic programs that we can use to validate our
interpreter in automated tests. By using the technique presented above
and adding some more methods, the tests become even easier to read.
Here if the factorial program.
10 REM
15 REM COMPUTE FACTORIAL
20 REM
25 LET F =3D 1
30 READ N
31 LET X =3D N
35 IF N =3D 0 THEN 55
40 LET F =3D F * N
45 LET N =3D N - 1
50 GOTO 35
55 PRINT "FACT", X, "IS", F
60 GOTO 25
65 DATA 1, 3, 5, 6, 20
99 END
Here is the test that runs the factorial program.
01 class TestRunningBasicPrograms < Test::Unit::TestCase
02
03 def test_factorial
04
05 script 'fact.bas'
06
07 expects 'FACT', 1, 'IS', 1
08 expects 'FACT', 3, 'IS', 6
09 expects 'FACT', 5, 'IS', 120
10 expects 'FACT', 6, 'IS', 720
11 expects 'FACT', 20, 'IS', 2432902008176640000
12
13 assert_output_as_expected
14
15 end
16
17 end
At line 5 we set the program file under test, from line 7 up to 11 we
declare the expectations and the last line (line 13) checks the
outcome.
Tests using the runtime
As the interpreter returns the runtime object, we can use it during
the assertion phase.
01 def test_1et
02
03 program =3D <<BASIC
04 10 LET A =3D (23 + 5) / 2
05 40 END
06 BASIC
07
08 runtime =3D @basic.run(program)
09
10 assert_equal 14, runtime[:A]
11
12 end
We run the program and store the runtime in the runtime variable (line
8). Then we assert that the value of the variable A of the program is
the one expected, using the runtime object.
Test results
The code attached to this summary contain tests. Here is the tests results.
$>ruby basic_parser_test.rb
Loaded suite basic_parser_test
Started
.............
Finished in 0.008335 seconds.
13 tests, 56 assertions, 0 failures, 0 errors
$>ruby basic_test.rb
Loaded suite basic_test
Started
.............
Finished in 0.020823 seconds.
13 tests, 23 assertions, 0 failures, 0 errors
You can download the code here.
Annex
Here is a BNF description of the language syntax.
<program> ::=3D <statement> {\n <statement>}
<statement> ::=3D <let> | <read> | <data> | <print> | <goto> | <if> |
<for> | <next> |
<end> | <stop> | <def> | <gosub> | <return> | <dim> | <r=
em>
<let> ::=3D LET <variable> =3D <expression>
<read> ::=3D READ <variable> {, <variable>}
<data> ::=3D DATA <number> {, <number>}
<print> ::=3D PRINT <label> | <label> <expression> | <expression>
<goto> ::=3D GOTO <line-number>
<if> ::=3D IF <expression> <relational> <expression> THEN <line-n=
umber>
<for> ::=3D FOR <unsubscripted-var> =3D <expression> TO
<expression> [STEP <expression>]
<next> ::=3D NEXT <unsubscripted-var>
<end> ::=3D END
<stop> ::=3D STOP
<def> ::=3D DEF FN <letter> (<unsubscripted-var>) =3D <expression>
<gosub> ::=3D GOSUB <line-number>
<return> ::=3D RETURN
<dim> ::=3D DIM <letter>(<integer>) | <letter>(<integer>, <integer=
>)
<rem> ::=3D <string>
<variable> ::=3D <letter> [<digit>] [(<integer>) | (<integer>, <integer=
>)]
<label> ::=3D "<string>"
<relational> ::=3D < | =3D | > | <=3D | >=3D | <>
<unsubscripted-var> ::=3D <letter> [<digit>]
Expressions may contain the following arithmetic operations: +, -, *, /, ^.
Basic has next built-in functions: SIN, COS, TAN, ATN, EXP, ABS, LOG,
SQR, RND, INT