[#262740] Any experience with Bluehost? — joviyach <joviyach@...>

I am looking for hosting for RoR, but I'd also like to be able to do

15 messages 2007/08/01
[#262768] Re: Any experience with Bluehost? — Brett Simmers <bsimmers@...> 2007/08/01

joviyach wrote:

[#262749] Railless ActiveRecord — Ari Brown <ari@...>

Hey all. More ActiveRecord trouble.

16 messages 2007/08/01

[#262782] Dynamic method call — "Andrea Maschio" <andrea.maschio@...>

I'm trying, for the purpose of making something similar to a grammar, to do

32 messages 2007/08/01
[#262785] Re: Dynamic method call — Sharon Phillips <phillipsds@...> 2007/08/01

> I'm trying, for the purpose of making something similar to a

[#262791] Re: Dynamic method call — "Andrea Maschio" <andrea.maschio@...> 2007/08/01

Thank you very much guys, it worked. I was doing this for the purpose of

[#262827] Re: Dynamic method call — "Gregory Brown" <gregory.t.brown@...> 2007/08/01

On 8/1/07, Andrea Maschio <andrea.maschio@gmail.com> wrote:

[#262882] Re: Dynamic method call — "Andrea Maschio" <andrea.maschio@...> 2007/08/01

the problem is that method_name is a static call, i need to make it dynamic

[#262883] Re: Dynamic method call — "Gregory Brown" <gregory.t.brown@...> 2007/08/01

On 8/1/07, Andrea Maschio <andrea.maschio@gmail.com> wrote:

[#262904] Private methods not so private? — Frank Meyer <lolz.llolz@...>

Hello,

15 messages 2007/08/01

[#263011] Beginner's tutorial and poor attempt at classes — Gabriel Dragffy <gabe@...>

Hi all

16 messages 2007/08/02
[#263012] Re: Beginner's tutorial and poor attempt at classes — dblack@... 2007/08/02

Hi --

[#263034] #send in 1.9 — Trans <transfire@...>

Looking over 1.9's change of #send, ie.

61 messages 2007/08/02
[#263036] Re: #send in 1.9 — "Tim Pease" <tim.pease@...> 2007/08/02

On 8/2/07, Trans <transfire@gmail.com> wrote:

[#263093] Re: #send in 1.9 — Ari Brown <ari@...> 2007/08/02

[#263672] Re: #send in 1.9 — Trans <transfire@...> 2007/08/07

[#263674] Re: #send in 1.9 — "Gregory Brown" <gregory.t.brown@...> 2007/08/07

On 8/7/07, Trans <transfire@gmail.com> wrote:

[#263684] Re: #send in 1.9 — Trans <transfire@...> 2007/08/07

[#263687] Re: #send in 1.9 — "Gregory Brown" <gregory.t.brown@...> 2007/08/07

On 8/7/07, Trans <transfire@gmail.com> wrote:

[#263736] Re: #send in 1.9 — Trans <transfire@...> 2007/08/07

[#263747] Re: #send in 1.9 — "Gregory Brown" <gregory.t.brown@...> 2007/08/08

On 8/7/07, Trans <transfire@gmail.com> wrote:

[#263781] Re: #send in 1.9 — dblack@... 2007/08/08

Hi --

[#263825] Re: #send in 1.9 — Trans <transfire@...> 2007/08/08

[#263837] Re: #send in 1.9 — James Edward Gray II <james@...> 2007/08/08

On Aug 8, 2007, at 9:52 AM, Trans wrote:

[#263841] Re: #send in 1.9 — "Robert Dober" <robert.dober@...> 2007/08/08

On 8/8/07, James Edward Gray II <james@grayproductions.net> wrote:

[#263845] Re: #send in 1.9 — James Edward Gray II <james@...> 2007/08/08

On Aug 8, 2007, at 10:30 AM, Robert Dober wrote:

[#263115] Determining the common prefix for several strings — Todd Burch <promos@...>

I have several strings to analyze. The strings are the names of a list

38 messages 2007/08/03
[#263137] Re: Determining the common prefix for several strings — Xavier Noria <fxn@...> 2007/08/03

El Aug 3, 2007, a las 2:31 AM, Todd Burch escribi鷓

[#263140] Re: Determining the common prefix for several strings — Xavier Noria <fxn@...> 2007/08/03

El Aug 3, 2007, a las 4:26 AM, Xavier Noria escribi鷓

[#263141] Re: Determining the common prefix for several strings — Xavier Noria <fxn@...> 2007/08/03

El Aug 3, 2007, a las 4:41 AM, Xavier Noria escribi鷓

[#263195] Numbers Can Be Words (#133) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

14 messages 2007/08/03

[#263200] Getting the 'Sender' or 'Caller' object of a method — Peter Laurens <peterlaurenspublic@...>

Hi,

12 messages 2007/08/03

[#263250] ruby on the zaurus — "Sy Ali" <sy1234@...>

I'm happy with the older ruby 1.8.4 which I have for my Zaurus

17 messages 2007/08/03
[#263253] Re: ruby on the zaurus — gregarican <greg.kujawa@...> 2007/08/03

On Aug 3, 2:56 pm, "Sy Ali" <sy1...@gmail.com> wrote:

[#263257] Re: ruby on the zaurus — gregarican <greg.kujawa@...> 2007/08/03

On Aug 3, 3:13 pm, gregarican <greg.kuj...@gmail.com> wrote:

[#263303] Better way to do this? Currently using two method_missing calls... — Dan <dan.gottlieb@...>

Hi,

15 messages 2007/08/03
[#263306] Re: Better way to do this? Currently using two method_missing calls... — Xavier Noria <fxn@...> 2007/08/04

El Aug 4, 2007, a las 1:50 AM, Dan escribi鷓

[#263331] Re: Better way to do this? Currently using two method_missing calls... — Dan <dan.gottlieb@...> 2007/08/04

Thanks for the reply. I'm probably being dense here, but I don't see

[#263339] Re: Better way to do this? Currently using two method_missing calls... — Xavier Noria <fxn@...> 2007/08/04

El Aug 4, 2007, a las 1:29 PM, Dan escribi鷓

[#263344] Re: Better way to do this? Currently using two method_missing calls... — Dan <dan.gottlieb@...> 2007/08/04

Ok, I see where you were going now. I guess I could go in that

[#263304] python-style decorators — Keith Rarick <kr@...>

I've been using ruby for about 8 months now and I've come to appreciate

35 messages 2007/08/03
[#263505] Re: python-style decorators — Trans <transfire@...> 2007/08/06

[#263719] Re: python-style decorators — "Keith Rarick" <kr@...> 2007/08/07

On 8/6/07, Trans <transfire@gmail.com> wrote:

[#266555] Re: python-style decorators — Trans <transfire@...> 2007/08/28

[#266763] Re: python-style decorators — Daniel DeLorme <dan-ml@...42.com> 2007/08/29

Trans wrote:

[#266765] Re: python-style decorators — "Keith Rarick" <kr@...> 2007/08/29

On 8/29/07, Daniel DeLorme <dan-ml@dan42.com> wrote:

[#266769] Re: python-style decorators — Trans <transfire@...> 2007/08/30

[#266844] Re: python-style decorators — "Keith Rarick" <kr@...> 2007/08/30

On 8/29/07, Trans <transfire@gmail.com> wrote:

[#266845] Re: python-style decorators — Trans <transfire@...> 2007/08/30

[#266873] Re: python-style decorators — "Keith Rarick" <kr@...> 2007/08/30

On 8/30/07, Trans <transfire@gmail.com> wrote:

[#263347] building rubygems without documentation — "Sy Ali" <sy1234@...>

I see no way to build rubygems without documentation. I checked the

13 messages 2007/08/04
[#263359] Re: building rubygems without documentation — Ben Bleything <ben@...> 2007/08/04

On Sat, Aug 04, 2007, Sy Ali wrote:

[#263480] yield or call? — "Ronald Fischer" <ronald.fischer@...>

def f(&b)

24 messages 2007/08/06
[#263481] Re: yield or call? — "Phlip" <phlip2005@...> 2007/08/06

Ronald Fischer wrote:

[#263586] Alternate Regular Expressions? — Ari Brown <ari@...>

Just randomly curious -

27 messages 2007/08/07
[#263588] Re: Alternate Regular Expressions? — "Phlip" <phlip2005@...> 2007/08/07

Ari Brown wrote:

[#263592] Re: Alternate Regular Expressions? — Ari Brown <ari@...> 2007/08/07

[#263596] Re: Alternate Regular Expressions? — Kenneth McDonald <kenneth.m.mcdonald@...> 2007/08/07

Ari,

[#263602] Re: Alternate Regular Expressions? — Ari Brown <ari@...> 2007/08/07

I'm moderately serious. This is going to be one of those projects

[#263613] I came from Perl, and would ask for some quick start point — Lee NL <ruby@...>

Dear all,

12 messages 2007/08/07

[#263627] Feature request (pretty_inspect variant, yielding single quotes instead of double) — "Ronald Fischer" <ronald.fischer@...>

require 'pp'

8 messages 2007/08/07

[#263688] Need Solaris Help — James Edward Gray II <james@...>

I'm told the following bit of code doesn't work on Solaris:

20 messages 2007/08/07

[#263728] non-constant strings — Dmitry Bilunov <kmeaw@...>

Hello. Why does Ruby have non-constant strings? It seems there is a way

15 messages 2007/08/07

[#263796] case statement — Shai Rosenfeld <shaiguitar@...>

hi guys,

22 messages 2007/08/08

[#263853] deadlock in ThreadPool using backtick — Justin Johnson <justinjohnson@...>

Hello,

19 messages 2007/08/08

[#263930] Collect objects from an array based on one unique parameter — Milo Thurston <knirirr@...>

If one has an array of objects, each containing various values, what

13 messages 2007/08/09
[#263932] Re: Collect objects from an array based on one unique parameter — Konrad Meyer <konrad@...> 2007/08/09

On Thursday 09 August 2007 02:24:46 am Milo Thurston wrote:

[#263989] define_method with default parameters — Emmanuel Oga <oga_emmanuel_oga@...>

how can i use define_method to assign default parameters?

13 messages 2007/08/09

[#264089] Cellular Automata (#134) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

32 messages 2007/08/10

[#264113] Any recommendations on ruby editor — "harry pillei" <Hari@...>

Hi,

31 messages 2007/08/10
[#264122] Re: Any recommendations on ruby editor — franco <flazzarino@...> 2007/08/10

On Aug 10, 12:37 pm, "harry pillei" <H...@pillai.co.uk> wrote:

[#264135] Sorting a logfile, how would you write it? — Frank Meyer <lolz.llolz@...>

I've written a little ruby program which can sort logfiles with the

15 messages 2007/08/10
[#264149] Re: Sorting a logfile, how would you write it? — William James <w_a_x_man@...> 2007/08/10

On Aug 10, 1:29 pm, Frank Meyer <lolz.ll...@gmail.com> wrote:

[#264172] Re: Sorting a logfile, how would you write it? — Ryan Davis <ryand-ruby@...> 2007/08/11

[#264160] Split a string based on change of character — Andrew Savige <ajsavige@...>

For a string "ZBBBCZZ", I want to produce a list ["Z", "BBB", "C", "ZZ"]

27 messages 2007/08/11

[#264193] global_variable_set (like instance_variable_set) — Thomas Hafner <thomas@...>

Hello,

15 messages 2007/08/11

[#264211] Interesting garbage collection article on LTU — Lionel Bouton <lionel-subscription@...>

Hi,

11 messages 2007/08/11

[#264234] launchy 0.1.2 Released — Jeremy Hinegardner <jeremy@...>

launchy version 0.1.2 has been released.

19 messages 2007/08/12
[#264243] Re: launchy 0.1.2 Released — Trans <transfire@...> 2007/08/12

[#264244] Re: launchy 0.1.2 Released — Sebastian Hungerecker <sepp2k@...> 2007/08/12

Trans wrote:

[#264270] Ubuntu as a Ruby dev environment? — joviyach <joviyach@...>

Developing using things like MySQL, PHP, and Ruby has been an absolute

27 messages 2007/08/12

[#264305] Can .rhtml files include text from .txt or .html file? — Sfdesigner Sfdesigner <daniel@...>

Hi,

11 messages 2007/08/12

[#264314] Non Existent Method Dir.empty? Description via "ri" — "Wolfgang Nádasi-donner" <ed.odanow@...>

Moin, moin!

24 messages 2007/08/12
[#264586] Re: Non Existent Method Dir.empty? Description via "ri" — Daniel Berger <djberg96@...> 2007/08/14

[#264598] Re: Non Existent Method Dir.empty? Description via "ri" — "Wolfgang Nádasi-donner" <ed.odanow@...> 2007/08/14

Daniel Berger wrote:

[#264350] TCPSocket Flushing — David -- <neko18@...>

I have two programs, a server and a client. I want to send two messages

13 messages 2007/08/13

[#264445] Why don't Ruby libraries share memory? — "Matt Harvey" <matt@...>

This paragraph is motivation. While my question is not Rails-specific, I am

12 messages 2007/08/13

[#264508] Why is rake really slow? — richpoirier@...

Is rake supposed to be really slow?

13 messages 2007/08/14

[#264532] Does an Array#apply make any sense at all? — "nikolai.weibull@..." <nikolai.weibull@...>

Hi!

29 messages 2007/08/14

[#264783] mp3 file magic number identification — John Joyce <dangerwillrobinsondanger@...>

Does anybody know how to identify (validate) mp3 files (other audio

15 messages 2007/08/15

[#264817] grep a csv? — Michael Linfield <globyy3000@...>

If i had a huge CSV file, and i wanted to pull out say all the lines

27 messages 2007/08/16
[#264821] Re: grep a csv? — "M. Edward (Ed) Borasky" <znmeb@...> 2007/08/16

Michael Linfield wrote:

[#264826] Re: grep a csv? — Michael Linfield <globyy3000@...> 2007/08/16

M. Edward (Ed) Borasky wrote:

[#264911] Double quote escape character — Alvaro Perez <alvaro.pmartinez@...>

Hi all,

13 messages 2007/08/16

[#264923] Does singleton variables have any meaning ? — "Arno J." <jub@...>

Hello,

17 messages 2007/08/16
[#264967] Re: Does singleton variables have any meaning ? — dblack@... 2007/08/16

Hi --

[#265015] Re: Does singleton variables have any meaning ? — "Arno J." <jub@...> 2007/08/16

>> class << self #or class << A

[#265115] wishing of reactive programming in ruby — ashishwave <ashishwave@...>

ruby integrates power of functional programming from lisp , purest OO

17 messages 2007/08/17

[#265130] method access to the enclosing method's locals? — Larry Kluger <rubyforum@...>

18 messages 2007/08/17

[#265154] 8086 simulator in ruby — Vasil Vangelovski <vvangelovski@...>

I'm thinking of writing a simulator for the intel 8086 processor in

22 messages 2007/08/17

[#265223] Problem with Array#delete — Matthew B Gardner <weather@...>

Hello, I'm baffled by the following problem:

16 messages 2007/08/18
[#265226] Re: Problem with Array#delete — Morton Goldberg <m_goldberg@...> 2007/08/18

On Aug 18, 2007, at 12:59 AM, Matthew B Gardner wrote:

[#265230] Re: Problem with Array#delete — Matthew B Gardner <weather@...> 2007/08/18

Sorry, I only meant the code I posted as an example of what is happening --

[#265244] How do you print the first 5 records in an array? — Bob Sanders <small.business.strategy@...>

Let's say I have an array defined as:

29 messages 2007/08/18

[#265273] Emulating a Groovy feature? — John Wells <lists@...>

Guys,

17 messages 2007/08/18

[#265303] Is this the perfect regex for validating first & last names? — Todd Burch <promos@...>

Perhaps a fairly bold statement, coming from a novice regex'er. :)

11 messages 2007/08/18

[#265381] Detecting duplicates in an array, anything in the standard library ? — Thibaut Barr鑽e <thibaut.barrere@...>

Hi!

35 messages 2007/08/19
[#265594] Re: Detecting duplicates in an array, anything in the standard library ? — Pe, Botp <botp@...> 2007/08/21

From: Thibaut Barr鑽e [mailto:thibaut.barrere@gmail.com]

[#265614] Re: Detecting duplicates in an array, anything in the standa — Jimmy Kofler <koflerjim@...> 2007/08/21

Duplicates can also be extracted from an array like this:

[#265488] Current rubygems require idiom — Bil Kleb <Bil.Kleb@...>

Hi,

15 messages 2007/08/20

[#265543] Regexp: named captures — Ari Brown <ari@...>

How do named captures in Ruby work? This is what I've tried:

21 messages 2007/08/20

[#265592] Dear Lazyweb: Gem Platforms — Eric Hodel <drbrain@...7.net>

As you may or may not have heard, RubyGems will be merged into Ruby

14 messages 2007/08/21

[#265596] Test if file is binary ? — "Rebhan, Gilbert" <Gilbert.Rebhan@...>

26 messages 2007/08/21

[#265635] How to "cast" in Ruby — Marcin Tyman <m.tyman@...>

Hi,

15 messages 2007/08/21
[#265636] Re: How to "cast" in Ruby — "David A. Black" <dblack@...> 2007/08/21

Hi --

[#265729] Get Date Modified value for a directory (folder) — Hayato Iriumi <hiriumi@...>

Hello, folks.

12 messages 2007/08/22

[#265843] time class changed in ruby-1.8.6? — "Ball, Donald A Jr (Library)" <donald.ball@...>

Hi guys. I'm in the process of migrating a ruby app from 1.8.5 to 1.8.6

11 messages 2007/08/22

[#265888] ruby shell? — "Simon Schuster" <significants@...>

what about a shell based on ruby? would such a thing be

26 messages 2007/08/23
[#265892] Re: ruby shell? — "Robert Klemme" <shortcutter@...> 2007/08/23

2007/8/23, Simon Schuster <significants@gmail.com>:

[#265930] Re: ruby shell? — "Daniel Aquino" <mr.danielaquino@...> 2007/08/23

It would be cool if we could some how write a patch that would alter

[#265971] Functional Programming — benjohn@...

I'm interested in functional programming.

26 messages 2007/08/23
[#266017] Re: Functional Programming — Brian Adkins <lojicdotcom@...> 2007/08/23

On Aug 23, 1:32 pm, benj...@fysh.org wrote:

[#266080] Re: Functional Programming — Sharon Phillips <phillipsds@...> 2007/08/24

> If you like Ruby, you may also enjoy Lisp since it influenced Ruby.

[#266039] something I just found out, am sharing (:newbish) — "Simon Schuster" <significants@...>

075:0> a = "hello"

13 messages 2007/08/24

[#266067] How to append some data at the beginning of a file — Uday Thokala <udaykanth_t@...>

Hi,

10 messages 2007/08/24

[#266085] ID3 Tags (#136) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

38 messages 2007/08/24

[#266087] Combining Array Elements — gregarican <greg.kujawa@...>

I have an array that I would like to combine elements. Here's a sample

14 messages 2007/08/24

[#266159] Thread safety techniques for server applications? — Aaron Smith <beingthexemplary@...>

Hey all,

24 messages 2007/08/25
[#266173] Re: Thread safety techniques for server applications? — "dtuttle1@..." <dtuttle1@...> 2007/08/25

Hi Aaron,

[#266190] Re: Thread safety techniques for server applications? — khaines@... 2007/08/25

On Sat, 25 Aug 2007, dtuttle1@gmail.com wrote:

[#266199] Re: Thread safety techniques for server applications? — "Terry Poulin" <bigboss64@...> 2007/08/25

> Remember that Ruby threads, being green threads, are all in the same

[#266202] Re: Thread safety techniques for server applications? — "ara.t.howard" <ara.t.howard@...> 2007/08/25

[#266162] How can I make this if/else more succinct? — eggie5 <eggie5@...>

How can I make this if/else more succinct?

13 messages 2007/08/25

[#266274] Ruby Vs. Java — Nick Nick <schaefer88@...>

Which programming language is faster - Ruby or Java?

49 messages 2007/08/26
[#266276] Re: Ruby Vs. Java — "simon jenkins" <simojenki@...> 2007/08/26

It depends what you mean by faster,

[#266280] Re: Ruby Vs. Java — Nick el <schaefer88@...> 2007/08/26

[#266293] Re: Ruby Vs. Java — Phrogz <phrogz@...> 2007/08/26

On Aug 26, 6:16 am, Nick el <schaefe...@gmail.com> wrote:

[#266304] Re: Ruby Vs. Java — "I. P." <stack.tcpip@...> 2007/08/26

|Phrogz|

[#266279] 2D MMORPG — Nick el <schaefer88@...>

I've been trying to find out what programming language would be best for

20 messages 2007/08/26

[#266285] sort_by { rand } not working — Mike Dershowitz <michael.dershowitz@...>

Hello:

22 messages 2007/08/26

[#266309] Why does: system("./ati-driver-installer-8.40.4-x86.x86_64.run --buildpkg Ubuntu/feisty") not work ? It always fails without any error? — kazaam <kazaam@...>

Well,

11 messages 2007/08/26

[#266403] Ruby Pocket Reference — John Joyce <dangerwillrobinsondanger@...>

I picked up the new OREILLY book Ruby Pocket Reference today, by

23 messages 2007/08/27
[#266414] Re: Ruby Pocket Reference — Thomas Worm <usenet@...4r.de> 2007/08/27

On Mon, 27 Aug 2007 14:39:53 +0900, John Joyce wrote:

[#266452] Re: Ruby Pocket Reference — Karl von Laudermann <doodpants@...> 2007/08/27

On Aug 27, 3:58 am, Thomas Worm <use...@s4r.de> wrote:

[#266456] Re: Ruby Pocket Reference — "Kyle Schmitt" <kyleaschmitt@...> 2007/08/27

But ruby already _has_ animals.

[#266464] Re: Ruby Pocket Reference — John Joyce <dangerwillrobinsondanger@...> 2007/08/27

No, I'm not that dense, I know OREILLY chooses random animals at

[#266471] Substitution within system quoted string — "Victor Reyes" <victor.reyes@...>

Team,

11 messages 2007/08/27

[#266497] IDE's With Indentation Guides Like SciTE? — "list. rb" <list.rb@...>

I've used SciTE for quite some time now and have become addicted to the

18 messages 2007/08/28

[#266616] idiomatic way to assign if not nil? — Jay Levitt <jay@...>

I know I can use "a ||= b" to assign b to a if a is nil.

21 messages 2007/08/28

[#266664] Difference between Distributed ruby and Rinda — Hema Latha <hema_aspire@...>

Can anyone tell me the difference between Distributed ruby and rinda?

9 messages 2007/08/29

[#266728] How to make an array of hashes to a single array with all the values of these hashes ? — kazaam <kazaam@...>

Take a look at this,

13 messages 2007/08/29
[#266731] Re: How to make an array of hashes to a single array with all the values of these hashes ? — Phrogz <phrogz@...> 2007/08/29

On Aug 29, 12:39 pm, kazaam <kaz...@oleco.net> wrote:

[#266768] Bug in % (Float)? — "Charlie Lehardy" <charlie.lehardy@...>

Modulo should be a fairly simple operation, however I'm finding some very

25 messages 2007/08/30
[#266781] Re: Bug in % (Float)? — Pe, Botp <botp@...> 2007/08/30

From: Charlie Lehardy [mailto:charlie.lehardy@gmail.com] :

[#266789] Re: Bug in % (Float)? — Morton Goldberg <m_goldberg@...> 2007/08/30

On Aug 29, 2007, at 10:14 PM, Pe, Botp wrote:

[#266794] Re: Bug in % (Float)? — Calamitas <calamitates@...> 2007/08/30

On 30/08/2007, Morton Goldberg <m_goldberg@ameritech.net> wrote:

[#266804] Re: Bug in % (Float)? — Morton Goldberg <m_goldberg@...> 2007/08/30

On Aug 30, 2007, at 3:39 AM, Calamitas wrote:

[#266865] Re: Bug in % (Float)? — Calamitas <calamitates@...> 2007/08/30

On 30/08/2007, Morton Goldberg <m_goldberg@ameritech.net> wrote:

[#266975] Re: Bug in % (Float)? — Morton Goldberg <m_goldberg@...> 2007/08/31

On Aug 30, 2007, at 5:56 PM, Calamitas wrote:

[#266806] Important Research Project — "E.D.G." <edgrsprj@...>

Important Research Project (Related to computer programming)

15 messages 2007/08/30

[#266841] Changing date backward messes up threaded sleep — Earle Clubb <eclubb@...>

Can anyone explain this behavior? If the system time is set backward,

13 messages 2007/08/30

[#266882] 0.06 == 0.06 returns false in Ruby? — "Jason G." <jasonpurchase@...>

Hi

45 messages 2007/08/31
[#266885] Re: 0.06 == 0.06 returns false in Ruby? — Peña, Botp <botp@...> 2007/08/31

From: Jason G. [mailto:jasonpurchase@yahoo.com]

[#266914] Re: 0.06 == 0.06 returns false in Ruby? — Michael Ulm <michael.ulm@...> 2007/08/31

Pe単a wrote:

[#266924] Re: 0.06 == 0.06 returns false in Ruby? — Daniel DeLorme <dan-ml@...42.com> 2007/08/31

Michael Ulm wrote:

[#266931] Re: 0.06 == 0.06 returns false in Ruby? — "Robert Klemme" <shortcutter@...> 2007/08/31

2007/8/31, Daniel DeLorme <dan-ml@dan42.com>:

[#266933] Re: 0.06 == 0.06 returns false in Ruby? — Pe, Botp <botp@...> 2007/08/31

From: Robert Klemme [mailto:shortcutter@googlemail.com]

[#266894] Ruby stupidities — Kenneth McDonald <kenneth.m.mcdonald@...>

The title is intentionally (but semiseriously) contentious, but I'm not

16 messages 2007/08/31

[#266945] Twisting a Rope (#137) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

32 messages 2007/08/31

[QUIZ] Twisting a Rope (#137)

From: Ruby Quiz <james@...>
Date: 2007-08-31 13:19:54 UTC
List: ruby-talk #266945
The three rules of Ruby Quiz:

1.  Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.

2.  Support Ruby Quiz by submitting ideas as often as you can:

http://www.rubyquiz.com/

3.  Enjoy!

Suggestion:  A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion.  Please reply to the original quiz message,
if you can.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

by John Miller

This week's task is to implement the Rope data structure as a Ruby class.  This
topic comes out of the ICFP programming competition
(http://www.icfpcontest.com/) which had competitors manipulating a 7.5 million
character string this year.

	What is a Rope:

You may not realize it, but for many changes the content to a String, Ruby
creates a new copy of the original with the modifications applied.  For small
strings that are created once and read often this is actually a very efficient
way to do thing, but what happens when the string starts to get long, and is
undergoing a lot of changes?  First, the program will spend more and more of its
processing cycles just copying bits around.  Second, the garbage collector will
be called more and more often to pick up the little stringy scraps you've left
all over the memory.

Ropes (the name is a pun for a heavy duty string) are tree structures where a
node represents the concatenation of its left branch with its right, and leaves
are flat strings. (This is a little sloppy. A rope may contain shared subtrees,
and is thus really a directed acyclic graph, where the out-edges of each vertex
are ordered. We will continue to be sloppy.)  E.g. To prepend Text A to Text B,
one creates a Node (call it N1) with A as its left branch and B as its right.  
To further append Text C create a new Node N2 with its left branch pointing to 
N1 and its right to C.  Easy, right?  To find out more see Boehm, Atkinson and 
Plass "Ropes: an Alternative to Strings" at:

	http://rubyurl.com/2FRbO

The task comes in three parts, each increasing in difficulty:

Part one:

Create a Rope class that can do the following:

	a. 'append' or 'prepend' a String or another Rope 
	   (alias the << operator to the append function)     
	b. Return the fully concatenated text with 'to_s' 
	c. define 'slice' to call to_s.slice  
	d. provide a 'length' method

Part two:

Add the following:

	a. Add the ability to 'index' a single character given a 0-based offset
	   from the beginning of the string.
	b. Add the ability to 'shift' a single character from the front of a Rope.
	   (Remove and return the character) 
	c. Add your own 'slice' method that returns a String. Implement as many of 
	   the String method's forms as possible.  To run the example code this
	   function will only need to understand the slice(offset,length) form.
	   Major Bonus for Regex and Substring forms. 
	d. "Balance" the tree with a 'normalize' method. 
	   (see Boehm, Atkinson and Plass 1319 Rebalancing)

Part three: (bonus)

Add the following:

	a. Change the 'slice' method to return a Rope. Ideally this method should
	   do as little string copying as possible. (Doing this will well
	   dramatically increase the speed of the example code)
	b. Allow 'shift' to optionally accept an integer number of characters to
	   remove and return.
	c. modify the '<<' operator so that can efficiently append a few
	   characters at a time. (see Boehm, Atkinson and Plass 1318 para. 4)
	d. *Major Bonus* Add the ability to append and prepend IO classes in a
	   lazy fashion. (see Boehm, Atkinson and Plass 1318 para. 2)

The following code may help you explore how efficient your code is and show
where Ropes are useful.  `ruby -r /path/to/your/rope/class this_script.rb Rope`
will run the test with your code.  Run the script without arguments to see how
well String does.  Also play around with the SIZE and CHUNKS constants to get a
feel for how they affect performance.

	require 'benchmark'
	
	#This code make a String/Rope of  CHUNCKS chunks of text
	#each chunck is SIZE bytes long.  Each chunck starts with 
	#an 8 byte number.  Initially the chuncks are shuffled the
	#qsort method sorts them into ascending order.
	#
	#pass the name of the class to use as a parameter
	#ruby -r rope.rb this_file Rope
	
	puts 'preparing data...'
	TextClass = Object.const_get(ARGV.shift || :String)
	
	def qsort(text)
	  return TextClass.new if text.length == 0
	  pivot = text.slice(0,8).to_s.to_i
	  less = TextClass.new
	  more = TextClass.new
	  offset = 8+SIZE
	  while (offset < text.length)
	    i = text.slice(offset,8).to_s.to_i
	    (i < pivot ? less : more) << text.slice(offset,8+SIZE)
	    offset = offset + 8+SIZE
	  end
	  print "*"
	  return qsort(less) << text.slice(0,8+SIZE) << qsort(more)
	end
	
	SIZE  = 512 * 1024
	CHUNCKS = 128
	CHARS = %w[R O P E]
	data = TextClass.new
	bulk_string = 
	  TextClass.new(Array.new(SIZE) { CHARS[rand(4)] }.join)
	puts 'Building Text...'
	build = Benchmark.measure do
	  (0..CHUNCKS).sort_by { rand }.each do |n| 
	    data<< sprintf("%08i",n) << bulk_string
	  end 
	  data.normalize  if data.respond_to? :normalize
	end
	GC.start
	sort = Benchmark.measure do
	  puts "Sorting Text..."
	  qsort(data)
	  puts"\nEND"
	end
	
	puts "Build: #{build}Sort: #{sort}"

In This Thread

Prev Next