[#173424] Ruby 1.8.4 and tcltk under Linux — Mark Volkmann <r.mark.volkmann@...>

I have some Ruby code that uses Tk that works fine under Windows.

10 messages 2006/01/01

[#173454] macworld — Mike Schwab <michael.schwab@...>

What Ruby stuff will be happening at Macworld? What software is

32 messages 2006/01/01
[#173606] Re: macworld — "Hampton" <hcatlin@...> 2006/01/02

I just bought a new Mac, and its the worst dev environment for ruby

[#173607] Re: macworld — James Edward Gray II <james@...> 2006/01/02

On Jan 2, 2006, at 9:47 AM, Hampton wrote:

[#173646] Re: macworld — Chad Perrin <perrin@...> 2006/01/02

On Tue, Jan 03, 2006 at 12:52:59AM +0900, James Edward Gray II wrote:

[#173648] Re: macworld — James Edward Gray II <james@...> 2006/01/02

On Jan 2, 2006, at 1:57 PM, Chad Perrin wrote:

[#173665] Re: macworld — Chad Perrin <perrin@...> 2006/01/02

On Tue, Jan 03, 2006 at 05:03:49AM +0900, James Edward Gray II wrote:

[#173520] Can't change the value of self — Jonathan Leighton <lists@...>

This code:

14 messages 2006/01/02

[#173544] New to Ruby and Programming — Will Shattuck <willshattuck@...>

Hi folks. Happy New Year!

36 messages 2006/01/02
[#173551] Re: New to Ruby and Programming — "J. Ryan Sobol" <ryansobol@...> 2006/01/02

Can you list and describe the programs you've developed in the past?

[#173555] Re: New to Ruby and Programming — Will Shattuck <willshattuck@...> 2006/01/02

On 1/1/06, J. Ryan Sobol <ryansobol@gmail.com> wrote:

[#173556] Re: New to Ruby and Programming — "J. Ryan Sobol" <ryansobol@...> 2006/01/02

Sounds like your at the cusp of a new and exciting thing, so I want

[#173557] Re: New to Ruby and Programming — Will Shattuck <willshattuck@...> 2006/01/02

On 1/1/06, J. Ryan Sobol <ryansobol@gmail.com> wrote:

[#173628] application and web app technologies — cartercc@...

January, 2006.

32 messages 2006/01/02

[#173657] Implicit block parameter? — "Ross Bamford" <rosco@...>

Hi,

33 messages 2006/01/02

[#173738] Rubyhelp wanted /offered — PG <PG@...>

hi guys - I read some of the posts here & wanted to point out that

16 messages 2006/01/03

[#173777] Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — Alan Garrison <alang@...>

Our company, which is beginning to use Ruby in production systems, has

37 messages 2006/01/03
[#173783] Re: Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — "M. Edward (Ed) Borasky" <znmeb@...> 2006/01/03

I just took a brief look at the Darcs web site and the Cogito web site.

[#173789] Re: Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — Alan Garrison <alang@...> 2006/01/03

M. Edward (Ed) Borasky wrote:

[#173797] Re: Ruby projects and interfaces to revision control systems — Ollivier Robert <keltia@...> 2006/01/03

Alan Garrison wrote:

[#173807] Re: Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — mental@... 2006/01/03

It's lunch time, so here are my own (very opinionated) thoughts on

[#173852] Re: Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — mathew <meta@...> 2006/01/03

mental@rydia.net wrote:

[#174304] Re: Ruby projects and interfaces to revision control systems (Darcs vs. Cogito) — Jeffrey Dik <jeffrey.dik@...> 2006/01/05

2005 seems to have been a really good year for open-source SCMs. Many

[#173791] - Requesting Comments for Process Definition and Presentation — Ilias Lazaridis <ilias@...>

comp.lang.python / comp.lang.ruby

23 messages 2006/01/03
[#173798] Re: [OT] - Requesting Comments for Process Definition and Presentation — Claudio Grondi <claudio.grondi@...> 2006/01/03

Ilias Lazaridis wrote:

[#173823] Re: [OT] - Requesting Comments for Process Definition and Presentation — Ilias Lazaridis <ilias@...> 2006/01/03

Claudio Grondi wrote:

[#174489] Re: [OT] - Requesting Comments for Process Definition and Presentation — Xavier Morel <xavier.morel@...> 2006/01/06

Ilias Lazaridis wrote:

[#173897] silly regex question — Joe Van Dyk <joevandyk@...>

Can someone help me make this code not suck?

15 messages 2006/01/03
[#173901] Re: silly regex question — James Edward Gray II <james@...> 2006/01/03

On Jan 3, 2006, at 4:22 PM, Joe Van Dyk wrote:

[#173902] Re: silly regex question — Joe Van Dyk <joevandyk@...> 2006/01/03

On 1/3/06, James Edward Gray II <james@grayproductions.net> wrote:

[#173905] Re: silly regex question — James Edward Gray II <james@...> 2006/01/03

On Jan 3, 2006, at 4:41 PM, Joe Van Dyk wrote:

[#173898] Proposed new rule — "Warren Brown" <warrenbrown@...>

> The three rules of Ruby Quiz:

40 messages 2006/01/03
[#173912] Re: [QUIZ] Proposed new rule — James Edward Gray II <james@...> 2006/01/03

On Jan 3, 2006, at 4:23 PM, Warren Brown wrote:

[#173923] Email Address Regex [was Re: silly regex question] — Jacob Fugal <lukfugl@...>

On 1/3/06, Dan Kohn <dan@dankohn.com> wrote:

30 messages 2006/01/03
[#174026] Re: Email Address Regex — "Andreas S." <f@...> 2006/01/04

Jacob Fugal wrote:

[#173989] Is there a way to clear the contents of a terminal? — John Maclean <info@...>

Hi Chaps,

15 messages 2006/01/04

[#174109] Question on iterating a hash — phil swenson <phil.swenson@...>

I have a hash that looks like this : {"1"=>"0, "3"="1", "45"=>"1",

17 messages 2006/01/04

[#174202] using irb — John Maclean <info@...>

So far I've created a ~/bin/rb/dev/foo directory as a place to write and test scripts. After reading the "pick axe" book some more it seems as is irb is a better "place" or "way" to try out stuff. This correct?

14 messages 2006/01/05

[#174257] Demystifying Symbols. — Dave Howell <groups@...>

I was actually doing really well until the strange discussion involving

24 messages 2006/01/05

[#174312] how remove puts inside method? — Carlos Delmar <k@...>

I have a method (process_transaction) that uses puts to output a result.

14 messages 2006/01/05

[#174357] Is it possible to create a GUI/TUI toolkit using ruby? — "simonh" <simonharrison@...>

this may be a daft question, but is it possible to create a widget

9 messages 2006/01/05

[#174374] How do you sort a text file? — Danny Abc <dannyabc@...>

I'm new to Ruby and was wondering how to sort a text file?

15 messages 2006/01/05

[#174521] Dice Roller (#61) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

111 messages 2006/01/06
[#174531] Re: [QUIZ] Dice Roller (#61) — "J. Ryan Sobol" <ryansobol@...> 2006/01/06

Please don't take this the wrong way, but I've never played D&D.

[#174560] Re: [QUIZ] Dice Roller (#61) — Jim Freeze <jim@...> 2006/01/06

On Jan 6, 2006, at 12:56 PM, Ruby Quiz wrote:

[#174568] Re: [QUIZ] Dice Roller (#61) — Austin Ziegler <halostatue@...> 2006/01/06

On 06/01/06, Jim Freeze <jim@freeze.org> wrote:

[#174585] Re: [QUIZ] Dice Roller (#61) — Jim Freeze <jim@...> 2006/01/06

[#174587] Re: [QUIZ] Dice Roller (#61) — James Edward Gray II <james@...> 2006/01/06

On Jan 6, 2006, at 5:35 PM, Jim Freeze wrote:

[#174593] Splitting strings on spaces, unless inside quotes — Richard Livsey <richard@...>

I want to split a string into words, but group quoted words together

17 messages 2006/01/07

[#174641] Iterator Fu Failing Me — James Edward Gray II <james@...>

I have a group of classes, all implementing a parse?() class method.

38 messages 2006/01/07

[#174669] RMagick exporting pixels as string — Ilmari Heikkinen <ilmari.heikkinen@...>

Hi,

4 messages 2006/01/07

[#174744] Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...>

After my first day back at my University, I was quickly reminded that

101 messages 2006/01/08
[#174749] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Seidman <gsslist+ruby@...> 2006/01/08

On Sun, Jan 08, 2006 at 11:28:17AM +0900, Gregory Brown wrote:

[#174752] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

On 1/7/06, Gregory Seidman <gsslist+ruby@anthropohedron.net> wrote:

[#174755] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — gwtmp01@... 2006/01/08

[#174756] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

On 1/8/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:

[#174800] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Edward Gray II <james@...> 2006/01/08

On Jan 8, 2006, at 12:14 AM, Gregory Brown wrote:

[#174839] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Steve Litt <slitt@...> 2006/01/08

On Sunday 08 January 2006 12:32 pm, James Edward Gray II wrote:

[#174847] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

On 1/8/06, Steve Litt <slitt@earthlink.net> wrote:

[#174856] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Steve Litt <slitt@...> 2006/01/08

On Sunday 08 January 2006 05:04 pm, Gregory Brown wrote:

[#174867] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — gwtmp01@... 2006/01/08

[#174875] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Britt <james_b@...> 2006/01/09

gwtmp01@mac.com wrote:

[#174894] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/09

On 1/8/06, James Britt <james_b@neurogami.com> wrote:

[#174895] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — dblack@... 2006/01/09

Hi --

[#174905] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/09

On 1/8/06, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#174963] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — dblack@... 2006/01/09

Hi --

[#175030] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/09

On 1/9/06, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#175036] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — gwtmp01@... 2006/01/09

[#175050] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/09

On 1/9/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:

[#175055] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Britt <james_b@...> 2006/01/09

Gregory Brown wrote:

[#174758] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

On 1/8/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:

[#174761] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — gwtmp01@... 2006/01/08

[#174766] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

On 1/8/06, gwtmp01@mac.com <gwtmp01@mac.com> wrote:

[#174794] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — gwtmp01@... 2006/01/08

[#174806] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Edward Gray II <james@...> 2006/01/08

On Jan 8, 2006, at 9:00 AM, gwtmp01@mac.com wrote:

[#174822] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

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

[#174826] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Edward Gray II <james@...> 2006/01/08

On Jan 8, 2006, at 2:04 PM, Gregory Brown wrote:

[#174827] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — Gregory Brown <gregory.t.brown@...> 2006/01/08

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

[#174828] Re: Ideas on "Why Living Dangerous can be A Good Thing" in Ruby? — James Edward Gray II <james@...> 2006/01/08

On Jan 8, 2006, at 2:21 PM, Gregory Brown wrote:

[#174768] Is Ruby RAILS really suitable for modern Web Development ? — "Jules" <Roseanna80@...>

I have been reading through RAILS and builing the Depot Application

13 messages 2006/01/08

[#174775] You want a Ruby extension? Talk to me, baby — Joe Van Dyk <joevandyk@...>

Hi,

25 messages 2006/01/08

[#174890] global variables are bad?? — John Maclean <info@...>

Chaps,

13 messages 2006/01/09

[#174921] Remove HTML from String? — "jotto" <jonathan.otto@...>

I can't find a method to remove HTML from a string in the core API. PHP

12 messages 2006/01/09

[#175020] Ruby, Unicode - ever? — dseverin <dmitry.severin@...>

Well, as I could search the web so far, since about 2001 or even early,

21 messages 2006/01/09
[#175025] Re: Ruby, Unicode - ever? — Austin Ziegler <halostatue@...> 2006/01/09

On 09/01/06, dseverin <dmitry.severin@gmail.com> wrote:

[#175275] Re: Ruby, Unicode - ever? — David Vallner <david@...> 2006/01/11

Austin Ziegler wrote:

[#175138] problem with running foxruby on windows 2000 — Mohsen Akhavan <cplus_developer@...>

Hello How are you ,I installed ruby 1.8.2 with fxruby 1.2.6 for

9 messages 2006/01/10

[#175219] Finding CPU% of a linux task — Joe Van Dyk <joevandyk@...>

Hi,

9 messages 2006/01/10

[#175277] Finding a sentence (more than one word & punctuation (, . ;)) in a string? — Kev Jackson <kevin.jackson@...>

given this string

12 messages 2006/01/11

[#175321] Parsing Japanese Language and Some Ruby Trivia — Michael Sullivan <unixwzrd@...>

All this talk about Unicode support and HTML parsing got me to

15 messages 2006/01/11
[#175417] Re-post: Parsing Japanese Language and Some Ruby Trivia — Michael Sullivan <unixwzrd@...> 2006/01/12

Hi,

[#175327] how can I give a name to an anonymous class — sayoyo@...

Hi,

15 messages 2006/01/11
[#175331] Re: how can I give a name to an anonymous class — gwtmp01@... 2006/01/11

[#175352] safe array index ? — Christer Nilsson <janchrister.nilsson@...>

Is it possible to catch index out of range ?

14 messages 2006/01/11

[#175408] Looking up properties and speed — Jonathan Leighton <lists@...>

Hi,

14 messages 2006/01/12

[#175429] Availability of Ruby 1.8.4 Windows (One Click Install) — jsp408@...

1.8.2-15 was the last release of Ruby (Windows One Click Install) in

17 messages 2006/01/12
[#175432] Re: Availability of Ruby 1.8.4 Windows (One Click Install) — David Vallner <david@...> 2006/01/12

jsp408@comcast.net wrote:

[#175444] Re: Availability of Ruby 1.8.4 Windows (One Click Install) — James Britt <james_b@...> 2006/01/12

David Vallner wrote:

[#175466] Re: Availability of Ruby 1.8.4 Windows (One Click Install) — Alexandru Popescu <the.mindstorm.mailinglist@...> 2006/01/12

Sorry to come in the middle of this thread, but I am wondering why

[#175458] Dice Roller (#61) — Matthew Moss <matthew.moss.coder@...>

My reason for choosing a dice roller is somewhat selfish: I was interested

13 messages 2006/01/12

[#175470] Newbie question about multiple assignments — Alex <AlexAfrasinei@...>

12 messages 2006/01/12

[#175487] Question about GUI API for Ruby — Jacek Olszak <jacekolszak@...2.pl>

Hi... currently I'm developing a small gui application. I don't know

29 messages 2006/01/12
[#175551] Re: Question about GUI API for Ruby — tsumeruby@... 2006/01/12

On Thursday 12 January 2006 08:37 pm, Jacek Olszak wrote:

[#175587] Re: Question about GUI API for Ruby — "David Vallner" <david@...> 2006/01/12

On Thu, 12 Jan 2006 17:44:33 +0100, <tsumeruby@tsumelabs.com> wrote:

[#175588] Nothern VA RUG to meet — Richard Kilmer <rich@...>

January 25...details can be found here: http://www.novarug.org

25 messages 2006/01/12
[#175589] RUGS — "J. Ryan Sobol" <ryansobol@...> 2006/01/12

It's exhilarating to see all the RUG announcements, like this one.

[#175655] ruby under cygwin & windows paths — Mojca Miklavec <mojca.miklavec.lists@...>

Hello,

15 messages 2006/01/13

[#175662] Packing (#62) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

16 messages 2006/01/13

[#175720] Range#member? Oddity — James Edward Gray II <james@...>

I'm not understanding what I am seeing here. Can anyone please

43 messages 2006/01/13
[#175732] Re: Range#member? Oddity — Matthew Desmarais <desmarm@...> 2006/01/13

James Edward Gray II wrote:

[#175745] Re: Range#member? Oddity — "David Vallner" <david@...> 2006/01/13

On Fri, 13 Jan 2006 22:16:14 +0100, Matthew Desmarais <desmarm@gmail.com>

[#175746] Re: Range#member? Oddity — James Edward Gray II <james@...> 2006/01/13

On Jan 13, 2006, at 3:58 PM, David Vallner wrote:

[#175750] Re: Range#member? Oddity — "David Vallner" <david@...> 2006/01/13

On Fri, 13 Jan 2006 23:00:37 +0100, James Edward Gray II

[#175781] Re: Range#member? Oddity — Hal Fulton <hal9000@...> 2006/01/14

James Edward Gray II wrote:

[#175783] Re: Range#member? Oddity — Christer Nilsson <janchrister.nilsson@...> 2006/01/14

Hal Fulton wrote:

[#175731] why is this a comile error — bimo remus <bmoremus@...>

I am doing a tutorial from the Thomas~Hansson book and am getting this

20 messages 2006/01/13
[#175733] Re: why is this a comile error — Austin Ziegler <halostatue@...> 2006/01/13

On 13/01/06, bimo remus <bmoremus@yahoo.com> wrote:

[#175735] Re: why is this a comile error — James Edward Gray II <james@...> 2006/01/13

On Jan 13, 2006, at 3:17 PM, Austin Ziegler wrote:

[#175755] Re: why is this a comile error — Austin Ziegler <halostatue@...> 2006/01/13

On 13/01/06, James Edward Gray II <james@grayproductions.net> wrote:

[#175832] Librend 0.4 — Ilmari Heikkinen <ilmari.heikkinen@...>

Librend 0.4-----------

5 messages 2006/01/14

[#175882] Resetting ruby — List Recv <listrecv@...>

I'm looking for a fast way to "reset" Ruby. That is, to reset the

19 messages 2006/01/16

[#175910] basic question about Fixnum & Integer — Tom Allison <tallison@...>

Hello,

25 messages 2006/01/16
[#175911] Re: basic question about Fixnum & Integer — zdennis <zdennis@...> 2006/01/16

Tom Allison wrote:

[#175913] Re: basic question about Fixnum & Integer — Tom Allison <tallison@...> 2006/01/16

zdennis wrote:

[#175919] Re: basic question about Fixnum & Integer — Jules <julesjacobs@...> 2006/01/16

No, you don't have to require integer, because it is in the core. The

[#175921] Re: basic question about Fixnum & Integer — Tom Allison <tallison@...> 2006/01/16

Jules wrote:

[#175923] Re: basic question about Fixnum & Integer — Daniel Harple <dharple@...> 2006/01/16

[#175950] this month, the next month, and the one after that — Mason Kessinger <masonkessinger@...>

What I want to do is simple.

14 messages 2006/01/16

[#175998] Question about regular expression — Eric Luo <eric.wenbl@...>

I need to hack out an regular expression, which will match "SNPB" without

12 messages 2006/01/17

[#176147] Unable to write to file... (example from "pickaxe book", second edition, p128) — John Maclean <info@...>

Following the example from "pickaxe book", second edition, p128

11 messages 2006/01/19

[#176155] My Thought on the "Pickaxe book" (from a Ruby novice) — John Maclean <info@...>

Chaps,

33 messages 2006/01/19
[#176157] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — Doug Bromley <doug.bromley@...> 2006/01/19

I think what John is saying is that in the other languages he's used

[#176158] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — John Maclean <info@...> 2006/01/19

Thanks Doug. More concise and articulate that I ever could be.

[#176162] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — Kenneth Collins <pine29@...> 2006/01/19

John, pick out the way to do something that seems most natural to you

[#176167] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — Mark Volkmann <r.mark.volkmann@...> 2006/01/19

On 1/19/06, Kenneth Collins <pine29@myfastmail.com> wrote:

[#176168] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — James Britt <james_b@...> 2006/01/19

Mark Volkmann wrote:

[#176186] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — Mark Volkmann <r.mark.volkmann@...> 2006/01/19

On 1/19/06, James Britt <james_b@neurogami.com> wrote:

[#176188] Re: My Thought on the "Pickaxe book" (from a Ruby novice) — ara.t.howard@... 2006/01/19

On Fri, 20 Jan 2006, Mark Volkmann wrote:

[#176196] Ruby Quiz #62 — Andrew Dudzik <adudzik@...>

Hi all--just found my way into this list by way of Ruby Quiz, which looks

14 messages 2006/01/19

[#176229] Mongrel 0.1.0 -- A Fast As Hell Mostly Ruby Web Server — Zed Shaw <zedshaw@...>

Hi,

16 messages 2006/01/20

[#176247] Mongrel 0.1.1 -- A Fast Ruby Web Server (It Works Now, Maybe) — Zed Shaw <zedshaw@...>

Hi All,

41 messages 2006/01/20
[#176430] Re: [ANN] Mongrel 0.1.1 -- A Fast Ruby Web Server (It Works Now, Maybe) — PA <petite.abeille@...> 2006/01/21

[#176461] Re: [ANN] Mongrel 0.1.1 -- A Fast Ruby Web Server (It Works Now, Maybe) — Jim Freeze <jimfreeze@...> 2006/01/22

On Jan 21, 2006, at 3:07 PM, PA wrote:

[#176469] Re: Mongrel 0.1.1 -- A Fast Ruby Web Server (It Works Now, M — Jeff Pritchard <jp@...> 2006/01/22

Noob question here.

[#176480] Re: Mongrel 0.1.1 -- A Fast Ruby Web Server (It Works Now, M — Zed Shaw <zedshaw@...> 2006/01/22

On Jan 22, 2006, at 12:42 PM, Jeff Pritchard wrote:

[#176255] Grid Folding (#63) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

28 messages 2006/01/20

[#176282] error:- "regex literal in condition" — John Maclean <info@...>

Hi Guys,

32 messages 2006/01/20
[#176288] Hungarian Case variable names. — Zach <zacharooni@...> 2006/01/20

This is an ignorant question to pose, but here I go anyway.

[#176297] Basic Inheritance questions {noob alert:- pickaxe ed. 2, page 27} — John Maclean <info@...>

Chaps,

12 messages 2006/01/20
[#176298] Re: Basic Inheritance questions {noob alert:- pickaxe ed. 2, page 27} — Wilson Bilkovich <wilsonb@...> 2006/01/20

You can do it one of three ways:

[#176329] Re: Basic Inheritance questions {noob alert:- pickaxe ed. 2, page 27} — John Maclean <info@...> 2006/01/20

Thanks for that speedy reply. I've decided to require the within the

[#176330] PostgreSQL in Ruby with SSL connections — Kevin Brown <blargity@...>

Is SSL supported with the ruby postgres adapter? I'd like to SSL the

13 messages 2006/01/20
[#176383] Re: PostgreSQL in Ruby with SSL connections — Dick Davies <rasputnik@...> 2006/01/21

It's handled transparently by libpq. If you're using the C library,

[#176879] Re: PostgreSQL in Ruby with SSL connections — Kevin Brown <blargity@...> 2006/01/25

I'd like to use SSL certificate authentication, and that happens

[#176456] #63: Grid Folding — Luke Blanshard <luke@...>

Greetings all,

16 messages 2006/01/22

[#176457] Minimizing memory allocations — Ilmari Heikkinen <ilmari.heikkinen@...>

So there I was this morning, staring at an ObjectSpace counter tellingme that I'm allocating 1500 Arrays and 10000 Floats per frame. Whichpretty much ground my framerate to ground by requiring a 0.2s GC runevery other frame. So I decided to get down and rid my code of as manyallocations as possible.

23 messages 2006/01/22
[#176512] Re: Minimizing memory allocations — John Carter <john.carter@...> 2006/01/23

On Sun, 22 Jan 2006, Ilmari Heikkinen wrote:

[#177139] Re: Memoization? — Dave Howell <groups@...> 2006/01/26

[#176479] remove non-ASCII characters in a string — Levin Alexander <levin@...>

Hi,

14 messages 2006/01/22

[#176525] Line breaking in Ruby can be dangerous — Sky Yin <sky.yin@...>

After programing in ruby for the past 3 months, I must say I'm

11 messages 2006/01/23

[#176543] WeakRef Hash — James Edward Gray II <james@...>

I need a Hash-like structure, using WeakRef, so that the key value

14 messages 2006/01/23

[#176622] About rant on Dave Thomas site, titled 'imitation...' — "simonh" <simonharrison@...>

Couldn't post a reply on Daves site so thought i'd post one here. Here

38 messages 2006/01/24
[#177011] Re: About rant on Dave Thomas site, titled 'imitation...' — "Francis Hwang" <sera@...> 2006/01/25

SteveC wrote:

[#177218] Re: About rant on Dave Thomas site, titled 'imitation...' — Dave Thomas <Dave@...> 2006/01/27

[#177219] Re: About rant on Dave Thomas site, titled 'imitation...' — Alex Combas <alex.combas@...> 2006/01/27

On 1/26/06, Dave Thomas <Dave@pragprog.com> wrote:

[#177269] Re: About rant on Dave Thomas site, titled 'imitation...' — Dave Thomas <Dave@...> 2006/01/28

[#177272] Re: About rant on Dave Thomas site, titled 'imitation...' — Alex Combas <alex.combas@...> 2006/01/28

On 1/27/06, Dave Thomas <Dave@pragprog.com> wrote:

[#177387] Re: About rant on Dave Thomas site, titled 'imitation...' — Eric Hodel <drbrain@...7.net> 2006/01/30

On Jan 28, 2006, at 1:05 AM, Alex Combas wrote:

[#177389] Re: About rant on Dave Thomas site, titled 'imitation...' — Alex Combas <alex.combas@...> 2006/01/30

On 1/29/06, Eric Hodel <drbrain@segment7.net> wrote:

[#176722] LazyLoad — "Erik Veenstra" <google@...>

Imagine, you're building a CVS like repository. A repository

22 messages 2006/01/24

[#176883] postgres database — Tom Allison <tallison@...>

What is the file I need to require for connection to a postgres

14 messages 2006/01/25

[#176899] I like the new ruby-doc.org! — James Edward Gray II <james@...>

Hadn't seen this mentioned here, so just wanted to say that I feel

30 messages 2006/01/25

[#176923] Gems zlib problem — Ryan Tate <ryantate@...>

I am going to echo posts scattered throughout the Internet here and say

16 messages 2006/01/25
[#176928] Re: Gems zlib problem — mlbright@... 2006/01/25

This is what worked for me.

[#177189] Re: Gems zlib problem — Ryan Tate <ryantate@...> 2006/01/27

Thanks, I'll give this a shot. I did install all three of those (zlibc,

[#177306] nil != [] — Alex Polite <notmyprivateemail@...>

OK. Here's my second stupid question for today.

13 messages 2006/01/28

[#177318] Loop weirdness — Jonathan Leighton <lists@...>

Hi,

16 messages 2006/01/28

[#177327] OpenGL-0.32g for Apple MacOS X — James Adam <james.adam@...>

In case anyone needs this, I've uploaded my tweaked version of the

9 messages 2006/01/29

[#177383] relative dates — charlie bowman <cbowmanschool@...>

today = Time.now

14 messages 2006/01/30

[#177404] Ruby tutorials w/ excercises — Scott Taylor <scott@...>

13 messages 2006/01/30

[#177415] One-Click Ruby Installer 184-16 preview1 is available! — Curt Hibbs <curt.hibbs@...>

One-Click Ruby Installer 184-16 preview1 is available!

18 messages 2006/01/30
[#177419] Re: One-Click Ruby Installer 184-16 preview1 is available! — Dirk Meijer <hawkman.gelooft@...> 2006/01/30

whoa!

[#177424] Strange posting about ebooks — Peter Hickman <peter@...>

For some unfathomable reason I have received four emails containing

58 messages 2006/01/30
[#177447] Re: Strange posting about ebooks — dblack@... 2006/01/30

Hi --

[#177452] Re: Strange posting about ebooks — Dirk Meijer <hawkman.gelooft@...> 2006/01/30

i got them as well...

[#177453] Re: Strange posting about ebooks — dblack@... 2006/01/30

Hi --

[#177455] Re: Strange posting about ebooks — James Edward Gray II <james@...> 2006/01/30

On Jan 30, 2006, at 8:21 AM, dblack@wobblini.net wrote:

[#177498] Re: Strange posting about ebooks — tsumeruby@... 2006/01/30

On Monday 30 January 2006 11:28 pm, James Edward Gray II wrote:

[#177502] Re: Strange posting about ebooks — Ryan Leavengood <leavengood@...> 2006/01/30

On 1/30/06, tsumeruby@tsumelabs.com <tsumeruby@tsumelabs.com> wrote:

[#177469] check for and if not there, create direcory and file — charlie bowman <cbowmanschool@...>

18 messages 2006/01/30

[#177491] Is this a floating point precision problem? — "Todd S." <tgate@...>

I'm using the Matrix module (matrix.rb) to help place a vertex into

11 messages 2006/01/30

[#177517] One-Click Ruby Installer 184-16 preview2 is available! — Curt Hibbs <curt.hibbs@...>

=== One-Click Ruby Installer 184-16 preview2 is available! ===

24 messages 2006/01/30
[#177532] Re: One-Click Ruby Installer 184-16 preview2 is available! — Tom Copeland <tom@...> 2006/01/31

On Tue, 2006-01-31 at 08:32 +0900, Curt Hibbs wrote:

[#177567] Re: One-Click Ruby Installer 184-16 preview2 is available! — Curt Hibbs <ml.chibbs@...> 2006/01/31

On 1/30/06, Tom Copeland <tom@infoether.com> wrote:

[#177596] Re: One-Click Ruby Installer 184-16 preview2 is available! — Joel VanderWerf <vjoel@...> 2006/01/31

Curt Hibbs wrote:

[#177612] Re: One-Click Ruby Installer 184-16 preview2 is available! — Curt Hibbs <ml.chibbs@...> 2006/01/31

On 1/31/06, Joel VanderWerf <vjoel@path.berkeley.edu> wrote:

[#177642] Re: One-Click Ruby Installer 184-16 preview2 is available! — Guillaume Marcais <guslist@...> 2006/02/01

[#177643] Re: One-Click Ruby Installer 184-16 preview2 is available! — Curt Hibbs <ml.chibbs@...> 2006/02/01

Maybe the RUBYOPT environent variable isn't getting set. Try manually

[#177539] Mongrel HTTP Library 0.2.0 (Fast And RubyForgified) — Zed Shaw <zedshaw@...>

Hi Everyone,

10 messages 2006/01/31

[#177619] Numeric#of — ara.t.howard@...

28 messages 2006/01/31
[#177621] Re: [RCR] Numeric#of — Yukihiro Matsumoto <matz@...> 2006/01/31

Hi,

Re: [QUIZ] Dice Roller (#61)

From: "Ross Bamford" <rosco@...>
Date: 2006-01-08 19:43:07 UTC
List: ruby-talk #174815
Hi,

This is my quiz entry for Ruby Quiz 61 (Dice Roller). It's actually the
second idea I had, after starting out with Antlr (I still finished that
one, because I wanted to get to grips with Antlr anyway - I happened to
be playing with it when this quiz came out :)). I've bundled both this
entry and that one at:

   http://roscopeco.co.uk/code/ruby-quiz-entries/quiz61-dice-roller.tar.gz

Anyway, back to my real entry. I guess I took the short-cut route to
the dice-roller, and instead of parsing out the expressions I instead
decided to 'coerce' them to Ruby code, by just implementing the 'd'
operator with a 'rolls' method on Fixnum, and using gsub to convert
the input expression.

   d3*2                  =>   1.rolls(3)*2
   (5d5-4)d(16/d4)+3     =>   (5.rolls(5)-4).rolls(16/1.rolls(4))+3
   d%*7                  =>   1.rolls(100)*7

This is implemented in the DiceRoller.parse method, which returns the
string. You can just 'eval' this of course, or use the 'roll' method
(also provided as a more convenient class method that wraps the whole
thing up for you) to do it. Ruby runs the expression, and gives back
the result. I almost feel like I cheated...?

As well as the main 'roll.rb' I also included a separate utility that
uses loaded dice to find min/max achievable. All three files can be
executed, and if you enable --verbose mode on Ruby you'll see the
dice rolls and parsed expressions.

----------[MAIN (roll.rb)]-----------
#!/usr/local/bin/ruby
#
# Ruby Quiz 61, the quick way
# by Ross Bamford

# Just a debugging helper
module Kernel
   def dbg(*s)
     puts(*s) if $VERBOSE|| @dice_debug
   end
   attr_writer :dice_debug
   def dice_debug?; @dice_debug; end
end

# Need to implement the 'rolls' method. Wish it didn't have to
# be on Fixnum but for this it makes the parsing *lots* easier.
class Fixnum
   def self.roll_proc=(blk)
     @roll_proc = blk
   end

  def self.roll_proc
     @roll_proc ||= method(:rand).to_proc
   end

   def rolls(sides)
     (1..self).inject(0) { |s,v| s + Fixnum.roll_proc[sides] }
   end
end

# Here's the roller.
class DiceRoller
   class << self
     # Completely wrap up a roll
     def roll(expr, count = 1, debug = false)
       new(expr,debug).roll(count)
     end

     # The main 'parse' method. Just really coerces the code to Ruby
     # and then compiles to a block that returns the result.
     def parse(expr)
       # very general check here. Will pass lots of invalid syntax,
       # but hopefully that won't compile later. This removes the
       # possibility of using variables and the like, but that wasn't
       # required anyway. The regexps would be a bit more difficult
       # if we wanted to do that.
       raise SyntaxError, "'#{expr}' is not a valid dice expression", [] if  
expr =~ /[^d\d\(\)\+\-\*\/\%]|[^d]%|d-|\*\*/

       # Rubify!
       s = expr.gsub( /([^\d\)])d|^d/,   '\11d')          # fix e.g. 'd5'  
and '33+d3' to '1.d5' and '33+1d3'
       s.gsub!(       /d%/,              'd(100)'  )      # fix e.g. 'd%'  
to 'd(100)'
       s.gsub!(       /d([\+\-]?\d+)/,   '.rolls(\1)')    # fix e.g. '3d8'  
to '3.rolls(8) (*)
       s.gsub!(       /d\(/,             '.rolls(')       # fix e.g.  
'2d(5+5)' to '2.rolls(5+5)'

       # (*) This line treats + or - straight after 'd' as a unary sign,
       # so you can have '3d-8*7' => '3.rolls(+8)-7'
       # This would throw a runtime error from rolls, though.

       # Make a block. Doing it this way gets Ruby to compile it now
       # so we'll reliably get fail fast on bad syntax.
       dbg "PARS: #{expr} => #{s}"
       begin
         eval("lambda { #{s} }")
       rescue Exception => ex
         raise SyntaxError, "#{expr} is not a valid dice expression", []
       end
     end
   end

   # Create a new roller that rolls the specified dice expression
   def initialize(expr, debug = false)
     dbg "NEW : #{to_s}: #{expr} => #{expr_code}"
     @expr_code, @expr, @debug = expr, DiceRoller.parse(expr), debug
   end

   # Get hold of the original expression and compiled block, respectively
   attr_reader :expr_code, :expr

   # Roll this roller count times
   def roll(count = 1)
     dbg "  ROLL: #{to_s}: #{count} times"
     r = (1..count).inject([]) do |totals,v|
       this_r = begin
         expr.call
       rescue Exception => ex
         raise RuntimeError, "'#{expr_code}' raised: #{ex}", []
       end

       dbg "    r#{v}: rolled #{this_r}"
       totals << this_r
     end

     r.length < 2 ? r[0] : r
   end
end

# Library usage:
#
#   require 'roll'
#
#   # is the default:
#   # Fixnum.roll_proc = lambda { |sides| rand(sides) + 1 }
#
#   DiceRoller.roll('1+2*d6')
#
#   d = DiceRoller.new('((3d%)+8*(d(5*5)))')
#   d.roll(5)
#
#   d = DiceRoller.new('45*10d3')   # debug
#
#   # ... or
#   one_roll = d.expr.call
#

# command-line usage
if $0 == __FILE__
   unless expr = ARGV[0]
     puts "Usage: ruby [--verbose] roll.rb expr [count]"
   else
     (ARGV[1] || 1).to_i.times { print "#{DiceRoller.roll(expr)}  " }
     print "\n"
   end
end
=====================================




-----------[UTIL: minmax.rb]----------
#!/usr/local/bin/ruby

require 'roll'

LOW_DICE  = lambda { |sides| 1 }
HIGH_DICE = lambda { |sides| sides }

# Adds a 'minmax' method that uses loaded dice to find
# min/max achievable for a given expression.
#
# Obviously not thread safe, but then neither is the
# whole thing ;D
class DiceRoller
   def self.minmax(expr)
     old_proc = Fixnum.roll_proc
     Fixnum.roll_proc = LOW_DICE
     low = DiceRoller.roll(expr)

     Fixnum.roll_proc = HIGH_DICE
     high = DiceRoller.roll(expr)
     Fixnum.roll_proc = old_proc

     [low,high]
   end
end

if $0 == __FILE__
   if expr = ARGV[0]
     min, max = DiceRoller.minmax(expr)
     puts "Expression: #{expr} ; min / max = #{min} / #{max}"
   else
     puts "Usage: minmax.rb <expr>"
   end
end
=====================================





-----------[TEST: test.rb]----------
#!/usr/local/bin/ruby
#
# Ruby Quiz, number 61 - Dice roller
# This entry by Ross Bamford (rosco<at>roscopeco.co.uk)

require 'test/unit'
require 'roll'

ASSERTS = {
   '1'                   => 1,
   '1+2'                 => 3,
   '1+3*4'               => 13,
   '1*2+4/8-1'           => 1,
   'd1'                  => 1,
   '1d1'                 => 1,
   'd10'                 => 10,
   '1d10'                => 10,
   '10d10'               => 100,
   'd3*2'                => 6,
   '5d6d7'               => 210,   # left assoc
   '2d3+8'               => 14,    # not 22
   '(2d(3+8))'           => 22,    # not 14
   'd3+d3'               => 6,
   '33+d3+10'            => 46,
   'd2*2d4'              => 16,
   'd(2*2)+d4'           => 8,
   'd%'                  => 100,
   '2d%'                 => 200,
   'd%*7'                => 700,
   '14+3*10d2'           => 74,
   '(5d5-4)d(16/d4)+3'   => 87,    #25d4 + 3
   '3d+8/8'              => 3      #3d(+8)/8
}

ERRORS = {

   # Bad input, all should raise exception
   'd'                   => SyntaxError,
   '3d'                  => SyntaxError,
   '3d-8'                => SyntaxError,  # - # of sides
   '3ddd6'               => SyntaxError,
   '3%2'                 => SyntaxError,
   '%d'                  => SyntaxError,
   '+'                   => SyntaxError,
   '4**3'                => SyntaxError
}

# bit messy, but can't get class methods on Fixnum
Fixnum.roll_proc = lambda { |sides| sides }

class TestDiceRoller < Test::Unit::TestCase
   def initialize(*args)
     super
   end

   ASSERTS.each do |expr, expect|
     eval <<-EOC
       def test_good_#{expr.hash.abs}
         expr, expect = #{expr.inspect}, #{expect.inspect}
         puts "\n-----------------------\n\#{expr} => \#{expect}" if  
$VERBOSE
         res = DiceRoller.roll(expr)
         puts "Returned \#{res}\n-----------------------" if $VERBOSE
         assert_equal expect, res
       end
     EOC
   end

   ERRORS.each do |expr, expect|
     eval <<-EOC
       def test_error_#{expr.hash.abs}
         expr, expect = #{expr.inspect}, #{expect.inspect}
         assert_raise(#{expect}) do
           puts "\n-----------------------\n\#{expr} => \#{expect}" if  
$VERBOSE
           res = DiceRoller.roll(expr)
           puts "Returned \#{res}\n-----------------------" if $VERBOSE
         end
       end
     EOC
   end
end
=====================================

-- 
Ross Bamford - rosco@roscopeco.remove.co.uk

In This Thread