# Ruby

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

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

---

## [Interview Tips free eBook](https://www.ruby-forum.com/t/interview-tips-free-ebook/179055)

<div class="topic-metadata">

**Author:** [@Jaggu\_BN](https://www.ruby-forum.com/u/Jaggu_BN)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 6:39pm UTC](https://www.ruby-forum.com/t/interview-tips-free-ebook/179055 "2009-11-16T18:39:12Z")

</div>

When an HR Executives in a Call Center or any Organizations is interviewing a potential employee they are usually looking for skills that an employee can apply on the job. Check outh the Heads: Introduction Intervie…

---

## [Customized GUI](https://www.ruby-forum.com/t/customized-gui/178975)

<div class="topic-metadata">

**Author:** [@xogue](https://www.ruby-forum.com/u/xogue)\
**Replies:** 11\
**Last updated:** [November 16, 2009, 5:06pm UTC](https://www.ruby-forum.com/t/customized-gui/178975 "2009-11-16T17:06:09Z")

</div>

first off, sorry if this in the wrong place, i just signed up here. if so, let me know where to put further posts. i am looking for a way to make a customized gui, like using differently shaped windows or graphics for…

---

## [Traversing the contents of a proc (for a DSL)](https://www.ruby-forum.com/t/traversing-the-contents-of-a-proc-for-a-dsl/178994)

<div class="topic-metadata">

**Author:** [@Siemen\_B](https://www.ruby-forum.com/u/Siemen_B)\
**Replies:** 10\
**Last updated:** [November 16, 2009, 4:41pm UTC](https://www.ruby-forum.com/t/traversing-the-contents-of-a-proc-for-a-dsl/178994 "2009-11-16T16:41:34Z")

</div>

Hi List, Is it possible to traverse and modify the statements inside a Proc after it has been created? I’m playing with a small DSL for HTML, which should look like this. html { head { title {“Hello World”} } body …

---

## [Open File Remotely](https://www.ruby-forum.com/t/open-file-remotely/197110)

<div class="topic-metadata">

**Author:** [@mishoo](https://www.ruby-forum.com/u/mishoo)\
**Replies:** 5\
**Last updated:** [November 16, 2009, 4:06pm UTC](https://www.ruby-forum.com/t/open-file-remotely/197110 "2009-11-16T16:06:51Z")

</div>

I know that this question looks like a Webistrano question but since I donâ€™t know much about Ruby, I thought it might be a simple Ruby question too. We have installed Webistrano and Capistrano install on some server …

---

## [Another rubygem install problem](https://www.ruby-forum.com/t/another-rubygem-install-problem/178942)

<div class="topic-metadata">

**Author:** [@nelson2005](https://www.ruby-forum.com/u/nelson2005)\
**Replies:** 3\
**Last updated:** [November 16, 2009, 3:56pm UTC](https://www.ruby-forum.com/t/another-rubygem-install-problem/178942 "2009-11-16T15:56:39Z")

</div>

I’m trying to install a fresh copy of Ruby into empty directory ‘/modlest/modlusr/ruby’ on a stock Red Hat server but it doesn’t work. Here’s what I’ve done: /modlest/users/erik/rubygems-1.3.3\> cat /proc/version –\>Li…

---

## [Re: Found Senryu (#224)](https://www.ruby-forum.com/t/re-found-senryu-224/179015)

<div class="topic-metadata">

**Author:** [@wkm](https://www.ruby-forum.com/u/wkm)\
**Replies:** 1\
**Last updated:** [November 16, 2009, 3:16pm UTC](https://www.ruby-forum.com/t/re-found-senryu-224/179015 "2009-11-16T15:16:07Z")

</div>

My solution is enclosed. It uses the Lingua::EN package from http://www.pressure.to/ruby/ to count syllables. According to it there are 4729 Senryu’s in the US Constitution (with amendments). :slight\_smile: As an asi…

---

## [Sorting array of names](https://www.ruby-forum.com/t/sorting-array-of-names/179043)

<div class="topic-metadata">

**Author:** [@ladyinred](https://www.ruby-forum.com/u/ladyinred)\
**Replies:** 4\
**Last updated:** [November 16, 2009, 1:26pm UTC](https://www.ruby-forum.com/t/sorting-array-of-names/179043 "2009-11-16T13:26:39Z")

</div>

Hi all, I have a Ruby program that reads in a text file of first names and surnames and prints them out in alphabetical order. Now I’m trying to add the option: if a person has a middle name, to print that out too and …

---

## [Rails on JRuby, JDBC Adapter and DB2](https://www.ruby-forum.com/t/rails-on-jruby-jdbc-adapter-and-db2/179044)

<div class="topic-metadata">

**Author:** [@Andy\_Hu](https://www.ruby-forum.com/u/Andy_Hu)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/rails-on-jruby-jdbc-adapter-and-db2/179044 "2009-11-16T13:08:32Z")

</div>

Hi All, Has anyone worked on project based on Rails on JRuby and db2 database? As we know db2 has no native boolean type, I thought activerecord-jdbc-adapter can convert it automatically. But actually as Nick repl…

---

## [Help with SQLite3-ruby, please](https://www.ruby-forum.com/t/help-with-sqlite3-ruby-please/179040)

<div class="topic-metadata">

**Author:** [@amcniece](https://www.ruby-forum.com/u/amcniece)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/help-with-sqlite3-ruby-please/179040 "2009-11-16T12:27:34Z")

</div>

Hello everybody! I’m Andy and I have a BIG and nasty problem with SQLite-ruby module and I hope for some help here. The main problem is that I am forced to use RUBY 1.8.0, because I’m building a plugin for SketchUp (w…

---

## [Newbie ..need help with metaprogramming](https://www.ruby-forum.com/t/newbie-need-help-with-metaprogramming/178886)

<div class="topic-metadata">

**Author:** [@dhaval](https://www.ruby-forum.com/u/dhaval)\
**Replies:** 5\
**Last updated:** [November 16, 2009, 11:46am UTC](https://www.ruby-forum.com/t/newbie-need-help-with-metaprogramming/178886 "2009-11-16T11:46:04Z")

</div>

hi, i wrote a small code to check metaprogramming in ruby…what am i doing wrong…can you pl help? class Testvar attr\_accessor :a1 def initialize @a1=‘init’ end end var =":a1" t = Testvar.new if t.respond\_to?("#{…

---

## [How do I get a random number between two random numbers?](https://www.ruby-forum.com/t/how-do-i-get-a-random-number-between-two-random-numbers/178984)

<div class="topic-metadata">

**Author:** [@someguy](https://www.ruby-forum.com/u/someguy)\
**Replies:** 11\
**Last updated:** [November 16, 2009, 10:45am UTC](https://www.ruby-forum.com/t/how-do-i-get-a-random-number-between-two-random-numbers/178984 "2009-11-16T10:45:29Z")

</div>

I want to create a program that asks you to guess a number between two numbers. The problem is that I can’t figure out how to make the numbers that you’re guessing between random and have the random number you are gue…

---

## [Replace a very long string with gsub get regexp error](https://www.ruby-forum.com/t/replace-a-very-long-string-with-gsub-get-regexp-error/179016)

<div class="topic-metadata">

**Author:** [@ahmad](https://www.ruby-forum.com/u/ahmad)\
**Replies:** 5\
**Last updated:** [November 16, 2009, 8:40am UTC](https://www.ruby-forum.com/t/replace-a-very-long-string-with-gsub-get-regexp-error/179016 "2009-11-16T08:40:30Z")

</div>

Hello, I’ve encountered a problem to replace a very long string with gsub. The string length is around 80,000. As example, data contains string with length 80,000 lala = “Replaced string” input = input.gsub(data, l…

---

## [Roman Numerals (Arrgh!)](https://www.ruby-forum.com/t/roman-numerals-arrgh/178764)

<div class="topic-metadata">

**Author:** [@rickbocas](https://www.ruby-forum.com/u/rickbocas)\
**Replies:** 21\
**Last updated:** [November 16, 2009, 8:34am UTC](https://www.ruby-forum.com/t/roman-numerals-arrgh/178764 "2009-11-16T08:34:23Z")

</div>

I have a homework assignment where I have to convert an inputted integer into Roman Numerals. I was doing fine building upon the previous steps until the arrays came in. We have to use the format/guidelines the profes…

---

## [What's ||](https://www.ruby-forum.com/t/whats/179003)

<div class="topic-metadata">

**Author:** [@duxieweb](https://www.ruby-forum.com/u/duxieweb)\
**Replies:** 9\
**Last updated:** [November 16, 2009, 8:19am UTC](https://www.ruby-forum.com/t/whats/179003 "2009-11-16T08:19:26Z")

</div>

sorry just was learning ruby so have some low level questions, :slight\_smile: in this statement: 1.upto(10) do |c| print c," " end what’s the usage of “| … |” in ruby? can’t easily understand. Thanks.

---

## [\[Bug #2374\] URI.regexp('http') $B$,(B 'http://' $B$K%^%C%A$9$k(B](https://www.ruby-forum.com/t/bug-2374-uri-regexp-http-b-b-http-b-k-c-a-9-k-b/179032)

<div class="topic-metadata">

**Author:** [@Kouhei\_Y](https://www.ruby-forum.com/u/Kouhei_Y)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 5:34am UTC](https://www.ruby-forum.com/t/bug-2374-uri-regexp-http-b-b-http-b-k-c-a-9-k-b/179032 "2009-11-16T05:34:58Z")

</div>

Bug #2374: URI.regexp(‘http’) e$B$,e(B ‘http://’ e$B$K%^%C%A$9$ke(B http://redmine.ruby-lang.org/issues/show/2374 e$B5/I\<\<Te(B: Kouhei Y. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: lib ruby -v: rub…

---

## [\[Bug #2373\] URI.parse $B$O(B hier-part $B$,6u$G$"$k(B URI $B$r%Q!\<%9$G$-$J$$(B](https://www.ruby-forum.com/t/bug-2373-uri-parse-b-o-b-hier-part-b-6u-g-k-b-uri-b-r-q-9-g-j-b/179030)

<div class="topic-metadata">

**Author:** [@Kouhei\_Y](https://www.ruby-forum.com/u/Kouhei_Y)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 5:25am UTC](https://www.ruby-forum.com/t/bug-2373-uri-parse-b-o-b-hier-part-b-6u-g-k-b-uri-b-r-q-9-g-j-b/179030 "2009-11-16T05:25:01Z")

</div>

Bug #2373: URI.parse e$B$Oe(B hier-part e$B$,6u$G$"$ke(B URI e$B$r%Q!\<%9$G$-$J$$e(B http://redmine.ruby-lang.org/issues/show/2373 e$B5/I\<\<Te(B: Kouhei Y. e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: …

---

## [Very newbie question](https://www.ruby-forum.com/t/very-newbie-question/178993)

<div class="topic-metadata">

**Author:** [@duxieweb](https://www.ruby-forum.com/u/duxieweb)\
**Replies:** 10\
**Last updated:** [November 16, 2009, 3:26am UTC](https://www.ruby-forum.com/t/very-newbie-question/178993 "2009-11-16T03:26:03Z")

</div>

Hello, I run these in irb: irb(main):001:0\> queue=0 =\> 0 irb(main):002:0\> if !queue then print “The queue is empty.” end =\> nil why the result is nil? I thought it should be printing “The queue is empty.” Thanks. …

---

## [Rainbows! 0.6.0 - bugfixes galore](https://www.ruby-forum.com/t/rainbows-0-6-0-bugfixes-galore/179024)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 0\
**Last updated:** [November 16, 2009, 12:51am UTC](https://www.ruby-forum.com/t/rainbows-0-6-0-bugfixes-galore/179024 "2009-11-16T00:51:08Z")

</div>

Rainbows! is a HTTP server for sleepy Rack applications. It is based on Unicorn, but designed to handle applications that expect long request/response times and/or slow clients. For Rack applications not heavily bou…

---

## [Unicorn 0.95.0 - we \<3 Rainbows! and ponies too](https://www.ruby-forum.com/t/unicorn-0-95-0-we-3-rainbows-and-ponies-too/179021)

<div class="topic-metadata">

**Author:** [@ericw](https://www.ruby-forum.com/u/ericw)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 11:35pm UTC](https://www.ruby-forum.com/t/unicorn-0-95-0-we-3-rainbows-and-ponies-too/179021 "2009-11-15T23:35:03Z")

</div>

Unicorn is a HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels. Slow clients should only be serv…

---

## [Including .specification files (or other "dot" files) in Rake Package on Linux/Mac OS X](https://www.ruby-forum.com/t/including-specification-files-or-other-dot-files-in-rake-package-on-linux-mac-os-x/179020)

<div class="topic-metadata">

**Author:** [@ate50eggs](https://www.ruby-forum.com/u/ate50eggs)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 10:40pm UTC](https://www.ruby-forum.com/t/including-specification-files-or-other-dot-files-in-rake-package-on-linux-mac-os-x/179020 "2009-11-15T22:40:37Z")

</div>

I’ve found that my instantiation of the Rake Package task for packaging up a Rails app isn’t including the ‘.specification’ files in the ‘/vendor/gems/\*\*/\*’ pattern. I’ve recreated this on Linux and Mac OS X. It seem…

---

## [Re: what's ||](https://www.ruby-forum.com/t/re-whats/179012)

<div class="topic-metadata">

**Author:** [@kyle](https://www.ruby-forum.com/u/kyle)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 6:17pm UTC](https://www.ruby-forum.com/t/re-whats/179012 "2009-11-15T18:17:15Z")

</div>

Sorry I hit send on the previous message before I finished – plus I suppose “lazy” evaluation was a bad term for it. Basically, the right side of the operator isn’t evaluated if the left side expression is true. && i…

---

## [DRYing a Regex](https://www.ruby-forum.com/t/drying-a-regex/178882)

<div class="topic-metadata">

**Author:** [@RichardOnRails](https://www.ruby-forum.com/u/RichardOnRails)\
**Replies:** 41\
**Last updated:** [November 15, 2009, 2:30pm UTC](https://www.ruby-forum.com/t/drying-a-regex/178882 "2009-11-15T14:30:01Z")

</div>

I’ve got a routine that works fine at building an array of upper-case strings extracted from a string: aNewList = \[\] s = StringScanner.new sNewList upper = /\[A-Z\]+/ not\_upper= Regexp.new( upper.source.sub( /\[/, ‘\[^…

---

## [\[Bug #2368\] URI.regexp $B$K%^%C%A$9$kJ8;zNs$,(B URI.parse $B$G$-$J$$$3$H$,$"$k(B](https://www.ruby-forum.com/t/bug-2368-uri-regexp-b-k-c-a-9-kj8-zns-b-uri-parse-b-g-j-3-h-k-b/179002)

<div class="topic-metadata">

**Author:** [@Yui\_NARUSE](https://www.ruby-forum.com/u/Yui_NARUSE)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 1:47pm UTC](https://www.ruby-forum.com/t/bug-2368-uri-regexp-b-k-c-a-9-kj8-zns-b-uri-parse-b-g-j-3-h-k-b/179002 "2009-11-15T13:47:27Z")

</div>

e$B%A%1%C%He(B #2368 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE) e$B;d$O!Ve(BURI.regexp e$B$K%^%C%A$9$kJ8;zNs$N=89g$He(B URI.parse e$B$G$-$kJ8;zNs$N=89g$OEy$7$$$N$@$m$&!W$H;W$C$F$$$?$?$ae(B e$BDs\<($7$?$h$&$J$U$k$^$$$K$H$…

---

## [How to do a getPixel on Win32 using Ruby?](https://www.ruby-forum.com/t/how-to-do-a-getpixel-on-win32-using-ruby/178985)

<div class="topic-metadata">

**Author:** [@winterheat](https://www.ruby-forum.com/u/winterheat)\
**Replies:** 5\
**Last updated:** [November 15, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/how-to-do-a-getpixel-on-win32-using-ruby/178985 "2009-11-15T12:59:43Z")

</div>

Does someone know how to do a getPixel on Win32 using Ruby? (either to get a pixel’s color value on a window or on the whole screen). thanks.

---

## [Bsearch.rb](https://www.ruby-forum.com/t/bsearch-rb/178996)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 11:35am UTC](https://www.ruby-forum.com/t/bsearch-rb/178996 "2009-11-15T11:35:11Z")

</div>

I found online Ruby/Bsearch: a binary search library for Ruby. Yippee! Is the following good idiomatic Ruby for doing a binary search the way that Array.assoc searches linearly? irb -r .\\ruby-bsearch-1.5\\bsearch.rb s…

---

## [Array.assoc](https://www.ruby-forum.com/t/array-assoc/178987)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 4\
**Last updated:** [November 15, 2009, 10:20am UTC](https://www.ruby-forum.com/t/array-assoc/178987 "2009-11-15T10:20:17Z")

</div>

If I want to find the source to the Class Array … specifically Array.assoc … where would I look?

---

## [Edit related record](https://www.ruby-forum.com/t/edit-related-record/178998)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 10:07am UTC](https://www.ruby-forum.com/t/edit-related-record/178998 "2009-11-15T10:07:24Z")

</div>

There’s a one-to-one relation between the base model “item” and the associated model “page,” but the page table is empty and the structure seems wrong (no fk): mysql\> mysql\> describe rss2mysql.pages; ±------±-------…

---

## [Scrape html gives partial result](https://www.ruby-forum.com/t/scrape-html-gives-partial-result/178902)

<div class="topic-metadata">

**Author:** [@Thufir](https://www.ruby-forum.com/u/Thufir)\
**Replies:** 4\
**Last updated:** [November 15, 2009, 9:46am UTC](https://www.ruby-forum.com/t/scrape-html-gives-partial-result/178902 "2009-11-15T09:46:20Z")

</div>

Why does scrape.rb just result in a few lines of html, rather than an entire document? The html can be printed in its entirety, but how to persist it? It looks like I have a misplaced } on line 21, but moving it to…

---

## [\[Bug #2368\] URI.regexp $B$K%^%C%A$9$kJ8;zNs$,(B URI.parse $B$G$-$J$$$3$H$,$"$k(B](https://www.ruby-forum.com/t/bug-2368-uri-regexp-b-k-c-a-9-kj8-zns-b-uri-parse-b-g-j-3-h-k-b/178995)

<div class="topic-metadata">

**Author:** [@Kouhei\_Y](https://www.ruby-forum.com/u/Kouhei_Y)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 7:12am UTC](https://www.ruby-forum.com/t/bug-2368-uri-regexp-b-k-c-a-9-kj8-zns-b-uri-parse-b-g-j-3-h-k-b/178995 "2009-11-15T07:12:27Z")

</div>

e$B%A%1%C%He(B #2368 e$B$,99?7$5$l$^$7$?!#e(B (by Kouhei Y.) e$B3N$+$Ke(B “http://” e$B$OIT@5$Je(B URI e$B$G$7$?$N$GNc$H$7$FITE,@Z$G$7$?!#e(B e$B;d$O!Ve(BURI.regexp e$B$K%^%C%A$9$kJ8;zNs$N=89g$He(B URI.parse e$B$G$-$…

---

## [\[Bug #2369\] ENV's strange behavior on WinXP](https://www.ruby-forum.com/t/bug-2369-envs-strange-behavior-on-winxp/178990)

<div class="topic-metadata">

**Author:** [@SSwanabe](https://www.ruby-forum.com/u/SSwanabe)\
**Replies:** 0\
**Last updated:** [November 15, 2009, 6:12am UTC](https://www.ruby-forum.com/t/bug-2369-envs-strange-behavior-on-winxp/178990 "2009-11-15T06:12:10Z")

</div>

Bug #2369: ENV’s strange behavior on WinXP http://redmine.ruby-lang.org/issues/show/2369 e$B5/I\<\<Te(B: \_ wanabe e$B%9%F!\<%?%9e(B: Open, e$BM%@hEYe(B: Normal e$B%+%F%4%je(B: core, Target version: 1.9.x ruby -v: ruby …

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

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