# Ruby

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

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

---

## [Do we "own" XML namespace?](https://www.ruby-forum.com/t/do-we-own-xml-namespace/143046)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 3\
**Last updated:** [July 15, 2008, 4:03am UTC](https://www.ruby-forum.com/t/do-we-own-xml-namespace/143046 "2008-07-15T04:03:37Z")

</div>

Hi– Little bit of debate going on with LibXML, and I’d like to get some general feed back. Currently the module namespace used by libxml-ruby is “XML”, so we see code like: require ‘libxml’ XML::Document.new The q…

---

## [Code Review: rubyopt](https://www.ruby-forum.com/t/code-review-rubyopt/143091)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [July 15, 2008, 3:58am UTC](https://www.ruby-forum.com/t/code-review-rubyopt/143091 "2008-07-15T03:58:55Z")

</div>

tfpt review “/shelveset:rubyopt;REDMOND\\tomat” Misc Ruby optimizations. Optimizes method lookup: Adds cache for unsuccessful CLR member lookup. CLR types are read-only and so the knowledge of a member lookup fai…

---

## [Shoes toolket](https://www.ruby-forum.com/t/shoes-toolket/143082)

<div class="topic-metadata">

**Author:** [@Edward\_R](https://www.ruby-forum.com/u/Edward_R)\
**Replies:** 1\
**Last updated:** [July 15, 2008, 3:50am UTC](https://www.ruby-forum.com/t/shoes-toolket/143082 "2008-07-15T03:50:43Z")

</div>

I have been trying to write a few programs with shoes. I am wondering if there is a way to change the background from within a button. I have tried something like the following but it does not work. Shoes.app ‘change…

---

## [Instance\_eval or class\_eval on metaclass?](https://www.ruby-forum.com/t/instance-eval-or-class-eval-on-metaclass/142800)

<div class="topic-metadata">

**Author:** [@Christopher\_JSBott](https://www.ruby-forum.com/u/Christopher_JSBott)\
**Replies:** 2\
**Last updated:** [July 15, 2008, 3:47am UTC](https://www.ruby-forum.com/t/instance-eval-or-class-eval-on-metaclass/142800 "2008-07-15T03:47:11Z")

</div>

I was looking at someone’s implementation of #meta\_eval and I noticed they used #instance\_eval. I’ve always been using #class\_eval with metaclasses and getting my desired effect. So why use #instance\_eval over #clas…

---

## [Open3 throws exception when preceded by fork](https://www.ruby-forum.com/t/open3-throws-exception-when-preceded-by-fork/143057)

<div class="topic-metadata">

**Author:** [@trickyvail](https://www.ruby-forum.com/u/trickyvail)\
**Replies:** 3\
**Last updated:** [July 15, 2008, 2:33am UTC](https://www.ruby-forum.com/t/open3-throws-exception-when-preceded-by-fork/143057 "2008-07-15T02:33:10Z")

</div>

I am attempting to create a daemon that (when required) spawns off child processes to perform “jobs”. It is important that this daemon does not block so it can start concurrent jobs, and that it knows when jobs have c…

---

## [Array of hashes (finding value)](https://www.ruby-forum.com/t/array-of-hashes-finding-value/143073)

<div class="topic-metadata">

**Author:** [@nateleavitt](https://www.ruby-forum.com/u/nateleavitt)\
**Replies:** 5\
**Last updated:** [July 15, 2008, 12:14am UTC](https://www.ruby-forum.com/t/array-of-hashes-finding-value/143073 "2008-07-15T00:14:50Z")

</div>

I’m just looking for other possible solutions. Sorry, this is kinda a noob question. Currently I loop through the array and check the value of each hash key to find values. Is that the only and/or best way to find m…

---

## [How to loop through two arrays in parallel](https://www.ruby-forum.com/t/how-to-loop-through-two-arrays-in-parallel/143066)

<div class="topic-metadata">

**Author:** [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Replies:** 9\
**Last updated:** [July 14, 2008, 11:09pm UTC](https://www.ruby-forum.com/t/how-to-loop-through-two-arrays-in-parallel/143066 "2008-07-14T23:09:34Z")

</div>

I have two arrays from a form. params\[:products\] and params\[:quantity\] which are products\[\] and quantity\[\] I would like to extract the data from each item to get their name and quantity. Is there a way in Ruby to do…

---

## [Ruby & Threads](https://www.ruby-forum.com/t/ruby-threads/143042)

<div class="topic-metadata">

**Author:** [@michaelb](https://www.ruby-forum.com/u/michaelb)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 10:36pm UTC](https://www.ruby-forum.com/t/ruby-threads/143042 "2008-07-14T22:36:11Z")

</div>

Hello all, I’m building an application that has to branch out and call about 10 other Ruby scripts. Since each script will run for a few seconds, waiting for each one to finish will take a while, which is too much. So…

---

## [Factorials](https://www.ruby-forum.com/t/factorials/142965)

<div class="topic-metadata">

**Author:** [@toro04](https://www.ruby-forum.com/u/toro04)\
**Replies:** 5\
**Last updated:** [July 14, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/factorials/142965 "2008-07-14T22:32:36Z")

</div>

I just started using ruby, and no matter how hard i try i cant do factorials. how to a get the factorial of an imported number?

---

## [Win32/Process when create a process, how to pass data](https://www.ruby-forum.com/t/win32-process-when-create-a-process-how-to-pass-data/143065)

<div class="topic-metadata">

**Author:** [@qilu](https://www.ruby-forum.com/u/qilu)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 9:43pm UTC](https://www.ruby-forum.com/t/win32-process-when-create-a-process-how-to-pass-data/143065 "2008-07-14T21:43:15Z")

</div>

I am working on moving a server code from Linux to Window XP. I need make original Process.fork call work on Windows XP. I tried two approaches: I have simplified the code. Approach 1: keep original fork method: req…

---

## [Bug involving condition variables](https://www.ruby-forum.com/t/bug-involving-condition-variables/142984)

<div class="topic-metadata">

**Author:** [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 7:44pm UTC](https://www.ruby-forum.com/t/bug-involving-condition-variables/142984 "2008-07-14T19:44:01Z")

</div>

The following code generates a ThreadError (“not owner”, raised in unlock\_mutex\_inner()). However, the ThreadError never gets reported at the top level (even though my code is re-raising it and Thread.abort\_on\_excepti…

---

## [Anyone having Warble working with Rails cache sweepers?](https://www.ruby-forum.com/t/anyone-having-warble-working-with-rails-cache-sweepers/142950)

<div class="topic-metadata">

**Author:** [@RaphaSSSSl\_Valyi](https://www.ruby-forum.com/u/RaphaSSSSl_Valyi)\
**Replies:** 4\
**Last updated:** [July 14, 2008, 7:15pm UTC](https://www.ruby-forum.com/t/anyone-having-warble-working-with-rails-cache-sweepers/142950 "2008-07-14T19:15:54Z")

</div>

Hi all, I’ve got finally my Rails app almost working on Glassfish with Warble. I had good stuff working: static page cache, JNDI connection pooling… And the overall performance looks great. BUT, I can’t have my cache…

---

## [MutableString encoding issue](https://www.ruby-forum.com/t/mutablestring-encoding-issue/142983)

<div class="topic-metadata">

**Author:** [@Oleg\_T](https://www.ruby-forum.com/u/Oleg_T)\
**Replies:** 5\
**Last updated:** [July 14, 2008, 6:38pm UTC](https://www.ruby-forum.com/t/mutablestring-encoding-issue/142983 "2008-07-14T18:38:22Z")

</div>

Stumbled on this when testing yaml. “\\204” =\> “?” While irb(main):005:0\>"\\204" =\> “\\204” I believe Ruby string can hold arbitrary byte values, but as we are storing content as a string we are obviously losin…

---

## [Error accessing Sqlite](https://www.ruby-forum.com/t/error-accessing-sqlite/142883)

<div class="topic-metadata">

**Author:** [@toospoiled](https://www.ruby-forum.com/u/toospoiled)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 6:30pm UTC](https://www.ruby-forum.com/t/error-accessing-sqlite/142883 "2008-07-14T18:30:11Z")

</div>

Hi, I’ve tried to access to a Sqlite database, or to create one, but the result is always the same, when I execute this code: require ‘rubygems’ require ‘sqlite3’ dir=‘C:\\Documents and Settings\\Andrea Marchese\\Deskto…

---

## [Connecting to a Windows share from a Windows computer](https://www.ruby-forum.com/t/connecting-to-a-windows-share-from-a-windows-computer/142951)

<div class="topic-metadata">

**Author:** [@panth0r](https://www.ruby-forum.com/u/panth0r)\
**Replies:** 8\
**Last updated:** [July 14, 2008, 6:29pm UTC](https://www.ruby-forum.com/t/connecting-to-a-windows-share-from-a-windows-computer/142951 "2008-07-14T18:29:04Z")

</div>

We have two separate servers running Windows Server 2003, and what we need to do is simply copy files from a share on one of the computers to the other, the computers share a domain. I assume there is some simple lib…

---

## [Timer program](https://www.ruby-forum.com/t/timer-program/143021)

<div class="topic-metadata">

**Author:** [@hydroflamexz18](https://www.ruby-forum.com/u/hydroflamexz18)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/timer-program/143021 "2008-07-14T17:04:25Z")

</div>

I’ve been looking to enhance a timer program I’ve made. It’s extremely simple so I want to add new features like maybe an alarm when the times up, I’m going to try to download an audio file such as an mp3 for an alarm…

---

## [\[NEWBIE\] Help with class instance variables](https://www.ruby-forum.com/t/newbie-help-with-class-instance-variables/143007)

<div class="topic-metadata">

**Author:** [@ittayd](https://www.ruby-forum.com/u/ittayd)\
**Replies:** 7\
**Last updated:** [July 14, 2008, 4:52pm UTC](https://www.ruby-forum.com/t/newbie-help-with-class-instance-variables/143007 "2008-07-14T16:52:22Z")

</div>

Hello, The code below prints: #\<Gem::Platform:0x…fdbdf0696 @cpu=“x86”, @os=“linux”, @version=nil\> that is, the @arch, @os and @classifier are empty. (if i set these variables in the id method, they work fine) (Gem::P…

---

## [Error handling with command calls](https://www.ruby-forum.com/t/error-handling-with-command-calls/143024)

<div class="topic-metadata">

**Author:** [@stefans](https://www.ruby-forum.com/u/stefans)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 4:40pm UTC](https://www.ruby-forum.com/t/error-handling-with-command-calls/143024 "2008-07-14T16:40:40Z")

</div>

Hello, I’m trying to rewrite a Bash shell script with Ruby. do\_something if $?.exitstatus != 0 handle\_error end do\_some\_other\_thing if $?.exitstatus != 0 handle\_error end How can I avoid having to poll exitstat…

---

## [Shoes Toolkit](https://www.ruby-forum.com/t/shoes-toolkit/143025)

<div class="topic-metadata">

**Author:** [@hydroflamexz18](https://www.ruby-forum.com/u/hydroflamexz18)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 4:24pm UTC](https://www.ruby-forum.com/t/shoes-toolkit/143025 "2008-07-14T16:24:35Z")

</div>

I recently was using the Shoes universal app. I’m guessing it’s very basic because if I use too much lines of code It’ll flake out on me. Is there anything like this that’s universal because I use a variety of compute…

---

## [Why Ruby interpreter is writed in c (not in c++)?](https://www.ruby-forum.com/t/why-ruby-interpreter-is-writed-in-c-not-in-c/142750)

<div class="topic-metadata">

**Author:** [@Ranieri\_T](https://www.ruby-forum.com/u/Ranieri_T)\
**Replies:** 26\
**Last updated:** [July 14, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/why-ruby-interpreter-is-writed-in-c-not-in-c/142750 "2008-07-14T15:56:44Z")

</div>

Hi, I’ve downloaded the sources of Ruby 1.8.7-p22 and compiled it with MS CL compiler. Ok, very well. But, the code is in structured C, not in object oriented C++. Why? C++ doesn’t provides the sabe low level faciliti…

---

## [\#define like with ruby](https://www.ruby-forum.com/t/define-like-with-ruby/143001)

<div class="topic-metadata">

**Author:** [@jyrppa](https://www.ruby-forum.com/u/jyrppa)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/define-like-with-ruby/143001 "2008-07-14T15:55:33Z")

</div>

My code snippet looks like: … testdata\[current\_line + 1\] … … I would like to replace current\_line + 1 with something more desciptive like NEXT\_LINE. In C I would do: #define NEXT\_LINE current\_line + 1 Is there so…

---

## [Re: Texture/image similarity with ruby? (computer vision)](https://www.ruby-forum.com/t/re-texture-image-similarity-with-ruby-computer-vision/143010)

<div class="topic-metadata">

**Author:** [@Axel\_E](https://www.ruby-forum.com/u/Axel_E)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 2:33pm UTC](https://www.ruby-forum.com/t/re-texture-image-similarity-with-ruby-computer-vision/143010 "2008-07-14T14:33:33Z")

</div>

a good toolkit: http://kogs-www.informatik.uni-hamburg.de/~koethe/vigra/ and another http://www.itk.org/HTML/WatershedSegmentationExample.html i’ve used bot a lot, shelling out to ruby mostly, unfortunately …

---

## [Tidy segfault on Linux](https://www.ruby-forum.com/t/tidy-segfault-on-linux/122239)

<div class="topic-metadata">

**Author:** [@lfeistel](https://www.ruby-forum.com/u/lfeistel)\
**Replies:** 3\
**Last updated:** [July 14, 2008, 1:37pm UTC](https://www.ruby-forum.com/t/tidy-segfault-on-linux/122239 "2008-07-14T13:37:18Z")

</div>

Hi– I’m using the Ruby tidy gem to clean some user-input HTML. It works splendidly on my Mac development machine, but seg faults on a CentOS linux box. I’ve tracked through the code, and the crash occurs in Tidybuf.r…

---

## [What is the complexity of find\_by\_name?](https://www.ruby-forum.com/t/what-is-the-complexity-of-find-by-name/142980)

<div class="topic-metadata">

**Author:** [@kretch](https://www.ruby-forum.com/u/kretch)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 1:31pm UTC](https://www.ruby-forum.com/t/what-is-the-complexity-of-find-by-name/142980 "2008-07-14T13:31:26Z")

</div>

Hi All I was wondering whether find\_by\_name has linear complexity O(n) with n being the number of records? Or is it log(n) or constant? I have some code which uses find\_by\_name heavily, and I was wondering if the long …

---

## [Passing arguments to a class, how do?](https://www.ruby-forum.com/t/passing-arguments-to-a-class-how-do/142945)

<div class="topic-metadata">

**Author:** [@lz-coelho](https://www.ruby-forum.com/u/lz-coelho)\
**Replies:** 8\
**Last updated:** [July 14, 2008, 1:22pm UTC](https://www.ruby-forum.com/t/passing-arguments-to-a-class-how-do/142945 "2008-07-14T13:22:03Z")

</div>

I’m learning Ruby, and i need to solve a problem: class Person def namer=(name, surname) @var = name @car = surname end end object = Person.new object.namer = (how to pass the params here) ? Thanks for your atte…

---

## [Methods with \[\] braces can't take block arguments?](https://www.ruby-forum.com/t/methods-with-braces-cant-take-block-arguments/142958)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [July 14, 2008, 11:11am UTC](https://www.ruby-forum.com/t/methods-with-braces-cant-take-block-arguments/142958 "2008-07-14T11:11:56Z")

</div>

Hi All, I want to create a L2 cache object based on Hash. Since it’s a secondary cache, the object bound to the key may have expired, but can be recreated. However I want the get method itself to do get-get-set if th…

---

## [Raw Sockets for packet sniffing](https://www.ruby-forum.com/t/raw-sockets-for-packet-sniffing/142993)

<div class="topic-metadata">

**Author:** [@fdmanana](https://www.ruby-forum.com/u/fdmanana)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 9:21am UTC](https://www.ruby-forum.com/t/raw-sockets-for-packet-sniffing/142993 "2008-07-14T09:21:34Z")

</div>

Hello, I am trying to use, through 100% Ruby code, Linux Raw Sockets for packet sniffing. I am using the same syscalls that I would use in C code. I am able to inject packets through the raw socket but not to sniff pa…

---

## [1.9.1 feature$B$H(B1.9.0-3$B%j%j!\<%9%W%i%s(B](https://www.ruby-forum.com/t/1-9-1-feature-b-h-b1-9-0-3-b-j-j-9-w-i-s-b/142989)

<div class="topic-metadata">

**Author:** [@Yugui\_SYuki\_S.S](https://www.ruby-forum.com/u/Yugui_SYuki_S.S)\
**Replies:** 0\
**Last updated:** [July 14, 2008, 9:19am UTC](https://www.ruby-forum.com/t/1-9-1-feature-b-h-b1-9-0-3-b-j-j-9-w-i-s-b/142989 "2008-07-14T09:19:56Z")

</div>

Yuguie$B$G$9!#e(B\[ruby-core:17644\]e$B0J2\<$N$\*OC$r$^$H$a$F$\_$^$7$?!#e(B == 1.9.1 e$BAG0Fe(B === e$B4^$^$l$k5!G=e(B e$B%V%m%C%/0z?t$N%G%U%)%k%HCM;XDje(B e$BAH$9~$$N%+%P%l%C%8B,Dj5!G=e(B e$B2~NIHGe(Btranscode transcode …

---

## [Treetop positive lookahead problem](https://www.ruby-forum.com/t/treetop-positive-lookahead-problem/142838)

<div class="topic-metadata">

**Author:** [@tma](https://www.ruby-forum.com/u/tma)\
**Replies:** 4\
**Last updated:** [July 14, 2008, 6:20am UTC](https://www.ruby-forum.com/t/treetop-positive-lookahead-problem/142838 "2008-07-14T06:20:38Z")

</div>

Hi, I just started plyaing around with treetop and have probably barely touched the surface of possibilities with this great tool. Anyway I have a problem that I think should be quite trivial. My test rule is: rule …

---

## [Rmagick on Mac](https://www.ruby-forum.com/t/rmagick-on-mac/142939)

<div class="topic-metadata">

**Author:** [@vinnie](https://www.ruby-forum.com/u/vinnie)\
**Replies:** 2\
**Last updated:** [July 14, 2008, 2:53am UTC](https://www.ruby-forum.com/t/rmagick-on-mac/142939 "2008-07-14T02:53:59Z")

</div>

I’m thinking of installing rmagick on my Mac. From what I’ve read, I’ll need to install X11 for rmagick to display images. I’d prefer to NOT have to do this, so if I am not displaying an image with rmagick, and theref…

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

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