# Ruby

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

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

---

## [Postgres-ing? Too many choices!](https://www.ruby-forum.com/t/postgres-ing-too-many-choices/52302)

<div class="topic-metadata">

**Author:** [@daveh](https://www.ruby-forum.com/u/daveh)\
**Replies:** 3\
**Last updated:** [January 12, 2006, 7:23pm UTC](https://www.ruby-forum.com/t/postgres-ing-too-many-choices/52302 "2006-01-12T19:23:23Z")

</div>

it appears that there are three different Gems for talking to a PostgreSQL database. postgres (0.7.1) postgres-pr (0.4.0) ruby-postgres (0.7.1) What are the differences between them? How do I pick one? Thanks.

---

## [Finding a sentence (more than one word & punctuation (, . ;)](https://www.ruby-forum.com/t/finding-a-sentence-more-than-one-word-punctuation/52131)

<div class="topic-metadata">

**Author:** [@Kev\_J](https://www.ruby-forum.com/u/Kev_J)\
**Replies:** 5\
**Last updated:** [January 12, 2006, 6:50pm UTC](https://www.ruby-forum.com/t/finding-a-sentence-more-than-one-word-punctuation/52131 "2006-01-12T18:50:10Z")

</div>

given this string " \<td valign=“top”\>message \<td valign=“top”\>the message to echo. \<td valign=“top” align=“center”\>Yes, unless data is included in a character section within this element. " how can I get …

---

## [Ruby Tk --\> Window Buttons](https://www.ruby-forum.com/t/ruby-tk-window-buttons/52291)

<div class="topic-metadata">

**Author:** [@alexmaster](https://www.ruby-forum.com/u/alexmaster)\
**Replies:** 3\
**Last updated:** [January 12, 2006, 6:12pm UTC](https://www.ruby-forum.com/t/ruby-tk-window-buttons/52291 "2006-01-12T18:12:34Z")

</div>

Hi @ all! I don’t want the user to maximize the TkRoot - window with the button on the right side of the window! How can I disable this one? Or how can I make the size of my window fixed? Thanks in advance! ALEX

---

## [TK custom events](https://www.ruby-forum.com/t/tk-custom-events/52279)

<div class="topic-metadata">

**Author:** [@PWR](https://www.ruby-forum.com/u/PWR)\
**Replies:** 5\
**Last updated:** [January 12, 2006, 6:07pm UTC](https://www.ruby-forum.com/t/tk-custom-events/52279 "2006-01-12T18:07:37Z")

</div>

Hi, does anyone know how to set up a custom event which the Tk main loop will pick up i.e. I want to be able to create an event/handler which allows me to dispatch my own events to the Tk main loop. Any help gratfully…

---

## [Ideas on "Why Living Dangerous can be A Good Thing" in Ruby?](https://www.ruby-forum.com/t/ideas-on-why-living-dangerous-can-be-a-good-thing-in-ruby/51840)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 100\
**Last updated:** [January 12, 2006, 5:52pm UTC](https://www.ruby-forum.com/t/ideas-on-why-living-dangerous-can-be-a-good-thing-in-ruby/51840 "2006-01-12T17:52:28Z")

</div>

After my first day back at my University, I was quickly reminded that not everyone in the world embraces the “You’ll shoot your eye out” nature of Ruby as much as we all do. I just started a course on object oriented…

---

## [How can I give a name to an anonymous class](https://www.ruby-forum.com/t/how-can-i-give-a-name-to-an-anonymous-class/95026)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 14\
**Last updated:** [January 12, 2006, 5:49pm UTC](https://www.ruby-forum.com/t/how-can-i-give-a-name-to-an-anonymous-class/95026 "2006-01-12T17:49:24Z")

</div>

Hi, I’m try to create a generic anonymous class, and I want to set the class name of the class, however I can’t find a function which allow me to do this, the only way I can do this is actually assigner the newly cre…

---

## [Amrita 1.0.2 fails its unit tests](https://www.ruby-forum.com/t/amrita-1-0-2-fails-its-unit-tests/52301)

<div class="topic-metadata">

**Author:** [@Ben\_Gribaudo](https://www.ruby-forum.com/u/Ben_Gribaudo)\
**Replies:** 0\
**Last updated:** [January 12, 2006, 5:40pm UTC](https://www.ruby-forum.com/t/amrita-1-0-2-fails-its-unit-tests/52301 "2006-01-12T17:40:02Z")

</div>

Hi folks, Amrita 1.0.2 fails 5 of its unit tests when I run them. After downloading a fresh copy of Amrita, uncompressing it and uploading it to an Ubuntu 5.10 box, I received the test failures below. Any idea why I …

---

## [Midnight](https://www.ruby-forum.com/t/midnight/95048)

<div class="topic-metadata">

**Author:** [@misiek](https://www.ruby-forum.com/u/misiek)\
**Replies:** 6\
**Last updated:** [January 12, 2006, 4:23pm UTC](https://www.ruby-forum.com/t/midnight/95048 "2006-01-12T16:23:37Z")

</div>

how to use that method to returns a new time representing the start of the day (0:00) 134: def beginning\_of\_day 135: (self - self.seconds\_since\_midnight).change(:usec =\> 0) 136: end i’d lik…

---

## [Safe array index?](https://www.ruby-forum.com/t/safe-array-index/61037)

<div class="topic-metadata">

**Author:** [@christer](https://www.ruby-forum.com/u/christer)\
**Replies:** 13\
**Last updated:** [January 12, 2006, 4:08pm UTC](https://www.ruby-forum.com/t/safe-array-index/61037 "2006-01-12T16:08:31Z")

</div>

Is it possible to catch index out of range ? a = \[1,2\] a\[99\] returns nil, I would like to get an error. I’ve tried to define a SafeArray class, but failed. I managed to redefine Array, but I want to have both possibi…

---

## [viewIcons.rb example](https://www.ruby-forum.com/t/viewicons-rb-example/61160)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 0\
**Last updated:** [January 12, 2006, 3:47pm UTC](https://www.ruby-forum.com/t/viewicons-rb-example/61160 "2006-01-12T15:47:16Z")

</div>

Hello, i am programming tk and want to creat and icon on the taskbar. I think this is the library i am looking for but the examples do not work. I am running windows xp pro, and the newest version of the one click i…

---

## [Newbie: functions don't work in script](https://www.ruby-forum.com/t/newbie-functions-dont-work-in-script/52281)

<div class="topic-metadata">

**Author:** [@corck](https://www.ruby-forum.com/u/corck)\
**Replies:** 3\
**Last updated:** [January 12, 2006, 3:04pm UTC](https://www.ruby-forum.com/t/newbie-functions-dont-work-in-script/52281 "2006-01-12T15:04:13Z")

</div>

sorry for this newbie question, just started ruby programming today, Try to work me through the book Programming Ruby the script: #!/usr/local/bin/ruby a = \[ “a”, “b”, “c” \] a.include?(“b”) returns me nothing, if …

---

## [Unit tests and string comparisons](https://www.ruby-forum.com/t/unit-tests-and-string-comparisons/61124)

<div class="topic-metadata">

**Author:** [@joe-dumoulin](https://www.ruby-forum.com/u/joe-dumoulin)\
**Replies:** 6\
**Last updated:** [January 12, 2006, 2:52pm UTC](https://www.ruby-forum.com/t/unit-tests-and-string-comparisons/61124 "2006-01-12T14:52:06Z")

</div>

Hi, I’m testing the equality of two rather large strings. They look the same to me, but doing assert\_equal “big ass long string”, “big ass long string” says that they’re different. And they look very similar to me.…

---

## [Ruby Thread in CGI application?](https://www.ruby-forum.com/t/ruby-thread-in-cgi-application/52240)

<div class="topic-metadata">

**Author:** [@akoSS](https://www.ruby-forum.com/u/akoSS)\
**Replies:** 8\
**Last updated:** [January 12, 2006, 12:26pm UTC](https://www.ruby-forum.com/t/ruby-thread-in-cgi-application/52240 "2006-01-12T12:26:38Z")

</div>

Hello, i heard that ruby’s Thread is not a native system thread but is implemented in the interpreter itself. is that true? does this mean that is is lighter than native threads? does anyone know if Thread.start on e…

---

## [Database timezone difference](https://www.ruby-forum.com/t/database-timezone-difference/52186)

<div class="topic-metadata">

**Author:** [@samckayak](https://www.ruby-forum.com/u/samckayak)\
**Replies:** 2\
**Last updated:** [January 12, 2006, 12:16pm UTC](https://www.ruby-forum.com/t/database-timezone-difference/52186 "2006-01-12T12:16:34Z")

</div>

Hi, I’m pulling data from a database in Europe and saving a dataset in North America database. Included in the data are DateTime information. Because the timezones are different, when I pull the data it gets transla…

---

## [Dynamic Languages Day @ Brussels](https://www.ruby-forum.com/t/dynamic-languages-day-brussels/52275)

<div class="topic-metadata">

**Author:** [@Pascal\_Costanza](https://www.ruby-forum.com/u/Pascal_Costanza)\
**Replies:** 0\
**Last updated:** [January 12, 2006, 12:16pm UTC](https://www.ruby-forum.com/t/dynamic-languages-day-brussels/52275 "2006-01-12T12:16:30Z")

</div>

Dynamic Languages Day @ Vrije Universiteit Brussel Monday, February 13, 2006, VUB Campus Etterbeek The VUB (Programming Technology Lab, System and Software Engineering Lab), ULB (deComp) and the Belgian Association …

---

## [Is this a bug?](https://www.ruby-forum.com/t/is-this-a-bug/95082)

<div class="topic-metadata">

**Author:** [@vivek](https://www.ruby-forum.com/u/vivek)\
**Replies:** 4\
**Last updated:** [January 12, 2006, 11:22am UTC](https://www.ruby-forum.com/t/is-this-a-bug/95082 "2006-01-12T11:22:29Z")

</div>

I have the below sample program. a=\[1,2,3,1\] b=\[1,\[2,4\],\[5,6,3\],4\] b.flatten! a.push b a.uniq! puts a The output it produces is 1 2 3 1 2 4 5 6 3 4 a.uniq! doesnt seem to work on the array created afte…

---

## [Ruby and parsing](https://www.ruby-forum.com/t/ruby-and-parsing/52149)

<div class="topic-metadata">

**Author:** [@matrixise](https://www.ruby-forum.com/u/matrixise)\
**Replies:** 2\
**Last updated:** [January 12, 2006, 8:39am UTC](https://www.ruby-forum.com/t/ruby-and-parsing/52149 "2006-01-12T08:39:56Z")

</div>

Hi all, Firstly, Happy New Year :stuck\_out\_tongue: Secondly, I have a c++ source code with many “try catch”. try { } catch (Exception &pException) { \<BODY OF CATCH (for Exception)\> } I would like to parse my fi…

---

## [WEBrick Issue with IE: Page Not Found, Cannot Connect to Ser](https://www.ruby-forum.com/t/webrick-issue-with-ie-page-not-found-cannot-connect-to-ser/95080)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [January 12, 2006, 7:23am UTC](https://www.ruby-forum.com/t/webrick-issue-with-ie-page-not-found-cannot-connect-to-ser/95080 "2006-01-12T07:23:22Z")

</div>

I’m working on a Ruby on Rails project. I had a catastrophic notebook failure earlier this week so I moved everything over to a new machine. I installed a new version of Ruby, Rails, WATIR, Eclipse, and everything els…

---

## [How to programatically submit a form that uses document.form](https://www.ruby-forum.com/t/how-to-programatically-submit-a-form-that-uses-document-form/51923)

<div class="topic-metadata">

**Author:** [@harry](https://www.ruby-forum.com/u/harry)\
**Replies:** 4\
**Last updated:** [January 12, 2006, 7:05am UTC](https://www.ruby-forum.com/t/how-to-programatically-submit-a-form-that-uses-document-form/51923 "2006-01-12T07:05:24Z")

</div>

Hi there: have been trying to use Mechanize to submit a form and scrape the resulting page - but realized after looking at the form page that it uses Javascript to perform the form submission :-/ The page with the fo…

---

## [Newbie question: find source code of Enumerable, Comparable](https://www.ruby-forum.com/t/newbie-question-find-source-code-of-enumerable-comparable/52246)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 3\
**Last updated:** [January 12, 2006, 6:29am UTC](https://www.ruby-forum.com/t/newbie-question-find-source-code-of-enumerable-comparable/52246 "2006-01-12T06:29:31Z")

</div>

Hi there, I’m new to Ruby and trying to read the source, beside the books, to understand the language. While I can find the source for many library classes in the folder lib/ruby/1.8, I cannot find the source for cla…

---

## [Gem server problem?](https://www.ruby-forum.com/t/gem-server-problem/52206)

<div class="topic-metadata">

**Author:** [@itsme213](https://www.ruby-forum.com/u/itsme213)\
**Replies:** 2\
**Last updated:** [January 12, 2006, 6:26am UTC](https://www.ruby-forum.com/t/gem-server-problem/52206 "2006-01-12T06:26:25Z")

</div>

Getting different failures on gem list. Anyone else see this? ==================== C:\\Documents and Settings\>gem list -r activerecord \*\*\* REMOTE GEMS \*\*\* Updating Gem source index for: http://gems.rubyforge.org ERRO…

---

## [Escaping in MSSQL script?](https://www.ruby-forum.com/t/escaping-in-mssql-script/52213)

<div class="topic-metadata">

**Author:** [@Chris\_McMahon](https://www.ruby-forum.com/u/Chris_McMahon)\
**Replies:** 7\
**Last updated:** [January 12, 2006, 3:10am UTC](https://www.ruby-forum.com/t/escaping-in-mssql-script/52213 "2006-01-12T03:10:22Z")

</div>

Hi… Can anyone suggest the proper way to escape the backslashes in the directory name in the following script? d = c.run(“ALTER DATABASE fooDB MODIFY FILE (NAME = foo\_log, FILENAME = ‘C:\\Program Files\\Microsoft SQL …

---

## [Finding an outputting a string of text](https://www.ruby-forum.com/t/finding-an-outputting-a-string-of-text/95064)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 0\
**Last updated:** [January 11, 2006, 10:40pm UTC](https://www.ruby-forum.com/t/finding-an-outputting-a-string-of-text/95064 "2006-01-11T22:40:07Z")

</div>

Thanks in advance for any help you folks can provide. Using Ruby + Watir, I’ve written a script that launches IE, goes to my company’s web site, and logs in, also recording the time for each transaction. I cannot fig…

---

## [Fast Ruby Debugger?](https://www.ruby-forum.com/t/fast-ruby-debugger/95040)

<div class="topic-metadata">

**Author:** [@josephmat36](https://www.ruby-forum.com/u/josephmat36)\
**Replies:** 4\
**Last updated:** [January 11, 2006, 10:25pm UTC](https://www.ruby-forum.com/t/fast-ruby-debugger/95040 "2006-01-11T22:25:02Z")

</div>

Hi all – I originally sent this to ruby-core but had suggestions that I mail it to ruby-talk as well. So, here it goes: After developing in Java for years in IDEs I’m starving for a decent ruby debugger. When lea…

---

## [Ruby-DBI to query MS SQL 2003 ? (newb)](https://www.ruby-forum.com/t/ruby-dbi-to-query-ms-sql-2003-newb/52181)

<div class="topic-metadata">

**Author:** [@Josiah\_Ritchie](https://www.ruby-forum.com/u/Josiah_Ritchie)\
**Replies:** 2\
**Last updated:** [January 11, 2006, 10:22pm UTC](https://www.ruby-forum.com/t/ruby-dbi-to-query-ms-sql-2003-newb/52181 "2006-01-11T22:22:00Z")

</div>

I’m trying to write a script to pull data out of a MS SQL 2003 database and manipulate it a bit. I’ve found ActiveRecord to be slim on examples outside of the Rails environment. I’ve tried lots of variations on the na…

---

## [Checking Join data for nil](https://www.ruby-forum.com/t/checking-join-data-for-nil/52171)

<div class="topic-metadata">

**Author:** [@jkay](https://www.ruby-forum.com/u/jkay)\
**Replies:** 1\
**Last updated:** [January 11, 2006, 10:12pm UTC](https://www.ruby-forum.com/t/checking-join-data-for-nil/52171 "2006-01-11T22:12:40Z")

</div>

So I have a join 1:0…1. If there is nothing in the child side I get an error when I say property.pdf.name that I can’t access nil.name. But I can’t seem to figure out how to check if pdf is nil or not before I call …

---

## [Rue teaches piglet about symbols on #ruby-lang](https://www.ruby-forum.com/t/rue-teaches-piglet-about-symbols-on-ruby-lang/51925)

<div class="topic-metadata">

**Author:** [@combas](https://www.ruby-forum.com/u/combas)\
**Replies:** 9\
**Last updated:** [January 11, 2006, 8:53pm UTC](https://www.ruby-forum.com/t/rue-teaches-piglet-about-symbols-on-ruby-lang/51925 "2006-01-11T20:53:21Z")

</div>

Taken from #ruby-lang with a slight cleanup (I am piglet) piglet wonders if someone would be so kind to explain what a symbol is slowly and clearly so his simple pig brain will understand. “A symbol is the name of a…

---

## [Stupid question from a Ruby newb](https://www.ruby-forum.com/t/stupid-question-from-a-ruby-newb/52127)

<div class="topic-metadata">

**Author:** [@will](https://www.ruby-forum.com/u/will)\
**Replies:** 10\
**Last updated:** [January 11, 2006, 8:44pm UTC](https://www.ruby-forum.com/t/stupid-question-from-a-ruby-newb/52127 "2006-01-11T20:44:06Z")

</div>

Hi folks, I know that this is a really simple question, and there must be many ways to do it in Ruby… but what I’m looking for is an elegant way to take a collection of objects and create a hash mapping one attribute…

---

## [Ruby-agi-1.0.2 released!](https://www.ruby-forum.com/t/ruby-agi-1-0-2-released/52190)

<div class="topic-metadata">

**Author:** [@Mohammad\_K](https://www.ruby-forum.com/u/Mohammad_K)\
**Replies:** 0\
**Last updated:** [January 11, 2006, 8:41pm UTC](https://www.ruby-forum.com/t/ruby-agi-1-0-2-released/52190 "2006-01-11T20:41:04Z")

</div>

I am happy to announce the release of ruby-agi-1.0.2 This is a stable release of ruby-agi. ruby-agi is available at http://rubyforge.org/projects/ruby-agi/ You can also install ruby-agi via gem. To install ruby-agi …

---

## [PDF Reader](https://www.ruby-forum.com/t/pdf-reader/95030)

<div class="topic-metadata">

**Author:** [@Chintakrindi\_Meghan](https://www.ruby-forum.com/u/Chintakrindi_Meghan)\
**Replies:** 1\
**Last updated:** [January 11, 2006, 7:58pm UTC](https://www.ruby-forum.com/t/pdf-reader/95030 "2006-01-11T19:58:32Z")

</div>

Hi Can we use “rpdf2txt” for the PDF reading ? Thanks Meghanath Management Dynamics, Inc. removed\_email\_address@domain.invalid Phone: 240.453.6507 Cell: 240.372.6241 www.ManagementDynamics.com

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

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