# Ruby

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

[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:** 1914

---

## [Re: Making a count of unique elements in an array](https://www.ruby-forum.com/t/re-making-a-count-of-unique-elements-in-an-array/51917)

<div class="topic-metadata">

**Author:** [@PeSSSSaS\_Botp](https://www.ruby-forum.com/u/PeSSSSaS_Botp)\
**Replies:** 0\
**Last updated:** [January 9, 2006, 8:09am UTC](https://www.ruby-forum.com/t/re-making-a-count-of-unique-elements-in-an-array/51917 "2006-01-09T08:09:25Z")

</div>

Dan K. \[mailto:removed\_email\_address@domain.invalid\] wrote: #counter = {} #arr.each {|e| counter\[e\] += 1 rescue counter\[e\] = 1 } #p counter.to\_a me, like the above but w slight modif below: irb(main):013:0\> counter2…

---

## [Phoenix Ruby Users Group January meeting reminder](https://www.ruby-forum.com/t/phoenix-ruby-users-group-january-meeting-reminder/51915)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [January 9, 2006, 7:54am UTC](https://www.ruby-forum.com/t/phoenix-ruby-users-group-january-meeting-reminder/51915 "2006-01-09T07:54:21Z")

</div>

Monday, Jan 9, 6:15 PM at Cyclone Commerce. Details are on the Refresh Phoenix wiki James B. – http://www.ruby-doc.org - Ruby Help & Documentation Ruby Code & Style - Ruby Code & Style: Writers wanted http:…

---

## [Red Letter: The Ruby Journal site takes shape, accepting pro](https://www.ruby-forum.com/t/red-letter-the-ruby-journal-site-takes-shape-accepting-pro/60407)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 9, 2006, 3:55am UTC](https://www.ruby-forum.com/t/red-letter-the-ruby-journal-site-takes-shape-accepting-pro/60407 "2006-01-09T03:55:46Z")

</div>

After a brief hiatus over the winter holidays, Red Letter: The Ruby Journal is again making progress towards issue #1. You can visit the journal’s initial web site at http:// redletter.therubyjournal.com. Click on the…

---

## [Adding a method to a single object](https://www.ruby-forum.com/t/adding-a-method-to-a-single-object/51903)

<div class="topic-metadata">

**Author:** [@Marco\_Lange](https://www.ruby-forum.com/u/Marco_Lange)\
**Replies:** 1\
**Last updated:** [January 9, 2006, 3:22am UTC](https://www.ruby-forum.com/t/adding-a-method-to-a-single-object/51903 "2006-01-09T03:22:36Z")

</div>

Hi, how is it possible to add a method to a single object programatically? E.g. I want to write a method class Object def rename\_method(old\_id, new\_id) … end end The method shall rename a method for a specific in…

---

## [Passing a hash of args](https://www.ruby-forum.com/t/passing-a-hash-of-args/51896)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 8\
**Last updated:** [January 9, 2006, 2:28am UTC](https://www.ruby-forum.com/t/passing-a-hash-of-args/51896 "2006-01-09T02:28:25Z")

</div>

Is there a way to pass each item is a hash as a successive argument to a function? ie: time = { :year =\> 2003 :month =\> 03 :day =\> 24 } Time.local(time) (that wouldn’t work but you get the idea) Cheers

---

## [Dice Roller](https://www.ruby-forum.com/t/dice-roller/94765)

<div class="topic-metadata">

**Author:** [@Stefan\_W](https://www.ruby-forum.com/u/Stefan_W)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 11:57pm UTC](https://www.ruby-forum.com/t/dice-roller/94765 "2006-01-08T23:57:34Z")

</div>

Hi, here is my solution… I don’t know if it handles every case right, but it was fun to write… :wink: By the way, does someone of you know what became of rockit http://rockit.sourceforge.net/ - it would’ve been very h…

---

## [Dice Roller (#61)](https://www.ruby-forum.com/t/dice-roller-61/94767)

<div class="topic-metadata">

**Author:** [@John\_Earles](https://www.ruby-forum.com/u/John_Earles)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 11:00pm UTC](https://www.ruby-forum.com/t/dice-roller-61/94767 "2006-01-08T23:00:09Z")

</div>

Hi! This is my first entry to a RUBY-QUIZ. Sure I could have opted to use ‘eval’, but I figured I might as well learn a little about expression parsing. Fun stuff! My entry is focused around The Shunting Yard Algo…

---

## [DRb troubles, cannot Marshal or proxy objects successfully](https://www.ruby-forum.com/t/drb-troubles-cannot-marshal-or-proxy-objects-successfully/51891)

<div class="topic-metadata">

**Author:** [@seanwarburton](https://www.ruby-forum.com/u/seanwarburton)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/drb-troubles-cannot-marshal-or-proxy-objects-successfully/51891 "2006-01-08T20:53:31Z")

</div>

I’ve been trying for hours trying ot get my DRb session store working. I can get it to work in a gerneralized way, but I need to add some validation to check the state of the session data, and keep track of it, in cas…

---

## [Problem with dbtalk](https://www.ruby-forum.com/t/problem-with-dbtalk/51882)

<div class="topic-metadata">

**Author:** [@mohsena](https://www.ruby-forum.com/u/mohsena)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 6:13pm UTC](https://www.ruby-forum.com/t/problem-with-dbtalk/51882 "2006-01-08T18:13:29Z")

</div>

Hello I tried to do one of the prepared ruby applicaton name dbtalk07 inserted in http://www.insula.cz/dbtalk/ when I open the zip ,one of the files "toybase.sql " that is a script will be used by mysql that make the …

---

## [Re: Is Ruby RAILS really suitable for modern Web Development](https://www.ruby-forum.com/t/re-is-ruby-rails-really-suitable-for-modern-web-development/51872)

<div class="topic-metadata">

**Author:** [@sgware](https://www.ruby-forum.com/u/sgware)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/re-is-ruby-rails-really-suitable-for-modern-web-development/51872 "2006-01-08T15:48:03Z")

</div>

Hi Jules, Thanks for your message about Ruby on Rails. I think you’ll find that you’re likely to get a quicker and more accurate response to your message on the Ruby on Rails specific mailing list. For subscription …

---

## [Re: Is Ruby RAILS really suitable for modern Web Development](https://www.ruby-forum.com/t/re-is-ruby-rails-really-suitable-for-modern-web-development/102194)

<div class="topic-metadata">

**Author:** [@sgware](https://www.ruby-forum.com/u/sgware)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/re-is-ruby-rails-really-suitable-for-modern-web-development/102194 "2006-01-08T15:48:03Z")

</div>

Hi Jules, Thanks for your message about Ruby on Rails. I think you’ll find that you’re likely to get a quicker and more accurate response to your message on the Ruby on Rails specific mailing list. For subscription …

---

## [QtRuby/smoke make don't find headers](https://www.ruby-forum.com/t/qtruby-smoke-make-dont-find-headers/94731)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 8, 2006, 2:38pm UTC](https://www.ruby-forum.com/t/qtruby-smoke-make-dont-find-headers/94731 "2006-01-08T14:38:10Z")

</div>

I’m under way to install QTruby but i’m stuck at smoke / make level. First, i did install using darwinports then, i’ve tried to compile either qtruby-1.0.9 or qtruby-1.0.11) I’ve this .configure : …/configure --enabl…

---

## [Geography/Map Classes?](https://www.ruby-forum.com/t/geography-map-classes/51843)

<div class="topic-metadata">

**Author:** [@Landon](https://www.ruby-forum.com/u/Landon)\
**Replies:** 1\
**Last updated:** [January 8, 2006, 2:26pm UTC](https://www.ruby-forum.com/t/geography-map-classes/51843 "2006-01-08T14:26:07Z")

</div>

Hello, I’m still very new to Ruby, however am growing to like the language more and more as I use it. Presently, I’m looking for some classes(I’m used to java, sorry, not sure what you’d call them in Ruby) that can m…

---

## [Demystifying Symbols](https://www.ruby-forum.com/t/demystifying-symbols/51653)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 23\
**Last updated:** [January 8, 2006, 9:11am UTC](https://www.ruby-forum.com/t/demystifying-symbols/51653 "2006-01-08T09:11:26Z")

</div>

I was actually doing really well until the strange discussion involving throwing constants into the mix showed up, so I’m ignoring that. Steve’s Newby Guide was excellent, if overly-complicated. Extremely useful item …

---

## [How do you sort a text file?](https://www.ruby-forum.com/t/how-do-you-sort-a-text-file/51683)

<div class="topic-metadata">

**Author:** [@dannyabc](https://www.ruby-forum.com/u/dannyabc)\
**Replies:** 14\
**Last updated:** [January 8, 2006, 9:11am UTC](https://www.ruby-forum.com/t/how-do-you-sort-a-text-file/51683 "2006-01-08T09:11:26Z")

</div>

I’m new to Ruby and was wondering how to sort a text file? With UNIX scripts, I just use “cat input.txt | sort \> output.txt”.

---

## [Newbie question (Array.\<\<)](https://www.ruby-forum.com/t/newbie-question-array/51841)

<div class="topic-metadata">

**Author:** [@toadkicker](https://www.ruby-forum.com/u/toadkicker)\
**Replies:** 2\
**Last updated:** [January 8, 2006, 5:56am UTC](https://www.ruby-forum.com/t/newbie-question-array/51841 "2006-01-08T05:56:55Z")

</div>

I must be missing something… I’ve got the following class method. The problem is the line that reads objs \<\< self.new(obj). The first time through the loop, the objs array looks correct. After the second iteration ho…

---

## [Ruby after the tutorial](https://www.ruby-forum.com/t/ruby-after-the-tutorial/51839)

<div class="topic-metadata">

**Author:** [@Daren](https://www.ruby-forum.com/u/Daren)\
**Replies:** 2\
**Last updated:** [January 8, 2006, 5:20am UTC](https://www.ruby-forum.com/t/ruby-after-the-tutorial/51839 "2006-01-08T05:20:51Z")

</div>

I am a PHP developer and have just begun to investigate Ruby. I have looked through the online Pickaxe book and Why’s Poignant guide, but I’m anxious to get started programming with it. Unfortunately, I’m pretty sho…

---

## [Proposed new rule](https://www.ruby-forum.com/t/proposed-new-rule/89142)

<div class="topic-metadata">

**Author:** [@warren\_b](https://www.ruby-forum.com/u/warren_b)\
**Replies:** 39\
**Last updated:** [January 8, 2006, 1:50am UTC](https://www.ruby-forum.com/t/proposed-new-rule/89142 "2006-01-08T01:50:25Z")

</div>

Enjoy! I'd like to propose a new rule (1.5?): Please flag all submissions and discussions of quizzes by starting the subject with the string “\[QUIZ\]”. I really enjoy following the discussions of the different quiz…

---

## [Sippet needed to convert from a string](https://www.ruby-forum.com/t/sippet-needed-to-convert-from-a-string/51787)

<div class="topic-metadata">

**Author:** [@tomrobinson](https://www.ruby-forum.com/u/tomrobinson)\
**Replies:** 3\
**Last updated:** [January 7, 2006, 11:38pm UTC](https://www.ruby-forum.com/t/sippet-needed-to-convert-from-a-string/51787 "2006-01-07T23:38:05Z")

</div>

Snippit needed given some option variables c1 = 0 c2 = 0 c3 = 0 c4 = 0 given a string (a set of pairs of options) which could be read from MYSQL or a file paramString = ‘“c1” 0 “c3” 1 “c2” “y” “c4” “v”’ such th…

---

## [Is it possible to create a GUI/TUI toolkit using ruby?](https://www.ruby-forum.com/t/is-it-possible-to-create-a-gui-tui-toolkit-using-ruby/56350)

<div class="topic-metadata">

**Author:** [@simonh](https://www.ruby-forum.com/u/simonh)\
**Replies:** 8\
**Last updated:** [January 7, 2006, 10:28pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-create-a-gui-tui-toolkit-using-ruby/56350 "2006-01-07T22:28:36Z")

</div>

this may be a daft question, but is it possible to create a widget toolkit using a scripting language? I know that most are written in C / C++ (QT, fox, wx), also ncurses for terminal interfaces. Therefore, is it impo…

---

## [Plist parser for ruby](https://www.ruby-forum.com/t/plist-parser-for-ruby/51823)

<div class="topic-metadata">

**Author:** [@p\_morrow](https://www.ruby-forum.com/u/p_morrow)\
**Replies:** 0\
**Last updated:** [January 7, 2006, 8:24pm UTC](https://www.ruby-forum.com/t/plist-parser-for-ruby/51823 "2006-01-07T20:24:58Z")

</div>

Hello, I’ve thrown together a plist.xml parser for ruby: http://www.narf-lib.org/2006/01/plistxml-parser-for-ruby.html The method Plist.parse\_xml( filename ) returns a plist file as a tree of Hash / Array / String /…

---

## [RMagick exporting pixels as string](https://www.ruby-forum.com/t/rmagick-exporting-pixels-as-string/51814)

<div class="topic-metadata">

**Author:** [@Ilmari\_H](https://www.ruby-forum.com/u/Ilmari_H)\
**Replies:** 3\
**Last updated:** [January 7, 2006, 3:05pm UTC](https://www.ruby-forum.com/t/rmagick-exporting-pixels-as-string/51814 "2006-01-07T15:05:19Z")

</div>

Hi, I’m exporting pixels to an OpenGL texture from Magick::Image using export\_pixels. The problem is that it’s slow. 5.5 seconds for a 330x370 image -slow. Is there a faster way to do this: image.export\_pixels(0,0,…

---

## [Confirmation required - initialising](https://www.ruby-forum.com/t/confirmation-required-initialising/59739)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 8\
**Last updated:** [January 7, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/confirmation-required-initialising/59739 "2006-01-07T13:56:08Z")

</div>

Is i) and ii) just two different methods for initialising? i) class Song attr\_reader :name, :artist, : end ii) def initialize(foo, blah, haha) @foo = foo @blah = blah @haha = haha end

---

## [Using irb](https://www.ruby-forum.com/t/using-irb/89620)

<div class="topic-metadata">

**Author:** [@jmaenpaa](https://www.ruby-forum.com/u/jmaenpaa)\
**Replies:** 13\
**Last updated:** [January 7, 2006, 1:37pm UTC](https://www.ruby-forum.com/t/using-irb/89620 "2006-01-07T13:37:07Z")

</div>

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

---

## [Initialization using the Singleton design pattern](https://www.ruby-forum.com/t/initialization-using-the-singleton-design-pattern/56285)

<div class="topic-metadata">

**Author:** [@johanatan](https://www.ruby-forum.com/u/johanatan)\
**Replies:** 3\
**Last updated:** [January 7, 2006, 1:37pm UTC](https://www.ruby-forum.com/t/initialization-using-the-singleton-design-pattern/56285 "2006-01-07T13:37:06Z")

</div>

Hi, I have a singleton class, as in one that does “include Singleton”. I want to run a few methods when the instance is created. Usually one would do that in initialize(), but obviously I can’t do that here. This is …

---

## [Default block parameter?](https://www.ruby-forum.com/t/default-block-parameter/51645)

<div class="topic-metadata">

**Author:** [@Mark\_J.Reed](https://www.ruby-forum.com/u/Mark_J.Reed)\
**Replies:** 6\
**Last updated:** [January 7, 2006, 1:37pm UTC](https://www.ruby-forum.com/t/default-block-parameter/51645 "2006-01-07T13:37:03Z")

</div>

Okay, this is probably a dumb question, but how do I declare an optional block parameter with a default value? I tried several variations on this basic theme: def meth(&block = lambda { |i| ... }) ... end …

---

## [About The Pickaxe 2nd ed. and Ruby 2](https://www.ruby-forum.com/t/about-the-pickaxe-2nd-ed-and-ruby-2/51654)

<div class="topic-metadata">

**Author:** [@Surgeon](https://www.ruby-forum.com/u/Surgeon)\
**Replies:** 3\
**Last updated:** [January 7, 2006, 9:11am UTC](https://www.ruby-forum.com/t/about-the-pickaxe-2nd-ed-and-ruby-2/51654 "2006-01-07T09:11:23Z")

</div>

Hi, I have just ordered the Pickaxe 2nd ed. from Amazon. But now I am thinking that in a near future Ruby 2 will be released and this wondeful book is on Ruby 1.8. Well, what will happen then? Will it be “démodé”?

---

## [Ruby install conflict and ruby-dbi-all on debian 3.1](https://www.ruby-forum.com/t/ruby-install-conflict-and-ruby-dbi-all-on-debian-3-1/51810)

<div class="topic-metadata">

**Author:** [@bill](https://www.ruby-forum.com/u/bill)\
**Replies:** 0\
**Last updated:** [January 7, 2006, 9:08am UTC](https://www.ruby-forum.com/t/ruby-install-conflict-and-ruby-dbi-all-on-debian-3-1/51810 "2006-01-07T09:08:23Z")

</div>

Hi there, I am running debian 3.1(sarge, I think). I need to be able to connect to mysql, Postgres & Oracle. I can connect to postgres & Mysql but Oracle (to a remote host) is proving a pain. Following problems and …

---

## [Problem Connecting to Oracle](https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792)

<div class="topic-metadata">

**Author:** [@mcarlson](https://www.ruby-forum.com/u/mcarlson)\
**Replies:** 1\
**Last updated:** [January 7, 2006, 7:56am UTC](https://www.ruby-forum.com/t/problem-connecting-to-oracle/51792 "2006-01-07T07:56:22Z")

</div>

Howdy, I’m hoping someone can assist me with a problem I’m having connecting to a remote Oracle database. Details: Running windows 2000. Have Oracle 92 client installed. The install was successful, as I’m able to …

---

## [Oniguruma lookbehind question](https://www.ruby-forum.com/t/oniguruma-lookbehind-question/94639)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 10\
**Last updated:** [January 7, 2006, 5:29am UTC](https://www.ruby-forum.com/t/oniguruma-lookbehind-question/94639 "2006-01-07T05:29:00Z")

</div>

Hi – For some reason, lookbehind and alternation seem not to be playing together in a little Oniguruma test. This is based on the string splitting thread from a little while ago this evening, and uses a CVS 1.9.0 Ru…

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

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