# Ruby

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

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

---

## [Learn to program](https://www.ruby-forum.com/t/learn-to-program/60597)

<div class="topic-metadata">

**Author:** [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Replies:** 13\
**Last updated:** [May 16, 2006, 3:36pm UTC](https://www.ruby-forum.com/t/learn-to-program/60597 "2006-05-16T15:36:24Z")

</div>

I realy dont understand what Chris is talking about here in his book “learning to program” Can someoe shed some light on this def little\_pest tough\_var tough\_var = nil puts ’ HAHA! I ruined your variable!’ end toug…

---

## [Require 'mechanize'/Ruby search path problem](https://www.ruby-forum.com/t/require-mechanize-ruby-search-path-problem/60649)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 2\
**Last updated:** [May 16, 2006, 3:33pm UTC](https://www.ruby-forum.com/t/require-mechanize-ruby-search-path-problem/60649 "2006-05-16T15:33:10Z")

</div>

Hello all, i have installed mechanize from a gem: sudo gem install mechanize and it went OK, as far as i am concerned. However, when i am trying to run any example from the mechanize RDoc, i am getting the following…

---

## [Fwd: In search of elegant indices searching](https://www.ruby-forum.com/t/fwd-in-search-of-elegant-indices-searching/60636)

<div class="topic-metadata">

**Author:** [@tbobker](https://www.ruby-forum.com/u/tbobker)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 1:07pm UTC](https://www.ruby-forum.com/t/fwd-in-search-of-elegant-indices-searching/60636 "2006-05-16T13:07:08Z")

</div>

Your result is confusing me: {{‘x’=\>1,‘w’=\>1}=\>\[0,3\],{‘x’=\>3,‘w’=\>3}=\>\[2\],{‘x’=\>5,‘w’=\>4}=\>\[4\],{‘x’=\>6, ‘w’=\>5}=\>\[5\]}. Not really sure what you’re trying to accomplish, if you want to determine the indices at which…

---

## [ruby\_strtod$B$N@:EY(B](https://www.ruby-forum.com/t/ruby-strtod-b-n-ey-b/60632)

<div class="topic-metadata">

**Author:** [@U.Nakamura](https://www.ruby-forum.com/u/U.Nakamura)\
**Replies:** 4\
**Last updated:** [May 16, 2006, 12:30pm UTC](https://www.ruby-forum.com/t/ruby-strtod-b-n-ey-b/60632 "2006-05-16T12:30:37Z")

</div>

e$B$3$s$K$A$O!"$J$+$\`$ie(B(e$B$&e(B)e$B$G$9!#e(B e$B5W$7?6$j$Ke(B1.8e$B$Ge(Btest-alle$B$7$F$\_$?$i4v$D$+$N%F%9%H$Ge(BFailuree$B$,A}e(B e$B$($F$$$k$3$H$K5$IU$-$^$7$?!#e(B e$B6qBNE\*$K$Oe(BYAMLe$B$N%F%9%H$J$N$G$9$,!"D4$Y$…

---

## [Weird class-loading issue (or maybe a problem with define\_me](https://www.ruby-forum.com/t/weird-class-loading-issue-or-maybe-a-problem-with-define-me/60558)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 7\
**Last updated:** [May 16, 2006, 11:41am UTC](https://www.ruby-forum.com/t/weird-class-loading-issue-or-maybe-a-problem-with-define-me/60558 "2006-05-16T11:41:51Z")

</div>

I’m working on an app and having a strange class loading problem. I’ve extracted it to the most basic code possible. foo.rb require “bar” class Foo FOO = “foo” end bar.rb require “foo” class Bar def self.set\_foo(…

---

## [Float#div and Float#divmod \[AGAIN\]](https://www.ruby-forum.com/t/float-div-and-float-divmod-again/58582)

<div class="topic-metadata">

**Author:** [@Shin-ichiro\_HARA](https://www.ruby-forum.com/u/Shin-ichiro_HARA)\
**Replies:** 15\
**Last updated:** [May 16, 2006, 11:29am UTC](https://www.ruby-forum.com/t/float-div-and-float-divmod-again/58582 "2006-05-16T11:29:50Z")

</div>

e$B86$G$9!#e(B e$B4{$K2?EY$+OCBj$K$J$C$F$$$F7+$jJV$7$\_$?$$$G$9$,!"e(B e$B0J2\<$Oe(B 1.8.4 e$B$G$NDs0F$G$9!#e(B e$B8=:\_!Je(B1.8.4 snapshote$B!K$G!"e(B -3.4.div(1.1) #=\> -3 e$B$H$J$C$F$$$^$9$,!"$3$l$Oe(B -4 e$B$H$9$Y$-…

---

## [Variable class idea and request for critique](https://www.ruby-forum.com/t/variable-class-idea-and-request-for-critique/60629)

<div class="topic-metadata">

**Author:** [@Edmund\_Jorgensen](https://www.ruby-forum.com/u/Edmund_Jorgensen)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 11:10am UTC](https://www.ruby-forum.com/t/variable-class-idea-and-request-for-critique/60629 "2006-05-16T11:10:43Z")

</div>

Hi all, I’m fairly new to Ruby but really enjoying it. I’ve been working on a medium large project that is non rails but uses ActiveRecord and assorted other pieces of the rails framework. I’d been finding myself h…

---

## [Ruby/gnuplot on windows](https://www.ruby-forum.com/t/ruby-gnuplot-on-windows/60627)

<div class="topic-metadata">

**Author:** [@jdruse](https://www.ruby-forum.com/u/jdruse)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 10:38am UTC](https://www.ruby-forum.com/t/ruby-gnuplot-on-windows/60627 "2006-05-16T10:38:25Z")

</div>

Using the sine wave example from the home page how to, I’ve been able to get gnuplot to generate the plot but it immediately terminates, flashing only briefly on the screen. I bypassed the which method and hardcoded …

---

## [Stack level too deep (SystemStackError)](https://www.ruby-forum.com/t/stack-level-too-deep-systemstackerror/94832)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [May 16, 2006, 9:47am UTC](https://www.ruby-forum.com/t/stack-level-too-deep-systemstackerror/94832 "2006-05-16T09:47:13Z")

</div>

When writing a code to find the factor of a given number, i ran into the following error message: “factor.rb:48: parse error, unexpected kEND, expecting $” I was hoping someone could shed light on the problem. Heres t…

---

## [How to decode the following string](https://www.ruby-forum.com/t/how-to-decode-the-following-string/59159)

<div class="topic-metadata">

**Author:** [@usrlocal](https://www.ruby-forum.com/u/usrlocal)\
**Replies:** 4\
**Last updated:** [May 16, 2006, 7:37am UTC](https://www.ruby-forum.com/t/how-to-decode-the-following-string/59159 "2006-05-16T07:37:55Z")

</div>

hello, when i work on a pop mail client program, i met the following string at the Subject field: Subject: =?GBK?B?dnNvYy5jbiDXorLhs8m5piE==?= Subject: =?GB2312?B?RndkOiCyu7rD0uLLvKOsvfHM7LLF1qq1wMTjtcTTys/k?= i kno…

---

## [Time class and time zones](https://www.ruby-forum.com/t/time-class-and-time-zones/60529)

<div class="topic-metadata">

**Author:** [@edlau](https://www.ruby-forum.com/u/edlau)\
**Replies:** 3\
**Last updated:** [May 16, 2006, 6:36am UTC](https://www.ruby-forum.com/t/time-class-and-time-zones/60529 "2006-05-16T06:36:19Z")

</div>

Question in brief: Is it possible to create a Time object with a time zone other than the local time zone or GMT? I’m relatively new to Ruby (coming from the Java world), and after reading the docs and playing with T…

---

## [Considering Ruby For a Networking Application](https://www.ruby-forum.com/t/considering-ruby-for-a-networking-application/59758)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 35\
**Last updated:** [May 16, 2006, 6:17am UTC](https://www.ruby-forum.com/t/considering-ruby-for-a-networking-application/59758 "2006-05-16T06:17:40Z")

</div>

I’m going to be working on a fairly basic networking application shortly. This is low level socket work. (I cannot use a nicety like DRB sadly.) I’m very familiar with this kind of stuff in Perl, but have done very …

---

## [Solaris Install: Non-standard location](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409)

<div class="topic-metadata">

**Author:** [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Replies:** 5\
**Last updated:** [May 16, 2006, 6:14am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/60409 "2006-05-16T06:14:29Z")

</div>

Were I able to install at the default location, things would be golden. Unfortunately, that’s not an option. My first attempt at installing failed horribly. (Couldn’t access GetoptLong, for instance, because the sit…

---

## [Begining programmer questions](https://www.ruby-forum.com/t/begining-programmer-questions/60502)

<div class="topic-metadata">

**Author:** [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Replies:** 74\
**Last updated:** [May 16, 2006, 5:02am UTC](https://www.ruby-forum.com/t/begining-programmer-questions/60502 "2006-05-16T05:02:32Z")

</div>

I was wondering, i thought in Ruby you didnt have to declare variables but in this little exercise from the book i have the error i get is that the variable info is undeclared. Basically the exercise is to keep fillin…

---

## [Problem with rspec mock object](https://www.ruby-forum.com/t/problem-with-rspec-mock-object/94835)

<div class="topic-metadata">

**Author:** [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 4:52am UTC](https://www.ruby-forum.com/t/problem-with-rspec-mock-object/94835 "2006-05-16T04:52:45Z")

</div>

I have perhaps the simplest mock object ever - it doesn’t do anything. However when I use it, it gives me an error. Here’s the full code, along with the error: require “rental” context “A new rental” do setup do @…

---

## [X-y plots](https://www.ruby-forum.com/t/x-y-plots/94778)

<div class="topic-metadata">

**Author:** [@jdruse](https://www.ruby-forum.com/u/jdruse)\
**Replies:** 11\
**Last updated:** [May 16, 2006, 4:41am UTC](https://www.ruby-forum.com/t/x-y-plots/94778 "2006-05-16T04:41:26Z")

</div>

I’m new to ruby and am looking for a way to create an x-y plot. Any suggestions? Jon

---

## [Columnization of text, using text-reform](https://www.ruby-forum.com/t/columnization-of-text-using-text-reform/94798)

<div class="topic-metadata">

**Author:** [@Sy\_Ali](https://www.ruby-forum.com/u/Sy_Ali)\
**Replies:** 3\
**Last updated:** [May 16, 2006, 2:38am UTC](https://www.ruby-forum.com/t/columnization-of-text-using-text-reform/94798 "2006-05-16T02:38:48Z")

</div>

Ok, I got text-hyphen and text-reform installed\[1\], and I looked at the test case for text-reform. Yes, that’s a great way to start learning stuff. I also found a way to adapt it to my uses!\[2\] This is a major vict…

---

## [Exerb and sqlite3](https://www.ruby-forum.com/t/exerb-and-sqlite3/94831)

<div class="topic-metadata">

**Author:** [@Seamus\_Brady\_Ssent\_S](https://www.ruby-forum.com/u/Seamus_Brady_Ssent_S)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 2:26am UTC](https://www.ruby-forum.com/t/exerb-and-sqlite3/94831 "2006-05-16T02:26:37Z")

</div>

Hi all I am experiencing a problem with exerb win32 3.2 / 3.3.1, sqlite3 and ruby 1.8.2 on Win2k. When I run my scripts with the ruby executable, they run fine. However when I try using a script created with exerb…

---

## [Exerb and sqlite3](https://www.ruby-forum.com/t/exerb-and-sqlite3/60605)

<div class="topic-metadata">

**Author:** [@Seamus\_Brady\_Ssent\_S](https://www.ruby-forum.com/u/Seamus_Brady_Ssent_S)\
**Replies:** 0\
**Last updated:** [May 16, 2006, 2:23am UTC](https://www.ruby-forum.com/t/exerb-and-sqlite3/60605 "2006-05-16T02:23:31Z")

</div>

Hi all I am experiencing a problem with exerb win32 3.2 / 3.3.1, sqlite3 and ruby 1.8.2 on Win2k. When I run my scripts with the ruby executable, they run fine. However when I try using a script created with exerb…

---

## [Solaris Install: Non-standard location](https://www.ruby-forum.com/t/solaris-install-non-standard-location/94829)

<div class="topic-metadata">

**Author:** [@xmg-eric](https://www.ruby-forum.com/u/xmg-eric)\
**Replies:** 1\
**Last updated:** [May 16, 2006, 12:02am UTC](https://www.ruby-forum.com/t/solaris-install-non-standard-location/94829 "2006-05-16T00:02:05Z")

</div>

(Resending after a bit more refactoring. Guidance would be most appreciated.) Were I able to install at the default location, things would be golden. Unfortunately, that’s not an option. My first attempt at installi…

---

## [Ruby community website / forum](https://www.ruby-forum.com/t/ruby-community-website-forum/59698)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 27\
**Last updated:** [May 15, 2006, 11:55pm UTC](https://www.ruby-forum.com/t/ruby-community-website-forum/59698 "2006-05-15T23:55:43Z")

</div>

Coming from Perl, what I miss in Ruby the most is (surprise !) not CPAN, but rather the community at Perlmonks (http://perlmonks.org). For those not familiar with Perlmonks, it’s a community website that’s actually a …

---

## [Conway's Life de-golfed](https://www.ruby-forum.com/t/conways-life-de-golfed/60485)

<div class="topic-metadata">

**Author:** [@miken700](https://www.ruby-forum.com/u/miken700)\
**Replies:** 6\
**Last updated:** [May 15, 2006, 11:33pm UTC](https://www.ruby-forum.com/t/conways-life-de-golfed/60485 "2006-05-15T23:33:26Z")

</div>

I took some golfed code from a discussion here little while back ( http://www.ruby-forum.com/search?query=Golfing+a+signature.&forums%5B%5D=4 ) and tried my hand at de-golfing and re-working it a bit to make it readab…

---

## [Struct.new vs class](https://www.ruby-forum.com/t/struct-new-vs-class/60520)

<div class="topic-metadata">

**Author:** [@Giles\_B](https://www.ruby-forum.com/u/Giles_B)\
**Replies:** 10\
**Last updated:** [May 15, 2006, 10:55pm UTC](https://www.ruby-forum.com/t/struct-new-vs-class/60520 "2006-05-15T22:55:13Z")

</div>

OK, so I have this class and it could probably be a Struct. class Sample I should probably turn this whole class into a simple Struct.new(etc.) statement attr :note\_length, true attr :track, true attr :note, true a…

---

## [Search an array](https://www.ruby-forum.com/t/search-an-array/94815)

<div class="topic-metadata">

**Author:** [@pkspence](https://www.ruby-forum.com/u/pkspence)\
**Replies:** 3\
**Last updated:** [May 15, 2006, 10:41pm UTC](https://www.ruby-forum.com/t/search-an-array/94815 "2006-05-15T22:41:43Z")

</div>

Given the following scenario… $0 = “C:/mhiqTest/testAdoConnection.rb” $@\[0\] = “c:/ruby/lib/ruby/site\_ruby/1.8/DBD/ADO/ADO.rb:57:in connect'" $@\[1\] = "c:/ruby/lib/ruby/site\_ruby/1.8/dbi.rb:424:inconnect’” $@\[2\] = “c:/r…

---

## [Re: Search an array](https://www.ruby-forum.com/t/re-search-an-array/94816)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [May 15, 2006, 10:29pm UTC](https://www.ruby-forum.com/t/re-search-an-array/94816 "2006-05-15T22:29:59Z")

</div>

the currently running program; $0? The idea is to log all the errors to a SQL Server database, the name of the program, line number where the error occurred, error message, etc. Thanks! Why look in $@? You already…

---

## [Text::hyphen, de patterns](https://www.ruby-forum.com/t/text-hyphen-de-patterns/60582)

<div class="topic-metadata">

**Author:** [@pgundlach](https://www.ruby-forum.com/u/pgundlach)\
**Replies:** 2\
**Last updated:** [May 15, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/text-hyphen-de-patterns/60582 "2006-05-15T22:09:07Z")

</div>

Hello, I’d like to use text::hyphen, and I’d like to know how to use german hyphenation patterns. There are two files de1.rb and de2.rb in the distribution, but what parameter should I use to the Text::Hyphen.new met…

---

## [Problem with net/imap](https://www.ruby-forum.com/t/problem-with-net-imap/60474)

<div class="topic-metadata">

**Author:** [@Thiago\_J](https://www.ruby-forum.com/u/Thiago_J)\
**Replies:** 2\
**Last updated:** [May 15, 2006, 10:05pm UTC](https://www.ruby-forum.com/t/problem-with-net-imap/60474 "2006-05-15T22:05:08Z")

</div>

Hi all, I’ve been struggling for the past hour to get just the message text itself from the body but I can’t figure out, all I get is the entire body which contains all the headers, etc… This is what I’m doing… ima…

---

## [Simple crawling/HTML extraction](https://www.ruby-forum.com/t/simple-crawling-html-extraction/60526)

<div class="topic-metadata">

**Author:** [@splattael](https://www.ruby-forum.com/u/splattael)\
**Replies:** 2\
**Last updated:** [May 15, 2006, 9:37pm UTC](https://www.ruby-forum.com/t/simple-crawling-html-extraction/60526 "2006-05-15T21:37:06Z")

</div>

Hello all, I would like to accomplish the following task: I have a bunch of links. Visit every link one by one For every visited link, extract a string with a regexp from the page can be recursive: If one/more o…

---

## [Re: Compiling Ruby w/ Profile Guided Optimization](https://www.ruby-forum.com/t/re-compiling-ruby-w-profile-guided-optimization/94818)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 1\
**Last updated:** [May 15, 2006, 9:03pm UTC](https://www.ruby-forum.com/t/re-compiling-ruby-w-profile-guided-optimization/94818 "2006-05-15T21:03:46Z")

</div>

Ruby with this feature turned on. For the (somewhat contrived/synthetic) scenario below, it looks like compiling with profile guided optimization turned on, along with -O3, results in about a 9% speed increase vs. -…

---

## [Foo bar](https://www.ruby-forum.com/t/foo-bar/94776)

<div class="topic-metadata">

**Author:** [@ckonrad](https://www.ruby-forum.com/u/ckonrad)\
**Replies:** 9\
**Last updated:** [May 15, 2006, 9:03pm UTC](https://www.ruby-forum.com/t/foo-bar/94776 "2006-05-15T21:03:35Z")

</div>

where does all the foo and bar references come from, is that from duntemans assembly book from way back in the day? He had a fake martian counting system with foo bar bas foobidity etc to use as an example of how to t…

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

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