# Ruby

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

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

---

## [Calling perl function in ruby](https://www.ruby-forum.com/t/calling-perl-function-in-ruby/161183)

<div class="topic-metadata">

**Author:** [@loganathan](https://www.ruby-forum.com/u/loganathan)\
**Replies:** 5\
**Last updated:** [February 25, 2009, 5:58pm UTC](https://www.ruby-forum.com/t/calling-perl-function-in-ruby/161183 "2009-02-25T17:58:56Z")

</div>

Below code is used for calling c function in ruby. #! /usr/bin/ruby require ‘/usr/lib/ruby/1.8/inline.rb’ puts “Inline module…” class MyTest inline do |builder| builder.c " long factorial(int max) { int i=max, re…

---

## [Updating row with pg =\> success or failure](https://www.ruby-forum.com/t/updating-row-with-pg-success-or-failure/161248)

<div class="topic-metadata">

**Author:** [@raimon](https://www.ruby-forum.com/u/raimon)\
**Replies:** 6\
**Last updated:** [February 25, 2009, 5:31pm UTC](https://www.ruby-forum.com/t/updating-row-with-pg-success-or-failure/161248 "2009-02-25T17:31:13Z")

</div>

Hello, I’m playing a little with the pg of Ruby, and I’m accessing some postgresql database. I want to update some rows, but I can’t find the method/command to know if they were updated or not. For a normal select: …

---

## [Newbie question \> count array key?](https://www.ruby-forum.com/t/newbie-question-count-array-key/161250)

<div class="topic-metadata">

**Author:** [@remco](https://www.ruby-forum.com/u/remco)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 4:46pm UTC](https://www.ruby-forum.com/t/newbie-question-count-array-key/161250 "2009-02-25T16:46:14Z")

</div>

Hi, newbie question(i guess) a = Bookings.find(:all, :conditions =\> \[3.days.ago\]) a = \[id : 1, departure : ‘AMS’, arrival =\> ‘NY’\],\[id : 2, departure : ‘AMS’, arrival =\> ‘BCN’\],\[id : 3, departure : ‘AMS’, arrival =\> …

---

## [Uniuq no](https://www.ruby-forum.com/t/uniuq-no/160316)

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 6\
**Last updated:** [February 25, 2009, 4:43pm UTC](https://www.ruby-forum.com/t/uniuq-no/160316 "2009-02-25T16:43:15Z")

</div>

I want to create new unique id in ruby.I have used the following coding.But I don’'t know whether it works perfectly or not. t = Time.new p “%10.5f” % t.to\_f does it give unique value always.I you know some other way…

---

## [Extrange String#=~ behaviour](https://www.ruby-forum.com/t/extrange-string-behaviour/161260)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 5\
**Last updated:** [February 25, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/extrange-string-behaviour/161260 "2009-02-25T16:39:53Z")

</div>

Hi, I can’t understand it: class String def =~ obj puts “Sorry, I don’t compare” end end a) OK irb\> “string” =~ 1234 Sorry, I don’t compare nil b) Â¿? irb\> “string” =~ /string/ 0 c) OK irb\> “string”.send(:"…

---

## [Feeding data to be PUT with Net::HTTP?](https://www.ruby-forum.com/t/feeding-data-to-be-put-with-net-http/161132)

<div class="topic-metadata">

**Author:** [@chrismalek](https://www.ruby-forum.com/u/chrismalek)\
**Replies:** 3\
**Last updated:** [February 25, 2009, 4:34pm UTC](https://www.ruby-forum.com/t/feeding-data-to-be-put-with-net-http/161132 "2009-02-25T16:34:47Z")

</div>

Since I am HTTP PUT’ing large amounts of data (ideally using Net::HTTP) I would like to feed data in some way to an HTTP PUT so that I don’t have to have the entire amount of data in memory before using methods like r…

---

## [Changing the format of a text file](https://www.ruby-forum.com/t/changing-the-format-of-a-text-file/161316)

<div class="topic-metadata">

**Author:** [@bary](https://www.ruby-forum.com/u/bary)\
**Replies:** 2\
**Last updated:** [February 25, 2009, 3:17pm UTC](https://www.ruby-forum.com/t/changing-the-format-of-a-text-file/161316 "2009-02-25T15:17:46Z")

</div>

Hello everyone, i am new to ruby and im having some problems trying to reformat a text file. Basically, i have a large log file which is around 200mb in the following format: 1000000 name Status …

---

## [Length of Dynamically Merged Column](https://www.ruby-forum.com/t/length-of-dynamically-merged-column/161326)

<div class="topic-metadata">

**Author:** [@deeparaj](https://www.ruby-forum.com/u/deeparaj)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 3:00pm UTC](https://www.ruby-forum.com/t/length-of-dynamically-merged-column/161326 "2009-02-25T15:00:38Z")

</div>

Hi, I need to know the Length of dynamically merged column in parseexcel using ruby could u please help me.

---

## [Domain based restriction](https://www.ruby-forum.com/t/domain-based-restriction/161300)

<div class="topic-metadata">

**Author:** [@brianzimmer](https://www.ruby-forum.com/u/brianzimmer)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 2:07pm UTC](https://www.ruby-forum.com/t/domain-based-restriction/161300 "2009-02-25T14:07:52Z")

</div>

Hello, I’m working on an application where I allow users to embed a uniquely generated block of js code which also includes an swf file on their own domain. I have a setup where a user enters their domain in my appli…

---

## [Reverse geocoding in rails app](https://www.ruby-forum.com/t/reverse-geocoding-in-rails-app/160238)

<div class="topic-metadata">

**Author:** [@rizwana](https://www.ruby-forum.com/u/rizwana)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 1:45pm UTC](https://www.ruby-forum.com/t/reverse-geocoding-in-rails-app/160238 "2009-02-25T13:45:45Z")

</div>

Hi all, Hope all are doing well. Actually i need a help for implementing reverse geocoding in Ruby on Rails application. I have implemented geocoding in which the user enters his address for which the respective map …

---

## [Reg : Rubygems](https://www.ruby-forum.com/t/reg-rubygems/161305)

<div class="topic-metadata">

**Author:** [@sasi](https://www.ruby-forum.com/u/sasi)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 12:27pm UTC](https://www.ruby-forum.com/t/reg-rubygems/161305 "2009-02-25T12:27:57Z")

</div>

I tried to install the restful\_adhearsion package. So I used, $ gem install jsgoecke-restful\_adhearsion –source=http://gems.github.com/ But it shows the error, ERROR: could not find gem jsgoecke-restful\_adhearsion …

---

## [Objects put into a declared array](https://www.ruby-forum.com/t/objects-put-into-a-declared-array/161216)

<div class="topic-metadata">

**Author:** [@paradise](https://www.ruby-forum.com/u/paradise)\
**Replies:** 3\
**Last updated:** [February 25, 2009, 10:36am UTC](https://www.ruby-forum.com/t/objects-put-into-a-declared-array/161216 "2009-02-25T10:36:46Z")

</div>

Hi I’ve got this misunderstanding of how to use arrays and objects stored there in (note I’m actually using Shoes if this has any bearing on my problem). below is a bit of code i’ve written that creates an array of 25…

---

## [Fetch an excel sheet name in ruby](https://www.ruby-forum.com/t/fetch-an-excel-sheet-name-in-ruby/161221)

<div class="topic-metadata">

**Author:** [@deeparaj](https://www.ruby-forum.com/u/deeparaj)\
**Replies:** 3\
**Last updated:** [February 25, 2009, 9:01am UTC](https://www.ruby-forum.com/t/fetch-an-excel-sheet-name-in-ruby/161221 "2009-02-25T09:01:40Z")

</div>

hi, I got this error.in \`method\_missing’: Open (WIN32OLERuntimeError) OLE error code:800A03EC in Microsoft Office Excel For the below coding: require ‘win32ole’ require ‘rubygems’ xl = WIN32OLE.new(‘Excel.Applicati…

---

## [Slide Show (S9) Gem Updated (v0.7.5) - Supports Plugins/Helpers; New Built-in Helpers Include conte](https://www.ruby-forum.com/t/slide-show-s9-gem-updated-v0-7-5-supports-plugins-helpers-new-built-in-helpers-include-conte/161301)

<div class="topic-metadata">

**Author:** [@gerald\_b](https://www.ruby-forum.com/u/gerald_b)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 9:01am UTC](https://www.ruby-forum.com/t/slide-show-s9-gem-updated-v0-7-5-supports-plugins-helpers-new-built-in-helpers-include-conte/161301 "2009-02-25T09:01:25Z")

</div>

Hello, I uploaded a new slideshow gem version (that is, v0.7.5). == What’s Slides Show (S9)? A Ruby gem that lets you create slide shows and author slides in plain text using a wiki-style markup language that’s easy-…

---

## [Help/Cannot Open Ruby Project in Ide](https://www.ruby-forum.com/t/help-cannot-open-ruby-project-in-ide/161057)

<div class="topic-metadata">

**Author:** [@devrubygem](https://www.ruby-forum.com/u/devrubygem)\
**Replies:** 10\
**Last updated:** [February 25, 2009, 8:47am UTC](https://www.ruby-forum.com/t/help-cannot-open-ruby-project-in-ide/161057 "2009-02-25T08:47:42Z")

</div>

I apologize if I’m posting this in the wrong forum. I’m having trouble opening my whole folder project in my Netbean Ide, and also in my Aptana Ide, I’m only able to open up a file.rb. I have the projects stored in th…

---

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

<div class="topic-metadata">

**Author:** [@vetrivel](https://www.ruby-forum.com/u/vetrivel)\
**Replies:** 4\
**Last updated:** [February 25, 2009, 8:29am UTC](https://www.ruby-forum.com/t/array/161293 "2009-02-25T08:29:02Z")

</div>

How to Join multiple arrays in a single method in ruby Ex: a= \[ 1 ,2 , 3\] b = \[4,5,6\] c = \[7,8,9\] Using single method i want b and c array content into the a array.

---

## [Append static text for all files in a directory](https://www.ruby-forum.com/t/append-static-text-for-all-files-in-a-directory/161182)

<div class="topic-metadata">

**Author:** [@srinathbtech](https://www.ruby-forum.com/u/srinathbtech)\
**Replies:** 4\
**Last updated:** [February 25, 2009, 6:36am UTC](https://www.ruby-forum.com/t/append-static-text-for-all-files-in-a-directory/161182 "2009-02-25T06:36:43Z")

</div>

How to append static text for all files in application . I want to append comment lines on top of each file in app/controllers/ how can iterate and append in the app ? I used this for single file : filename = File.op…

---

## [Pointer and other questions](https://www.ruby-forum.com/t/pointer-and-other-questions/161143)

<div class="topic-metadata">

**Author:** [@dasch](https://www.ruby-forum.com/u/dasch)\
**Replies:** 15\
**Last updated:** [February 25, 2009, 5:01am UTC](https://www.ruby-forum.com/t/pointer-and-other-questions/161143 "2009-02-25T05:01:46Z")

</div>

Hi, I just started with ruby and I understand from reading the documentation that pointers don’t exist. I’m in the process of writing a netlister. Such a software is usually built using several linked lists. More pre…

---

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

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 1\
**Last updated:** [February 25, 2009, 3:59am UTC](https://www.ruby-forum.com/t/code-review-netinterop1/161285 "2009-02-25T03:59:48Z")

</div>

tfpt review “/shelveset:netinterop1;REDMOND\\jdeville” Comment : Adds more netinterop tests related to methods. Adds these tests to snap. Adds tags for netinterop Modifies testsupport.cs (ClrAssembly) to make the Fl…

---

## [Rawr / compliance level](https://www.ruby-forum.com/t/rawr-compliance-level/161170)

<div class="topic-metadata">

**Author:** [@ADADAD](https://www.ruby-forum.com/u/ADADAD)\
**Replies:** 4\
**Last updated:** [February 25, 2009, 3:11am UTC](https://www.ruby-forum.com/t/rawr-compliance-level/161170 "2009-02-25T03:11:04Z")

</div>

i am trying to compile my jruby script (and hopefully hpricot gem) with RAWR, however getting the following error. Any ideas here ? Compliance level ‘1.4’ is incompatible with target level ‘1.5’. A compliance level ‘…

---

## [Code Review: EventsAndSites5](https://www.ruby-forum.com/t/code-review-eventsandsites5/161284)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 2:03am UTC](https://www.ruby-forum.com/t/code-review-eventsandsites5/161284 "2009-02-25T02:03:07Z")

</div>

tfpt review “/shelveset:EventsAndSites5;REDMOND\\tomat” DLR, Python: Refactors Python's RelfectedEvent and moves the language independent part to DLR EventTracker. Fixes CompilerHelpers.GetCallableMet…

---

## [Heist: a Scheme interpreter in Ruby](https://www.ruby-forum.com/t/heist-a-scheme-interpreter-in-ruby/161283)

<div class="topic-metadata">

**Author:** [@james-calivar](https://www.ruby-forum.com/u/james-calivar)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 1:20am UTC](https://www.ruby-forum.com/t/heist-a-scheme-interpreter-in-ruby/161283 "2009-02-25T01:20:50Z")

</div>

Hi all, Just a quick announcement that I’ve just released the first alpha version of Heist, a Scheme interpreter in Ruby. It’s currently fairly arithmetic-focused, but it also has runtime support for some of the more …

---

## [Post & put probelms with restclient](https://www.ruby-forum.com/t/post-put-probelms-with-restclient/161281)

<div class="topic-metadata">

**Author:** [@andrewneal](https://www.ruby-forum.com/u/andrewneal)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 12:59am UTC](https://www.ruby-forum.com/t/post-put-probelms-with-restclient/161281 "2009-02-25T00:59:41Z")

</div>

Hi all, I am hoping someone can shed some light on what I am doing wrong here. I have a simple class that I created using the rails scaffold script TestServer name :string serverid :integer I am trying to connect …

---

## [Tokenizing text](https://www.ruby-forum.com/t/tokenizing-text/161276)

<div class="topic-metadata">

**Author:** [@alce](https://www.ruby-forum.com/u/alce)\
**Replies:** 0\
**Last updated:** [February 25, 2009, 12:07am UTC](https://www.ruby-forum.com/t/tokenizing-text/161276 "2009-02-25T00:07:49Z")

</div>

Hello, I need to tokenize English text into sentences. I realize this is a very complex task to get right all of the time (if possible at all) but for the time being I’m only trying to implement a better solution than …

---

## [BitTorrent Proxy](https://www.ruby-forum.com/t/bittorrent-proxy/160690)

<div class="topic-metadata">

**Author:** [@gregthegerg](https://www.ruby-forum.com/u/gregthegerg)\
**Replies:** 1\
**Last updated:** [February 24, 2009, 11:34pm UTC](https://www.ruby-forum.com/t/bittorrent-proxy/160690 "2009-02-24T23:34:47Z")

</div>

Hi, I was wondering if anybody knows of a way that I can read data coming on a port for BitTorrent, I figured I might need the libtorrent-ruby. So, I got it already. Can anybody give me a hint on anything else I might…

---

## [What's your favorite JRuby 1.2 feature/fix?](https://www.ruby-forum.com/t/whats-your-favorite-jruby-1-2-feature-fix/161263)

<div class="topic-metadata">

**Author:** [@headius](https://www.ruby-forum.com/u/headius)\
**Replies:** 1\
**Last updated:** [February 24, 2009, 9:39pm UTC](https://www.ruby-forum.com/t/whats-your-favorite-jruby-1-2-feature-fix/161263 "2009-02-24T21:39:41Z")

</div>

We’re prepping for release announcements for JRuby 1.2 RC1 and I figured I’d ask those of you following along for your favorite new features. Just reply to this thread…it will help us put together an announcement with…

---

## [Ruby 1.8.6 Source and Debian Apt-Get Upgrades](https://www.ruby-forum.com/t/ruby-1-8-6-source-and-debian-apt-get-upgrades/160554)

<div class="topic-metadata">

**Author:** [@unknown](https://www.ruby-forum.com/u/unknown)\
**Replies:** 1\
**Last updated:** [February 24, 2009, 9:37pm UTC](https://www.ruby-forum.com/t/ruby-1-8-6-source-and-debian-apt-get-upgrades/160554 "2009-02-24T21:37:55Z")

</div>

Hi, I am hoping to get some advice with a problem I have gotten myself into; I upgraded my packages using apt-get yesterday and have found an issue with my installed (source built) version of Ruby 1.8.6. I am wonderin…

---

## [String#gsub escaping special characters](https://www.ruby-forum.com/t/string-gsub-escaping-special-characters/161242)

<div class="topic-metadata">

**Author:** [@gyngve](https://www.ruby-forum.com/u/gyngve)\
**Replies:** 5\
**Last updated:** [February 24, 2009, 8:07pm UTC](https://www.ruby-forum.com/t/string-gsub-escaping-special-characters/161242 "2009-02-24T20:07:47Z")

</div>

Ugh, just got bitten by trying to replace ’ w/ ’ in a string (backslash apostrophe). Turns out that ’ is a regex interpolator, just like \\1, \\2, so “a’b’c’d”.gsub("’","\\’") did not work, nor did it with the 2nd param …

---

## [Better error reporting from eval?](https://www.ruby-forum.com/t/better-error-reporting-from-eval/161240)

<div class="topic-metadata">

**Author:** [@matt\_neuburg](https://www.ruby-forum.com/u/matt_neuburg)\
**Replies:** 2\
**Last updated:** [February 24, 2009, 8:06pm UTC](https://www.ruby-forum.com/t/better-error-reporting-from-eval/161240 "2009-02-24T20:06:36Z")

</div>

This might seem silly, but it is only a reduced version of a real issue. Consider the following: class Thing def ev(what) eval(what) end def bar() 1 + 1 nil + 2 # causing an exception in bar() end def foo bar(…

---

## [JRoR: Co-existing with Java/Hibernate back end](https://www.ruby-forum.com/t/jror-co-existing-with-java-hibernate-back-end/161252)

<div class="topic-metadata">

**Author:** [@weyus](https://www.ruby-forum.com/u/weyus)\
**Replies:** 0\
**Last updated:** [February 24, 2009, 7:00pm UTC](https://www.ruby-forum.com/t/jror-co-existing-with-java-hibernate-back-end/161252 "2009-02-24T19:00:22Z")

</div>

All, I’m looking at a project where I’m being asked to focus mostly on the front-end development. I don’t have all of the details yet, but the implication is that the model layer is going to be handled completely in …

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

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