# Ruby

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

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

---

## [Simple socketing](https://www.ruby-forum.com/t/simple-socketing/98187)

<div class="topic-metadata">

**Author:** [@canute](https://www.ruby-forum.com/u/canute)\
**Replies:** 1\
**Last updated:** [July 12, 2006, 11:52pm UTC](https://www.ruby-forum.com/t/simple-socketing/98187 "2006-07-12T23:52:19Z")

</div>

Hi there, I recently started with Ruby and I am trying to make a very simple irc bot, but I am having some slight problems though. This is what I came up with: require ‘socket’ class Irc def connect(server, port = 6…

---

## [Simple socketing](https://www.ruby-forum.com/t/simple-socketing/98186)

<div class="topic-metadata">

**Author:** [@canute](https://www.ruby-forum.com/u/canute)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 11:30pm UTC](https://www.ruby-forum.com/t/simple-socketing/98186 "2006-07-12T23:30:59Z")

</div>

Hi there, I recently started with Ruby and I am trying to make a very simple irc bot, but I am having some slight problems though. This is what I came up with: require ‘socket’ class Irc def connect(server, port = 6…

---

## [Multiple level hash assignment equivalence to perl](https://www.ruby-forum.com/t/multiple-level-hash-assignment-equivalence-to-perl/98173)

<div class="topic-metadata">

**Author:** [@dmcclean](https://www.ruby-forum.com/u/dmcclean)\
**Replies:** 3\
**Last updated:** [July 12, 2006, 10:59pm UTC](https://www.ruby-forum.com/t/multiple-level-hash-assignment-equivalence-to-perl/98173 "2006-07-12T22:59:05Z")

</div>

Is there a succinct way in ruby to do a multiple level hash assignement? I am more used to perl, which you can do something like $hp-\>{level1}-\>{level2} = 3 even if the first and second level had never existed below. …

---

## [Fwd: Please Forward: Ruby Quiz Submission (Part 1)](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission-part-1/98166)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 1\
**Last updated:** [July 12, 2006, 10:25pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission-part-1/98166 "2006-07-12T22:25:20Z")

</div>

I believe this message was rejected for length when I sent it the first time, so trying a two-parter… James Edward G. II Begin forwarded message:

---

## [Ruby and byte](https://www.ruby-forum.com/t/ruby-and-byte/98061)

<div class="topic-metadata">

**Author:** [@agnessa](https://www.ruby-forum.com/u/agnessa)\
**Replies:** 4\
**Last updated:** [July 12, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/ruby-and-byte/98061 "2006-07-12T22:22:09Z")

</div>

Hello! How would you go about representing the byte type in Ruby? I have a task where I neeed to be writing and reading bytes from a tcp socket - so for instance I might want to send/receive an integer which is 1 byte…

---

## [Prototype-0.0.0](https://www.ruby-forum.com/t/prototype-0-0-0/98126)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [July 12, 2006, 10:18pm UTC](https://www.ruby-forum.com/t/prototype-0-0-0/98126 "2006-07-12T22:18:46Z")

</div>

NAME prototype.rb URIS http://codeforpeople.com/lib/ruby/ http://rubyforge.org/projects/codeforpeople/ SYNOPSIS prototype.rb implements the prototype design pattern http://en.wikipedia.org/wiki/Prototype-based\_pr…

---

## [HDF5 interface?](https://www.ruby-forum.com/t/hdf5-interface/98169)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 10:15pm UTC](https://www.ruby-forum.com/t/hdf5-interface/98169 "2006-07-12T22:15:23Z")

</div>

I’ve done a good bit of googling, searching this and other Ruby forums, etc… and can’t seem to find a Ruby interface to HDF5 (a format for scientific data). Anyone seen anything like this? Thanks in advance, John

---

## [How to structure ruby libraries?](https://www.ruby-forum.com/t/how-to-structure-ruby-libraries/98094)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 2\
**Last updated:** [July 12, 2006, 9:43pm UTC](https://www.ruby-forum.com/t/how-to-structure-ruby-libraries/98094 "2006-07-12T21:43:10Z")

</div>

hello we are building a new ruby library which will probably consist of several dozens of source files. we want to package it in a gem. are there any conventions on how to structure the directories of the library ? …

---

## [Newb: an explaination for this if statement](https://www.ruby-forum.com/t/newb-an-explaination-for-this-if-statement/98161)

<div class="topic-metadata">

**Author:** [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Replies:** 7\
**Last updated:** [July 12, 2006, 9:40pm UTC](https://www.ruby-forum.com/t/newb-an-explaination-for-this-if-statement/98161 "2006-07-12T21:40:22Z")

</div>

Hi. I’m confused as to why this variable\* is nessesary: def add\_product(product) existing\_product = @items.find {|item| item.product == product} if existing\_product existing\_product.increment\_quantity else e…

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/98160)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 9:36pm UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/98160 "2006-07-12T21:36:23Z")

</div>

Begin forwarded message:

---

## [Generating a random floating point number](https://www.ruby-forum.com/t/generating-a-random-floating-point-number/98113)

<div class="topic-metadata">

**Author:** [@jamiethehutt](https://www.ruby-forum.com/u/jamiethehutt)\
**Replies:** 6\
**Last updated:** [July 12, 2006, 9:19pm UTC](https://www.ruby-forum.com/t/generating-a-random-floating-point-number/98113 "2006-07-12T21:19:50Z")

</div>

I’m a Ruby newbie and I’m wondering if there’s a simple way to generate a random floating point number, I want to generate numbers between 0 and about 2-3.6 with the max changing each time (an example max would be 3.2…

---

## [Determining a class's ancestor easily without instances](https://www.ruby-forum.com/t/determining-a-classs-ancestor-easily-without-instances/98146)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 6\
**Last updated:** [July 12, 2006, 9:02pm UTC](https://www.ruby-forum.com/t/determining-a-classs-ancestor-easily-without-instances/98146 "2006-07-12T21:02:52Z")

</div>

Given two classes A and B, I know that I can loop through the superclasses of A to determine it it’s a descendant of B. Is there a more expedient way to do this - something like “is\_a?” but at the class level (since i…

---

## [Class Help, undifined local var or meth](https://www.ruby-forum.com/t/class-help-undifined-local-var-or-meth/98137)

<div class="topic-metadata">

**Author:** [@diragor](https://www.ruby-forum.com/u/diragor)\
**Replies:** 8\
**Last updated:** [July 12, 2006, 8:58pm UTC](https://www.ruby-forum.com/t/class-help-undifined-local-var-or-meth/98137 "2006-07-12T20:58:18Z")

</div>

I was using this class before and it was fine until I tried to put it into an array, and now I don’t know what’s wrong, I keep getting the same error, and I’ve check the spellings numerous times… class PurchaseOrder …

---

## [Learning newb: regaring methods and class methods](https://www.ruby-forum.com/t/learning-newb-regaring-methods-and-class-methods/98148)

<div class="topic-metadata">

**Author:** [@eddiewould](https://www.ruby-forum.com/u/eddiewould)\
**Replies:** 1\
**Last updated:** [July 12, 2006, 7:38pm UTC](https://www.ruby-forum.com/t/learning-newb-regaring-methods-and-class-methods/98148 "2006-07-12T19:38:00Z")

</div>

hi, i just need to know if i’m on the right trax regarding ruby: a ‘::’ method class attached to another constant or variable will tell that constant/variable to use all methods under it’s class where as ‘.’ tells rub…

---

## [\[QUIZ\] Pangrams (#86)](https://www.ruby-forum.com/t/quiz-pangrams-86/98141)

<div class="topic-metadata">

**Author:** [@johnnybutler7](https://www.ruby-forum.com/u/johnnybutler7)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 6:53pm UTC](https://www.ruby-forum.com/t/quiz-pangrams-86/98141 "2006-07-12T18:53:00Z")

</div>

I let it run overnight in two irb sessions (with two different starter sentences) and they both finally converged - but I don’t know how long it took. Looking at the other solutions, I think I have plenty to learn ab…

---

## [Redefining core classes](https://www.ruby-forum.com/t/redefining-core-classes/97429)

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 14\
**Last updated:** [July 12, 2006, 6:49pm UTC](https://www.ruby-forum.com/t/redefining-core-classes/97429 "2006-07-12T18:49:27Z")

</div>

Hi you all, I am reading the â??Whyâ??s (poignant) guide to Rubyâ?. Iâ??ve reached to the example where he explains how you can change the core â??Stringâ? class definition, adding variables and methods (in http://…

---

## [Require](https://www.ruby-forum.com/t/require/98115)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [July 12, 2006, 6:27pm UTC](https://www.ruby-forum.com/t/require/98115 "2006-07-12T18:27:03Z")

</div>

I am using require in two different ways and they both don’t work. In case #1 I use it to read a file with a code snippet. The file is located in the same directory. The code snipped defines an array called code\_wor…

---

## [Ruby on Rails job in Dallas (Plano), TX](https://www.ruby-forum.com/t/ruby-on-rails-job-in-dallas-plano-tx/98103)

<div class="topic-metadata">

**Author:** [@scott](https://www.ruby-forum.com/u/scott)\
**Replies:** 1\
**Last updated:** [July 12, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/ruby-on-rails-job-in-dallas-plano-tx/98103 "2006-07-12T17:25:15Z")

</div>

Data Delivery Services, an IT company in Plano, TX, is looking for a developer that is passionate about their trade. The ideal candidate should be relatively comfortable programming in Ruby and Ruby on Rails. Familia…

---

## [Gem install sqlite3-ruby](https://www.ruby-forum.com/t/gem-install-sqlite3-ruby/98043)

<div class="topic-metadata">

**Author:** [@jaw6](https://www.ruby-forum.com/u/jaw6)\
**Replies:** 4\
**Last updated:** [July 12, 2006, 5:22pm UTC](https://www.ruby-forum.com/t/gem-install-sqlite3-ruby/98043 "2006-07-12T17:22:32Z")

</div>

Hi – I’m trying to set up Rails with sqlite on a raw Debian box. Rails is fine, but I’m having problems with sqlite. Actually, sqlite is fine, but the sqlite3-ruby bindings are problematic. I /suspect/ that this box …

---

## [Ruby problems calling VB COM using win32ole](https://www.ruby-forum.com/t/ruby-problems-calling-vb-com-using-win32ole/98120)

<div class="topic-metadata">

**Author:** [@rawroe](https://www.ruby-forum.com/u/rawroe)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 5:19pm UTC](https://www.ruby-forum.com/t/ruby-problems-calling-vb-com-using-win32ole/98120 "2006-07-12T17:19:59Z")

</div>

Hi, I’m experiencing some unusual behaviour trying to use VB COM through win32ole in Ruby, and I’m hoping someone might be able to help. I’m using Ruby 1.84-19 (final) here. I’ve included the contents of the files I’…

---

## [Re: Why Ruby over Python?](https://www.ruby-forum.com/t/re-why-ruby-over-python/98111)

<div class="topic-metadata">

**Author:** [@jamal86](https://www.ruby-forum.com/u/jamal86)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 4:46pm UTC](https://www.ruby-forum.com/t/re-why-ruby-over-python/98111 "2006-07-12T16:46:26Z")

</div>

brad tilley wrote: This may be a trivial reason to most people, but it makes a huge difference to me. I find it much easier to turn .rb scripts into standalone .exe executbales on Windows. I’ve used Python’s py2exe a…

---

## [Re: Appending to a CSV file](https://www.ruby-forum.com/t/re-appending-to-a-csv-file/98109)

<div class="topic-metadata">

**Author:** [@BergerS\_Daniel](https://www.ruby-forum.com/u/BergerS_Daniel)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 4:39pm UTC](https://www.ruby-forum.com/t/re-appending-to-a-csv-file/98109 "2006-07-12T16:39:44Z")

</div>

She says that she can’t figure out how to /append/ to a CSV file using Ruby’s standard library. Does anyone have the magic recipe, or should she be using FasterCSV instead? File.open(file, ‘a+’) ??? Or, did you me…

---

## [Re: Help with a regexp](https://www.ruby-forum.com/t/re-help-with-a-regexp/98106)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 4:30pm UTC](https://www.ruby-forum.com/t/re-help-with-a-regexp/98106 "2006-07-12T16:30:12Z")

</div>

Daniel, here’s a function to do what you want … class String def bencode? if /^(\[1-9\]+\\d\*):/.match(self)==nil return false else number=eval((/(^(\[1-9\]+\\d\*)):/.match(self))\[1\]) rest\_of\_string\_length=self\[self.in…

---

## [Def m(a=nil, b)](https://www.ruby-forum.com/t/def-m-a-nil-b/97894)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 5\
**Last updated:** [July 12, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/def-m-a-nil-b/97894 "2006-07-12T16:23:57Z")

</div>

e$B$U$H!“e(B1.9 e$B$J$ie(B (TCPServer#initialize e$B$N$h$&$Ke(B) e$BBh0l0z?t$r\>Je(B e$BN,2DG=$J%a%=%C%I$re(B def m(a=nil, b) e$B$HDj5A$G$-$k$N$G$O$J$+$me(B e$B$&$+!”$HA\[A|$7!";n$7$F$\_$?$N$G$9$,!"$G$-$J$$$h$&$G$9!#e(B …

---

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

<div class="topic-metadata">

**Author:** [@damaris](https://www.ruby-forum.com/u/damaris)\
**Replies:** 3\
**Last updated:** [July 12, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/rescuing-exceptions-with-redo/102964 "2006-07-12T16:20:17Z")

</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…

---

## [Object IDs](https://www.ruby-forum.com/t/object-ids/97936)

<div class="topic-metadata">

**Author:** [@regularfry](https://www.ruby-forum.com/u/regularfry)\
**Replies:** 6\
**Last updated:** [July 12, 2006, 4:20pm UTC](https://www.ruby-forum.com/t/object-ids/97936 "2006-07-12T16:20:05Z")

</div>

A couple of quick questions: a) Are object id’s ever reused within the life of a Ruby process? b) Are object id’s unique across the whole Ruby process, or only within a given context?

---

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

<div class="topic-metadata">

**Author:** [@noagenda](https://www.ruby-forum.com/u/noagenda)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 4:16pm UTC](https://www.ruby-forum.com/t/no-subject/98101 "2006-07-12T16:16:12Z")

</div>

get 201451,201454,201457,201460,201460,201483

---

## [String#scan puzzlement](https://www.ruby-forum.com/t/string-scan-puzzlement/98085)

<div class="topic-metadata">

**Author:** [@Martin\_DeMello](https://www.ruby-forum.com/u/Martin_DeMello)\
**Replies:** 2\
**Last updated:** [July 12, 2006, 3:02pm UTC](https://www.ruby-forum.com/t/string-scan-puzzlement/98085 "2006-07-12T15:02:40Z")

</div>

I’m trying to match sequences of capitalised words - can someone explain why the second regexp works but not the first? irb(main):001:0\> a = “And then we Went to The Next Place to be” =\> “And then we Went to The Next…

---

## [Ruby Weekly News 3rd - 9th July 2006](https://www.ruby-forum.com/t/ruby-weekly-news-3rd-9th-july-2006/98073)

<div class="topic-metadata">

**Author:** [@weliwarmer](https://www.ruby-forum.com/u/weliwarmer)\
**Replies:** 0\
**Last updated:** [July 12, 2006, 1:26pm UTC](https://www.ruby-forum.com/t/ruby-weekly-news-3rd-9th-july-2006/98073 "2006-07-12T13:26:32Z")

</div>

http://www.rubyweeklynews.org/20060709.html Use the link above for a nicer version of this newsletter that’s formatted for the web, including links to threads and other sites. You can also subscribe to a newsletter-o…

---

## [Class name methods](https://www.ruby-forum.com/t/class-name-methods/98023)

<div class="topic-metadata">

**Author:** [@joey](https://www.ruby-forum.com/u/joey)\
**Replies:** 1\
**Last updated:** [July 12, 2006, 11:49am UTC](https://www.ruby-forum.com/t/class-name-methods/98023 "2006-07-12T11:49:52Z")

</div>

Hey Ruby-Talk, I’ve got this: class H end def H(a) p a end H H I was wondering how Ruby handles this? I know it works, but how? :slight\_smile: j\`ey http://www.eachmapinject.com Ergh C(http://code.eachmapinjec…

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

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