# Ruby

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

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

---

## [Obtaining ip address of client socket in ruby](https://www.ruby-forum.com/t/obtaining-ip-address-of-client-socket-in-ruby/121148)

<div class="topic-metadata">

**Author:** [@ribes](https://www.ruby-forum.com/u/ribes)\
**Replies:** 2\
**Last updated:** [November 24, 2007, 6:35pm UTC](https://www.ruby-forum.com/t/obtaining-ip-address-of-client-socket-in-ruby/121148 "2007-11-24T18:35:40Z")

</div>

How can I obtain the ip address of the originating (client) socket , in a server/client socket ruby program? What ruby library is fitted with a class/ method to do this? How can it be done using ruby? I would appreci…

---

## [Aquarium V0.2.0 Released](https://www.ruby-forum.com/t/aquarium-v0-2-0-released/121158)

<div class="topic-metadata">

**Author:** [@Dean\_W](https://www.ruby-forum.com/u/Dean_W)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/aquarium-v0-2-0-released/121158 "2007-11-24T17:55:50Z")

</div>

I just posted V0.2.0 for Aquarium, an Aspect-Oriented toolkit for Ruby. You can install/update in the usual way: $ sudo gem install/update aquarium Here are the change notes for this release: == Version 0.2.0 V0.2.…

---

## [Newbie question - Problems in installing rails](https://www.ruby-forum.com/t/newbie-question-problems-in-installing-rails/121153)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [November 24, 2007, 5:53pm UTC](https://www.ruby-forum.com/t/newbie-question-problems-in-installing-rails/121153 "2007-11-24T17:53:28Z")

</div>

C:\>gem -v 0.9.2 C:\>gem install rails --include-dependencies Bulk updating Gem source index for: http://gems.rubyforge.org ERROR: While executing gem … (OpenURI::HTTPError) 404 Not Found I am getting the error abov…

---

## [Hashes, Sets, and eql?](https://www.ruby-forum.com/t/hashes-sets-and-eql/121132)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 6\
**Last updated:** [November 24, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/hashes-sets-and-eql/121132 "2007-11-24T17:50:33Z")

</div>

Hey everyone! I’ve been working with sets and I need to use them as a key in a hash. Unfortunately, it looks like Sets are implemented as a Hash (which makes sense), but it looks like Set#eql? calls eql? on the underl…

---

## [RSpec installation problems](https://www.ruby-forum.com/t/rspec-installation-problems/121154)

<div class="topic-metadata">

**Author:** [@visage](https://www.ruby-forum.com/u/visage)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 5:35pm UTC](https://www.ruby-forum.com/t/rspec-installation-problems/121154 "2007-11-24T17:35:20Z")

</div>

All, I’m working on learning rails, but I am having a tremendous amount of difficulty getting rspec on rails installed. I have blogged about it, and I was hoping someone might be able to help out. I’m running on Vist…

---

## [Printf("%x\\n", -2\*\*32) prints ..f00ffffffff00000000](https://www.ruby-forum.com/t/printf-x-n-2-32-prints-f00ffffffff00000000/121152)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 5:06pm UTC](https://www.ruby-forum.com/t/printf-x-n-2-32-prints-f00ffffffff00000000/121152 "2007-11-24T17:06:38Z")

</div>

\-2\*\*32 e$B$re(B %x e$B$G%U%)!\<%^%C%H$9$k$He(B …f00ffffffff00000000 e$B$K$J$j$^$9!#e(B % ./ruby -ve ‘printf("%x\\n", -2\*\*32)’ ruby 1.9.0 (2007-11-23 patchlevel 0) \[i686-linux\] …f00ffffffff00000000 1.8 e$B$G$Oe(B …f000…

---

## [RubyCocoa 0.13.0](https://www.ruby-forum.com/t/rubycocoa-0-13-0/121151)

<div class="topic-metadata">

**Author:** [@Laurent\_S](https://www.ruby-forum.com/u/Laurent_S)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 5:03pm UTC](https://www.ruby-forum.com/t/rubycocoa-0-13-0/121151 "2007-11-24T17:03:42Z")

</div>

Hi, I am honored to announce the immediate release of RubyCocoa 0.13.0. RubyCocoa is a Mac OS X framework that allows Cocoa programming in the object-oriented scripting language Ruby. In other words, it is a bridge t…

---

## [When \*\[\],1 dumps core](https://www.ruby-forum.com/t/when-1-dumps-core/121150)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/when-1-dumps-core/121150 "2007-11-24T16:42:34Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B 1.9 e$B$Ge(B when e$B@a$Ke(B \*\[\], 1 e$B$J$I$H=q$/$HMn$A$^$9!#e(B $ ./ruby -e ‘case 1 when \*\[\], 1; end’ – control frame ---------- c:0001 p:---- s:0001 b:-001 l:000000 d:000000 ------ – backtrac…

---

## [REXML: Raw tags in element text?](https://www.ruby-forum.com/t/rexml-raw-tags-in-element-text/121108)

<div class="topic-metadata">

**Author:** [@Jari\_W](https://www.ruby-forum.com/u/Jari_W)\
**Replies:** 4\
**Last updated:** [November 24, 2007, 4:30pm UTC](https://www.ruby-forum.com/t/rexml-raw-tags-in-element-text/121108 "2007-11-24T16:30:17Z")

</div>

In REXML, is it possible to add raw tags to element text, without having to add elements for those tags? (I would like to add a few HTML tags like to strings, before I know what element nodes they will appear at.) B…

---

## [Choosing a scripting language for scientific programming](https://www.ruby-forum.com/t/choosing-a-scripting-language-for-scientific-programming/120768)

<div class="topic-metadata">

**Author:** [@deltaquattro](https://www.ruby-forum.com/u/deltaquattro)\
**Replies:** 14\
**Last updated:** [November 24, 2007, 4:16pm UTC](https://www.ruby-forum.com/t/choosing-a-scripting-language-for-scientific-programming/120768 "2007-11-24T16:16:50Z")

</div>

Hi, I’m a Fortran scientific programmer, and recently I have had to write a lot of shell scripts which let different codes communicate by means of I/O files. Right now I’m using awk and (to a lesser extent) perl to d…

---

## [Extending to an existing case menu](https://www.ruby-forum.com/t/extending-to-an-existing-case-menu/121137)

<div class="topic-metadata">

**Author:** [@quik77](https://www.ruby-forum.com/u/quik77)\
**Replies:** 1\
**Last updated:** [November 24, 2007, 4:05pm UTC](https://www.ruby-forum.com/t/extending-to-an-existing-case-menu/121137 "2007-11-24T16:05:43Z")

</div>

user\_input = $stdin.gets.chomp case user\_input when ‘x’ puts ‘this is a test’ end So far so fine. Now I want to add something like when ‘y’ puts ‘yay, a new test’ end What would be the simplest or most elegant wa…

---

## [Will there be ability to use both native and green threads in Ruby 1.9/2.0](https://www.ruby-forum.com/t/will-there-be-ability-to-use-both-native-and-green-threads-in-ruby-1-9-2-0/121146)

<div class="topic-metadata">

**Author:** [@Voroztsov\_A](https://www.ruby-forum.com/u/Voroztsov_A)\
**Replies:** 0\
**Last updated:** [November 24, 2007, 3:44pm UTC](https://www.ruby-forum.com/t/will-there-be-ability-to-use-both-native-and-green-threads-in-ruby-1-9-2-0/121146 "2007-11-24T15:44:03Z")

</div>

Does anybody know will there be support for both native and green threads in Ruby 1.9/2.0? I found letter with unanswered question in ruby-core: 2007/11/14, Berger, Daniel removed\_email\_address@domain.invalid:

---

## [Access modifier : private](https://www.ruby-forum.com/t/access-modifier-private/121135)

<div class="topic-metadata">

**Author:** [@dharmarth](https://www.ruby-forum.com/u/dharmarth)\
**Replies:** 3\
**Last updated:** [November 24, 2007, 3:40pm UTC](https://www.ruby-forum.com/t/access-modifier-private/121135 "2007-11-24T15:40:31Z")

</div>

Hi! I’m missing some core ruby concept here that I just can’t figure out; any assistance would be excellent and welcome: I came to know from various posts that Class level varibales are shared among its subclasses in…

---

## [Processing-like application in Ruby?](https://www.ruby-forum.com/t/processing-like-application-in-ruby/121037)

<div class="topic-metadata">

**Author:** [@cifroes](https://www.ruby-forum.com/u/cifroes)\
**Replies:** 3\
**Last updated:** [November 24, 2007, 2:41pm UTC](https://www.ruby-forum.com/t/processing-like-application-in-ruby/121037 "2007-11-24T14:41:18Z")

</div>

Hello, I was wondering if anyone knows any application/framework/stuff similar to Processing (http://www.processing.org/) using Ruby as base language? Thanks, Paulo

---

## [Parsing nested JSON data](https://www.ruby-forum.com/t/parsing-nested-json-data/121118)

<div class="topic-metadata">

**Author:** [@evensoul](https://www.ruby-forum.com/u/evensoul)\
**Replies:** 5\
**Last updated:** [November 24, 2007, 12:10pm UTC](https://www.ruby-forum.com/t/parsing-nested-json-data/121118 "2007-11-24T12:10:37Z")

</div>

Hi, I didn’t find a mailing list dedicated to ruby-json, so I assume that this would be the correct place to ask. From a web API, I receive a JSON stream such as: \[{“u”:“http://…html”,“d”:“some title”,“t”:\[“ruby”\]}, …

---

## [Composition: Build objects from other objects](https://www.ruby-forum.com/t/composition-build-objects-from-other-objects/120463)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 21\
**Last updated:** [November 24, 2007, 10:15am UTC](https://www.ruby-forum.com/t/composition-build-objects-from-other-objects/120463 "2007-11-24T10:15:56Z")

</div>

http://www.javaworld.com/javaworld/jw-06-2001/jw-0608-java101.html has a discussion of composition versus inheritance which I’m trying to apply to ruby. For discussions sake, I’ll use the classes discussed in the abo…

---

## [Create method using define\_method with all sort of args?](https://www.ruby-forum.com/t/create-method-using-define-method-with-all-sort-of-args/120976)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 6\
**Last updated:** [November 24, 2007, 5:36am UTC](https://www.ruby-forum.com/t/create-method-using-define-method-with-all-sort-of-args/120976 "2007-11-24T05:36:04Z")

</div>

Hi all I know that one can create new methods using define\_method… def new\_method end is equivalent to define\_method(:new\_method) do end def new\_method(some\_param) end is equivalent to define\_method(:new\_method…

---

## [Read, write, seek method in a ring buffer class](https://www.ruby-forum.com/t/read-write-seek-method-in-a-ring-buffer-class/120758)

<div class="topic-metadata">

**Author:** [@martin\_mercy2001](https://www.ruby-forum.com/u/martin_mercy2001)\
**Replies:** 11\
**Last updated:** [November 24, 2007, 4:02am UTC](https://www.ruby-forum.com/t/read-write-seek-method-in-a-ring-buffer-class/120758 "2007-11-24T04:02:00Z")

</div>

Could any body help me with creating a ring buffer class using a string. use memory circular buffer not an IO buffer. just read, write and seek method. Read method should take anumber and return the string. write meth…

---

## [Getting Ruby to work with Postgres on Windows XP](https://www.ruby-forum.com/t/getting-ruby-to-work-with-postgres-on-windows-xp/121005)

<div class="topic-metadata">

**Author:** [@dapperd](https://www.ruby-forum.com/u/dapperd)\
**Replies:** 5\
**Last updated:** [November 24, 2007, 2:13am UTC](https://www.ruby-forum.com/t/getting-ruby-to-work-with-postgres-on-windows-xp/121005 "2007-11-24T02:13:55Z")

</div>

Hi there, I have postgres 8.2 installed (not from the source, just the installer) and would like to get ruby to talk to my postgres databases simply. I have ruby-postgres installed and am using the extconf.rb to insta…

---

## [Eigenvalues, eigenvectors in Ruby?](https://www.ruby-forum.com/t/eigenvalues-eigenvectors-in-ruby/120754)

<div class="topic-metadata">

**Author:** [@Une\_BSSSSvS\_ue](https://www.ruby-forum.com/u/Une_BSSSSvS_ue)\
**Replies:** 39\
**Last updated:** [November 23, 2007, 11:55pm UTC](https://www.ruby-forum.com/t/eigenvalues-eigenvectors-in-ruby/120754 "2007-11-23T23:55:47Z")

</div>

is there algo allready implemented to find eigenvalues, eigenvectors in Ruby ??? for symetrical matrices ?

---

## [ODBC and Ruby](https://www.ruby-forum.com/t/odbc-and-ruby/121081)

<div class="topic-metadata">

**Author:** [@lorenzo](https://www.ruby-forum.com/u/lorenzo)\
**Replies:** 4\
**Last updated:** [November 23, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/odbc-and-ruby/121081 "2007-11-23T20:21:18Z")

</div>

hello, I’m new in ruby, I’ve problems conneting ruby odbc with informix db, in tbles with thousand records my program always retruns no rows, this is the test program: sth=c.prepare(“select \* from anopta”) sth.execut…

---

## [Two arrays: return only values that exist in both arrays?](https://www.ruby-forum.com/t/two-arrays-return-only-values-that-exist-in-both-arrays/121068)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 8\
**Last updated:** [November 23, 2007, 8:07pm UTC](https://www.ruby-forum.com/t/two-arrays-return-only-values-that-exist-in-both-arrays/121068 "2007-11-23T20:07:13Z")

</div>

Hi all a = \[:one, :two, :three, :six\] b = \[:two, :four, :five: six\] I want to extract the values of two arrays which exist in both ones (a and b): =\> \[:two, :six\] Does there exist a method for this? Thanks Josh

---

## [Array object but to\_a is needed to access data](https://www.ruby-forum.com/t/array-object-but-to-a-is-needed-to-access-data/120778)

<div class="topic-metadata">

**Author:** [@lucevers](https://www.ruby-forum.com/u/lucevers)\
**Replies:** 2\
**Last updated:** [November 23, 2007, 8:05pm UTC](https://www.ruby-forum.com/t/array-object-but-to-a-is-needed-to-access-data/120778 "2007-11-23T20:05:37Z")

</div>

Hi, Below a progam (test version) that shall analyse syslog messages. The program works fine but I don’t understand why to\_a is needed. (filter.hash\[:action\].to\_a\[0\]) filter.hash\[:action\].class -\> answer array filte…

---

## [Help needed using a regex .sub](https://www.ruby-forum.com/t/help-needed-using-a-regex-sub/120996)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 4\
**Last updated:** [November 23, 2007, 8:04pm UTC](https://www.ruby-forum.com/t/help-needed-using-a-regex-sub/120996 "2007-11-23T20:04:48Z")

</div>

I’m trying to insert a NULL between the first pair of commas in the line below if it’s not already there. Before: PWCLLP-243-00000002,Images\\1\\pwcllp\_243\_00000002.tif, After: PWCLLP-243-00000002,NULL,Images\\1\\pwcllp\_…

---

## [Chomp - works in irb, not in program](https://www.ruby-forum.com/t/chomp-works-in-irb-not-in-program/121094)

<div class="topic-metadata">

**Author:** [@wpvanpaassen](https://www.ruby-forum.com/u/wpvanpaassen)\
**Replies:** 8\
**Last updated:** [November 23, 2007, 7:37pm UTC](https://www.ruby-forum.com/t/chomp-works-in-irb-not-in-program/121094 "2007-11-23T19:37:58Z")

</div>

When I try to use chomp to get user input, I get this error: private method \`chomp’ called for nil:NilClass (NoMethodError) from d:/scripts/ruby/fix1.rb:82:in \`run' from d:/scripts/ruby/fix1.rb:128 When I use …

---

## [Read a xml file](https://www.ruby-forum.com/t/read-a-xml-file/121073)

<div class="topic-metadata">

**Author:** [@mihai](https://www.ruby-forum.com/u/mihai)\
**Replies:** 5\
**Last updated:** [November 23, 2007, 7:25pm UTC](https://www.ruby-forum.com/t/read-a-xml-file/121073 "2007-11-23T19:25:36Z")

</div>

hello, im new in using rexml and a i have a first question: how can a read this file: i want to read all children so that output will be something like that: …

---

## [Compact if statement for Codegolf](https://www.ruby-forum.com/t/compact-if-statement-for-codegolf/71815)

<div class="topic-metadata">

**Author:** [@dfg59](https://www.ruby-forum.com/u/dfg59)\
**Replies:** 10\
**Last updated:** [November 23, 2007, 7:19pm UTC](https://www.ruby-forum.com/t/compact-if-statement-for-codegolf/71815 "2007-11-23T19:19:19Z")

</div>

I’m working on my codegolfing skills and was wondering, what is the shortest possible way to write the following in ruby: if a==0 1 else 2 end Thanks for the help!

---

## [Emulating a Groovy feature?](https://www.ruby-forum.com/t/emulating-a-groovy-feature/112407)

<div class="topic-metadata">

**Author:** [@princenamor](https://www.ruby-forum.com/u/princenamor)\
**Replies:** 18\
**Last updated:** [November 23, 2007, 7:08pm UTC](https://www.ruby-forum.com/t/emulating-a-groovy-feature/112407 "2007-11-23T19:08:37Z")

</div>

Guys, There’s something called Safe Navigation in Groovy (http://groovy.codehaus.org/Statements#Statements-Safenavigation) that I find very appealing. So, Groovy will allow you to safely walk an object graph, even if…

---

## [Working with regular expressions and "$"?](https://www.ruby-forum.com/t/working-with-regular-expressions-and/121080)

<div class="topic-metadata">

**Author:** [@josh](https://www.ruby-forum.com/u/josh)\
**Replies:** 3\
**Last updated:** [November 23, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/working-with-regular-expressions-and/121080 "2007-11-23T16:29:33Z")

</div>

Hi all I remember to have read somewhere that the matching results of a regular expression match like string1 =~ /some\_expression/ is stored in “$”. I couldn’t find documentation related to this (it’s a little hard …

---

## [Calling and passing blocks in a C extension](https://www.ruby-forum.com/t/calling-and-passing-blocks-in-a-c-extension/121023)

<div class="topic-metadata">

**Author:** [@reflex](https://www.ruby-forum.com/u/reflex)\
**Replies:** 2\
**Last updated:** [November 23, 2007, 3:38pm UTC](https://www.ruby-forum.com/t/calling-and-passing-blocks-in-a-c-extension/121023 "2007-11-23T15:38:31Z")

</div>

Hello How do I do the equivalent of the code below in a C extension? def foo(&block) x = 0 my\_iterator do |b| b.process(&block) x += 1 end return x end I tried lots of different combinations of rb\_iterate() and…

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

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