# Ruby

**URL:** https://www.ruby-forum.com/c/ruby/7.md?page=1755

[Latest](https://www.ruby-forum.com/latest.md) · [Categories](https://www.ruby-forum.com/categories.md) · [Tags](https://www.ruby-forum.com/tags.md)

**Page:** 1756

---

## [Sorting arrays](https://www.ruby-forum.com/t/sorting-arrays/96490)

<div class="topic-metadata">

**Author:** [@zanoni](https://www.ruby-forum.com/u/zanoni)\
**Replies:** 23\
**Last updated:** [July 9, 2006, 7:00pm UTC](https://www.ruby-forum.com/t/sorting-arrays/96490 "2006-07-09T19:00:12Z")

</div>

I’m having some major comprehension problems in figuring out this problem. In the event that this is not appropriate for the list, my apologies and feel free to flame me. I’m just so stuck right now. I have checked…

---

## [Deadlockproblem](https://www.ruby-forum.com/t/deadlockproblem/97679)

<div class="topic-metadata">

**Author:** [@asterix](https://www.ruby-forum.com/u/asterix)\
**Replies:** 2\
**Last updated:** [July 9, 2006, 6:47pm UTC](https://www.ruby-forum.com/t/deadlockproblem/97679 "2006-07-09T18:47:30Z")

</div>

Hello, i’m trying to realize asynchronous communication, but the sender have to wait until the answer is recieved. Although it is only one kind of message allowed at each time. Here is my code and the output. using …

---

## [Announcing MarkaBoo 0.7.3 - Bookmark Exporting, Advanced Edi](https://www.ruby-forum.com/t/announcing-markaboo-0-7-3-bookmark-exporting-advanced-edi/97690)

<div class="topic-metadata">

**Author:** [@xmlblog\_SChristian\_S](https://www.ruby-forum.com/u/xmlblog_SChristian_S)\
**Replies:** 0\
**Last updated:** [July 9, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/announcing-markaboo-0-7-3-bookmark-exporting-advanced-edi/97690 "2006-07-09T18:16:48Z")

</div>

Lots of goodies in this new release. Here’s a rundown: \* Bookmark exporting By popular demand, we've added the ability to export your bookmarks in browser-friendly format. Clicking on the export link produces a pag…

---

## [RailsConf Europe, Sept. 14-15: don't put it off!](https://www.ruby-forum.com/t/railsconf-europe-sept-14-15-dont-put-it-off/97682)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 9, 2006, 4:28pm UTC](https://www.ruby-forum.com/t/railsconf-europe-sept-14-15-dont-put-it-off/97682 "2006-07-09T16:28:21Z")

</div>

Hi everyone – In the excitement of the Chicago RailsConf and other recent events, don’t forget the excitement of RailsConf Europe! You’ve heard of it, but it seems kind of shadowy compared to the “big” events? Here’…

---

## [Method lookup weirdness](https://www.ruby-forum.com/t/method-lookup-weirdness/102961)

<div class="topic-metadata">

**Author:** [@Ilmari\_H](https://www.ruby-forum.com/u/Ilmari_H)\
**Replies:** 2\
**Last updated:** [July 9, 2006, 3:22pm UTC](https://www.ruby-forum.com/t/method-lookup-weirdness/102961 "2006-07-09T15:22:49Z")

</div>

Hi, I’m a bit mystified by the following: Strange module Foo extend self def bar; ‘bar’ end end Foo.bar module Foo remove\_method :bar end Foo.bar =\> ‘bar’ # eh? Normal module Bar extend self def foo; ‘foo’…

---

## [Recursive Rake rules with multiple pre-requisites](https://www.ruby-forum.com/t/recursive-rake-rules-with-multiple-pre-requisites/97673)

<div class="topic-metadata">

**Author:** [@ToRA](https://www.ruby-forum.com/u/ToRA)\
**Replies:** 0\
**Last updated:** [July 9, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/recursive-rake-rules-with-multiple-pre-requisites/97673 "2006-07-09T13:10:41Z")

</div>

Hi, I’m having a problem getting rake to work using rules that are recursive and have multiple prerequisites…I’ve got my problem down to a fairly simple example, at the bottom of the post. If I run it, (assuming a li…

---

## [Attr\_reader as a class method](https://www.ruby-forum.com/t/attr-reader-as-a-class-method/97657)

<div class="topic-metadata">

**Author:** [@pool007](https://www.ruby-forum.com/u/pool007)\
**Replies:** 2\
**Last updated:** [July 9, 2006, 9:34am UTC](https://www.ruby-forum.com/t/attr-reader-as-a-class-method/97657 "2006-07-09T09:34:28Z")

</div>

Hi list. I’d like to use attr\_reader to introduce a class method. For example, the following is the code I’ve tried. irb(main):001:0\> class Foo irb(main):002:1\> ONE = 1 irb(main):003:1\> end =\> 1 irb(main):004:0\> …

---

## [Alternative to the Symbol#to\_proc hack](https://www.ruby-forum.com/t/alternative-to-the-symbol-to-proc-hack/102966)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 8\
**Last updated:** [July 9, 2006, 6:43am UTC](https://www.ruby-forum.com/t/alternative-to-the-symbol-to-proc-hack/102966 "2006-07-09T06:43:20Z")

</div>

I’ve always been in two minds about the Symbol#to\_proc hack, it’s clever but adds a bit of line noise. Then I figured you can turn it around: class String def everything\_in(e) e.map { |u| u.send(self) } end end …

---

## [GC oddness](https://www.ruby-forum.com/t/gc-oddness/97366)

<div class="topic-metadata">

**Author:** [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Replies:** 16\
**Last updated:** [July 9, 2006, 2:25am UTC](https://www.ruby-forum.com/t/gc-oddness/97366 "2006-07-09T02:25:07Z")

</div>

Hi all, Can someone smarter tell me why this fails? I’m expecting the TestDir to get GC’d when I call GC.start in the test, but something’s obviously keeping a reference lying around. I just can’t see what it is… r…

---

## [One-Click Ruby Installer 184-19 Final is available!](https://www.ruby-forum.com/t/one-click-ruby-installer-184-19-final-is-available/97617)

<div class="topic-metadata">

**Author:** [@curthibbs](https://www.ruby-forum.com/u/curthibbs)\
**Replies:** 3\
**Last updated:** [July 9, 2006, 2:15am UTC](https://www.ruby-forum.com/t/one-click-ruby-installer-184-19-final-is-available/97617 "2006-07-09T02:15:47Z")

</div>

The final 1.8.4 release of the One-Click Ruby Installer for Windows is available for download at: http://rubyforge.org/frs/?group\_id=167

---

## [Ruby - mysql - Error Authentication protocol not supported](https://www.ruby-forum.com/t/ruby-mysql-error-authentication-protocol-not-supported/97645)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 9, 2006, 2:03am UTC](https://www.ruby-forum.com/t/ruby-mysql-error-authentication-protocol-not-supported/97645 "2006-07-09T02:03:12Z")

</div>

On Windows XP Prof system, using Ruby 1.8.4 & mysql-ruby-2.7.1 (pure ruby interface), myswl 5.0 server, and rubyuser is defined as a mysql user, I am trying to run the following sample program and getting the error: \*…

---

## [Write to specified line number of file](https://www.ruby-forum.com/t/write-to-specified-line-number-of-file/97639)

<div class="topic-metadata">

**Author:** [@ar1](https://www.ruby-forum.com/u/ar1)\
**Replies:** 0\
**Last updated:** [July 9, 2006, 12:55am UTC](https://www.ruby-forum.com/t/write-to-specified-line-number-of-file/97639 "2006-07-09T00:55:33Z")

</div>

Hi, I want to read a file, and write to another file by randomize the lines. I saw the method File.lineno= but it doesn’t seem to work. I just get the same file written as the original, without the lines having been …

---

## [Re: Panagrams (#86)](https://www.ruby-forum.com/t/re-panagrams-86/97611)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 2\
**Last updated:** [July 8, 2006, 11:59pm UTC](https://www.ruby-forum.com/t/re-panagrams-86/97611 "2006-07-08T23:59:57Z")

</div>

Oops. I accidentally sent this just to Simon; it was supposed to go to the list: Simon Kröger removed\_email\_address@domain.invalid writes: Well, what’s an iteration in your code? I found a solution (the same) to yo…

---

## [Accessors and anonymous classes](https://www.ruby-forum.com/t/accessors-and-anonymous-classes/97637)

<div class="topic-metadata">

**Author:** [@russellf](https://www.ruby-forum.com/u/russellf)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 11:59pm UTC](https://www.ruby-forum.com/t/accessors-and-anonymous-classes/97637 "2006-07-08T23:59:13Z")

</div>

Hmmm… odd I wrote a version of this last night but it would appear that I failed to post it to the forum, doh! so here it goes again. If it did get out and this is a duplicate then please accept my apologies for the …

---

## [Definition of methods: self](https://www.ruby-forum.com/t/definition-of-methods-self/97635)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 11:15pm UTC](https://www.ruby-forum.com/t/definition-of-methods-self/97635 "2006-07-08T23:15:25Z")

</div>

In Why’s poignant guide to Ruby some examples appear where he defines a class “class LotteryTicket”, and then he defines a method “def self.new\_random”, or “def LotteryDraw.buy(…)”; that is, before the name of the met…

---

## [\- Combobox reading out current item](https://www.ruby-forum.com/t/combobox-reading-out-current-item/97629)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 8, 2006, 10:36pm UTC](https://www.ruby-forum.com/t/combobox-reading-out-current-item/97629 "2006-07-08T22:36:07Z")

</div>

Dear all, I’d like to read out the current item of a combobox. In the documentation about FOX, there’s a promise that for some developer version 1.5.x, it’s possible to access FXCombobox using SEL\_CHANGED I’m using …

---

## [Easy Pathname](https://www.ruby-forum.com/t/easy-pathname/97425)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 19\
**Last updated:** [July 8, 2006, 10:08pm UTC](https://www.ruby-forum.com/t/easy-pathname/97425 "2006-07-08T22:08:18Z")

</div>

I find myself always using File.join, and never utilizing Pathname b/c it’s not as convenient to construct. This snippet occured to me to make it more paletable: class String def /(dir) Pathname.new( File.join(self,…

---

## [Alternative to the Symbol#to\_proc hack](https://www.ruby-forum.com/t/alternative-to-the-symbol-to-proc-hack/97631)

<div class="topic-metadata">

**Author:** [@Ashley\_M](https://www.ruby-forum.com/u/Ashley_M)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/alternative-to-the-symbol-to-proc-hack/97631 "2006-07-08T21:42:39Z")

</div>

I’ve always been in two minds about the Symbol#to\_proc hack, it’s clever but adds a bit of line noise. Then I figured you can turn it around: class String def everything\_in(e) e.map { |u| u.send(self) } end end …

---

## [Algorithm searched](https://www.ruby-forum.com/t/algorithm-searched/97619)

<div class="topic-metadata">

**Author:** [@Meino\_Christian\_C](https://www.ruby-forum.com/u/Meino_Christian_C)\
**Replies:** 4\
**Last updated:** [July 8, 2006, 9:42pm UTC](https://www.ruby-forum.com/t/algorithm-searched/97619 "2006-07-08T21:42:30Z")

</div>

Hi, I was thinking of a “problem” I have: On my harddisc there are several recording of broadcasts made with my DVB-T receiver. Let it be an amount of 20 or so. Each recording is about 1.2GB - 3.5GB in size. An DVD …

---

## [Rescuing exceptions with "redo"](https://www.ruby-forum.com/t/rescuing-exceptions-with-redo/97632)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/rescuing-exceptions-with-redo/97632 "2006-07-08T21:37:14Z")

</div>

Hi aaall, I have a code like this (from Why’s (poignant) guide to Ruby, in http://poignantguide.net/ruby/chapter-5.html#section5): class LotteryTicket NUMERIC\_RANGE = 1…25 attr\_reader :picks def initialize( \*picks…

---

## [String#starts\_with?](https://www.ruby-forum.com/t/string-starts-with/97620)

<div class="topic-metadata">

**Author:** [@Martin\_DeMello](https://www.ruby-forum.com/u/Martin_DeMello)\
**Replies:** 4\
**Last updated:** [July 8, 2006, 9:32pm UTC](https://www.ruby-forum.com/t/string-starts-with/97620 "2006-07-08T21:32:14Z")

</div>

Has anyone run tests to see what the fastest way to do a String#starts\_with?(otherstring) is? I’ll need this in an inner loop, so it’s worth squeezing out the few drops of extra speed. martin

---

## [Re: String#starts\_with?](https://www.ruby-forum.com/t/re-string-starts-with/102962)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 8, 2006, 9:28pm UTC](https://www.ruby-forum.com/t/re-string-starts-with/102962 "2006-07-08T21:28:20Z")

</div>

String#index should be the fastest thanks. any suggestions for #ends\_with? If the above is correct, String#rindex. Best regards, Axel

---

## [Re: String#starts\_with?](https://www.ruby-forum.com/t/re-string-starts-with/97627)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 9:21pm UTC](https://www.ruby-forum.com/t/re-string-starts-with/97627 "2006-07-08T21:21:48Z")

</div>

String#index should be the fastest thanks. any suggestions for #ends\_with? If the above is correct, String#rindex. Best regards, Axel

---

## [Method lookup weirdness](https://www.ruby-forum.com/t/method-lookup-weirdness/97626)

<div class="topic-metadata">

**Author:** [@Ilmari\_H](https://www.ruby-forum.com/u/Ilmari_H)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 9:18pm UTC](https://www.ruby-forum.com/t/method-lookup-weirdness/97626 "2006-07-08T21:18:03Z")

</div>

Hi, I’m a bit mystified by the following: Strange module Foo extend self def bar; ‘bar’ end end Foo.bar module Foo remove\_method :bar end Foo.bar =\> ‘bar’ # eh? Normal module Bar extend self def foo; ‘foo’…

---

## [Re: debugging proposal](https://www.ruby-forum.com/t/re-debugging-proposal/97306)

<div class="topic-metadata">

**Author:** [@fangheuschrecke](https://www.ruby-forum.com/u/fangheuschrecke)\
**Replies:** 3\
**Last updated:** [July 8, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/re-debugging-proposal/97306 "2006-07-08T21:02:01Z")

</div>

Thanks! Somehow I did not spot this… I’ll give it another go then. Cheers, Max

---

## [Re: Algorithm searched](https://www.ruby-forum.com/t/re-algorithm-searched/97624)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 8:52pm UTC](https://www.ruby-forum.com/t/re-algorithm-searched/97624 "2006-07-08T20:52:52Z")

</div>

Dear Meino, Thank you very much for the links and hints ! New item on my TODO-list: Learn better English (at least for the names of algorithms’n’problems :wink: That’s what mailing lists are for : let other peopl…

---

## [Re: Algorithm searched](https://www.ruby-forum.com/t/re-algorithm-searched/97625)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 8, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/re-algorithm-searched/97625 "2006-07-08T20:46:22Z")

</div>

Dear Meino, doing some googling gives this Ruby implemention for solving the knapsack problem (stuffing m items into n with cost/storage constraints): \_http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/17…

---

## [Rexml: replace several text nodes by a single one](https://www.ruby-forum.com/t/rexml-replace-several-text-nodes-by-a-single-one/97601)

<div class="topic-metadata">

**Author:** [@pete](https://www.ruby-forum.com/u/pete)\
**Replies:** 2\
**Last updated:** [July 8, 2006, 7:27pm UTC](https://www.ruby-forum.com/t/rexml-replace-several-text-nodes-by-a-single-one/97601 "2006-07-08T19:27:30Z")

</div>

Hi, this sounds simple but I just don’t get it… I want to replace the text child nodes of an REXML::Element by a new, single text node… In order to do that, I want to remove any previous text nodes first require ‘r…

---

## [Equipment (for Camping) v0.1.0](https://www.ruby-forum.com/t/equipment-for-camping-v0-1-0/97602)

<div class="topic-metadata">

**Author:** [@zenzei](https://www.ruby-forum.com/u/zenzei)\
**Replies:** 0\
**Last updated:** [July 8, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/equipment-for-camping-v0-1-0/97602 "2006-07-08T18:53:39Z")

</div>

Hello ! I’m happy to release my first library in the ruby world ! Equipment is a Camping (the 4k framework) extensions library. It adds various utilities that you may find useful for your apps. It also puts some thin…

---

## [Hpricot 0.1 -- quick, cinchy HTML parsing](https://www.ruby-forum.com/t/hpricot-0-1-quick-cinchy-html-parsing/97009)

<div class="topic-metadata">

**Author:** [@why\_the\_lucky\_stiff](https://www.ruby-forum.com/u/why_the_lucky_stiff)\
**Replies:** 4\
**Last updated:** [July 8, 2006, 6:35pm UTC](https://www.ruby-forum.com/t/hpricot-0-1-quick-cinchy-html-parsing/97009 "2006-07-08T18:35:58Z")

</div>

Associates worldwide, here is some unpolished software for you. You’ll need a compiler to install this one and the \`iconv’ library installed. gem install hpricot --source code.whytheluckystiff.net Hpricot is a fast …

[Previous page](https://www.ruby-forum.com/c/ruby/7.md?page=1754)

[Next page](https://www.ruby-forum.com/c/ruby/7.md?page=1756)
