[#296620] linux: getting the "load" values without using "top" — James Dinkel <jdinkel@...>

I would like to get some of the information provided by the "top"

12 messages 2008/04/01

[#296625] should I use a database or a flat file? — James Dinkel <jdinkel@...>

I need to store some information with my ruby program and I am not sure

23 messages 2008/04/01
[#296628] Re: should I use a database or a flat file? — "Robert Klemme" <shortcutter@...> 2008/04/01

2008/4/1, James Dinkel <jdinkel@gmail.com>:

[#296633] Re: should I use a database or a flat file? — James Dinkel <jdinkel@...> 2008/04/01

[#296646] Re: should I use a database or a flat file? — "Todd Benson" <caduceass@...> 2008/04/01

On Tue, Apr 1, 2008 at 10:32 AM, James Dinkel <jdinkel@gmail.com> wrote:

[#296654] Does Ruby support exception wrapping (exception chaining)? — "Hartin, Brian" <Brian.Hartin@...>

I could not find any information about this, except regarding DRb.

16 messages 2008/04/01

[#296832] confused by 'test'.gsub(/.*/,'x') — Wybo Dekker <wybo@...>

Why do I get "xx" instead of "x" in the following:

14 messages 2008/04/02

[#296849] ruby constructor return value? — Brendan Stennett <brendan6@...>

How do I alert an error if it occurs in an object's constructor?

13 messages 2008/04/02

[#296984] using a range as a key — Michael Linfield <globyy3000@...>

I'm trying to achieve the effect of having a range of integers as a hash

14 messages 2008/04/03

[#297004] Using a string as executable code — Peter Marks <petertmarks@...>

I need to store one line method calls as strings in my db and then apply

14 messages 2008/04/04

[#297105] The ||= assignment operator — Belorion <belorion@...>

It was my understanding that the ||= assignment operator assigned the value

34 messages 2008/04/04
[#297114] Re: The ||= assignment operator — Chris Shea <cmshea@...> 2008/04/04

On Apr 4, 1:30 pm, Paul Mucur <mu...@waferbaby.com> wrote:

[#297141] Re: The ||= assignment operator — Pe, Botp <botp@...> 2008/04/05

From: Chris Shea [mailto:cmshea@gmail.com]=20

[#297234] Is possible to define various methods at same time? — Iñaki Baz Castillo <ibc@...>

Hi, is possible to define various methods in a single declaration? somethin=

17 messages 2008/04/06

[#297268] Do arrays use up alot of memory space? — Clement Ow <clement.ow@...>

I just started ruby not too long ago and I'm really new to the language.

16 messages 2008/04/07

[#297365] Ruby’s not ready - an indepth essay — "Song Ma" <songmash@...>

F.Y.I

83 messages 2008/04/08
[#297369] Re: Ruby’s not ready - an indepth essay — "Avdi Grimm" <avdi@...> 2008/04/08

2008/4/7 Song Ma <songmash@gmail.com>:

[#297375] Re: Ruby’s not ready - an indepth essay — "Song Ma" <songmash@...> 2008/04/08

Interesting. But what I am thinking about is not the attitude of the author,

[#297417] Re: Ruby’s not ready - an indepth essay — "Rob Sanheim" <rsanheim@...> 2008/04/08

2008/4/7 Song Ma <songmash@gmail.com>:

[#297430] Re: Ruby’s not ready - an indepth essay — "M. Edward (Ed) Borasky" <znmeb@...> 2008/04/08

Rob Sanheim wrote:

[#297437] Re: Ruby’s not ready - an indepth essay — Phillip Gawlowski <cmdjackryan@...> 2008/04/08

-----BEGIN PGP SIGNED MESSAGE-----

[#297441] Re: Ruby’s not ready - an indepth essay — Dave Thomas <dave@...> 2008/04/08

[#297444] Re: Ruby’s not ready - an indepth essay — "Jeremy McAnally" <jeremymcanally@...> 2008/04/08

I agree about the API docs. There has been talk recently about

[#297446] Re: Ruby’s not ready - an indepth essay — Dave Thomas <dave@...> 2008/04/08

[#297472] Re: Ruby’s not ready - an indepth essay — "Jeremy McAnally" <jeremymcanally@...> 2008/04/08

Someone has suggested that but I haven't looked at it. I haven't

[#297479] Re: Ruby’s not ready - an indepth essay — "s.ross" <cwdinfo@...> 2008/04/08

On Apr 8, 2008, at 12:05 PM, Jeremy McAnally wrote:

[#297484] Re: Ruby’s not ready - an indepth essay — "Kyle Schmitt" <kyleaschmitt@...> 2008/04/08

Php's docs are good, really good. But I always felt that it's because

[#297386] heavy loop functions slow — Michael Linfield <globyy3000@...>

Alright so I was playing with my large amounts of data and ran into yet

13 messages 2008/04/08

[#297471] capitalizing words — Peter Bailey <pbailey@...>

Hi,

17 messages 2008/04/08

[#297512] output of a method to file? — Zoe Phoenix <dark_sgtphoenix@...>

Can anybody tell me how to take the output of a method and save it to a

16 messages 2008/04/08
[#297516] Re: output of a method to file? — Phillip Gawlowski <cmdjackryan@...> 2008/04/08

-----BEGIN PGP SIGNED MESSAGE-----

[#297518] Re: output of a method to file? — Zoe Phoenix <dark_sgtphoenix@...> 2008/04/09

Maybe it would help if I posted the code, I'm not sure I understand...

[#297522] Re: output of a method to file? — Phillip Gawlowski <cmdjackryan@...> 2008/04/09

-----BEGIN PGP SIGNED MESSAGE-----

[#297526] Re: output of a method to file? — Zoe Phoenix <dark_sgtphoenix@...> 2008/04/09

hm, let me re-phrase... I only have 9 items in that array, right? How

[#297633] My error or bug in "attr_reader" ? — Hexren <me@...>

Hi guys.

13 messages 2008/04/09

[#297638] FXRuby versus Tk — Alex DeCaria <alex.decaria@...>

I've done some GUI program with Ruby/Tk, and am able to use it fairly

16 messages 2008/04/09

[#297724] OT: "Unix" in Japanese — Chad Perrin <perrin@...>

Since I figure there are probably a few Japanese Unix hackers on this

13 messages 2008/04/10

[#297819] RubyGems 1.1.1 — Eric Hodel <drbrain@...7.net>

Release 1.1.1 fixes some bugs.

21 messages 2008/04/11

[#297827] how to create random object to a particular ruby object ? — Pokkai Dokkai <bad_good_lion@...>

how to create random object to a particular ruby object ?

22 messages 2008/04/11
[#297839] Re: how to create random object to a particular ruby object ? — "Robert Klemme" <shortcutter@...> 2008/04/11

2008/4/11, Pokkai Dokkai <bad_good_lion@yahoo.com>:

[#297845] Re: how to create random object to a particular ruby object ? — "Robert Dober" <robert.dober@...> 2008/04/11

On Fri, Apr 11, 2008 at 1:16 PM, Robert Klemme

[#297844] How to duplicate a object changing the class without attributes memory copy — "Iñaki Baz Castillo" <ibc@...>

SGksIEknbSBkb2luZyBhIHNlcnZlciBhbmQgd2FudCB0byBhdm9pZCBtZW1vcnkgaW5uZWNlc2Fy

12 messages 2008/04/11

[#297884] delete_if, select and (lack of) delete_if!, self.POLS == false — Saku Ytti <saku@...>

Hey everyone,

24 messages 2008/04/11
[#297887] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — "David A. Black" <dblack@...> 2008/04/11

Hi --

[#297890] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — Saku Ytti <saku@...> 2008/04/11

On (2008-04-12 01:32 +0900), David A. Black wrote:

[#297892] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — "Robert Dober" <robert.dober@...> 2008/04/11

On Fri, Apr 11, 2008 at 6:46 PM, Saku Ytti <saku@ytti.fi> wrote:

[#297899] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — Saku Ytti <saku@...> 2008/04/11

On (2008-04-12 02:08 +0900), Robert Dober wrote:

[#297900] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — Saku Ytti <saku@...> 2008/04/11

On (2008-04-12 02:26 +0900), Saku Ytti wrote:

[#297914] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — "Robert Dober" <robert.dober@...> 2008/04/11

On Fri, Apr 11, 2008 at 7:31 PM, Saku Ytti <saku@ytti.fi> wrote:

[#297915] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — Saku Ytti <saku@...> 2008/04/11

On (2008-04-12 04:04 +0900), Robert Dober wrote:

[#297917] Re: delete_if, select and (lack of) delete_if!, self.POLS == false — "David A. Black" <dblack@...> 2008/04/11

Hi --

[#297928] How to check record duplication before saving? — Frank Tsao <shuhao.tsao@...>

Hi, everyone,

26 messages 2008/04/11
[#297932] Re: How to check record duplication before saving? — Phillip Gawlowski <cmdjackryan@...> 2008/04/11

-----BEGIN PGP SIGNED MESSAGE-----

[#297933] Re: How to check record duplication before saving? — Dave Thomas <dave@...> 2008/04/11

[#297936] Re: How to check record duplication before saving? — "RubyTalk@..." <rubytalk@...> 2008/04/11

If you are using Rails and migrations

[#297939] Re: How to check record duplication before saving? — Frank Tsao <shuhao.tsao@...> 2008/04/11

RubyTalk@gmail.com wrote:

[#297948] Re: How to check record duplication before saving? — "Todd Benson" <caduceass@...> 2008/04/11

On Fri, Apr 11, 2008 at 6:01 PM, Frank Tsao <shuhao.tsao@gmail.com> wrote:

[#297998] Re: How to check record duplication before saving? — "Todd Benson" <caduceass@...> 2008/04/12

On Fri, Apr 11, 2008 at 6:43 PM, Todd Benson <caduceass@gmail.com> wrote:

[#298017] Re: How to check record duplication before saving? — "ara.t.howard" <ara.t.howard@...> 2008/04/12

[#298027] Re: [OT] Re: How to check record duplication before saving? — "Todd Benson" <caduceass@...> 2008/04/13

On Sat, Apr 12, 2008 at 3:55 PM, ara.t.howard <ara.t.howard@gmail.com> wrote:

[#298031] Re: [OT] Re: How to check record duplication before saving? — "Todd Benson" <caduceass@...> 2008/04/13

On Sat, Apr 12, 2008 at 7:14 PM, Todd Benson <caduceass@gmail.com> wrote:

[#297935] Looking for Hidden Gems — James Gray <james@...>

I'm hunting for some gems that are under loved, off the beaten path,

13 messages 2008/04/11

[#298122] How to reliably setup require path — Christian Johansen <chrisjoha@...>

I'm writing my first Ruby command line application (beyond a simple

12 messages 2008/04/14

[#298145] noob 'why doesn't this work' question — Vincent Angeloni <nospam7272@...>

Hi and greetings to all group members!

17 messages 2008/04/14

[#298193] Is there a One True Postgres interface? Is Ruby-postgres maintained? — John Carter <john.carter@...>

Is there a One true Ruby Interface to Postgres?

53 messages 2008/04/14
[#298200] Re: Is there a One True Postgres interface? Is Ruby-postgres maintained? — Reid Thompson <reid.thompson@...> 2008/04/14

John Carter wrote:

[#298203] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — John Carter <john.carter@...> 2008/04/14

On Tue, 15 Apr 2008, Reid Thompson wrote:

[#298205] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — John Carter <john.carter@...> 2008/04/14

On Tue, 15 Apr 2008, John Carter wrote:

[#298223] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Chad Perrin <perrin@...> 2008/04/15

On Tue, Apr 15, 2008 at 08:44:31AM +0900, John Carter wrote:

[#298231] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — John Carter <john.carter@...> 2008/04/15

On Tue, 15 Apr 2008, Chad Perrin wrote:

[#298339] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Jeff Davis <ruby@...> 2008/04/15

On Tue, 2008-04-15 at 08:41 +0900, John Carter wrote:

[#298381] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — "M. Edward (Ed) Borasky" <znmeb@...> 2008/04/15

Jeff Davis wrote:

[#298387] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Phillip Gawlowski <cmdjackryan@...> 2008/04/16

-----BEGIN PGP SIGNED MESSAGE-----

[#298484] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Thomas Kellerer <YQDHXVLMUBXG@...> 2008/04/16

Phillip Gawlowski, 16.04.2008 02:08:

[#298488] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Phillip Gawlowski <cmdjackryan@...> 2008/04/16

-----BEGIN PGP SIGNED MESSAGE-----

[#298534] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Jeff Davis <ruby@...> 2008/04/16

On Wed, 2008-04-16 at 08:49 +0900, M. Edward (Ed) Borasky wrote:

[#302685] Re: Is there a One True Postgres interface? Is Ruby-postgresmaintained? — Peter Booth <pbooth@...> 2008/05/23

I can see Jeff's point. If both libpq and the Postgres JDBC drivers

[#302687] Yup, it's call SQLite! :-)) Re: Is there a One True Postgresinterface? Is Ruby-postgresmaintained? — John Carter <john.carter@...> 2008/05/23

Having started this huge thread on PostgresSQL, I found...

[#298266] Ada vs Ruby — Marc Heiler <shevegen@...>

Hi,

101 messages 2008/04/15
[#298275] Re: Ada vs Ruby — Michael Neumann <mneumann@...> 2008/04/15

Marc Heiler wrote:

[#298383] Re: Ada vs Ruby — Eleanor McHugh <eleanor@...> 2008/04/15

On 15 Apr 2008, at 13:28, Michael Neumann wrote:

[#298400] Re: Ada vs Ruby — "Rick DeNatale" <rick.denatale@...> 2008/04/16

On Tue, Apr 15, 2008 at 7:54 PM, Eleanor McHugh

[#298403] Re: Ada vs Ruby — Phillip Gawlowski <cmdjackryan@...> 2008/04/16

-----BEGIN PGP SIGNED MESSAGE-----

[#298472] Re: Ada vs Ruby — Eleanor McHugh <eleanor@...> 2008/04/16

On 16 Apr 2008, at 03:40, Phillip Gawlowski wrote:

[#298476] Re: Ada vs Ruby — Phillip Gawlowski <cmdjackryan@...> 2008/04/16

-----BEGIN PGP SIGNED MESSAGE-----

[#298513] Re: Ada vs Ruby — Eleanor McHugh <eleanor@...> 2008/04/16

On 16 Apr 2008, at 14:42, Phillip Gawlowski wrote:

[#298522] Re: Ada vs Ruby — Phillip Gawlowski <cmdjackryan@...> 2008/04/16

-----BEGIN PGP SIGNED MESSAGE-----

[#298641] Re: Ada vs Ruby — "Rick DeNatale" <rick.denatale@...> 2008/04/17

On Wed, Apr 16, 2008 at 12:57 PM, Phillip Gawlowski

[#298651] Re: Ada vs Ruby — Phillip Gawlowski <cmdjackryan@...> 2008/04/17

-----BEGIN PGP SIGNED MESSAGE-----

[#298540] Re: Ada vs Ruby — fburton@... (Francis Burton) 2008/04/16

In article <5E300D89-09B9-4788-9E43-C2517C0E0A3C@games-with-brains.com>,

[#298577] Re: Ada vs Ruby — Eleanor McHugh <eleanor@...> 2008/04/17

On 16 Apr 2008, at 19:40, Francis Burton wrote:

[#298626] Re: Ada vs Ruby — "Eivind Eklund" <eeklund@...> 2008/04/17

On Thu, Apr 17, 2008 at 3:21 AM, Eleanor McHugh

[#298267] checking connection to server:port [socket] — Kr Alfabeta <kristis@...>

hi,

17 messages 2008/04/15

[#298279] at_exit handlers and Process.kill — Daniel Berger <djberg96@...>

Hi all,

22 messages 2008/04/15

[#298318] Hash or bidimensional Array when key is case insensitive? — "Iñaki Baz Castillo" <ibc@...>

SGksIEkndmUgdG8gdGFrZSBhIGRlY2lzc2lvbiBhYm91dCB1c2luZyBhbiBiaWRpbWVuc2lvbmFs

8 messages 2008/04/15

[#298369] Windows, Net::SSH: how do I use a private key (w / password) — James Dinkel <jdinkel@...>

Private key authentication works with this user, I know because I use it

11 messages 2008/04/15

[#298386] Check if remote server exists — Jeff Miller <loadeddesigns@...>

Hello,

11 messages 2008/04/16

[#298408] Parallel for loop — Fredrik <fredjoha@...>

There doesn't seem to be any EASY way of doing a parallel computation

24 messages 2008/04/16

[#298589] Ruby Hero Awards — Gregg Pollack <GreggPollack@...>

Hey guys,

16 messages 2008/04/17

[#298608] thread question — Zoe Phoenix <dark_sgtphoenix@...>

Okay, I took someone's advice in an earlier post I made on how to poison

13 messages 2008/04/17

[#298629] How to "break" a "case-when" ? — "Iñaki Baz Castillo" <ibc@...>

SGksIGlzIG5vdCBwb3NzaWJsZSB0byB0ZXJtaW5hdGUgdGhlIGJvZHkgb2YgYSAid2hlbiIgc3Rh

16 messages 2008/04/17
[#298633] Re: How to "break" a "case-when" ? — "Stefan Lang" <perfectly.normal.hacker@...> 2008/04/17

2008/4/17, I=F1aki Baz Castillo <ibc@aliax.net>:

[#298635] Re: How to "break" a "case-when" ? — "Iñaki Baz Castillo" <ibc@...> 2008/04/17

MjAwOC80LzE3LCBTdGVmYW4gTGFuZyA8cGVyZmVjdGx5Lm5vcm1hbC5oYWNrZXJAZ21haWwuY29t

[#298711] system(ping) — Heinrich Piard <linux@...>

Hi,

15 messages 2008/04/17

[#298715] When are lambdas needed? — Stedwick <philip.brocoum@...>

I have seen many tutorials on the Internet explaining where lambdas

26 messages 2008/04/17

[#298739] forkoff - parallel processing for ruby enumerables — ara howard <ara.t.howard@...>

23 messages 2008/04/18

[#298883] why doesn't ruby have generics? — thufir <hawat.thufir@...>

Is it because Ruby is dynamic, or something else?

18 messages 2008/04/19

[#298915] Triangle Area (#160) — Matthew Moss <matthew.moss@...>

Apologies for the latest... Some busy stuff this week in "real life."

22 messages 2008/04/19

[#298982] Counting Program — "Will Mueller" <will.liljon@...>

I recently actually started "studying" ruby again and attempted to

18 messages 2008/04/20
[#298983] Re: Counting Program — Phillip Gawlowski <cmdjackryan@...> 2008/04/20

-----BEGIN PGP SIGNED MESSAGE-----

[#299006] Re: Counting Program — Dan Diebolt <dandiebolt@...> 2008/04/21

>it's as simple as ...

[#298986] A couple of questions regarding class design — "Michael W. Ryder" <_mwryder@...>

I am part way through implementing a Rational math class to further my

35 messages 2008/04/20
[#299079] Re: A couple of questions regarding class design — "Robert Dober" <robert.dober@...> 2008/04/21

On Sun, Apr 20, 2008 at 11:45 PM, Michael W. Ryder

[#299083] Re: A couple of questions regarding class design — "Michael W. Ryder" <_mwryder@...> 2008/04/21

Robert Dober wrote:

[#299112] Re: A couple of questions regarding class design — Robert Klemme <shortcutter@...> 2008/04/22

On 21.04.2008 23:28, Michael W. Ryder wrote:

[#299170] Re: A couple of questions regarding class design — "Michael W. Ryder" <_mwryder@...> 2008/04/22

Robert Klemme wrote:

[#299175] Re: A couple of questions regarding class design — "Robert Dober" <robert.dober@...> 2008/04/22

On Tue, Apr 22, 2008 at 9:15 PM, Michael W. Ryder

[#299194] Re: A couple of questions regarding class design — "Michael W. Ryder" <_mwryder@...> 2008/04/22

Robert Dober wrote:

[#299202] Re: A couple of questions regarding class design — "Robert Dober" <robert.dober@...> 2008/04/22

On Tue, Apr 22, 2008 at 10:55 PM, Michael W. Ryder

[#299234] Re: A couple of questions regarding class design — Robert Klemme <shortcutter@...> 2008/04/23

On 23.04.2008 00:44, Robert Dober wrote:

[#299012] Accessing Windows actions(Shutdow.Restart) — Raveendran Perumalsamy <jazzezravi@...>

Hi All,

14 messages 2008/04/21
[#299043] Re: Accessing Windows actions(Shutdow.Restart) — "Gordon Thiesfeld" <gthiesfeld@...> 2008/04/21

On Mon, Apr 21, 2008 at 1:25 AM, Raveendran Perumalsamy

[#299068] Barby 0.1 - Ruby barcode generator that doesn't suck (that much) — Tore Darell <toredarell@...>

This is something I released a while ago, but I thought I'd announce

10 messages 2008/04/21

[#299204] Extending Hast class with custom [] []= methods — Iñaki Baz Castillo <ibc@...>

Hi, I'd like to extend Hash class [] and []=3D methods in order to find a k=

12 messages 2008/04/22

[#299222] Extract date from filenames using regex — Clement Ow <clement.ow@...>

I have my code which looks like this:

13 messages 2008/04/23
[#299228] Re: Extract date from filenames using regex — "Daniel Finnie" <dan@...> 2008/04/23

Hi,

[#299239] Re: Extract date from filenames using regex — Clement Ow <clement.ow@...> 2008/04/23

Daniel Finnie wrote:

[#299273] HTTP::Post - HTTP::Get (Can someone help me?) — Fred <nospam@...>

Hello,

18 messages 2008/04/23
[#299318] Re: HTTP::Post - HTTP::Get (Can someone help me?) — darren kirby <bulliver@...> 2008/04/23

quoth the Fred:

[#299387] Re: HTTP::Post - HTTP::Get (Can someone help me?) — Fred <nospam@...> 2008/04/24

Thanx Darren for the info

[#299407] Re: HTTP::Post - HTTP::Get (Can someone help me?) — Fred <nospam@...> 2008/04/24

resp.body is a php page => purpose is to see of step 1 is working

[#299408] Re: HTTP::Post - HTTP::Get (Can someone help me?) — Fred <nospam@...> 2008/04/24

The First step is to insert javascript into PHP page.

[#299360] Email/SMTP::NET Problems — Brantley Shields <brantley_shields@...>

Greetings,

26 messages 2008/04/24

[#299463] Pointer concept in Ruby ? — "Iñaki Baz Castillo" <ibc@...>

SGksIEknZCBsaWtlIHRvIGhhdmUgYSB2YXJpYWJsZSBwb2ludGluZyB0byBhIEhhc2gvQXJyYXkg

16 messages 2008/04/24

[#299479] Function appends same value to string based on number of function calls — vannuys@...

Hi Guys,

9 messages 2008/04/24

[#299508] pretty folder tree script — John <john.d.perkins@...>

Hola,

20 messages 2008/04/24

[#299531] Is there any nomenclature for private methods? — Iñaki Baz Castillo <ibc@...>

Hi, I don't like the way of declaring publi and private methods since it's =

12 messages 2008/04/24

[#299585] Ruby Minimalism — aidy <aidy.lewis@...>

Hi,

16 messages 2008/04/25

[#299608] Array inject function problem — Inbroker Adams <dadravu@...>

Hello Rubyists,

19 messages 2008/04/25

[#299701] help re recording/replaying (i.e. automating) HTTP interactions to a web-site??? — "Greg Hauptmann" <greg.hauptmann.ruby@...>

Hi,

13 messages 2008/04/26
[#299705] Re: help re recording/replaying (i.e. automating) HTTP interactions to a web-site??? — Peter Szinek <peter@...> 2008/04/26

Greg,

[#299749] Re: help re recording/replaying (i.e. automating) HTTP interactions to a web-site??? — "Greg Hauptmann" <greg.hauptmann.ruby@...> 2008/04/26

sounds good, it support:

[#299750] Re: help re recording/replaying (i.e. automating) HTTP interactions to a web-site??? — "Greg Hauptmann" <greg.hauptmann.ruby@...> 2008/04/26

PS. 4th question Peter I forgot:

[#299714] All occurances of a character in a string — Raghu Go <rgowka1@...>

Hi - I am trying to figure out the ruby way of printing all occurances

14 messages 2008/04/26

[#299742] Typed ruby — Joe K <jkauzlar@...>

I realize there is a holy war attached to this subject, but it would be nice

15 messages 2008/04/26

[#299768] Transpose a large file(>2GB) — Ams Lo <rgowka1@...>

Hi -

18 messages 2008/04/27

[#299798] Ruby For Hackers — Luka Lukako <dezertir@...>

Anybody know how to writing Keyloggers in ruby, or trojans or other

21 messages 2008/04/27
[#299805] Re: Ruby For Hackers — Tim Hunter <TimHunter@...> 2008/04/27

Luka Lukako wrote:

[#299863] Apache2 conf and mod_ruby (mac os x 10.4.11) — unbewusst.sein@... (Une B騅ue)

15 messages 2008/04/28

[#299946] Array#first is not Array#[0] — Fredrik <fredjoha@...>

I made a class that is a subclass of Array :

19 messages 2008/04/29

[#300023] rails is a mess! — jOhn <netcam@...>

I have to say that rails is such a mess right now. Notta working and it

15 messages 2008/04/29

[#300077] Levenshtein_distance and recreate the string — Ams Lo <rgowka1@...>

Hi -

12 messages 2008/04/30

[#300078] What are the weaknesses in Ruby? — tenxian <hi.steven.tu@...>

What are the disadvantages of Ruby?

18 messages 2008/04/30

[#300135] How to create "def method(item)= (value)" ? — "Iñaki Baz Castillo" <ibc@...>

SGksIGlzIGl0IG5vdCBwb3NzaWJsZSB0byBjcmVhdGUgYSBtZXRob2QgdG8gdXNlIGluIHRoaXMg

28 messages 2008/04/30
[#300140] Re: How to create "def method(item)= (value)" ? — Phillip Gawlowski <cmdjackryan@...> 2008/04/30

-----BEGIN PGP SIGNED MESSAGE-----

[#300141] Re: How to create "def method(item)= (value)" ? — "David A. Black" <dblack@...> 2008/04/30

Hi --

[#300144] Re: How to create "def method(item)= (value)" ? — Phillip Gawlowski <cmdjackryan@...> 2008/04/30

-----BEGIN PGP SIGNED MESSAGE-----

[#300157] Search string for occurneces of words stored in array — John Butler <johnnybutler7@...>

Hi,

15 messages 2008/04/30

[SUMMARY] Word Search Generator (#159)

From: Matthew Moss <matthew.moss@...>
Date: 2008-04-18 21:38:48 UTC
List: ruby-talk #298849
Adam Shelly was our sole submission this week, so we are going to take
a look at his solution to the quiz.

Adam's first bit of code is a simple class, CrossWord:

class CrossWord
  attr_accessor :word, :place, :dir
  def initialize w
    @word=3Dw
    @dir=3D0
    @place=3Dnil
  end
  def unplaced?
    @place=3D=3Dnil
  end
end

This class maintains information about each word to be placed into the
puzzle, including the word itself but also the direction and
placement. The rest of the code works with this class rather than with
raw strings.

Let's jump for a moment to the main code.

gridsize =3D ARGV[1].split('x').map{|v|v.to_i}
g =3D CharGrid.new *gridsize

words=3DFile.open(ARGV[0],"r").read.split.sort_by{|s|s.length}.reverse
puts "unsolvable!" or exit if (words[0].size>gridsize.max)

g.fill words
File.open("search.txt","w"){|f|f.puts g.to_s}
File.open("solution.txt","w"){|f|f.puts g.solution}

Most of this should be fairly obvious work. The dimensions (e.g.
"24x20") are retrieved from the second command-line argument, split
over the 'x' and converted to integers. These dimensions are then used
to construct a new CharGrid object (which will be examined shortly).

The search words are read from the provided file and sorted from
longest to shortest. Presumably, the intent here is to place the
longest words into the puzzle first; the shortest (and more easily
placed) words are placed last.

A quick sanity check is done by comparing the length of the longest
word against the longest dimension of the grid. If the word is longer,
a puzzle would be impossible to generate. Adam uses a neat, if perhaps
confusing, technique to alert the user and exit out. To understand how
it works, I had to parenthesize according to operator precedence:

((puts "unsolvable!") or exit) if (words[0].size > gridsize.max)

Now, realizing that the puts statement returns nil, this made sense.
So, while this construct both outputs the warning message and exits
the program, this might have been clearer:

if (words[0].size > gridsize.max)
    puts "unsolvable!"
    exit
end

Getting back to Adam's main code, the words =97 now sorted and checked =97
are handed off to the grid's fill method, which does the bulk of the
work. Once done, the final step is to output the two text files as
requested, the puzzle itself using the to_s method, and the solution
via the solution method.

Most of Adam's code lives in the CharGrid class. The main algorithm is
found in the fill method:

def fill words
  iterations =3D 0
  @words =3D words.map{|w| CrossWord.new(w)}
  words_todo =3D @words.select{|w|w.unplaced?}

The master list of all words is kept in @words, which, as mentioned
earlier, is converted and kept as CrossWord instances rather than raw
strings). Then Adam loops until his words_todo array is empty. For the
first iteration of the loop, this array contains all of the words
sorted from longest to shortest.

  until words_todo.empty?
    words_todo.each{|cw| place cw }

The first step is an attempt to place all of the words that have not
yet been placed into the puzzle. We'll come back to the place method
in a bit.

    words_todo =3D @words.select{|w|w.unplaced?}.sort_by{rand}

Adam reevaluates what words still remain to be placed. Unlike before,
where words were sorted from longest to shortest (in an attempt to
place the more complex words first), remaining words are now
randomized. I imagine this is an attempt to add a bit of chaos where
order (i.e. word length) failed, but I question how much of a benefit
this is, considering words are placed within the word grid mostly at
random.

   if (iterations+=3D1) %(@w+@h)=3D=3D0
     #if we are getting stuck, try removing some words
     puts "#{togo =3D words_todo.size} to go..."
     words_done =3D (@words-words_todo).sort_by{rand}
     (togo*2).times{|i| words_todo<< remove(words_done[i]) if
words_done[i]}
    end
  end
end

As per Adam's comment, if the loop continues for a long while without
placing all the words in our list, some words are put back into the
todo list. togo indicates how many words are currently unplaced, and
twice as many are removed from the puzzle and put back into the
words_todo list. The hope here is that, when the next loop iteration
begins, the code will attempt to place the words remaining, in a
location and orientation that differs from prior iterations of the
loop.

Let's look at the place method next:

def place cw
   @words.sort_by{rand}.each{|otherword|
      startpt =3D find_overlap(cw, otherword)
      return if test_place(cw, startpt)
   }
end

In an effort do provide an interesting puzzle, where words overlap
frequently, the word to be placed is checked against all of the other
words in random order. If the word is successfully placed, test_place
returns a non-false value and the function exits.

def find_overlap cw, testword
  return nil if testword.unplaced?
  if (offset =3D testword.word.index cw.word[0])
    startpt =3D testword.place
    offset.times{startpt=3Dnextp(startpt,testword.dir)}
  else
    startpt =3D nil
  end
  startpt
end

find_overlap determines if the first character of the word to be
placed can be found in another, already placed word. If so, the
location of that character in the grid is determined by walking along
testword using nextp, which calculates the next grid index in a given
direction. That index is returned, or nil if the character is not
found.

This is certainly a good first step in trying to overlap words, though
I think more work needs to be done to create an interesting word
search puzzle... but I'll come back to that at the end of this
summary.

def test_place cw, suggestion=3Dnil
   dir=3DrandDir
   start=3D suggestion || randStart(cw.word[0])

Calling test_place attempts to place the supplied word. A random
direction and starting point are chosen; the latter is random if no
suggestion was made by find_overlap (i.e. there were no characters in
common between the two compared words).

   8.times do
      pt =3D start
      good =3D true

The loop will attempt all eight directions to place the word from the
starting location (but will exit the function as soon as the first
good direction is found).

      cw.word.each_byte{|chr|
        good =3D (@g[pt]=3D=3D?. ||  @g[pt]=3D=3Dchr) && (pt=3Dnextp(pt,dir)=
)
        break unless good
      }

Looking at each character of the word to place, and the corresponding
grid spaces, we determine if each character either fills in an empty
grid space (currently occupied by periods ?.) or matches existing grid
characters. As long as all characters of the word fulfill this
criteria, the variable good remains true.

      return add(cw, start, dir) if good

After examining the whole word, a true value for good indicates that
the word fits into the grid and can be placed. The add method
accomplishes this, and we exit test_place early, now that we have
actually placed the word.

      dir=3D(dir+1)%8
   end
   nil
end

Finishing the loop, the next direction is tried if the previous
direction did not allow the word to fit. If no direction works, nil is
returned, and the place method moves onto the next word.

That covers the bulk of the algorithm; the rest of the class is
bookkeeping, filling in characters or removing them, checking
directions, and more. I'm going to move onto looking at the output,
however please take a look at Adam's code if you want to see in more
detail how he manipulates the data.

Here now is the solution.txt output from one run of Adam's generator,
using the word list provided earlier:


e-x-p-r-e-s-s-i-o-n v-i-r-t-u-a-l . . .

=2E e-c-n-a-t-s-n-i p . . e-t-a-l-p-m-e-t
                 \ \
i c-o-n-d-i-t-i-o-n r e-v-a-l-u-a-t-e s
|                  \ \            |   |
n e c-o-n-s-t-a-n-t h i e . . . . c n c
| |                  \ \ \        | | |
t c p-a-r-a-m-e-t-e-r e m r . . . e o o
| |                    \ \ \      | | |
e n y-r-o-t-c-a-f . . . r i u . . j i p
| |                      \ \ \    | | |
r e . d-a-o-l-r-e-v-o . . i t s . b t e
| |                        \ \ \  | |
f r . e-l-b-a-t-u-m-m-i . . t i o o p .
| |                          \ \ \  |
a e . . t-c-a-r-t-s-b-a . . . a v l e .
| |                            \ \ \|
c f p-r-o-t-o-t-y-p-e s-t-a-c-k n e c l
| |                              \  | |
e e . . . . n-o-i-t-a-u-n-i-t-n-o-c x i
  |                                \| |
o r . a m . m-s-i-h-p-r-o-m-y-l-o-p e t
|     | |                             |
p . k r h l k-c-o-l-b . m-e-s-s-a-g-e e
|   | | | |                         | |
e g e g t a m-e-t-h-o-d s-s-a-l-c . t r
| | | | | |                         | |
r l y u i c r-e-f-l-e-c-t-i-o-n t . a a
| | | | | |                     |   | |
a o w m r o . n-o-i-t-c-n-u-f . y . g l
| | | | | |                     |   |
t b o e o l g-e-n-e-r-a-t-o-r . p . e .
| | | | |                       |   |
o a r n g t-n-e-m-e-t-a-t-s . . e . l .
| | | | |                           |
r l d t l . . . r-e-c-u-r-s-i-o-n . e .
        |                           |
i-t-e-r-a-t-o-r i-d-e-n-t-i-f-i-e-r d .

A congratulations to Adam whose solution does indeed generate word
search puzzles. His solution to the quiz worked better than my own
(incomplete) code, and managed to get it into a tighter space and
complete more often, due in large part to his algorithm that will
remove and replace words in the hopes that they will fit better.

However, one thing that is very similar between Adam's solution and my
own is the output. As you'll see, there are some very obvious
groupings of words parallel to one another. For the list of 44 words,
this particular word search has less than ten intersections, and the
parallel groupings make finding words easier than might be expected.
Handcrafted puzzles tend to be more difficult, visually interesting
(i.e. no parallel groupings) and many more intersections of words.

My initial thought was that Adam's overlap code would provide more
interesting puzzles than my very rough generator, as mine had no
metrics or heuristics beyond "Does it fit?" But there was very little
difference between Adam's output and my own. I have two suspicions.

First, Adam checks only the first character of one word against all of
the characters of another. I think that might have been two limiting,
and to my recollection, word search puzzles tend to have intersections
in the interior of words, and not at the ends.

Second, I suspect that a simple two-word intersection test like Adam's
won't be sufficient for interesting puzzles. I think three-word
(triangle), and perhaps four-word (rectangle), overlap tests might be
required. These are common patterns in word search puzzles, and the
triangle pattern would better fend off the uninteresting parallel
groupings.


In This Thread

Prev Next