[#249784] sprintf can not work in ruby c source? — Haoqi Haoqi <axgle@126.com>

here is my simple test:

11 messages 2007/05/01

[#249812] RubyConf 2007 — "David A. Black" <dblack@...>

Hi everyone --

18 messages 2007/05/01

[#249834] simple subclass question — "Ball, Donald A Jr (Library)" <donald.ball@...>

If I want a class and its children to have different values for the same

23 messages 2007/05/01
[#249836] Re: simple subclass question — Daniel Lucraft <dan@...> 2007/05/01

Ball, Donald A Jr (Library) wrote:

[#249861] Re: simple subclass question — "Ball, Donald A Jr (Library)" <donald.ball@...> 2007/05/01

Thanks to you and Robert for the quick answers. I think I get it now; I

[#249862] Re: simple subclass question — "Ball, Donald A Jr (Library)" <donald.ball@...> 2007/05/01

Actually, I spoke too quickly. If I use this construct:

[#249871] Re: simple subclass question — "Logan Capaldo" <logancapaldo@...> 2007/05/01

On 5/1/07, Ball, Donald A Jr (Library) <donald.ball@nashville.gov> wrote:

[#249948] Re: simple subclass question — "Rick DeNatale" <rick.denatale@...> 2007/05/02

On 5/1/07, Logan Capaldo <logancapaldo@gmail.com> wrote:

[#249954] Re: simple subclass question — "Robert Dober" <robert.dober@...> 2007/05/02

On 5/2/07, Rick DeNatale <rick.denatale@gmail.com> wrote:

[#249839] pallet 1.2.1 — Stephen Touset <stephen@...>

I've been writing a multiplatform packaging tool for the company I work

18 messages 2007/05/01

[#249887] testing and assigning with regexp's — "Mike Steiner" <mikejaysteiner@...>

I'm new to Ruby, and in a little program I'm writing, I have code like this:

17 messages 2007/05/02
[#249916] Re: testing and assigning with regexp's — Tim Hunter <TimHunter@...> 2007/05/02

Mike Steiner wrote:

[#249922] Newbie question: How to get an object in the Controller from a view's hidden field — Agnisys <agnisys@...> 2007/05/02

Hi,

[#249911] Inverse scanf: finding format specifers of existing fields — Bil Kleb <Bil.Kleb@...>

Hi,

17 messages 2007/05/02

[#249957] C DSL anyone? — Brad Phelan <phelan@...>

Just curious,

14 messages 2007/05/02

[#250015] Question regarding tr method in Strings Class — "Michael W. Ryder" <_mwryder@...>

Is there a way to denote a null in the replacement for a character using

11 messages 2007/05/03

[#250055] Checking Credit Cards (#122) — Ruby Quiz <james@...>

This quiz is super easy, of course. The reason I ran it though is that I wanted

18 messages 2007/05/03
[#250067] Re: [SUMMARY] Checking Credit Cards (#122) — anansi <kazaam@...> 2007/05/03

> Ruby Quiz will now take a one week break. Work has been rough this week and I

[#250071] Re: [SUMMARY] Checking Credit Cards (#122) — James Edward Gray II <james@...> 2007/05/03

On May 3, 2007, at 9:15 AM, anansi wrote:

[#250058] Beyond YAML? (scaling) — Bil Kleb <Bil.Kleb@...>

Hi,

28 messages 2007/05/03

[#250079] Enhanced Ruby editor — CParticle <cparticle@...>

All,

19 messages 2007/05/03

[#250117] Array to Hash — Josselin <josselin@...>

is it possible to convert easily an Array like this one :

14 messages 2007/05/03

[#250169] Is there a better way to do this? — "Michael W. Ryder" <_mwryder@...>

As part of my learning Ruby I am trying to learn how to format strings.

19 messages 2007/05/04

[#250178] Ruby love — "Cliff Rowley" <cliffrowley@...>

I just taught my girlfriend - who has never coded before - how to code in

32 messages 2007/05/04
[#250234] Re: Ruby love — Lloyd Linklater <lloyd@2live4.com> 2007/05/04

I also started teaching an old flame how to program. She went through

[#250238] Re: Ruby love — "Logan Capaldo" <logancapaldo@...> 2007/05/04

On 5/4/07, Lloyd Linklater <lloyd@2live4.com> wrote:

[#250265] Re: Ruby love — "Ivor Paul" <ivorpaul@...> 2007/05/04

Great, thanks guys.

[#250299] Re: Ruby love — "Gregory Brown" <gregory.t.brown@...> 2007/05/04

On 5/4/07, Ivor Paul <ivorpaul@gmail.com> wrote:

[#250374] Re: Ruby love — dblack@... 2007/05/05

Hi --

[#250267] Witch Oracle library should I use — "Ben Edwards" <funkytwig@...>

Have had a look on rubyforge and done a little looking around but not

24 messages 2007/05/04
[#250289] Re: Witch Oracle library should I use — Brian Candler <B.Candler@...> 2007/05/04

On Sat, May 05, 2007 at 12:27:13AM +0900, Ben Edwards wrote:

[#250750] Re: Witch Oracle library should I use — "Ben Edwards" <funkytwig@...> 2007/05/08

On 04/05/07, Brian Candler <B.Candler@pobox.com> wrote:

[#250773] Re: Witch Oracle library should I use — Brian Candler <B.Candler@...> 2007/05/08

On Tue, May 08, 2007 at 05:38:27PM +0900, Ben Edwards wrote:

[#250809] Re: Witch Oracle library should I use — "Ben Edwards" <funkytwig@...> 2007/05/08

On 08/05/07, Brian Candler <B.Candler@pobox.com> wrote:

[#250810] Re: Witch Oracle library should I use — khaines@... 2007/05/08

Ben Edwards wrote:

[#250811] Re: Witch Oracle library should I use — James Edward Gray II <james@...> 2007/05/08

On May 8, 2007, at 1:53 PM, khaines@enigo.com wrote:

[#250381] RubyCocoa Sheets - help anyone? — Tim Perrett <freestyle_kayaker@...>

Hey Guys

33 messages 2007/05/05

[#250394] A question for people with English OS — "Harry Kakueki" <list.push@...>

Can you view Japanese documents on the internet with an English OS

23 messages 2007/05/05
[#250620] Re: A question for people with English OS — Roseanne Zhang <roseanne@...> 2007/05/07

Harry Kakueki wrote:

[#250626] Re: A question for people with English OS — "Harry Kakueki" <list.push@...> 2007/05/07

On 5/7/07, Roseanne Zhang <roseanne@javaranch.com> wrote:

[#250633] Re: A question for people with English OS — John Joyce <dangerwillrobinsondanger@...> 2007/05/07

[#250414] SIMPLE! and INTUITIVE! GUI BUILDER for RUBY? — gcarcass <gcarcass@...>

Is there any, SIMPLE software that I can use to build GRAPHIC INTERFACES

20 messages 2007/05/05

[#250439] How can I output an object/variable's name? — John Joyce <dangerwillrobinsondanger@...>

Suppose I have an object :

15 messages 2007/05/05

[#250487] dynamically named variables or Constants — "Tom V." <ruby-talk@...>

Hi,

12 messages 2007/05/06
[#250490] Re: dynamically named variables or Constants — Stefano Crocco <stefano.crocco@...> 2007/05/06

Alle domenica 6 maggio 2007, Tom V. ha scritto:

[#250557] separate Chinese and English! with Ruby — Nanyang Zhan <sxain@...>

Don't get me wrong, because I just want to know how to separate English

34 messages 2007/05/07
[#250570] Re: separate Chinese and English! with Ruby — akbarhome <akbarhome@...> 2007/05/07

On May 7, 2:39 pm, Nanyang Zhan <s...@hotmail.com> wrote:> Don't get me wrong, because I just want to know how to separate English> words from a string with ruby.> There are strings (UTF-8 encoded) to record people's name,> like:>> 摩根·弗里曼 Morgan Freeman> 布鲁斯·威利斯 Bruce Willis> 李小明 Lee xiao ming> these strings containing Chinese name(without space between characters),> separated by a space, following an English name>> or> Frank Darabont> Just an English name.>> Would you give me an idea how to separate these Chinese characters(if> any)?>> --> Posted viahttp://www.ruby-forum.com/.

[#250571] Re: separate Chinese and English! with Ruby — akbarhome <akbarhome@...> 2007/05/07

On May 7, 4:12 pm, akbarhome <akbarh...@gmail.com> wrote:

[#250575] Re: separate Chinese and English! with Ruby — Nanyang Zhan <sxain@...> 2007/05/07

Akbar Home wrote:

[#250592] Re: separate Chinese and English! with Ruby — akbarhome <akbarhome@...> 2007/05/07

On May 7, 5:17 pm, Nanyang Zhan <s...@hotmail.com> wrote:

[#250603] Re: separate Chinese and English! with Ruby — John Joyce <dangerwillrobinsondanger@...> 2007/05/07

[#250606] Re: separate Chinese and English! with Ruby — Nanyang Zhan <sxain@...> 2007/05/07

John Joyce wrote:

[#250609] Re: separate Chinese and English! with Ruby — John Joyce <dangerwillrobinsondanger@...> 2007/05/07

[#250631] Re: separate Chinese and English! with Ruby — Nanyang Zhan <sxain@...> 2007/05/07

John Joyce wrote:

[#250734] Re: separate Chinese and English! with Ruby — eden li <eden.li@...> 2007/05/08

There is documentation:

[#250751] Re: separate Chinese and English! with Ruby — Nanyang Zhan <sxain@...> 2007/05/08

Eden Li wrote:

[#250782] Re: separate Chinese and English! with Ruby — "Michal Suchanek" <hramrach@...> 2007/05/08

On 08/05/07, Nanyang Zhan <sxain@hotmail.com> wrote:> Eden Li wrote:...> Thanks, Zev. but my current problem is about Chinese.> I am going to figure out a way to separate Chinese string from a string> mix with other characters.> What I mean other Characters are alphabets from English or/and other> languages, like Ô, é, á... (may I call them western words?)>> This string may be containing no Chinese:> "String without Chinese" ,I don't need to do anything about it, other> than identify such strings.> "中文 Western Words" #Chinese characters + space + western words.> "中文・另一些中文 western words" #Chinese characters may be separated by> punctuations, or/and space like:> "中文 前有空格 western words"> Almost all Chinese phrases are at the beginning of the strings.> But some may contain numbers, like:> "2007年的日记 diary of 2007"> or some time English or alphabets are used as part of Chinese> phrases,like:> "BB日记 diary of my baby">> Eden Li wrote:> > Nooo! Those are the first BYTES of the UTF-8 encoding of the> > punctuation that you listed.>> Finally, I know what those number are. Thanks.> >so if you remove them from a givenstring, you're going to get back a poorly encoded UTF-8 string>> In fact, I wanted to use those number to test whether a character is> Chinese or not (if 'character[0]' fit the range of [226, 228, 229, 230,> 231, 233, 239], then it was likely to be a Chinese). (Now I know it may> be wrong.)> Then depend on this judgment, if this part of string ( string would be> splited by space, divided into parts at the beginning) containing more> X%, say 60%, of this kind of characters, then I would mark this parts as> Chinese phrase, then take it out of string.>> I still want to use this strategy. but> As you point out, [226, 228, 229, 230, 231, 233, 239] are not safe to> identify Chinese, is there any other easy way to identify Chinese> characters?

[#250665] Ruby Performance - LOW ? — conker <hkchao@...>

Hi All,

23 messages 2007/05/07
[#250836] Re: Ruby Performance - LOW ? — Jason <rsfree3@...> 2007/05/08

On May 7, 2:55 pm, conker <hkc...@gmail.com> wrote:

[#250702] Difference answers from Terminal, TextMate, and BBEdit — Greg <user@...>

A newbie here trying to develop one of Pine's tutorial scripts. Ruby v1.8.6

15 messages 2007/05/08

[#250745] Pass data to a variable — "Seth .." <seth@...>

Hello,

19 messages 2007/05/08

[#250821] basic threading question: can ruby use real threads? — "Kyle Schmitt" <kyleaschmitt@...>

I've read somewhere, and would love for it to be wrong, that ruby

27 messages 2007/05/08
[#250823] Re: basic threading question: can ruby use real threads? — James Edward Gray II <james@...> 2007/05/08

On May 8, 2007, at 3:52 PM, Kyle Schmitt wrote:

[#250824] Re: basic threading question: can ruby use real threads? — "Kyle Schmitt" <kyleaschmitt@...> 2007/05/08

Sweet, thanks for the link!

[#250827] Re: basic threading question: can ruby use real threads? — "Kyle Schmitt" <kyleaschmitt@...> 2007/05/08

OK, so I'm reading that article, and I'm getting three things form it:

[#250923] Re: basic threading question: can ruby use real threads? — Marcin Raczkowski <swistak@...> 2007/05/09

On Tuesday 08 May 2007 21:34, Kyle Schmitt wrote:

[#250940] Re: basic threading question: can ruby use real threads? — MenTaLguY <mental@...> 2007/05/09

On Thu, 10 May 2007 01:00:04 +0900, Marcin Raczkowski <swistak@mailx.expro.pl> wrote:

[#250946] Re: basic threading question: can ruby use real threads? — Marcin Raczkowski <swistak@...> 2007/05/09

On Wednesday 09 May 2007 18:27, MenTaLguY wrote:

[#250949] Re: basic threading question: can ruby use real threads? — "Kyle Schmitt" <kyleaschmitt@...> 2007/05/09

If you fork, is there even a way to create objects that are shared

[#250954] Re: basic threading question: can ruby use real threads? — MenTaLguY <mental@...> 2007/05/09

On Thu, 10 May 2007 04:03:57 +0900, "Kyle Schmitt" <kyleaschmitt@gmail.com> wrote:

[#250970] Re: basic threading question: can ruby use real threads? — "Kyle Schmitt" <kyleaschmitt@...> 2007/05/09

Manipulating ruby objects from inside the threads would be the idea in

[#250856] Implementation of the object.sort method. — Jorge Domenico Bucaran Romano <jbucaran@...>

Hi,

12 messages 2007/05/09

[#250947] What's the most ruby-ish way to write this python code? — Drew Olson <olsonas@...>

All -

10 messages 2007/05/09

[#250998] The Factory Method — Enrique Comba Riepenhausen <ecomba@...>

Hi everyone,

16 messages 2007/05/10

[#251017] instance_variables doesn't return unassigned variables — Bernd <burnt99@...>

Hi,

10 messages 2007/05/10

[#251051] Trouble using string.tr() — Todd Burch <promos@...>

I've coded up EBCDIC to ASCII translate strings. Everything is working

24 messages 2007/05/10
[#251054] Re: Trouble using string.tr() — Robert Klemme <shortcutter@...> 2007/05/10

On 10.05.2007 17:01, Todd Burch wrote:

[#251056] Re: Trouble using string.tr() — Todd Burch <promos@...> 2007/05/10

Here are the two translate strings. Need more code? Thanks y'all.

[#251057] Re: Trouble using string.tr() — Todd Burch <promos@...> 2007/05/10

Note, the version I'm showing has the backslash. It fails with or

[#251061] Re: Trouble using string.tr() — Robert Klemme <shortcutter@...> 2007/05/10

On 10.05.2007 17:23, Todd Burch wrote:

[#251064] Re: Trouble using string.tr() — Todd Burch <promos@...> 2007/05/10

I'll need to code up a smaller example than the 400+ lines I have right

[#251083] Defending Ruby's OOP — Lucas Holland <hollandlucas@...>

Hi,

31 messages 2007/05/10

[#251105] self in blocks — Vasco Andrade e silva <vascoas@...>

Hi

18 messages 2007/05/10
[#251106] Re: self in blocks — MenTaLguY <mental@...> 2007/05/10

On Fri, 11 May 2007 06:37:07 +0900, Vasco Andrade e silva <vascoas@gmail.com> wrote:

[#251113] Re: self in blocks — Vasco Andrade e silva <vascoas@...> 2007/05/10

MenTaLguY wrote:

[#251136] how to remove dups from 2 lists? — "Mike Steiner" <mikejaysteiner@...>

I'm trying to write some code that removes all elements from 2 lists that

33 messages 2007/05/11
[#251160] Re: how to remove dups from 2 lists? — Alex Gutteridge <alexg@...> 2007/05/11

On 11 May 2007, at 11:18, Mike Steiner wrote:

[#251170] Re: how to remove dups from 2 lists? — Robert Klemme <shortcutter@...> 2007/05/11

On 11.05.2007 06:46, Alex Gutteridge wrote:

[#251173] Re: how to remove dups from 2 lists? — Enrique Comba Riepenhausen <ecomba@...> 2007/05/11

On 11 May 2007, at 09:10, Robert Klemme wrote:

[#251174] Re: how to remove dups from 2 lists? — Brian Candler <B.Candler@...> 2007/05/11

On Fri, May 11, 2007 at 04:55:14PM +0900, Enrique Comba Riepenhausen wrote:

[#251176] Re: how to remove dups from 2 lists? — Enrique Comba Riepenhausen <ecomba@...> 2007/05/11

[#251192] Re: how to remove dups from 2 lists? — "Kevin Compton" <klcompt@...> 2007/05/11

Assuming my previous assumption of what exactly is needed... at this point

[#251175] DRb connection error with more than 250+ DRb services — "J. Wook" <9ruvie@...>

23 messages 2007/05/11
[#251438] Re: DRb connection error with more than 250+ DRb services — Marcin Raczkowski <swistak@...> 2007/05/13

On Friday 11 May 2007 08:25, J. Wook wrote:

[#251440] Re: DRb connection error with more than 250+ DRb services — "Michal Suchanek" <hramrach@...> 2007/05/13

On 13/05/07, Marcin Raczkowski <swistak@mailx.expro.pl> wrote:

[#251200] Huffman Encoder (#123) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

19 messages 2007/05/11

[#251211] shebang - what's the point? — Todd Burch <promos@...>

I've written a few hundred scripts now, and not once have I ever coded a

12 messages 2007/05/11

[#251335] Why was the "Symbol is a String"-idea dropped? — enduro <sven613go@...>

Hello,

57 messages 2007/05/12
[#251363] Re: Why was the "Symbol is a String"-idea dropped? — Brian Candler <B.Candler@...> 2007/05/12

On Sat, May 12, 2007 at 04:20:10PM +0900, enduro wrote:

[#251382] Re: Why was the "Symbol is a String"-idea dropped? — Trans <transfire@...> 2007/05/12

[#251390] Re: Why was the "Symbol is a String"-idea dropped? — "Rick DeNatale" <rick.denatale@...> 2007/05/12

On 5/12/07, Trans <transfire@gmail.com> wrote:

[#251426] Re: Why was the "Symbol is a String"-idea dropped? — "Robert Dober" <robert.dober@...> 2007/05/13

On 5/12/07, Rick DeNatale <rick.denatale@gmail.com> wrote:

[#251427] Re: Why was the "Symbol is a String"-idea dropped? — Xavier Noria <fxn@...> 2007/05/13

Just wanted to point out that the original question is why Ruby core

[#251460] Re: Why was the "Symbol is a String"-idea dropped? — Yukihiro Matsumoto <matz@...> 2007/05/13

Hi,

[#251574] Re: Why was the "Symbol is a String"-idea dropped? — Trans <transfire@...> 2007/05/14

[#251626] Re: Why was the "Symbol is a String"-idea dropped? — enduro <sven715rt@...> 2007/05/15

Thank you all for your replies.

[#251644] Re: Why was the "Symbol is a String"-idea dropped? — Brian Candler <B.Candler@...> 2007/05/15

On Tue, May 15, 2007 at 10:07:24AM +0900, enduro wrote:

[#251651] Re: Why was the "Symbol is a String"-idea dropped? — "enduro (Sven Suska)" <sven715rt@...> 2007/05/15

Hello Brian,

[#251681] Re: Why was the "Symbol is a String"-idea dropped? — Brian Candler <B.Candler@...> 2007/05/15

On Tue, May 15, 2007 at 06:42:04PM +0900, enduro (Sven Suska) wrote:

[#251686] Re: Why was the "Symbol is a String"-idea dropped? — "Robert Dober" <robert.dober@...> 2007/05/15

On 5/15/07, Brian Candler <B.Candler@pobox.com> wrote:

[#251699] Re: Why was the "Symbol is a String"-idea dropped? — Brian Candler <B.Candler@...> 2007/05/15

On Tue, May 15, 2007 at 10:54:05PM +0900, Robert Dober wrote:

[#251710] Re: Why was the "Symbol is a String"-idea dropped? — Gary Wright <gwtmp01@...> 2007/05/15

[#251732] Re: Why was the "Symbol is a String"-idea dropped? — Brian Candler <B.Candler@...> 2007/05/15

On Wed, May 16, 2007 at 12:23:09AM +0900, Gary Wright wrote:

[#251780] Re: Why was the "Symbol is a String"-idea dropped? — "Sven Suska (enduro)" <sven715rt@...> 2007/05/16

Hello everybody,

[#251783] Re: Why was the "Symbol is a String"-idea dropped? — Trans <transfire@...> 2007/05/16

[#251785] Re: Why was the "Symbol is a String"-idea dropped? — "Logan Capaldo" <logancapaldo@...> 2007/05/16

On 5/16/07, Trans <transfire@gmail.com> wrote:

[#251794] Re: Why was the "Symbol is a String"-idea dropped? — dblack@... 2007/05/16

Hi --

[#251826] Re: Why was the "Symbol is a String"-idea dropped? — "Logan Capaldo" <logancapaldo@...> 2007/05/16

On 5/16/07, dblack@wobblini.net <dblack@wobblini.net> wrote:

[#251978] Re: Why was the "Symbol is a String"-idea dropped? — Gary Wright <gwtmp01@...> 2007/05/17

[#251980] Re: Why was the "Symbol is a String"-idea dropped? — dblack@... 2007/05/17

Hi --

[#252076] Re: Why was the "Symbol is a String"-idea dropped? — Paul Brannan <pbrannan@...> 2007/05/18

On Fri, May 18, 2007 at 03:17:01AM +0900, dblack@wobblini.net wrote:

[#251404] Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) — "Rick DeNatale" <rick.denatale@...>

On 5/12/07, Martin DeMello <martindemello@gmail.com> wrote:

13 messages 2007/05/12
[#251452] Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) — "Martin DeMello" <martindemello@...> 2007/05/13

On 5/13/07, Rick DeNatale <rick.denatale@gmail.com> wrote:

[#251477] Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) — darren kirby <bulliver@...> 2007/05/13

quoth the Martin DeMello:

[#251591] Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) — "Rick DeNatale" <rick.denatale@...> 2007/05/14

On 5/13/07, darren kirby <bulliver@badcomputer.org> wrote:

[#251593] Re: Algorithm books for Ruby (was Re: Object-oriented solution to Tower of Hanoi) — "Florian Frank" <flori@...> 2007/05/14

Rick DeNatale schrieb:

[#251829] Some Ruby Features missing... — edlich@...

To start a new Ruby Project I need some more features that I know

21 messages 2007/05/16

[#251879] Coopting String interpolation — aurelianito <aurelianocalvo@...>

We all know the #{} operator for String interpolation.

18 messages 2007/05/17
[#251881] Re: Coopting String interpolation — Pe, Botp <botp@...> 2007/05/17

From: aurelianito [mailto:aurelianocalvo@gmail.com] :

[#251882] Re: Coopting String interpolation — Pe, Botp <botp@...> 2007/05/17

# irb(main):005:0> greeting="hi, #{"Ms "+name.capitalize}"

[#251883] Re: Coopting String interpolation — aurelianito <aurelianocalvo@...> 2007/05/17

[#251918] Re: Coopting String interpolation — Robert Klemme <shortcutter@...> 2007/05/17

On 17.05.2007 07:09, aurelianito wrote:

[#251936] Re: Coopting String interpolation — "Aureliano Calvo" <aurelianocalvo@...> 2007/05/17

> > I'm trying to do some metaprogramming and I need to apply some

[#251892] Problem removing new line characters on Mac OS X — Singeo <singeo.sg@...>

Hi, I'm pretty new to Ruby. I've got a text file where I need to

18 messages 2007/05/17
[#251899] Re: Problem removing new line characters on Mac OS X — Hermann Martinelli <martinelli@...> 2007/05/17

Singeo wrote:

[#251902] Re: Problem removing new line characters on Mac OS X — Singeo <singeo.sg@...> 2007/05/17

Hi Hermann, just tried your suggestion of:

[#251908] "Crystallizing" Objects — Sven Suska <sven715rt@...>

Hello,

22 messages 2007/05/17

[#251990] rubyforge etiquette for dead projects — "Nasir Khan" <rubylearner@...>

Apologies if this is not the right forum for this, but this surely has

12 messages 2007/05/17

[#252034] Why not adopt "Python Style" indentation for Ruby? — Chris Dew <cmsdew@...>

As far as I can see, the 'end' keyword is 'repeating yourself' when

140 messages 2007/05/18
[#252035] Re: Why not adopt "Python Style" indentation for Ruby? — Yukihiro Matsumoto <matz@...> 2007/05/18

Hi,

[#252045] Re: Why not adopt "Python Style" indentation for Ruby? — "Michal Suchanek" <hramrach@...> 2007/05/18

On 18/05/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#317015] Re: Why not adopt "Python Style" indentation for Ruby? — Frasier Mruby <flyingkite@...> 2008/10/06

Dear Mats,

[#317018] Re: Why not adopt "Python Style" indentation for Ruby? — James Britt <james.britt@...> 2008/10/06

Frasier Mruby wrote:

[#317024] Re: Why not adopt "Python Style" indentation for Ruby? — Frasier Mruby <flyingkite@...> 2008/10/06

James, thank you for you fast response.

[#317045] Re: Why not adopt "Python Style" indentation for Ruby? — Tom Reilly <w3gat@...> 2008/10/07

I've thought that one rather likes the structure of a language learned

[#252098] Re: Why not adopt "Python Style" indentation for Ruby? — Jaroslaw Zabiello <hipertracker@...> 2007/05/18

Dnia Fri, 18 May 2007 16:38:05 +0900, Yukihiro Matsumoto napisaa):

[#252067] Re: Why not adopt "Python Style" indentation for Ruby? — Daniel Martin <martin@...> 2007/05/18

Chris Dew <cmsdew@googlemail.com> writes:

[#252073] Re: Why not adopt "Python Style" indentation for Ruby? — Yukihiro Matsumoto <matz@...> 2007/05/18

Hi,

[#252099] Re: Why not adopt "Python Style" indentation for Ruby? — "Eric Mahurin" <eric.mahurin@...> 2007/05/18

On 5/18/07, Yukihiro Matsumoto <matz@ruby-lang.org> wrote:

[#409189] Re: Why not adopt "Python Style" indentation for Ruby? — "Juha K." <lists@...> 2013/07/29

Why not go coffeescript style and create a preprocessor gem that

[#252060] Magic Squares (#124) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

29 messages 2007/05/18

[#252345] Re: How to adopt "Python Style" indentation for Ruby — Brian Candler <B.Candler@...>

On Mon, May 21, 2007 at 03:53:25PM +0900, Giles Bowkett wrote:

25 messages 2007/05/21
[#252502] Re: How to adopt "Python Style" indentation for Ruby — Brad Phelan <phelan@...> 2007/05/22

Brad Phelan wrote:

[#252511] Re: How to adopt "Python Style" indentation for Ruby — dblack@... 2007/05/22

Hi --

[#252352] using Enumerable when each has arguments? — "Erwin Abbott" <erwin.abbott@...>

Hi

16 messages 2007/05/21
[#252367] Re: using Enumerable when each has arguments? — Trans <transfire@...> 2007/05/21

[#252398] Wikipedia Bot — Peter Marsh <evil_grunger@...>

I'm planning on writing a simple Wikipedia Bot, but I'm having a little

17 messages 2007/05/21

[#252454] ruby libnet — Ari Brown <ari@...>

hey,

19 messages 2007/05/21
[#252500] Re: ruby libnet — anansi <kazaam@...> 2007/05/22

could you get it to work to send a SYN packet?

[#252506] Netiquette (was Re: ruby libnet) — James Edward Gray II <james@...> 2007/05/22

On May 22, 2007, at 3:35 AM, anansi wrote:

[#252468] Oddities of Ruby to a noob — "Hakusa@..." <Hakusa@...>

I have some good experience in other languages and consider myself a

15 messages 2007/05/22

[#252489] Partial Regular Expression Matching — Hans Fugal <fugalh@...>

I would like to identify partial matching of a regular expression, for a

11 messages 2007/05/22

[#252645] Enumerator for Hash — Ryan Hinton <iobass@...>

I have a complex object that I want to hash in different ways, similar

12 messages 2007/05/23

[#252685] can I do windows shell scripting in ruby? — davy.bold@...

Hello,

15 messages 2007/05/23
[#252689] Re: can I do windows shell scripting in ruby? — "Jano Svitok" <jan.svitok@...> 2007/05/23

On 5/23/07, davy.bold@googlemail.com <davy.bold@googlemail.com> wrote:

[#252706] require_gem vs. gem — Dennis Crissman <dcrissman@...>

I am confused, can somebody please explain to me the difference between

14 messages 2007/05/23

[#252747] Ruby Header Files in Mac OS X — Ari Brown <ari@...>

[Snow-iMac:~/Desktop/Programming/rubyforger] ari% ruby extconf.rb

15 messages 2007/05/23
[#252752] Re: Ruby Header Files in Mac OS X — Henry Maddocks <henryj@...> 2007/05/23

[#252836] Ruby - Debugging — "How do I use the ruby default debugger?" <jbucaran@...>

How do I use the ruby default debugger?

25 messages 2007/05/24
[#252840] Re: Ruby - Debugging — "Tomas Pospisek's Mailing Lists" <tpo2@...> 2007/05/24

On Fri, 25 May 2007, How do I use the ruby default debugger? wrote:

[#252891] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

Tomas Pospisek's Mailing Lists wrote:

[#252893] Re: Ruby - Debugging — Alex Gutteridge <alexg@...> 2007/05/25

On 25 May 2007, at 11:37, Jorge Domenico Bucaran Romano wrote:

[#252896] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

Alex Gutteridge wrote:

[#252897] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

Also, why does it shows this:

[#252898] Re: Ruby - Debugging — Alex Gutteridge <alexg@...> 2007/05/25

On 25 May 2007, at 12:18, Jorge Domenico Bucaran Romano wrote:

[#252902] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

Is it necessary to load the rubygems when debugging? Why do I need this?

[#252903] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

It is not working look at this:

[#252907] Re: Ruby - Debugging — Alex Gutteridge <alexg@...> 2007/05/25

On 25 May 2007, at 13:18, Jorge Domenico Bucaran Romano wrote:

[#252910] Re: Ruby - Debugging — Jorge Domenico Bucaran Romano <jbucaran@...> 2007/05/25

C:\Users\jbucaran>ruby -rdebug c:\users\jbucaran\desktop\demo2.rb

[#252857] Introducing the "it" keyword — Greg Fodor <gfodor@...>

A common pattern seen in a lot of ruby code is:

102 messages 2007/05/24
[#252861] Re: Introducing the "it" keyword — dblack@... 2007/05/24

Hi --

[#252866] Re: Introducing the "it" keyword — Greg Fodor <gfodor@...> 2007/05/24

> Maybe you could do:

[#252926] Re: Introducing the "it" keyword — "Ronald Fischer" <ronald.fischer@...> 2007/05/25

[#253009] Re: Introducing the "it" keyword — Gregory Seidman <gsslist+ruby@...> 2007/05/25

On Fri, May 25, 2007 at 04:58:08PM +0900, Ronald Fischer wrote:

[#253377] Re: Introducing the "it" keyword — "Ronald Fischer" <ronald.fischer@...> 2007/05/29

> > A more

[#253417] Re: Introducing the "it" keyword — Gregory Seidman <gsslist+ruby@...> 2007/05/29

On Tue, May 29, 2007 at 04:55:01PM +0900, Ronald Fischer wrote:

[#253678] Re: Introducing the "it" keyword — Eleanor McHugh <eleanor@...> 2007/05/31

On 29 May 2007, at 14:17, Gregory Seidman wrote:

[#253683] Re: Introducing the "it" keyword — "Michael W. Ryder" <_mwryder@...> 2007/05/31

Eleanor McHugh wrote:

[#253693] Re: Introducing the "it" keyword — Chad Perrin <perrin@...> 2007/05/31

On Thu, May 31, 2007 at 11:30:30AM +0900, Michael W. Ryder wrote:

[#253701] Re: Introducing the "it" keyword — "Michael W. Ryder" <_mwryder@...> 2007/05/31

Chad Perrin wrote:

[#253704] Re: Introducing the "it" keyword — Chad Perrin <perrin@...> 2007/05/31

On Thu, May 31, 2007 at 03:40:16PM +0900, Michael W. Ryder wrote:

[#253742] Re: Introducing the "it" keyword — "Jacob Burkhart" <igotimac@...> 2007/05/31

Would a let or with construct be fast enough and memory efficient

[#253744] Re: Introducing the "it" keyword — "Jacob Burkhart" <igotimac@...> 2007/05/31

consider the clarity of reading these:

[#253750] Re: Introducing the "it" keyword — Mariusz Pękala <skoot@...> 2007/05/31

On 2007-05-31 21:32:28 +0900 (Thu, May), Jacob Burkhart wrote:

[#253773] Re: Introducing the "it" keyword — Chad Perrin <perrin@...> 2007/05/31

On Thu, May 31, 2007 at 10:21:49PM +0900, Mariusz P??kala wrote:

[#253849] Re: Introducing the "it" keyword — "Jacob Burkhart" <igotimac@...> 2007/06/01

> Of course, I might find the with:a(v+1) syntax more readable if it were

[#252929] Re: Introducing the "it" keyword — Robert Klemme <shortcutter@...> 2007/05/25

On 24.05.2007 23:35, Greg Fodor wrote:

[#252933] Re: Introducing the "it" keyword — Greg Fodor <gfodor@...> 2007/05/25

> And don't tell me that this is too much typing for you.

[#252935] Re: Introducing the "it" keyword — Robert Klemme <shortcutter@...> 2007/05/25

On 25.05.2007 10:21, Greg Fodor wrote:

[#253087] Re: Introducing the "it" keyword — Robert Klemme <shortcutter@...> 2007/05/26

On 25.05.2007 11:40, Robert Klemme wrote:

[#252870] Ruby programming challenges and riddles? — "Hakusa@..." <Hakusa@...>

I recently fell in love with programming riddles and was told that

17 messages 2007/05/24

[#252961] Fractals (#125) — Ruby Quiz <james@...>

The three rules of Ruby Quiz:

21 messages 2007/05/25

[#253103] local variables vs. methods — Henrik Schmidt <no.spam@...>

Hi there,

18 messages 2007/05/26
[#253108] Re: local variables vs. methods — "Hakusa@..." <Hakusa@...> 2007/05/26

If a language stops you from doing something just because it's bad

[#253113] Perspectives for Ruby 2.0 — arcadiorubiogarcia@...

Hi,

13 messages 2007/05/26

[#253170] Tricky problem with === — "Erwin Abbott" <erwin.abbott@...>

I have a "BlankState" type of class and it's method_missing forwards

17 messages 2007/05/27

[#253374] Underscore — Jon Harrop <jon@...>

Logan Capaldo wrote:

22 messages 2007/05/29
[#253394] Re: Underscore — Jon Harrop <jon@...> 2007/05/29

Michael Fellinger wrote:

[#253396] Re: Underscore — "Jano Svitok" <jan.svitok@...> 2007/05/29

On 5/29/07, Jon Harrop <jon@ffconsultancy.com> wrote:

[#253467] Offline Rails Framework Documentation — Paul <pdavidow@...>

I would like to download the Rails Framework Documentation (http://

11 messages 2007/05/29

[#253526] #respond_to? not working for dynamically generated methods — Maurice Gladwell <maurice.gladwell@...>

It seems Object#respond_to doesn't work for dynamically generated

37 messages 2007/05/30
[#253543] Re: #respond_to? not working for dynamically generated methods — dblack@... 2007/05/30

Hi --

[#253556] Re: #respond_to? not working for dynamically generated metho — Maurice Gladwell <maurice.gladwell@...> 2007/05/30

David wrote:

[#253563] Re: #respond_to? not working for dynamically generated metho — dblack@... 2007/05/30

Hi --

[#253564] Re: #respond_to? not working for dynamically generated metho — James Edward Gray II <james@...> 2007/05/30

On May 30, 2007, at 7:53 AM, dblack@wobblini.net wrote:

[#253579] Re: #respond_to? not working for dynamically generated metho — Maurice Gladwell <maurice.gladwell@...> 2007/05/30

James Gray wrote:

[#253567] Help with Ruby < - > Oracle Connectivity — Peter Bailey <pbailey@...>

Hello,

15 messages 2007/05/30
[#253576] Re: Help with Ruby < - > Oracle Connectivity — Brian Candler <B.Candler@...> 2007/05/30

On Wed, May 30, 2007 at 10:30:40PM +0900, Peter Bailey wrote:

[#253584] Re: Help with Ruby < - > Oracle Connectivity — Peter Bailey <pbailey@...> 2007/05/30

Brian Candler wrote:

[#253591] Re: Help with Ruby < - > Oracle Connectivity — Brian Candler <B.Candler@...> 2007/05/30

On Wed, May 30, 2007 at 11:12:02PM +0900, Peter Bailey wrote:

[#253570] Enumerable#serially - those nifty functions w/o memory footprint — SonOfLilit <sonoflilit@...>

Hello,

13 messages 2007/05/30

[#253649] image_science 1.1.3 Released — Ryan Davis <ryand-ruby@...>

image_science version 1.1.3 has been released!

12 messages 2007/05/30
[#253652] Re: [ANN] image_science 1.1.3 Released — James Edward Gray II <james@...> 2007/05/30

On May 30, 2007, at 3:38 PM, Ryan Davis wrote:

Re: [QUIZ] Magic Squares (#124)

From: "Robert Dober" <robert.dober@...>
Date: 2007-05-20 19:53:01 UTC
List: ruby-talk #252322
Hmm does not seem that the attachments are too readable on the Ruby Quiz site.
So please forgive me for posting them here again, inline. I do not
include the HTML plugin as it is not closely connected to the topic of
the Quiz.

Cheers
Robert

# cat 124-magic-square.rb
# vim: sts=2 sw=2 ft=ruby expandtab nu tw=0:

Usage = <<-EOS
  usage:
      ruby #{$0} [-t|--test] [-h|--html] <Square Order List>

      Prints Magic Squares for all indicated orders.
      Indicating -t also tests the results.
EOS
loop do
  case ARGV.first
    when "-t", "--test"
      require 'test-squares'
      ARGV.shift
    when "-h", "--html"
      require 'html-output'
      ARGV.shift
    when "-?", "--help", nil
      puts Usage
      exit
    when "--"
      ARGV.shift && break
    else
      break
  end
end

#
# This is a default output module, another output
# module called HTMLOutput is provided as an example
# how to pull in an appropriate Output module
# as plugin.
#
module Output
  def to_s decoration = false
    l = (@order*@order).to_s.size
    return  @data.map{ |line|
                        line.map{ |cell|
                                   "%#{l}d" % cell
                                }.join(" ")
                      }.join("\n") unless decoration

    sep_line = "+" << ( "-" * l.succ.succ << "+" ) * @order
    sep_line.dup << "\n" <<
    @data.map{ | line | "| " << line.map{ |cell| "%#{l}d" % cell
}.join(" | ") << " |" }.
      zip( [sep_line] * @order ).flatten.join("\n")
  end
end

#
# The usage of cursors is slowing down the program a little
# bit but I feel it is still fast enough.
#
class Cursor
  attr_reader :cpos, :lpos
  def initialize order, lpos, cpos
    @order = order
    @lpos  = lpos
    @cpos  = cpos
  end

  def move ldelta, cdelta
    l = @lpos + ldelta
    c = @cpos + cdelta
    l %= @order
    c %= @order
    self.class.new @order, l, c
  end
  def next!
     @cpos += 1
     return if @cpos < @order
     @cpos = 0
     @lpos += 1
     @lpos %= @order
  end
end

#
# This is where the work is done, like
# testing and outputting and what was it?
# Ah yes storing the data.
#
class SquareData
  include Output
  include HTMLOutput rescue nil
  include TestSquare rescue nil
  def initialize order
    @order = order
    @data = Array.new( @order ){ Array.new( @order ) { nil } }
  end

  def peek(i, j); @data[i][j] end
  def poke(i, j, v); @data[i][j] = v end
  def [](c); @data[c.lpos][c.cpos] end
  def []=(c, v); @data[c.lpos][c.cpos] = v end

  def each_subdiagonal
    (@order/4).times do
      | line |
      (@order/4).times do
        | col |
        4.times do
          | l |
          4.times do
            | c |
            yield [ 4*line + l, 4*col + c ] if
            l==c || l+c == 3
          end
        end # 4.times do
      end # (@order/4).times do
    end # (@order/4).times do
  end

  def siamese_order
    model = self.class.new @order
    last = @order*@order
    @pos = Cursor.new @order, 0, @order/2
    yield @pos.lpos, @pos.cpos, peek( @pos.lpos, @pos.cpos )
    model[ @pos ] = true
    2.upto last do
      npos = @pos.move -1, +1
      npos = @pos.move +1, 0 if model[ npos ]
      model[ @pos = npos ] = true
      yield @pos.lpos, @pos.cpos, peek( @pos.lpos, @pos.cpos )
    end # @last.times do
  end
end # class SquareData

#
# The base class for Magic Squares it basically
# is the result of factorizing the three classes
# representing the three differnt cases, odd, even and
# double even.
# It's singleton class is used as a class Factory for
# the three implementing classes.
#
class Square

  def to_s decoration = false
    @data.to_s decoration
  end
  private
  def initialize order
    @order = order.to_i
    @last = @order*@order
    @data = SquareData.new @order
    compute
    @data.test rescue nil
  end

end

#
# The simplest case, the Siamese Order algorithm
# is applied.
#
class OddSquare < Square

  private
  def compute
    @pos = Cursor.new @order, 0, @order/2
    @data[ @pos ] = 1
    2.upto @last do
      | n |
      npos = @pos.move -1, +1
      npos = @pos.move +1, 0 if @data[ npos ]
      @data[ @pos = npos ] = n
    end # @last.times do
  end

end # class OddSquare

#
# The Double Cross Algorithm is applied
# to double even Squares.
#
class DoubleCross < Square
  def compute
    pos = Cursor.new @order, 0, 0
    1.upto( @last ) do
      | n |
      @data[ pos ] = n
      pos.next!
    end # 1.upto( @last ) do
    @data.each_subdiagonal do
      | lidx, cidx |
      @data.poke lidx, cidx, @last.succ - @data.peek( lidx, cidx )
    end

  end
end

#
# And eventually we use the LUX algorithm of Conway for even
# squares.
#
class FiatLux < Square
  L = [ [0, 1], [1, 0], [1, 1], [0, 0] ]
  U = [ [0, 0], [1, 0], [1, 1], [0, 1] ]
  X = [ [0, 0], [1, 1], [1, 0], [0, 1] ]
  def compute
    half = @order / 2
    lux_data = SquareData.new half
    n = half/2
    pos = Cursor.new half, 0, 0
    n.succ.times do
      half.times do
        lux_data[ pos ] = L
        pos.next!
      end # half.times do
    end # n.succ.times do
    half.times do
      lux_data[ pos ] = U
      pos.next!
    end # half.times do
    lux_data.poke n, n, U
    lux_data.poke n+1, n, L
    2.upto(n) do
      half.times do
        lux_data[ pos ] = X
        pos.next!
      end
    end # 2.upto(half) do

    count = 1
    lux_data.siamese_order do
      | siam_row, siam_col, elem |
      elem.each do
        | r, c |
        @data.poke 2*siam_row + r, 2*siam_col + c, count
        count += 1
      end # elem.each do
    end # lux_data.siamese_order do
  end
end # class FiatLux

class << Square
  #
  # trying to call the ctors with consistent values only
  #
  protected :new
  def Factory arg
    arg = arg.to_i
    case arg % 4
      when 1, 3
        OddSquare.new arg
      when 0
        DoubleCross.new arg
      else
        FiatLux.new arg
    end
  end
end
ARGV.each do
  |arg|
  puts Square::Factory( arg ).to_s( true )
  puts
end
__END__
#########################################
#########################################
#207/15 >  cat test-squares.rb
# vim: sts=2 sw=2 ft=ruby expandtab nu tw=0:

module TestSquare
  def assert cdt, msg
    return $stderr.puts( "#{msg} . . . . . ok" ) if cdt
    raise Exception, msg << "\n" << to_s
  end
  def test
    dia1 = dia2 = 0
    @order.times do
      | idx |
      dia1 += peek( idx, idx )
      dia2 += peek( idx, -idx.succ )
    end # @lines.each_with_index do
    assert dia1==dia2, "Both diagonals"
    @order.times do
      | idx1 |
      col_n = row_n = 0
      @order.times do
        | idx2 |
        col_n += peek idx2, idx1
        row_n += peek idx1, idx2
      end
      assert dia1 == col_n, "Col #{idx1}"
      assert dia1 == row_n, "Row #{idx1}"
    end # @lines.each_with_index do
  end # def test

  def is_ok?
    dia1 = dia2 = 0
    @order.times do
      | idx |
      dia1 += peek( idx, idx )
      dia2 += peek( idx, -idx.succ )
    end # @lines.each_with_index do
    return false unless dia1==dia2
    @order.times do
      | idx1 |
      col_n = row_n = 0
      @order.times do
        | idx2 |
        col_n += peek idx2, idx1
        row_n += peek idx1, idx2
      end
      return false unless dia1 == col_n
      return false unless dia1 == row_n
    end # @lines.each_with_index do
    true

  end

end
__END__

In This Thread