# Ruby

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

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

---

## [Next rubyquiz coming this evening](https://www.ruby-forum.com/t/next-rubyquiz-coming-this-evening/130579)

<div class="topic-metadata">

**Author:** [@mansfiem](https://www.ruby-forum.com/u/mansfiem)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/next-rubyquiz-coming-this-evening/130579 "2008-02-29T16:03:25Z")

</div>

My apologies… I wrote the next RubyQuiz earlier this week, and then conveniently forgot to post it this morning before leaving for work. It shall be posted this evening, first thing when I get home. – Matthew M. remo…

---

## [Getting number of days in a month](https://www.ruby-forum.com/t/getting-number-of-days-in-a-month/130362)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 25\
**Last updated:** [February 29, 2008, 3:33pm UTC](https://www.ruby-forum.com/t/getting-number-of-days-in-a-month/130362 "2008-02-29T15:33:04Z")

</div>

This is probably an easy question but I am trying to get at the number of days that are in a month. I have this calendar that I have built, the idea being that when a month turns from February to March, for example, t…

---

## [HELP: NameError: uninitialized constant](https://www.ruby-forum.com/t/help-nameerror-uninitialized-constant/130571)

<div class="topic-metadata">

**Author:** [@ookman](https://www.ruby-forum.com/u/ookman)\
**Replies:** 5\
**Last updated:** [February 29, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/help-nameerror-uninitialized-constant/130571 "2008-02-29T15:19:58Z")

</div>

OK. I’m learning Ruby by going through the examples in Programming Ruby by Dave T… Somehow I’m stuck and I cannot progress further. I have 3 files all in the same folder – Song.rb, SongList.rb and TestSongList.rb. …

---

## [Creating an open source packet generator](https://www.ruby-forum.com/t/creating-an-open-source-packet-generator/130350)

<div class="topic-metadata">

**Author:** [@jackster](https://www.ruby-forum.com/u/jackster)\
**Replies:** 2\
**Last updated:** [February 29, 2008, 2:45pm UTC](https://www.ruby-forum.com/t/creating-an-open-source-packet-generator/130350 "2008-02-29T14:45:29Z")

</div>

I know this is a slightly odd request but it’s for a project I’m working on to create a traffic generator to simulate DDOS (distributed denial of service) attacks to public websites which have been plaguing the intern…

---

## [Patch for ruby\_1\_8\_6/lib/rexml/element.rb@12852](https://www.ruby-forum.com/t/patch-for-ruby-1-8-6-lib-rexml-element-rb-12852/130311)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 4\
**Last updated:** [February 29, 2008, 8:17am UTC](https://www.ruby-forum.com/t/patch-for-ruby-1-8-6-lib-rexml-element-rb-12852/130311 "2008-02-29T08:17:03Z")

</div>

æŠ¼ç”°ã§ã™ã€‚ ã“ã‚“ã«ã¡ã¯ã€‚ 32040 ã¨ä¼¼ãŸã‚ˆã†ãªå•é¡Œã®ãƒ‘ãƒƒãƒã§ã™ã€‚ å¯¾è±¡ã¯ deprecate ãƒžãƒ¼ã‚¯ã•ã‚Œã¦ã„ã¾ã™ãŒã€ trunk ã§ã¯ 15141 ã§å¯¾å‡¦ã•ã‚Œã¦ã„ãŸã®ã§ã€ 1.8 ã‚‚åŒæ§˜ã«ã‚±ã‚…

---

## [How to set socket options?](https://www.ruby-forum.com/t/how-to-set-socket-options/130527)

<div class="topic-metadata">

**Author:** [@Nasir\_K](https://www.ruby-forum.com/u/Nasir_K)\
**Replies:** 3\
**Last updated:** [February 29, 2008, 5:50am UTC](https://www.ruby-forum.com/t/how-to-set-socket-options/130527 "2008-02-29T05:50:55Z")

</div>

We can set socket options using setsockopt on BasicSocket, where can I get various constants SOL\_ constants such as Socket::SOL\_SOCKET etc? I am unable to find them in rdoc. Also while writing a TCP client to a non R…

---

## [Proc.new and return](https://www.ruby-forum.com/t/proc-new-and-return/130462)

<div class="topic-metadata">

**Author:** [@S2S2S2](https://www.ruby-forum.com/u/S2S2S2)\
**Replies:** 14\
**Last updated:** [February 29, 2008, 5:45am UTC](https://www.ruby-forum.com/t/proc-new-and-return/130462 "2008-02-29T05:45:38Z")

</div>

I am sure this is a really easy question for most of you, but i was not able to find an answer to this, or to understand the difference between this two: $ irb irb(main):001:0\> a = Proc.new {true} =\> #Proc:0xb7cae30…

---

## [TreeTop: dealing with Grammars in multiple files?](https://www.ruby-forum.com/t/treetop-dealing-with-grammars-in-multiple-files/128364)

<div class="topic-metadata">

**Author:** [@philthompson](https://www.ruby-forum.com/u/philthompson)\
**Replies:** 3\
**Last updated:** [February 29, 2008, 5:31am UTC](https://www.ruby-forum.com/t/treetop-dealing-with-grammars-in-multiple-files/128364 "2008-02-29T05:31:00Z")

</div>

I know that you can include one grammar into another like so: grammar foo include Bar\_grammar end But what if Bar\_grammar is defined in a different file? I tried: load\_grammar “Bar\_grammar” grammar Foo include Ba…

---

## [String to Class?](https://www.ruby-forum.com/t/string-to-class/130490)

<div class="topic-metadata">

**Author:** [@Aaron\_T](https://www.ruby-forum.com/u/Aaron_T)\
**Replies:** 5\
**Last updated:** [February 29, 2008, 1:18am UTC](https://www.ruby-forum.com/t/string-to-class/130490 "2008-02-29T01:18:17Z")

</div>

I want to be able to take a class name stored in a variable as a string like: foo = “Foo::Bar” and convert that to the class Foo::Bar so that I can call .new(), etc: obj = foo.new I know I can just do: foo = Foo::B…

---

## [Subject: jig 0.1.2 Released](https://www.ruby-forum.com/t/subject-jig-0-1-2-released/130525)

<div class="topic-metadata">

**Author:** [@pfharlock](https://www.ruby-forum.com/u/pfharlock)\
**Replies:** 0\
**Last updated:** [February 29, 2008, 12:53am UTC](https://www.ruby-forum.com/t/subject-jig-0-1-2-released/130525 "2008-02-29T00:53:05Z")

</div>

jig version 0.1.2 has been released! http://jig.rubyforge.org A jig is an ordered sequence of objects (usually strings) and named gaps. When rendered as a string by Jig#to\_s, the objects are rendered calling #to\_s …

---

## [Count results of a query?](https://www.ruby-forum.com/t/count-results-of-a-query/130522)

<div class="topic-metadata">

**Author:** [@laredotornado](https://www.ruby-forum.com/u/laredotornado)\
**Replies:** 1\
**Last updated:** [February 29, 2008, 12:42am UTC](https://www.ruby-forum.com/t/count-results-of-a-query/130522 "2008-02-29T00:42:24Z")

</div>

Hi, I have this code @users = find(:all, :conditions =\> conditions, :page =\> {:size =\> page\_size, :current =\> page\_num} ) if (@users.count == 0) flash\[:notice\] = “No results found.” render :action =\> ‘search’ end …

---

## [Proposed Solutions (Monkeypatching)](https://www.ruby-forum.com/t/proposed-solutions-monkeypatching/130515)

<div class="topic-metadata">

**Author:** [@Trans](https://www.ruby-forum.com/u/Trans)\
**Replies:** 1\
**Last updated:** [February 28, 2008, 11:02pm UTC](https://www.ruby-forum.com/t/proposed-solutions-monkeypatching/130515 "2008-02-28T23:02:33Z")

</div>

On Feb 28, 12:59 pm, hemant removed\_email\_address@domain.invalid wrote: preventative obstruction is going to make anything better, it will Too often, I have seen people blaming everything to Rails, but I do not thi…

---

## [Threads in RubyCocoa apps](https://www.ruby-forum.com/t/threads-in-rubycocoa-apps/130501)

<div class="topic-metadata">

**Author:** [@praful](https://www.ruby-forum.com/u/praful)\
**Replies:** 2\
**Last updated:** [February 28, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/threads-in-rubycocoa-apps/130501 "2008-02-28T22:41:26Z")

</div>

Hi I’m writing a GUI that starts a worker thread using Thread.start. The Cocoa docs say that you should update the GUI using the main thread only. However, the examples that ship with Leopard, eg SimpleApp, have a th…

---

## [YAML iteration](https://www.ruby-forum.com/t/yaml-iteration/130502)

<div class="topic-metadata">

**Author:** [@aidy](https://www.ruby-forum.com/u/aidy)\
**Replies:** 1\
**Last updated:** [February 28, 2008, 9:45pm UTC](https://www.ruby-forum.com/t/yaml-iteration/130502 "2008-02-28T21:45:50Z")

</div>

Hi, This is the YAML test: tiscali1 url: http://tiscali3-test.vizumi.com/ first\_name: aidy surname: smith email: ‘removed\_email\_address@domain.invalid’ password: password registration: KJHDF123 test: tiscali2 …

---

## [Ruby C++ extend, prb with free object](https://www.ruby-forum.com/t/ruby-c-extend-prb-with-free-object/130497)

<div class="topic-metadata">

**Author:** [@tonyryu](https://www.ruby-forum.com/u/tonyryu)\
**Replies:** 0\
**Last updated:** [February 28, 2008, 7:47pm UTC](https://www.ruby-forum.com/t/ruby-c-extend-prb-with-free-object/130497 "2008-02-28T19:47:11Z")

</div>

Sorry for my bad english. I try to create an extention of interpreter ruby, with new class and module. But when i test my code, the object is never destruct before program’s ending. Maybe the garbage collector is disa…

---

## [What is a exec format error in daemons](https://www.ruby-forum.com/t/what-is-a-exec-format-error-in-daemons/130493)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 0\
**Last updated:** [February 28, 2008, 7:30pm UTC](https://www.ruby-forum.com/t/what-is-a-exec-format-error-in-daemons/130493 "2008-02-28T19:30:58Z")

</div>

Exec format error - E:/TradingTools/Development/app/helpers/ twsMonitor.rb e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons/ application.rb:109:in exec' e:/ruby/lib/ruby/gems/1.8/gems/daemons-1.0.9/lib/daemons…

---

## [Daemons error](https://www.ruby-forum.com/t/daemons-error/130382)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 2\
**Last updated:** [February 28, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/daemons-error/130382 "2008-02-28T19:27:55Z")

</div>

I thought the daemon would create the pid file. but however i get this strange error. require “Daemons” options = { :app\_name =\> “my\_app”, :ARGV =\> \[‘start’, ‘-f’\], :dir\_mode =\> :script, :dir =\> 'p…

---

## [Get pending jobs](https://www.ruby-forum.com/t/get-pending-jobs/130461)

<div class="topic-metadata">

**Author:** [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Replies:** 3\
**Last updated:** [February 28, 2008, 6:36pm UTC](https://www.ruby-forum.com/t/get-pending-jobs/130461 "2008-02-28T18:36:53Z")

</div>

Hello I would like to know how can I get the list of pending jobs in a given printer queue with ruby. Thanks regards

---

## [Multithreading problem](https://www.ruby-forum.com/t/multithreading-problem/130315)

<div class="topic-metadata">

**Author:** [@learningruby](https://www.ruby-forum.com/u/learningruby)\
**Replies:** 6\
**Last updated:** [February 28, 2008, 6:32pm UTC](https://www.ruby-forum.com/t/multithreading-problem/130315 "2008-02-28T18:32:28Z")

</div>

Hi All, I am pretty much a starter in multi-threading. In one of my application, I needed to run three threads along each other. Here is my code require ‘rubygems’ require ‘mechanize’ require ‘fileutils’ re…

---

## [Abstract class](https://www.ruby-forum.com/t/abstract-class/130452)

<div class="topic-metadata">

**Author:** [@ayyanar](https://www.ruby-forum.com/u/ayyanar)\
**Replies:** 4\
**Last updated:** [February 28, 2008, 5:18pm UTC](https://www.ruby-forum.com/t/abstract-class/130452 "2008-02-28T17:18:50Z")

</div>

How to create the abstract class and abstract method in ruby. In RAILS active\_record::base there is an attribute abstract\_class. How it is related to the ruby abstract class?

---

## [To long](https://www.ruby-forum.com/t/to-long/130478)

<div class="topic-metadata">

**Author:** [@snantz](https://www.ruby-forum.com/u/snantz)\
**Replies:** 1\
**Last updated:** [February 28, 2008, 5:05pm UTC](https://www.ruby-forum.com/t/to-long/130478 "2008-02-28T17:05:23Z")

</div>

I am trying to convert some vb script code to its Ruby counterpart and there is a function in the script which converts an expression to a long data type and my question is, is there a way to do the same thing in Ruby…

---

## [LSB and Ruby](https://www.ruby-forum.com/t/lsb-and-ruby/130477)

<div class="topic-metadata">

**Author:** [@daniel\_SSSSkerud](https://www.ruby-forum.com/u/daniel_SSSSkerud)\
**Replies:** 0\
**Last updated:** [February 28, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/lsb-and-ruby/130477 "2008-02-28T16:33:53Z")

</div>

The latest LSB release adds support for Python and Perl. From http://www.linux.com/feature/127582 : " Runtime languages (new in 3.2): Covers Perl and Python. Any application based on these languages can count on a s…

---

## [The Smallest Circle (#157)](https://www.ruby-forum.com/t/the-smallest-circle-157/129211)

<div class="topic-metadata">

**Author:** [@Matthew\_D\_Moss](https://www.ruby-forum.com/u/Matthew_D_Moss)\
**Replies:** 60\
**Last updated:** [February 28, 2008, 2:00pm UTC](https://www.ruby-forum.com/t/the-smallest-circle-157/129211 "2008-02-28T14:00:40Z")

</div>

The three rules of Ruby Q. 2: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. 2 by submitting ideas as often as you ca…

---

## [Regex and lookahead to specific number of chars](https://www.ruby-forum.com/t/regex-and-lookahead-to-specific-number-of-chars/186763)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 6\
**Last updated:** [February 28, 2008, 12:51pm UTC](https://www.ruby-forum.com/t/regex-and-lookahead-to-specific-number-of-chars/186763 "2008-02-28T12:51:00Z")

</div>

If I have a string such as “I love ruby, i really do love ruby, oh yes i do blah blah blah” and i want to insert an asterix at every 10th char whether its a whitespace, digit whatever how do i go about it i was tryin…

---

## [Ruby 1.8.4 and Ruby 1.8.6](https://www.ruby-forum.com/t/ruby-1-8-4-and-ruby-1-8-6/130446)

<div class="topic-metadata">

**Author:** [@Bala](https://www.ruby-forum.com/u/Bala)\
**Replies:** 3\
**Last updated:** [February 28, 2008, 11:12am UTC](https://www.ruby-forum.com/t/ruby-1-8-4-and-ruby-1-8-6/130446 "2008-02-28T11:12:20Z")

</div>

Hi Experts, I was wondering, if we could use previous version if we installed 1.8.6? i know this is stupid. :slight\_smile: any suggestions? regards, Bala

---

## [Sqlite3-ruby installation](https://www.ruby-forum.com/t/sqlite3-ruby-installation/129430)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 2\
**Last updated:** [February 28, 2008, 11:07am UTC](https://www.ruby-forum.com/t/sqlite3-ruby-installation/129430 "2008-02-28T11:07:36Z")

</div>

I’m very much struggling to get a ruby interface sqlite3. When trying to install the sqlite3-ruby gem, I keep running into errors. I do have sqlite3 installed (I’m running Kubuntu 7.10 Linux). I’m not sure where it is…

---

## [Native binarys](https://www.ruby-forum.com/t/native-binarys/130431)

<div class="topic-metadata">

**Author:** [@ben](https://www.ruby-forum.com/u/ben)\
**Replies:** 1\
**Last updated:** [February 28, 2008, 10:53am UTC](https://www.ruby-forum.com/t/native-binarys/130431 "2008-02-28T10:53:28Z")

</div>

Is there a quick and dirty way to obfuscate ruby code or to (better yet) build it into a native binary on os x?

---

## [Extracting hex keys from file](https://www.ruby-forum.com/t/extracting-hex-keys-from-file/130293)

<div class="topic-metadata">

**Author:** [@ben](https://www.ruby-forum.com/u/ben)\
**Replies:** 10\
**Last updated:** [February 28, 2008, 9:56am UTC](https://www.ruby-forum.com/t/extracting-hex-keys-from-file/130293 "2008-02-28T09:56:14Z")

</div>

Hello. I have a file that contains several values that I would like to read in as hex values (e.x. 3F 5A 6B 43 0E 2F AE…) I have some partial code: def getHash(file\_in) f = File.new(file\_in, “r”) f.each\_byte {|x| pr…

---

## [Rutema 0.6.0 Released](https://www.ruby-forum.com/t/rutema-0-6-0-released/130443)

<div class="topic-metadata">

**Author:** [@Vassilis\_R](https://www.ruby-forum.com/u/Vassilis_R)\
**Replies:** 0\
**Last updated:** [February 28, 2008, 9:30am UTC](https://www.ruby-forum.com/t/rutema-0-6-0-released/130443 "2008-02-28T09:30:52Z")

</div>

rutema version 0.6.0 has been released! DESCRIPTION: rutema is a test execution too with a twist. It allows you to combine test tools while it takes care of logging, reporting, archiving of results and formalizes exe…

---

## [How to use gtk2 test runner](https://www.ruby-forum.com/t/how-to-use-gtk2-test-runner/130439)

<div class="topic-metadata">

**Author:** [@pradeepta](https://www.ruby-forum.com/u/pradeepta)\
**Replies:** 0\
**Last updated:** [February 28, 2008, 7:57am UTC](https://www.ruby-forum.com/t/how-to-use-gtk2-test-runner/130439 "2008-02-28T07:57:13Z")

</div>

Hi, what is the way to run testrunner in gtk2 rather than in console ? Any body help !

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

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