# Ruby

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

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

---

## [\[Feature:trunk\] with\_index\_from](https://www.ruby-forum.com/t/feature-trunk-with-index-from/159538)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 8\
**Last updated:** [February 12, 2009, 9:01am UTC](https://www.ruby-forum.com/t/feature-trunk-with-index-from/159538 "2009-02-12T09:01:05Z")

</div>

e$B1sF#$G$9!#e(B with\_index e$B$N3+;O%$%s%G%C%/%9$r;XDj$G$-$k%P!\<%8%g%s$,$"$k$HJXMx$@$He(B e$B;W$$$^$9!#e(B $ ./ruby -e ‘p %w(a b c).map.with\_index\_from(1) {|c, i| \[c, i\] }’ \[\[“a”, 1\], \[“b”, 2\], \[“c”, 3\]\] e$B%$%s%G…

---

## [Mechanize 0.9.0 on ruby1.9.0/ubuntu - get(url) error](https://www.ruby-forum.com/t/mechanize-0-9-0-on-ruby1-9-0-ubuntu-get-url-error/160146)

<div class="topic-metadata">

**Author:** [@edouard](https://www.ruby-forum.com/u/edouard)\
**Replies:** 0\
**Last updated:** [February 12, 2009, 8:41am UTC](https://www.ruby-forum.com/t/mechanize-0-9-0-on-ruby1-9-0-ubuntu-get-url-error/160146 "2009-02-12T08:41:01Z")

</div>

Hi, i have switched to ruby1.9 because the better encoding support. Now i can’t get the mechanize0.9.0 to work properly. The WWW::Mechanize.get method returns a RuntimeError:need absolute url while I am using it the …

---

## [Fixing Watir Problem, was Re: Watir is acting retarded](https://www.ruby-forum.com/t/fixing-watir-problem-was-re-watir-is-acting-retarded/159588)

<div class="topic-metadata">

**Author:** [@runxc](https://www.ruby-forum.com/u/runxc)\
**Replies:** 2\
**Last updated:** [February 12, 2009, 8:05am UTC](https://www.ruby-forum.com/t/fixing-watir-problem-was-re-watir-is-acting-retarded/159588 "2009-02-12T08:05:20Z")

</div>

Daniel, Should we release a new Watir gem installer that requires these updated files? Bret

---

## [Updating ruby gems--\>error](https://www.ruby-forum.com/t/updating-ruby-gems-error/160139)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 0\
**Last updated:** [February 12, 2009, 6:50am UTC](https://www.ruby-forum.com/t/updating-ruby-gems-error/160139 "2009-02-12T06:50:08Z")

</div>

Here is what I did: $ sudo gem update --system Password: Updating RubyGems… Bulk updating Gem source index for: http://gems.rubyforge.org Attempting remote update of rubygems-update Successfully installed rubygems-…

---

## [Ruby.h defining macros](https://www.ruby-forum.com/t/ruby-h-defining-macros/160132)

<div class="topic-metadata">

**Author:** [@John\_Ky](https://www.ruby-forum.com/u/John_Ky)\
**Replies:** 2\
**Last updated:** [February 12, 2009, 6:15am UTC](https://www.ruby-forum.com/t/ruby-h-defining-macros/160132 "2009-02-12T06:15:53Z")

</div>

Hi Ruby T., When I include ruby.h, I’m getting new macros defined such as strcmpcase, and close on the Windows platform. This is conflicting with macros and function names in my own project. Is there a way to disab…

---

## [IIS 7 HttpModule for Rails/Rack with IronRuby](https://www.ruby-forum.com/t/iis-7-httpmodule-for-rails-rack-with-ironruby/159797)

<div class="topic-metadata">

**Author:** [@hotgazpacho](https://www.ruby-forum.com/u/hotgazpacho)\
**Replies:** 6\
**Last updated:** [February 12, 2009, 5:56am UTC](https://www.ruby-forum.com/t/iis-7-httpmodule-for-rails-rack-with-ironruby/159797 "2009-02-12T05:56:00Z")

</div>

First, I want to say that I’m very excited by the progress of IronRuby. So, my interrest lies in getting Ruby web applications running through IIS 7. Specifically Rails, but also others like Sinatra and Merb, all of w…

---

## [Hpricot or nokogiri?](https://www.ruby-forum.com/t/hpricot-or-nokogiri/157354)

<div class="topic-metadata">

**Author:** [@goodieboy](https://www.ruby-forum.com/u/goodieboy)\
**Replies:** 7\
**Last updated:** [February 12, 2009, 4:53am UTC](https://www.ruby-forum.com/t/hpricot-or-nokogiri/157354 "2009-02-12T04:53:27Z")

</div>

OK, was completely sold on Hpricot and now am having my doubts. I can’t seem to get to any of the docs (the site is down). Is it still being developed? Who are the developers? I love the API and really am hoping to us…

---

## [Regexp problem](https://www.ruby-forum.com/t/regexp-problem/159851)

<div class="topic-metadata">

**Author:** [@yankees26](https://www.ruby-forum.com/u/yankees26)\
**Replies:** 20\
**Last updated:** [February 12, 2009, 4:25am UTC](https://www.ruby-forum.com/t/regexp-problem/159851 "2009-02-12T04:25:23Z")

</div>

how i can extract: Traffic left: MB i need this nuber: 123313? I tried to match this in many ways but i stil have problem with escape characters.

---

## [Embedded # in column names](https://www.ruby-forum.com/t/embedded-in-column-names/160121)

<div class="topic-metadata">

**Author:** [@moredip](https://www.ruby-forum.com/u/moredip)\
**Replies:** 4\
**Last updated:** [February 12, 2009, 3:41am UTC](https://www.ruby-forum.com/t/embedded-in-column-names/160121 "2009-02-12T03:41:26Z")

</div>

I work with some legacy schema’s that have some fairly interesting column names in tables. Unfortunately, because of limitations in other programs using the tables, I don’t have the option to change anything about th…

---

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

<div class="topic-metadata">

**Author:** [@evildrummer](https://www.ruby-forum.com/u/evildrummer)\
**Replies:** 17\
**Last updated:** [February 12, 2009, 2:34am UTC](https://www.ruby-forum.com/t/array-uniq/160109 "2009-02-12T02:34:05Z")

</div>

I am having some troubles with the uniq method for arrays. This is a typical example of my data set, which I want to remove the duplicates from. TueAug052008 TueAug052008 TueAug052008 TueAug052008 Its clear to see…

---

## [Git push](https://www.ruby-forum.com/t/git-push/160124)

<div class="topic-metadata">

**Author:** [@raker\_t](https://www.ruby-forum.com/u/raker_t)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 11:07pm UTC](https://www.ruby-forum.com/t/git-push/160124 "2009-02-11T23:07:15Z")

</div>

I have pushed TFS to Git. Just an FYI, the building where the IronRuby team is located is having a building move the rest of the week. In addition, TFS is undergoing upgrades during that time. Due to all of this, I wo…

---

## [Rexml Quoting control](https://www.ruby-forum.com/t/rexml-quoting-control/160122)

<div class="topic-metadata">

**Author:** [@pitosalas](https://www.ruby-forum.com/u/pitosalas)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 11:04pm UTC](https://www.ruby-forum.com/t/rexml-quoting-control/160122 "2009-02-11T23:04:10Z")

</div>

I’m generating a xml with Rexml. Pretty straightforward. I have a question about quoting. I would like this result (for example) But when I do the obvious: x = Element.new(“Outline”) x.add\_attribute(“text”, “Elle…

---

## [1.9.1-p0 $B$N(B Net::HTTP#get $B$NBh(B 2 $B0z?t(B](https://www.ruby-forum.com/t/1-9-1-p0-b-n-b-net-http-get-b-nbh-b-2-b0z-t-b/160118)

<div class="topic-metadata">

**Author:** [@zunda](https://www.ruby-forum.com/u/zunda)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 10:41pm UTC](https://www.ruby-forum.com/t/1-9-1-p0-b-n-b-net-http-get-b-nbh-b-2-b0z-t-b/160118 "2009-02-11T22:41:57Z")

</div>

zundae$B$H?=$7$^$9e(B tDiarye$B$Ne(Bweather.rbe$B%W%i%0%$%s$re(Bruby-1.9.1e$B$GF0$/$h$&$K$7$h$&$H$7$F$$$Fe(B\*1e$B!"e(B ruby-1.9.1-p0e$B$Ne(BNet::HTTP#gete$B%a%=%C%I$,Bhe(B2e$B0z?t$Ke(Bnile$B$r\<u$1\<h$i$J$/$J$C$F$$e(B e…

---

## [Undefined method 'delegate' from ActiveRecord](https://www.ruby-forum.com/t/undefined-method-delegate-from-activerecord/160114)

<div class="topic-metadata">

**Author:** [@bouldr-matt](https://www.ruby-forum.com/u/bouldr-matt)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 10:07pm UTC](https://www.ruby-forum.com/t/undefined-method-delegate-from-activerecord/160114 "2009-02-11T22:07:12Z")

</div>

Hi, I have a project using jRuby 1.1.6 / Rails 2.2, being built into a war with warbler. I have successfully deployed the war into locally running copies of both Tomcat and Glassfish without issue. Whenever I depl…

---

## [Net-Ping ICMP issues (Windows)](https://www.ruby-forum.com/t/net-ping-icmp-issues-windows/160110)

<div class="topic-metadata">

**Author:** [@b0rdslide](https://www.ruby-forum.com/u/b0rdslide)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 9:39pm UTC](https://www.ruby-forum.com/t/net-ping-icmp-issues-windows/160110 "2009-02-11T21:39:23Z")

</div>

Hello all - I am running into a curious issue with Net-Ping on Windows (XP Pro SP2 with administrator privileges). Attempting Net::Ping::ICMP.new(host).ping fails. Here’s the code (which executes flawlessly under OS…

---

## [Glassfish gem: allocating memory](https://www.ruby-forum.com/t/glassfish-gem-allocating-memory/159969)

<div class="topic-metadata">

**Author:** [@marc](https://www.ruby-forum.com/u/marc)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 8:35pm UTC](https://www.ruby-forum.com/t/glassfish-gem-allocating-memory/159969 "2009-02-11T20:35:06Z")

</div>

Hi, I’ve deployed redmine with the glassfish gem. Usage is light, so using glassfish proper was overkill and ate a pile of memory. However, I’d like improve the memory management - to jruby? - but don’t know how to d…

---

## [Unsubcribe](https://www.ruby-forum.com/t/unsubcribe/160030)

<div class="topic-metadata">

**Author:** [@Thomas\_Hoffer](https://www.ruby-forum.com/u/Thomas_Hoffer)\
**Replies:** 3\
**Last updated:** [February 11, 2009, 8:29pm UTC](https://www.ruby-forum.com/t/unsubcribe/160030 "2009-02-11T20:29:46Z")

</div>

unsubscribe

---

## [A better way to do this job?](https://www.ruby-forum.com/t/a-better-way-to-do-this-job/159946)

<div class="topic-metadata">

**Author:** [@rubyernewbie](https://www.ruby-forum.com/u/rubyernewbie)\
**Replies:** 33\
**Last updated:** [February 11, 2009, 7:04pm UTC](https://www.ruby-forum.com/t/a-better-way-to-do-this-job/159946 "2009-02-11T19:04:22Z")

</div>

topics.each do |f| times +=1 puts f.title if times \> 4 break a little ugly, doesn’t it?

---

## [Image recognition](https://www.ruby-forum.com/t/image-recognition/159879)

<div class="topic-metadata">

**Author:** [@vbarre](https://www.ruby-forum.com/u/vbarre)\
**Replies:** 1\
**Last updated:** [February 11, 2009, 6:07pm UTC](https://www.ruby-forum.com/t/image-recognition/159879 "2009-02-11T18:07:50Z")

</div>

Hello, I need to write a software who read an image from a questionary, and recognize the options marked. Anyone knows any gem who has some function like it? I’m think about use rmagick. Thanks, Michel

---

## [Code Review: InflateJoin](https://www.ruby-forum.com/t/code-review-inflatejoin/160089)

<div class="topic-metadata">

**Author:** [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 5:59pm UTC](https://www.ruby-forum.com/t/code-review-inflatejoin/160089 "2009-02-11T17:59:34Z")

</div>

tfpt review “/shelveset:InflateJoin;REDMOND\\tomat” Comment : Fixes Zlib::Inflate#inflate and File#join. Tomas

---

## [How to do the recursion](https://www.ruby-forum.com/t/how-to-do-the-recursion/160022)

<div class="topic-metadata">

**Author:** [@alex-osu3](https://www.ruby-forum.com/u/alex-osu3)\
**Replies:** 13\
**Last updated:** [February 11, 2009, 5:35pm UTC](https://www.ruby-forum.com/t/how-to-do-the-recursion/160022 "2009-02-11T17:35:46Z")

</div>

Hi all, In order to study recursion, I want to change a decimal number into a binary number based on the algorithm on website http://www.trunix.org/programlama/cpp/fred/notes/cpp/misc/decimal2binary.html But my code…

---

## [Problem writing a Faster\_csv generated record to a file](https://www.ruby-forum.com/t/problem-writing-a-faster-csv-generated-record-to-a-file/160067)

<div class="topic-metadata">

**Author:** [@thiel](https://www.ruby-forum.com/u/thiel)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 5:22pm UTC](https://www.ruby-forum.com/t/problem-writing-a-faster-csv-generated-record-to-a-file/160067 "2009-02-11T17:22:08Z")

</div>

Hi, I have a problem writing a record generated with FasterCSV to a file: This is the code: op = File.new(“C:/Test/testmap.csv”, “w”) for i in 0 … n for j in 0 … 12 custrecord\[j\] = x\[i,j\] end csv\_string = FasterC…

---

## [Work around for wait with timeout and count\_waiters](https://www.ruby-forum.com/t/work-around-for-wait-with-timeout-and-count-waiters/160083)

<div class="topic-metadata">

**Author:** [@sharat](https://www.ruby-forum.com/u/sharat)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 5:00pm UTC](https://www.ruby-forum.com/t/work-around-for-wait-with-timeout-and-count-waiters/160083 "2009-02-11T17:00:54Z")

</div>

I was using following code in ruby 1.8 def self.wait\_for\_completion\_on(signal\_data) signal\_data.lock.synchronize do if signal\_data.lock.count{|i| !i.nil?} \> 0 signal\_data.lock.clear else k = 0 …

---

## [Mysql.bundle problem](https://www.ruby-forum.com/t/mysql-bundle-problem/160082)

<div class="topic-metadata">

**Author:** [@matthew](https://www.ruby-forum.com/u/matthew)\
**Replies:** 0\
**Last updated:** [February 11, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/mysql-bundle-problem/160082 "2009-02-11T16:54:18Z")

</div>

I’m not sure what is going on, but anytime I try to use the mysql class I get this error: /opt/local/lib/ruby/site\_ruby/1.8/powerpc-darwin8/mysql.bundle: dlopen(/opt/local/lib/ruby/site\_ruby/1.8/powerpc-darwin8/mysql.…

---

## [File#size](https://www.ruby-forum.com/t/file-size/159720)

<div class="topic-metadata">

**Author:** [@rogerdpack](https://www.ruby-forum.com/u/rogerdpack)\
**Replies:** 9\
**Last updated:** [February 11, 2009, 4:45pm UTC](https://www.ruby-forum.com/t/file-size/159720 "2009-02-11T16:45:53Z")

</div>

I am thinking this would be a nice function to have in the stdlib. File#size thoughts? -=r

---

## [Redefining @my\_attr=](https://www.ruby-forum.com/t/redefining-my-attr/160029)

<div class="topic-metadata">

**Author:** [@mikec](https://www.ruby-forum.com/u/mikec)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/redefining-my-attr/160029 "2009-02-11T16:42:20Z")

</div>

I want to write a generic validator that ensures an attr value is in a list before assigning, and if not, assigns a default. It works for self.attrib=‘value’, and Dummy.new.attrib=‘value’, but not @attrib=‘value’ wit…

---

## [Java method expectiong Java Interface](https://www.ruby-forum.com/t/java-method-expectiong-java-interface/160012)

<div class="topic-metadata">

**Author:** [@Manfred\_U](https://www.ruby-forum.com/u/Manfred_U)\
**Replies:** 1\
**Last updated:** [February 11, 2009, 4:23pm UTC](https://www.ruby-forum.com/t/java-method-expectiong-java-interface/160012 "2009-02-11T16:23:58Z")

</div>

Hi, I get a type error when I pass an object to a Java method which expects an interface as parameter although the object implements this interface: import org.jdesktop.swingx.decorator.HighlighterFactory test\_table…

---

## [Regexp ops: get rid of !=~?](https://www.ruby-forum.com/t/regexp-ops-get-rid-of/159987)

<div class="topic-metadata">

**Author:** [@gyngve](https://www.ruby-forum.com/u/gyngve)\
**Replies:** 2\
**Last updated:** [February 11, 2009, 4:02pm UTC](https://www.ruby-forum.com/t/regexp-ops-get-rid-of/159987 "2009-02-11T16:02:17Z")

</div>

The proper way to see if something doesn’t match is “foo” !~ /bar/ The ~/blah/ operator exists to apply to $\_ Unfortunately this means that “foo” !=~ /bar/ does “foo”.!= (~bar), which doesn’t produce an error, even…

---

## [Simple class question](https://www.ruby-forum.com/t/simple-class-question/160044)

<div class="topic-metadata">

**Author:** [@tbcox23](https://www.ruby-forum.com/u/tbcox23)\
**Replies:** 6\
**Last updated:** [February 11, 2009, 3:44pm UTC](https://www.ruby-forum.com/t/simple-class-question/160044 "2009-02-11T15:44:49Z")

</div>

Tonight I’m exploring the problem of tossing a value at a class instance and getting a value back - having it behave like a method, in other words. I’ve not looked at this before, and I don’t have much confidence abou…

---

## [Sharing some stuff + one question on mono](https://www.ruby-forum.com/t/sharing-some-stuff-one-question-on-mono/159923)

<div class="topic-metadata">

**Author:** [@thbar](https://www.ruby-forum.com/u/thbar)\
**Replies:** 7\
**Last updated:** [February 11, 2009, 2:11pm UTC](https://www.ruby-forum.com/t/sharing-some-stuff-one-question-on-mono/159923 "2009-02-11T14:11:19Z")

</div>

Hi, two things: I’m sharing in case it’s useful to someone else: I pushed some rake tasks here GitHub - thbar/ironruby-labs: Experimentations with IronRuby . I’m using it to download the DLR nightly to my Mac, pat…

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

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