# Ruby

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

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

---

## [Too slow in using Net::HTTP.post\_form](https://www.ruby-forum.com/t/too-slow-in-using-net-http-post-form/111912)

<div class="topic-metadata">

**Author:** [@ak756](https://www.ruby-forum.com/u/ak756)\
**Replies:** 5\
**Last updated:** [August 15, 2007, 3:34am UTC](https://www.ruby-forum.com/t/too-slow-in-using-net-http-post-form/111912 "2007-08-15T03:34:27Z")

</div>

Hi I am using Net::HTTP.post\_form to post cgi request to a website and get answers. Below is my code and I found that it always take about 30s to return the result. I think my Internt connection is not so slow as I p…

---

## [Can a lambda or Proc object yield a value to a block?](https://www.ruby-forum.com/t/can-a-lambda-or-proc-object-yield-a-value-to-a-block/111990)

<div class="topic-metadata">

**Author:** [@cleasaibeag](https://www.ruby-forum.com/u/cleasaibeag)\
**Replies:** 4\
**Last updated:** [August 15, 2007, 3:23am UTC](https://www.ruby-forum.com/t/can-a-lambda-or-proc-object-yield-a-value-to-a-block/111990 "2007-08-15T03:23:26Z")

</div>

I’ve searched quite a bit on the web and through “Programming Ruby - the Pragmatic Programmer’s Guide” and I can’t find a satisfactory answer to the question: Can a lambda or Proc object yield a value to a block? For…

---

## [Segmentation Fault in httpclient 2.1.0](https://www.ruby-forum.com/t/segmentation-fault-in-httpclient-2-1-0/111220)

<div class="topic-metadata">

**Author:** [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Replies:** 2\
**Last updated:** [August 15, 2007, 3:21am UTC](https://www.ruby-forum.com/t/segmentation-fault-in-httpclient-2-1-0/111220 "2007-08-15T03:21:26Z")

</div>

I’ve written a ruby script that connects to a web service running within our intranet via Soap4r. I developed the script on a Mac (OS 10.4.10, ruby 1.8.6 patch 0, soap4r 1.5.7, httpclient 2.1.0, net-ssh 1.1.2) and I h…

---

## [HTML test output?](https://www.ruby-forum.com/t/html-test-output/111515)

<div class="topic-metadata">

**Author:** [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Replies:** 8\
**Last updated:** [August 15, 2007, 3:15am UTC](https://www.ruby-forum.com/t/html-test-output/111515 "2007-08-15T03:15:26Z")

</div>

The other thing I’ve been looking for is a way to output the Ruby unit test results to the console and to an XML log file. I found a reference to the test-report gem, but it seems to have gone away. Has something take…

---

## [Convert a n binary number to /n](https://www.ruby-forum.com/t/convert-a-n-binary-number-to-n/112042)

<div class="topic-metadata">

**Author:** [@z4n9ief](https://www.ruby-forum.com/u/z4n9ief)\
**Replies:** 4\
**Last updated:** [August 15, 2007, 3:10am UTC](https://www.ruby-forum.com/t/convert-a-n-binary-number-to-n/112042 "2007-08-15T03:10:33Z")

</div>

Hi, If my number is 1111, I would like to had 0000. If my number is 1001, I would like to had 0110. If my number is 0011, I would like to had 1100. Of cours I know we can use XOR operator, but I would like to allow R…

---

## [How can I define UNION in ruby?](https://www.ruby-forum.com/t/how-can-i-define-union-in-ruby/112084)

<div class="topic-metadata">

**Author:** [@Zhan\_feng\_W](https://www.ruby-forum.com/u/Zhan_feng_W)\
**Replies:** 1\
**Last updated:** [August 15, 2007, 3:05am UTC](https://www.ruby-forum.com/t/how-can-i-define-union-in-ruby/112084 "2007-08-15T03:05:25Z")

</div>

Hi,friends, I’d like to know how can I define UNION in ruby? e.g. In C, I have a UNION as following: union ID\_OCT{ struct ID\_BIT{ unsigned class:2; /b8,b7/ unsigned if\_prim:1; /b6,0–primitive/ unsigned …

---

## [IPSocket::getaddress problem](https://www.ruby-forum.com/t/ipsocket-getaddress-problem/112077)

<div class="topic-metadata">

**Author:** [@h4z3](https://www.ruby-forum.com/u/h4z3)\
**Replies:** 3\
**Last updated:** [August 15, 2007, 2:43am UTC](https://www.ruby-forum.com/t/ipsocket-getaddress-problem/112077 "2007-08-15T02:43:24Z")

</div>

Hey guys, I want to test if IPSocket::getaddress(‘address’) is valid before printing it or anything… If the user enters an invalid address then the program dies, i tried rescuing the error but i didn’t have much luck,…

---

## [Swiftiply 0.6.1 Released](https://www.ruby-forum.com/t/swiftiply-0-6-1-released/112083)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [August 15, 2007, 2:03am UTC](https://www.ruby-forum.com/t/swiftiply-0-6-1-released/112083 "2007-08-15T02:03:23Z")

</div>

Swiftiply is a fast backend agnostic clustering proxy for web applications that is specifically designed to support HTTP traffic from web frameworks. New in this release, other than some bugfixes and performance tw…

---

## [Process.euid \[BUG\] Segmentation fault](https://www.ruby-forum.com/t/process-euid-bug-segmentation-fault/112034)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 2\
**Last updated:** [August 15, 2007, 1:39am UTC](https://www.ruby-forum.com/t/process-euid-bug-segmentation-fault/112034 "2007-08-15T01:39:22Z")

</div>

Process.euid e$B$Ge(B SEGV e$B$9$k$h$&$G$9!#e(B % ./ruby -e ‘p Process.euid’ -e:1: – control frame ---------- c:0004 p:---- s:0009 b:0009 l:000008 d:000008 CFUNC :euid c:0003 p:0014 s:0006 b:0005 l:000004 d:000004 T…

---

## [Ruby Chart](https://www.ruby-forum.com/t/ruby-chart/111975)

<div class="topic-metadata">

**Author:** [@amslonewolf](https://www.ruby-forum.com/u/amslonewolf)\
**Replies:** 2\
**Last updated:** [August 15, 2007, 1:30am UTC](https://www.ruby-forum.com/t/ruby-chart/111975 "2007-08-15T01:30:21Z")

</div>

Hi - I am a total Ruby N., so anyhelp would be much appreciated. I am sure the experts out there can whip the attached graph in a couple of minutes. I have Ruby calculating the data points, all I need to do is create…

---

## [How to parse the "next" button on yahoo resultpages?](https://www.ruby-forum.com/t/how-to-parse-the-next-button-on-yahoo-resultpages/112059)

<div class="topic-metadata">

**Author:** [@karltrout](https://www.ruby-forum.com/u/karltrout)\
**Replies:** 1\
**Last updated:** [August 15, 2007, 1:27am UTC](https://www.ruby-forum.com/t/how-to-parse-the-next-button-on-yahoo-resultpages/112059 "2007-08-15T01:27:21Z")

</div>

Hi guys, I’m new to ruby and I really like it. But I’m standing in front of a little maybe not so much ruby but more logical? problem. I did some little tool which searches yahoo and prints the results on the screen: …

---

## [To\_str behavior](https://www.ruby-forum.com/t/to-str-behavior/111907)

<div class="topic-metadata">

**Author:** [@Nasir\_K](https://www.ruby-forum.com/u/Nasir_K)\
**Replies:** 8\
**Last updated:** [August 15, 2007, 12:32am UTC](https://www.ruby-forum.com/t/to-str-behavior/111907 "2007-08-15T00:32:18Z")

</div>

Hi, I have two related questions on to\_str behavior. AFAIK to\_str does automatic coercion to string wherever one is required, it is to be provided for objects that exhibit string like behavior. But this mental model …

---

## [Attr\_\* position in a class and their results](https://www.ruby-forum.com/t/attr-position-in-a-class-and-their-results/112063)

<div class="topic-metadata">

**Author:** [@jub](https://www.ruby-forum.com/u/jub)\
**Replies:** 4\
**Last updated:** [August 14, 2007, 11:01pm UTC](https://www.ruby-forum.com/t/attr-position-in-a-class-and-their-results/112063 "2007-08-14T23:01:08Z")

</div>

Hello, I was playing with instance variables when I made up those two classes : class Vartest\_before def init @instance\_variable = “I belong to the instance” end attr\_accessor :instance\_variable def instance\_varia…

---

## [Is there a thread safe implementation of a priority queue?](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062)

<div class="topic-metadata">

**Author:** [@dizzyone](https://www.ruby-forum.com/u/dizzyone)\
**Replies:** 3\
**Last updated:** [August 14, 2007, 10:57pm UTC](https://www.ruby-forum.com/t/is-there-a-thread-safe-implementation-of-a-priority-queue/112062 "2007-08-14T22:57:08Z")

</div>

I could only find a class called Queue in RDoc. Is there no (thread safe) priority queue? If not where can I get one? Turing.

---

## [TCPSocket select method](https://www.ruby-forum.com/t/tcpsocket-select-method/111961)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 5\
**Last updated:** [August 14, 2007, 10:51pm UTC](https://www.ruby-forum.com/t/tcpsocket-select-method/111961 "2007-08-14T22:51:07Z")

</div>

Hmm. If you create a method thus: class TCPSocket def readableNow? r,w,e = select(\[self\],nil,nil,0) return r != nil end end It turns out to use a select OTHER than IO.select. Anyone know, by chance what the ‘int…

---

## [Change of Symbol to respond to intern?](https://www.ruby-forum.com/t/change-of-symbol-to-respond-to-intern/112047)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 6\
**Last updated:** [August 14, 2007, 10:06pm UTC](https://www.ruby-forum.com/t/change-of-symbol-to-respond-to-intern/112047 "2007-08-14T22:06:03Z")

</div>

I often find myself writing methods with the following form: def foo(sym\_or\_str) @iv = sym\_or\_str end when I go to compare later vs @iv, I can do: def compare\_vs\_iv(arg) if arg.to\_s == @iv.to\_s then … end … end …

---

## [Image\_science .so being called from my home dir - help](https://www.ruby-forum.com/t/image-science-so-being-called-from-my-home-dir-help/112061)

<div class="topic-metadata">

**Author:** [@wickie](https://www.ruby-forum.com/u/wickie)\
**Replies:** 0\
**Last updated:** [August 14, 2007, 8:57pm UTC](https://www.ruby-forum.com/t/image-science-so-being-called-from-my-home-dir-help/112061 "2007-08-14T20:57:57Z")

</div>

Anyone seen this before? I deploy my app to /home/myapp yet according to lsof mongrel is using the image science shared object from my home directory… mongrel\_r 26036 root mem REG 3,5 17617 7097656 /home/…

---

## [Timeout::Error - catchable?](https://www.ruby-forum.com/t/timeout-error-catchable/111925)

<div class="topic-metadata">

**Author:** [@Rik\_Hemsley](https://www.ruby-forum.com/u/Rik_Hemsley)\
**Replies:** 6\
**Last updated:** [August 14, 2007, 8:44pm UTC](https://www.ruby-forum.com/t/timeout-error-catchable/111925 "2007-08-14T20:44:56Z")

</div>

Hi, I’m having trouble catching the exception raised by Timeout.timeout Using the following code: require ‘timeout’ begin Timeout::timeout(1) do sleep(5) end rescue puts “rescued in outer” end The interpreter …

---

## [BackgrounDRb: Re-call do\_work or non blocking methods?](https://www.ruby-forum.com/t/backgroundrb-re-call-do-work-or-non-blocking-methods/112056)

<div class="topic-metadata">

**Author:** [@stephan](https://www.ruby-forum.com/u/stephan)\
**Replies:** 0\
**Last updated:** [August 14, 2007, 7:10pm UTC](https://www.ruby-forum.com/t/backgroundrb-re-call-do-work-or-non-blocking-methods/112056 "2007-08-14T19:10:54Z")

</div>

Hi. I’ve been trying to use BackgrounDRb for a couple of weeks now and have been experiencing some very odd behaviour, (largely due to Rails’ behaviour in the face of threads but also) due to my misunderstanding Back…

---

## [RubyCocoa 0.12.0](https://www.ruby-forum.com/t/rubycocoa-0-12-0/112050)

<div class="topic-metadata">

**Author:** [@Laurent\_S](https://www.ruby-forum.com/u/Laurent_S)\
**Replies:** 2\
**Last updated:** [August 14, 2007, 6:21pm UTC](https://www.ruby-forum.com/t/rubycocoa-0-12-0/112050 "2007-08-14T18:21:34Z")

</div>

Hi, I am honored to announce the immediate release of RubyCocoa 0.12.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…

---

## [Why don't Ruby libraries share memory?](https://www.ruby-forum.com/t/why-dont-ruby-libraries-share-memory/111955)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 11\
**Last updated:** [August 14, 2007, 4:42pm UTC](https://www.ruby-forum.com/t/why-dont-ruby-libraries-share-memory/111955 "2007-08-14T16:42:23Z")

</div>

This paragraph is motivation. While my question is not Rails-specific, I am asking it because of Rails. I’ve been investigating the memory footprint of my Mongrels. It is nice that they share the .so libraries from …

---

## [Symbols and strings](https://www.ruby-forum.com/t/symbols-and-strings/112019)

<div class="topic-metadata">

**Author:** [@maghac](https://www.ruby-forum.com/u/maghac)\
**Replies:** 6\
**Last updated:** [August 14, 2007, 1:45pm UTC](https://www.ruby-forum.com/t/symbols-and-strings/112019 "2007-08-14T13:45:48Z")

</div>

Hi, as a long-term perl user just recently converted to ruby, I’m curious about one particular syntax “feature”: ruby symbols and how they relate to strings. Isn’t really :name a shortcut for “name”? (I read somewher…

---

## [Confused by back refs in gsub](https://www.ruby-forum.com/t/confused-by-back-refs-in-gsub/111958)

<div class="topic-metadata">

**Author:** [@bodikp](https://www.ruby-forum.com/u/bodikp)\
**Replies:** 9\
**Last updated:** [August 14, 2007, 1:32pm UTC](https://www.ruby-forum.com/t/confused-by-back-refs-in-gsub/111958 "2007-08-14T13:32:08Z")

</div>

Can someone tell me why, in my code below, I’m getting part of the original search in my substitution in my result, when, I’m not asking for it, or at least, I don’t think I’m asking for it. Thanks, Peter Original l…

---

## [\[BUG\] Stack consistency error (sp: 11, bp: 12)](https://www.ruby-forum.com/t/bug-stack-consistency-error-sp-11-bp-12/112005)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 3\
**Last updated:** [August 14, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/bug-stack-consistency-error-sp-11-bp-12/112005 "2007-08-14T13:23:44Z")

</div>

e$B0J2\<$N$h$&$K$9$k$He(B Stack consistency error e$B$K$J$j$^$9!#e(B % ./ruby -e ’ class C def inspect bar {} end def bar raise ensure end end C.new.foo ’ -e:12:in \`method\_missing’-e:4: – control frame ------…

---

## [Need help cleaning up a model method](https://www.ruby-forum.com/t/need-help-cleaning-up-a-model-method/112026)

<div class="topic-metadata">

**Author:** [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Replies:** 4\
**Last updated:** [August 14, 2007, 1:04pm UTC](https://www.ruby-forum.com/t/need-help-cleaning-up-a-model-method/112026 "2007-08-14T13:04:40Z")

</div>

Hi, I need a little help cleaning up the method below. In my .NET days I would have let this pass, but I am trying to be a good ruby citizen by keeping things simple. This is from a seller model which has many vehicl…

---

## [Help with string matching algorythm](https://www.ruby-forum.com/t/help-with-string-matching-algorythm/111648)

<div class="topic-metadata">

**Author:** [@t-rex](https://www.ruby-forum.com/u/t-rex)\
**Replies:** 9\
**Last updated:** [August 14, 2007, 1:00pm UTC](https://www.ruby-forum.com/t/help-with-string-matching-algorythm/111648 "2007-08-14T13:00:34Z")

</div>

Hello, I would be so gratefull to ANYONE who can help me! I’m writting a program in C++. A part of my program is to compare two strings and as a result I have to get a number (range:0-1) which represents a similarity…

---

## [Accessing SOAP::Mapping::Object](https://www.ruby-forum.com/t/accessing-soap-object/111963)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 2\
**Last updated:** [August 14, 2007, 10:21am UTC](https://www.ruby-forum.com/t/accessing-soap-object/111963 "2007-08-14T10:21:12Z")

</div>

Hi, I just started with SOAP and Ruby and after one day trying to get it working I’am now stuck at getting the response into useable variables i.e. accessing the SOAP::Mapping::Object. I used soap4r and wdsl2ruby for…

---

## [\[1.9/12928\] problem with -r debug](https://www.ruby-forum.com/t/1-9-12928-problem-with-r-debug/112014)

<div class="topic-metadata">

**Author:** [@keltia](https://www.ruby-forum.com/u/keltia)\
**Replies:** 0\
**Last updated:** [August 14, 2007, 10:11am UTC](https://www.ruby-forum.com/t/1-9-12928-problem-with-r-debug/112014 "2007-08-14T10:11:24Z")

</div>

Hello, I’m running 1.9 from svn (revision 12928) on OS X. I appreciate that the hooks for the debugger have been put in place but trying to run a program in it leads to this as soon as I hit “s” on some lines: 321 \[…

---

## [' gem ' is not recongnized](https://www.ruby-forum.com/t/gem-is-not-recongnized/111891)

<div class="topic-metadata">

**Author:** [@dust](https://www.ruby-forum.com/u/dust)\
**Replies:** 2\
**Last updated:** [August 14, 2007, 8:45am UTC](https://www.ruby-forum.com/t/gem-is-not-recongnized/111891 "2007-08-14T08:45:28Z")

</div>

Hello, i have been having some trouble installing the “watir” gem. So, 1st things 1st, i have never tried to install any of these type of libraries so i may be doing this completly wrong. From my understanding you can…

---

## [Negative allocation size in rb\_f\_sprintf](https://www.ruby-forum.com/t/negative-allocation-size-in-rb-f-sprintf/111996)

<div class="topic-metadata">

**Author:** [@Tietew](https://www.ruby-forum.com/u/Tietew)\
**Replies:** 3\
**Last updated:** [August 14, 2007, 5:50am UTC](https://www.ruby-forum.com/t/negative-allocation-size-in-rb-f-sprintf/111996 "2007-08-14T05:50:52Z")

</div>

Tietew e$B$G$9!#e(B Railse$B$rF0$+$7$F$$$k$HI=Bj$N%(%i!\<$,=P$F:$$C$F$$$^$9!#e(B e$B4D6-$Oe(B e$B!&e(BDebian sid (Linux 2.6.20, x86\_64) e$B!&e(Bglibc 2.6.1-1 e$B!&e(Bgcc 4.1.3 20070718 (prerelease) (Debian 4.1.2-14) …

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

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