# Ruby

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

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

---

## [Bracket Packing (#78)](https://www.ruby-forum.com/t/bracket-packing-78/94703)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 4:03pm UTC](https://www.ruby-forum.com/t/bracket-packing-78/94703 "2006-05-11T16:03:28Z")

</div>

As I’m sure you have noticed by now, this was a very popular quiz. The problem gave two options for solutions and I’m glad to see that we had a fair number of both. Let’s examine a couple of checkers and one correc…

---

## [Installing mysql for ruby purposes (windows)](https://www.ruby-forum.com/t/installing-mysql-for-ruby-purposes-windows/59627)

<div class="topic-metadata">

**Author:** [@bfsog](https://www.ruby-forum.com/u/bfsog)\
**Replies:** 4\
**Last updated:** [May 11, 2006, 1:17pm UTC](https://www.ruby-forum.com/t/installing-mysql-for-ruby-purposes-windows/59627 "2006-05-11T13:17:27Z")

</div>

I have Ruby version 1.8.4 on XP SP 2. I installed Mysql Server 5.0.2 - this worked fine. I then tried some code like require “mysql” That code failed, I searched and found I have to run extconf.rb My question is, ac…

---

## [Re: A more elegant way to do this?](https://www.ruby-forum.com/t/re-a-more-elegant-way-to-do-this/60219)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 12:17pm UTC](https://www.ruby-forum.com/t/re-a-more-elegant-way-to-do-this/60219 "2006-05-11T12:17:29Z")

</div>

} end #Unless } end #unless use (value||\[\]), ie: (conf\['hosts'\]\[hostname\]\['groups'\]||\[\]).each { |group| (conf\['crontables'\]\[group\]||\[\]).each { | tab\_item| tab\_entries \<\< tab\_item } }

---

## [Strtod in 1.8.4 stable snapshot](https://www.ruby-forum.com/t/strtod-in-1-8-4-stable-snapshot/59829)

<div class="topic-metadata">

**Author:** [@Shin-ichiro\_HARA](https://www.ruby-forum.com/u/Shin-ichiro_HARA)\
**Replies:** 6\
**Last updated:** [May 11, 2006, 11:16am UTC](https://www.ruby-forum.com/t/strtod-in-1-8-4-stable-snapshot/59829 "2006-05-11T11:16:12Z")

</div>

¸¶¤Ç¤¹¡£ \[ruby-dev:28609\]¤Ç1.8.4 stable snapshot¤Îsample/test.rb ¤Ç¥¨¥é¡¼¤¬½Ð¤ë¤È¸À¤¤¤Þ¤·¤¬¡¢¤Þ¤À¼ã´³»Ä¤Ã¤Æ¤¤¤Þ¤¹(1207¹ÔÌÜ)¡£ 1.9.0 ¤Îutil.c¤Îstrtod¤ò¤½¤Î¤Þ¤Þ»ý¤Ã¤ÆÍè¤ë¤ï¤±¤Ë¤Ï¤¤¤«¤Ê¤¤¤ó¤Ç¤·¤ç¤¦¤«¡£

---

## [Creating a method like Array(object)](https://www.ruby-forum.com/t/creating-a-method-like-array-object/60225)

<div class="topic-metadata">

**Author:** [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 10:06am UTC](https://www.ruby-forum.com/t/creating-a-method-like-array-object/60225 "2006-05-11T10:06:19Z")

</div>

Hi all, Array has a nice feature where it can take an object and return an array containing the object (or if the object is an Array returns the object unchanged. So Array(1) is \[1\] but Array(\[1,2,3\]) returns \[1,2,3\]…

---

## [Re: Compiler for Ruby](https://www.ruby-forum.com/t/re-compiler-for-ruby/94660)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 2\
**Last updated:** [May 11, 2006, 9:41am UTC](https://www.ruby-forum.com/t/re-compiler-for-ruby/94660 "2006-05-11T09:41:45Z")

</div>

Thanks for the links. After reviewing several web pages, I have a few more questions at this time. Can YARV be used to speed up Ruby 1.84 programs for Windows? Is YARV on a separate track from Rite, or an integral p…

---

## [Thanks Ruby Quiz!](https://www.ruby-forum.com/t/thanks-ruby-quiz/94659)

<div class="topic-metadata">

**Author:** [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Replies:** 14\
**Last updated:** [May 11, 2006, 9:11am UTC](https://www.ruby-forum.com/t/thanks-ruby-quiz/94659 "2006-05-11T09:11:14Z")

</div>

The Rails Plugin is a direct result of the ruby quiz. I just wanted to say thanks to Ruby Q. and Mathew Ross for his solution. = numbersToWords - convert your integers and floats to english or japaneese words,or tran…

---

## [Re: A more elegant way to do this?](https://www.ruby-forum.com/t/re-a-more-elegant-way-to-do-this/94693)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 8:19am UTC](https://www.ruby-forum.com/t/re-a-more-elegant-way-to-do-this/94693 "2006-05-11T08:19:33Z")

</div>

Array() will do the job: Array(nil) =\> \[\] Array(\[1,2,3\]) =\> \[1, 2, 3\] Array(1) =\> \[1\] In your case: Array(conf\[‘hosts’\]\[hostname\]\[‘groups’\]).each { … } Gennady.

---

## [Ossl\_cipher.c:124: warning: control reaches end of non-void](https://www.ruby-forum.com/t/ossl-cipher-c-warning-control-reaches-end-of-non-void/60208)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 1\
**Last updated:** [May 11, 2006, 5:11am UTC](https://www.ruby-forum.com/t/ossl-cipher-c-warning-control-reaches-end-of-non-void/60208 "2006-05-11T05:11:39Z")

</div>

e$B$U$H!"$R$H$D7Y9p$,A}$($F$$$k$3$H$K5$$,$D$-$^$7$?!#e(B http://www.rubyist.net/~akr/chkbuild/debian-sarge/ruby-trunk/summary.html e$B%m%0$rHf3S$7$F$\_$?$i!"e(B gcc -fPIC -Wall -Wno-parentheses -g -O2 -DRUBY\_GC\_STRESS …

---

## [Ruby documentation discovery](https://www.ruby-forum.com/t/ruby-documentation-discovery/60085)

<div class="topic-metadata">

**Author:** [@John\_Conrad](https://www.ruby-forum.com/u/John_Conrad)\
**Replies:** 18\
**Last updated:** [May 11, 2006, 3:00am UTC](https://www.ruby-forum.com/t/ruby-documentation-discovery/60085 "2006-05-11T03:00:35Z")

</div>

I spent the day trying to grok the examples in xmpp4r (xmpp/jabber library for ruby; http://home.gna.org/xmpp4r/), and I ran up against a problem that I’ve had many times before, but haven’t found a good solution to …

---

## [Simple newbie question](https://www.ruby-forum.com/t/simple-newbie-question/94686)

<div class="topic-metadata">

**Author:** [@bob](https://www.ruby-forum.com/u/bob)\
**Replies:** 3\
**Last updated:** [May 11, 2006, 2:33am UTC](https://www.ruby-forum.com/t/simple-newbie-question/94686 "2006-05-11T02:33:45Z")

</div>

Hi, I’m just starting Ruby and theres something I’m sure is very simple but I just cant get it work. Its an exercise in Chris P.'s tutorial. The question is: Write a program which asks for a person’s favorite number. …

---

## [Changing the type of a variable](https://www.ruby-forum.com/t/changing-the-type-of-a-variable/60169)

<div class="topic-metadata">

**Author:** [@demallien](https://www.ruby-forum.com/u/demallien)\
**Replies:** 4\
**Last updated:** [May 11, 2006, 2:33am UTC](https://www.ruby-forum.com/t/changing-the-type-of-a-variable/60169 "2006-05-11T02:33:09Z")

</div>

Hi, I’m a ruby newbie, although I’m a programmer with 10yrs experience. I was running myself through the tutorial in Agile Web D. With Rails, when I ran into a problem. somewhere in the code I mistakenly entered @…

---

## [Re: Thanks Ruby Quiz!](https://www.ruby-forum.com/t/re-thanks-ruby-quiz/60180)

<div class="topic-metadata">

**Author:** [@DebaunS\_Steve\_SSemi](https://www.ruby-forum.com/u/DebaunS_Steve_SSemi)\
**Replies:** 4\
**Last updated:** [May 11, 2006, 1:31am UTC](https://www.ruby-forum.com/t/re-thanks-ruby-quiz/60180 "2006-05-11T01:31:39Z")

</div>

123.to\_slang == “a franklin, a jackson, three washingtons, and some jingle”

---

## [Metaprogramming resources and metaprogramming formalisms](https://www.ruby-forum.com/t/metaprogramming-resources-and-metaprogramming-formalisms/60189)

<div class="topic-metadata">

**Author:** [@chiaroscuro](https://www.ruby-forum.com/u/chiaroscuro)\
**Replies:** 0\
**Last updated:** [May 11, 2006, 12:33am UTC](https://www.ruby-forum.com/t/metaprogramming-resources-and-metaprogramming-formalisms/60189 "2006-05-11T00:33:43Z")

</div>

Hi, I am putting together resources for metaprogramming in ruby and I am looking for material. When I have enough material I intend to put it together both as a booklet (The Way of Meta) and a metaprogramming resourc…

---

## [How to matching "\[" in string](https://www.ruby-forum.com/t/how-to-matching-in-string/60185)

<div class="topic-metadata">

**Author:** [@sed\_nivo](https://www.ruby-forum.com/u/sed_nivo)\
**Replies:** 3\
**Last updated:** [May 10, 2006, 11:45pm UTC](https://www.ruby-forum.com/t/how-to-matching-in-string/60185 "2006-05-10T23:45:14Z")

</div>

Hi, How to matching “\[” in string with regular expressions? “\[” =~ /\[/ – don’t work.

---

## [Doesnt work](https://www.ruby-forum.com/t/doesnt-work/94559)

<div class="topic-metadata">

**Author:** [@corey](https://www.ruby-forum.com/u/corey)\
**Replies:** 4\
**Last updated:** [May 10, 2006, 11:44pm UTC](https://www.ruby-forum.com/t/doesnt-work/94559 "2006-05-10T23:44:34Z")

</div>

Hello i just started learing ruby tonight but the first little code example from the book doesnt work. It creates a ruby file and when i click on the ruby file a cmd window opens up and shows me the first line "Say so…

---

## [Re: Asserts in aggregate objects called by a Test::Unit::Tes](https://www.ruby-forum.com/t/re-asserts-in-aggregate-objects-called-by-a-test-tes/94684)

<div class="topic-metadata">

**Author:** [@Andrew\_Tanner](https://www.ruby-forum.com/u/Andrew_Tanner)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 11:28pm UTC](https://www.ruby-forum.com/t/re-asserts-in-aggregate-objects-called-by-a-test-tes/94684 "2006-05-10T23:28:32Z")

</div>

Thanks for the response Eric. I looked up add\_assert but it didn’t really help that much since the aggregate object (SubAssertObj) is in a diff context then the original TestStuff testcase. However I did do something …

---

## [Garbage-collection question OR ruby-gnome bug?](https://www.ruby-forum.com/t/garbage-collection-question-or-ruby-gnome-bug/60099)

<div class="topic-metadata">

**Author:** [@cam](https://www.ruby-forum.com/u/cam)\
**Replies:** 2\
**Last updated:** [May 10, 2006, 9:44pm UTC](https://www.ruby-forum.com/t/garbage-collection-question-or-ruby-gnome-bug/60099 "2006-05-10T21:44:09Z")

</div>

Hi, My friend and I have been writing an application that makes extensive use of gdkpixbuf’s, but they never get de-allocated. I’m not entirely sure how the garbage-collector works internally in ruby, but my program…

---

## [Re: changing the type of a variable](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94679)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94679 "2006-05-10T21:43:49Z")

</div>

Then you may benefit great deal (and enjoy it, actually) from becoming more comfortable with Ruby itself. Pickaxe (Programming Ruby, Second edition) is you best friend here ;-). Gennady.

---

## [Re: changing the type of a variable](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94676)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 4\
**Last updated:** [May 10, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94676 "2006-05-10T21:40:43Z")

</div>

You may need to restart your Rails application so that your changes may be picked up. Gennady.

---

## [Re: changing the type of a variable](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94678)

<div class="topic-metadata">

**Author:** [@Gennady\_B](https://www.ruby-forum.com/u/Gennady_B)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 9:31pm UTC](https://www.ruby-forum.com/t/re-changing-the-type-of-a-variable/94678 "2006-05-10T21:31:27Z")

</div>

That’s it. If it still complains, make sure that you changed it in the right/all place(s). Puts some messages around the code to make sure that the problem is really in between those messages. You can also use @items.…

---

## [Newbie question about initialize methods in subclasses](https://www.ruby-forum.com/t/newbie-question-about-initialize-methods-in-subclasses/94673)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 2\
**Last updated:** [May 10, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/newbie-question-about-initialize-methods-in-subclasses/94673 "2006-05-10T19:38:04Z")

</div>

All, I just seem to have had a revelation about how the super keyword in Ruby is ever so slightly different from the super keyword in Java. In general, given class B \< A and desiring to add an initialize method to B…

---

## [New\_haven.rb meeting tonight!](https://www.ruby-forum.com/t/new-haven-rb-meeting-tonight/60162)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 7:36pm UTC](https://www.ruby-forum.com/t/new-haven-rb-meeting-tonight/60162 "2006-05-10T19:36:36Z")

</div>

The New Haven Rubyists monthly meeting is tonight. ==Location / Time== 6:30 → 9:00, Innovation Software Group \[0\], North Haven, CT ==Description== We will start off with an open discussion on blocks/procs/lambdas f…

---

## [Range](https://www.ruby-forum.com/t/range/94656)

<div class="topic-metadata">

**Author:** [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Replies:** 5\
**Last updated:** [May 10, 2006, 7:33pm UTC](https://www.ruby-forum.com/t/range/94656 "2006-05-10T19:33:12Z")

</div>

another code example from my book doesnt work with the ruby interpreter parts = (“Part A” … “Part G”) parts.length #â??\> 7 that spits out a error that says it doesnt recognize the length method. I real…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/94674)

<div class="topic-metadata">

**Author:** [@beachguy82](https://www.ruby-forum.com/u/beachguy82)\
**Replies:** 2\
**Last updated:** [May 10, 2006, 7:30pm UTC](https://www.ruby-forum.com/t/no-subject/94674 "2006-05-10T19:30:03Z")

</div>

\-------- Forwarded Message -------- From: Charlie B. removed\_email\_address@domain.invalid Subject: Re: Thanks Ruby Q.! Date: Wed, 10 May 2006 13:08:27 -0400 My nickname is Typo and that’s exactly what happened with t…

---

## [Numeric precision problem](https://www.ruby-forum.com/t/numeric-precision-problem/60151)

<div class="topic-metadata">

**Author:** [@doug3](https://www.ruby-forum.com/u/doug3)\
**Replies:** 2\
**Last updated:** [May 10, 2006, 7:09pm UTC](https://www.ruby-forum.com/t/numeric-precision-problem/60151 "2006-05-10T19:09:37Z")

</div>

Greetings all. I’m having a little problem with numeric precision and being a NOOB to Ruby, I’m not quite sure where I am going wrong. When I perform the following calculation: n = ((9703.0 \* 16346204482307500.0) + 1…

---

## [Matching $end and $start tokens in RACC](https://www.ruby-forum.com/t/matching-end-and-start-tokens-in-racc/94672)

<div class="topic-metadata">

**Author:** [@Duff\_OMelia](https://www.ruby-forum.com/u/Duff_OMelia)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 7:07pm UTC](https://www.ruby-forum.com/t/matching-end-and-start-tokens-in-racc/94672 "2006-05-10T19:07:53Z")

</div>

Does anyone know if it is possible to match the $end and $start tokens in a RACC grammar? I can’t seem to get any actions that contain either of these tokens to fire. Thanks! Duff OMelia

---

## [Class \<\< my\_instance and class variables](https://www.ruby-forum.com/t/class-my-instance-and-class-variables/60145)

<div class="topic-metadata">

**Author:** [@raphael\_b](https://www.ruby-forum.com/u/raphael_b)\
**Replies:** 4\
**Last updated:** [May 10, 2006, 7:07pm UTC](https://www.ruby-forum.com/t/class-my-instance-and-class-variables/60145 "2006-05-10T19:07:45Z")

</div>

Hi, When running this code, class A def initialize(i) @value = i end end a = A.new(3) class \<\< a @@v = 5 def test @value\>@@v end end a.test I get a warning: “class variable access from toplevel singleton …

---

## [Error recovery in Racc using error token](https://www.ruby-forum.com/t/error-recovery-in-racc-using-error-token/60155)

<div class="topic-metadata">

**Author:** [@Duff\_OMelia](https://www.ruby-forum.com/u/Duff_OMelia)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 7:07pm UTC](https://www.ruby-forum.com/t/error-recovery-in-racc-using-error-token/60155 "2006-05-10T19:07:39Z")

</div>

Hi, I have been unable to successfully use the error token in my Racc grammar. In YACC, this is the token that is used to continue processing when an error occurs. I can’t seem to get any action containing the erro…

---

## [Re: FTP#mget, FTP#mput](https://www.ruby-forum.com/t/re-ftp-mget-ftp-mput/94670)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [May 10, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/re-ftp-mget-ftp-mput/94670 "2006-05-10T18:27:49Z")

</div>

From: removed\_email\_address@domain.invalid \[mailto:removed\_email\_address@domain.invalid\] mget and mput means get all files from the server that match foo\* - the only way to do this is to combine an ftp.list wi…

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

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