# Ruby

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

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

---

## [Values mix up](https://www.ruby-forum.com/t/values-mix-up/195585)

<div class="topic-metadata">

**Author:** [@jake\_1637](https://www.ruby-forum.com/u/jake_1637)\
**Replies:** 1\
**Last updated:** [September 26, 2010, 8:49am UTC](https://www.ruby-forum.com/t/values-mix-up/195585 "2010-09-26T08:49:56Z")

</div>

Hi I’m just starting to use ruby and I’m stuck on a homework assignment for class My problem is dollars = tempEntry.text.to\_f rate = tempEntry.text.to\_f time = tempEntry.text.to\_f fv = dollars\*(1+rate)\*\*time outp…

---

## [Begginer needs help](https://www.ruby-forum.com/t/begginer-needs-help/195590)

<div class="topic-metadata">

**Author:** [@jake\_1637](https://www.ruby-forum.com/u/jake_1637)\
**Replies:** 2\
**Last updated:** [September 26, 2010, 2:56am UTC](https://www.ruby-forum.com/t/begginer-needs-help/195590 "2010-09-26T02:56:27Z")

</div>

Hi i’m in a programming a class and i’m doing an assignment i’ve gotten it to work but one of the entries is messed up it takes the place of a diffrent one Here’s the code require ‘gtk2’ window = Gtk::Window.new wi…

---

## [Feedback on \[ruby-core:32351\]](https://www.ruby-forum.com/t/feedback-on-ruby-core-32351/195586)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 0\
**Last updated:** [September 26, 2010, 12:58am UTC](https://www.ruby-forum.com/t/feedback-on-ruby-core-32351/195586 "2010-09-26T00:58:12Z")

</div>

1.8.7 e$B%j%j!\<%9%V%i%s%A$K7H$o$C$F$$$kJ}$X$N$\*4j$$e(B \[ruby-core:32351\]e$B$K$D$$$F$N$\*JV;v$rAa5^$K4j$$$^$9!#e(B Luise$B;a\[)$/%Q%C%A$r#4#9F|A0$KAw$C$?$=$&$J$N$G!"e(Bapplye$B$+e(Brejecte$B$r%Q%C%A$K%+%S$,@8$($kA0$K7h$a$…

---

## [Tutorial help](https://www.ruby-forum.com/t/tutorial-help/195579)

<div class="topic-metadata">

**Author:** [@anthonyob](https://www.ruby-forum.com/u/anthonyob)\
**Replies:** 3\
**Last updated:** [September 25, 2010, 10:43pm UTC](https://www.ruby-forum.com/t/tutorial-help/195579 "2010-09-25T22:43:48Z")

</div>

the a =\<\<END\_STR spits out an error Here is what I coded with the tutorial \[code/\]#p004stringusage.rb #defining a constant PI = 3.1416 puts PI Defining a local variable myString = ‘I love my city, Pune’ puts m…

---

## [\[bug:trunk\] GNU/Linux select hang on a socket which TCP state is CLOSED](https://www.ruby-forum.com/t/bug-trunk-gnu-linux-select-hang-on-a-socket-which-tcp-state-is-closed/191149)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 6\
**Last updated:** [September 25, 2010, 10:05pm UTC](https://www.ruby-forum.com/t/bug-trunk-gnu-linux-select-hang-on-a-socket-which-tcp-state-is-closed/191149 "2010-09-25T22:05:31Z")

</div>

GNU/Linux e$B$G!"0J2\<$N%W%m%0%i%\`$,%O%s%0$7$^$9!#e(B % uname -mrsv Linux 2.6.26-2-486 #1 Sat Dec 26 08:37:39 UTC 2009 i686 % ./ruby -rsocket -ve ’ BasicSocket.do\_not\_reverse\_lookup = true serv = TCPServer.open(“127.…

---

## [\[Ruby 1.9-Feature#3037\]\[Rejected\] testrb $B$NF0:n$,(B1.8.7 $B$N(B testrb $B$H0c$$$9$.$k(B](https://www.ruby-forum.com/t/ruby-1-9-feature-3037-rejected-testrb-b-nf0-n-b1-8-7-b-n-b-testrb-b-h0c-9-k-b/195582)

<div class="topic-metadata">

**Author:** [@Shyouhei\_U](https://www.ruby-forum.com/u/Shyouhei_U)\
**Replies:** 0\
**Last updated:** [September 25, 2010, 9:45pm UTC](https://www.ruby-forum.com/t/ruby-1-9-feature-3037-rejected-testrb-b-nf0-n-b1-8-7-b-n-b-testrb-b-h0c-9-k-b/195582 "2010-09-25T21:45:37Z")

</div>

e$B%A%1%C%He(B #3037 e$B$,99?7$5$l$^$7$?!#e(B (by Shyouhei U.) e$B%9%F!\<%?%9e(B Opene$B$+$ie(BRejectede$B$KJQ99e(B e$BK\\7o$Oe(Brejecte$B$5$l$?$H$$$&G’\<1$G$9!#0c$C$?$i99?7$7$F$/$@$5$$!#e(B http://redmine.ruby-lang.org/…

---

## [Hard question: Any ideas why this code leaks memory?](https://www.ruby-forum.com/t/hard-question-any-ideas-why-this-code-leaks-memory/146300)

<div class="topic-metadata">

**Author:** [@Sven\_CSKoehler](https://www.ruby-forum.com/u/Sven_CSKoehler)\
**Replies:** 8\
**Last updated:** [September 25, 2010, 9:20pm UTC](https://www.ruby-forum.com/t/hard-question-any-ideas-why-this-code-leaks-memory/146300 "2010-09-25T21:20:27Z")

</div>

Hello, could someone help me understand why this code leaks memory? (I am using ruby 1.8.6 (2007-12-03 patchlevel 113) \[x86\_64-linux\].) def rss\_leaks /^VmRSS:\\s+(\\d+)/m.match(File.open("/proc/#{$$}/status") {|f| f.r…

---

## [Automation of controls and windows on Linux and OS X with Ruby?](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568)

<div class="topic-metadata">

**Author:** [@juuser](https://www.ruby-forum.com/u/juuser)\
**Replies:** 2\
**Last updated:** [September 25, 2010, 5:31pm UTC](https://www.ruby-forum.com/t/automation-of-controls-and-windows-on-linux-and-os-x-with-ruby/195568 "2010-09-25T17:31:00Z")

</div>

Hello! What would be the best way to automate controls and windows on linux and os x? In Windows there is a Windows API, which allows to locate windows by their title/handle/class name whatever, to click on buttons, …

---

## [SMTP + serial ports](https://www.ruby-forum.com/t/smtp-serial-ports/194746)

<div class="topic-metadata">

**Author:** [@watts](https://www.ruby-forum.com/u/watts)\
**Replies:** 3\
**Last updated:** [September 25, 2010, 4:36pm UTC](https://www.ruby-forum.com/t/smtp-serial-ports/194746 "2010-09-25T16:36:08Z")

</div>

Hi, i’m kinda new at ruby, and i wanna know (didnt even install ruby-serial), if there is anyone willing to help me at my project. What i need is, “Listen on serial port for signal changing at pins” ie, wait for analo…

---

## [Getting GUI for ruby for Linux running (QT or wxWidget)?](https://www.ruby-forum.com/t/getting-gui-for-ruby-for-linux-running-qt-or-wxwidget/195217)

<div class="topic-metadata">

**Author:** [@Markus\_F](https://www.ruby-forum.com/u/Markus_F)\
**Replies:** 22\
**Last updated:** [September 25, 2010, 3:28pm UTC](https://www.ruby-forum.com/t/getting-gui-for-ruby-for-linux-running-qt-or-wxwidget/195217 "2010-09-25T15:28:04Z")

</div>

Hi, I’m trying to evaluate GUI development with Ruby on Linux and Windows and currently I decided to try QT and wxWdigets. Seems it’s not my weekend, I really tried for hours, various attempts and I could get neither…

---

## [Ruby-based data language](https://www.ruby-forum.com/t/ruby-based-data-language/195198)

<div class="topic-metadata">

**Author:** [@tcsnide](https://www.ruby-forum.com/u/tcsnide)\
**Replies:** 13\
**Last updated:** [September 25, 2010, 9:55am UTC](https://www.ruby-forum.com/t/ruby-based-data-language/195198 "2010-09-25T09:55:03Z")

</div>

Has anyone ever endeavored to create a data/configuration file format based on Ruby’s syntax? In other words, a format like YAML but with a Ruby-based syntax. I tried to do this the easy way using $SAFE=4, but #method…

---

## [Gruff graphs](https://www.ruby-forum.com/t/gruff-graphs/195472)

<div class="topic-metadata">

**Author:** [@woow](https://www.ruby-forum.com/u/woow)\
**Replies:** 4\
**Last updated:** [September 25, 2010, 6:06am UTC](https://www.ruby-forum.com/t/gruff-graphs/195472 "2010-09-25T06:06:16Z")

</div>

Hi All, I am struggling to do following and would someone could be help. Following are my data time1 = \[ 1, 1.25, 3, 5\] y1 = \[2.7, 3, 5, 10\] time2 = \[ 0, 2, 5, 6, 7, 8, 9\] y2 = \[10, 1, 3, 5, 6, 7, 12\] I want to gr…

---

## [Using the same variable for an array and an iterator](https://www.ruby-forum.com/t/using-the-same-variable-for-an-array-and-an-iterator/195556)

<div class="topic-metadata">

**Author:** [@ryan](https://www.ruby-forum.com/u/ryan)\
**Replies:** 3\
**Last updated:** [September 25, 2010, 6:00am UTC](https://www.ruby-forum.com/t/using-the-same-variable-for-an-array-and-an-iterator/195556 "2010-09-25T06:00:57Z")

</div>

I’ve just started learning Ruby and am going through a few tutorials. Right now I’m playing around with arrays and am getting a strange error. I am creating an array named ‘x’ and creating an iterator named x as well…

---

## [Rcr: request for \_\_DATA\_\_ besides \_\_END\_\_](https://www.ruby-forum.com/t/rcr-request-for-data-besides-end/195558)

<div class="topic-metadata">

**Author:** [@botp](https://www.ruby-forum.com/u/botp)\
**Replies:** 0\
**Last updated:** [September 25, 2010, 5:33am UTC](https://www.ruby-forum.com/t/rcr-request-for-data-besides-end/195558 "2010-09-25T05:33:27Z")

</div>

Hi, in ruby there is END, and one can put data after that line. now what if i want to put non-data related info thereafter… my request would be that ruby use DATA as complement to END . DATA word is very easy t…

---

## [Ruby-GNOME2 0.90.0](https://www.ruby-forum.com/t/ruby-gnome2-0-90-0/195440)

<div class="topic-metadata">

**Author:** [@Kouhei\_S](https://www.ruby-forum.com/u/Kouhei_S)\
**Replies:** 1\
**Last updated:** [September 25, 2010, 5:18am UTC](https://www.ruby-forum.com/t/ruby-gnome2-0-90-0/195440 "2010-09-25T05:18:50Z")

</div>

Hi, The Ruby-GNOME2 project released Ruby-GNOME2 0.90.0. Web: http://ruby-gnome2.sourceforge.jp/ Download: Download ruby-gtk2-0.90.0.tar.gz (Ruby-GNOME 2) Download ruby-gnome2-all-0.90.0.tar.gz (Ruby-GNOME 2) = Ab…

---

## [Gruff vertical labels on x axis](https://www.ruby-forum.com/t/gruff-vertical-labels-on-x-axis/195545)

<div class="topic-metadata">

**Author:** [@woow](https://www.ruby-forum.com/u/woow)\
**Replies:** 1\
**Last updated:** [September 25, 2010, 3:47am UTC](https://www.ruby-forum.com/t/gruff-vertical-labels-on-x-axis/195545 "2010-09-25T03:47:01Z")

</div>

Hi I am hoping someone would know the answer for this…I have spent so much time on this I used code mentioned in below but I get the vertical labels on the top of the graph… could someone please help me to move it …

---

## [Trollop: Easter Egg Switches?](https://www.ruby-forum.com/t/trollop-easter-egg-switches/195555)

<div class="topic-metadata">

**Author:** [@callyworld](https://www.ruby-forum.com/u/callyworld)\
**Replies:** 0\
**Last updated:** [September 25, 2010, 3:37am UTC](https://www.ruby-forum.com/t/trollop-easter-egg-switches/195555 "2010-09-25T03:37:18Z")

</div>

Hey there… does anyone know if it is possible to put Easter egg switches in a Trollop opt list? I.e., is there some kind of ‘hidden’ options that makes a switch usable, but not show up when --help is used?

---

## [Processing XML](https://www.ruby-forum.com/t/processing-xml/195508)

<div class="topic-metadata">

**Author:** [@berlin](https://www.ruby-forum.com/u/berlin)\
**Replies:** 4\
**Last updated:** [September 25, 2010, 3:07am UTC](https://www.ruby-forum.com/t/processing-xml/195508 "2010-09-25T03:07:53Z")

</div>

I have the following xml layout: \<?xml version="1.0" encoding="UTF-8"?\> prod1 prodid1 prod2 prodid2 I am trying to use REXML via doc.elements.each("\*/doc") { |element| puts element.attributes\[“prod1”\] } wit…

---

## [Question installing JRuby 1.5.2 under SuSe SLES 10](https://www.ruby-forum.com/t/question-installing-jruby-1-5-2-under-suse-sles-10/195403)

<div class="topic-metadata">

**Author:** [@rubina](https://www.ruby-forum.com/u/rubina)\
**Replies:** 4\
**Last updated:** [September 25, 2010, 1:38am UTC](https://www.ruby-forum.com/t/question-installing-jruby-1-5-2-under-suse-sles-10/195403 "2010-09-25T01:38:11Z")

</div>

I downloaded jruby-bin-1.5.2.targ.gz on my SuSe SLES 10 system. How do I compile it? Any url with installation instructions? Thank you

---

## [Can't encode base64 for a jpg file](https://www.ruby-forum.com/t/cant-encode-base64-for-a-jpg-file/195547)

<div class="topic-metadata">

**Author:** [@evelasquez](https://www.ruby-forum.com/u/evelasquez)\
**Replies:** 4\
**Last updated:** [September 24, 2010, 11:29pm UTC](https://www.ruby-forum.com/t/cant-encode-base64-for-a-jpg-file/195547 "2010-09-24T23:29:57Z")

</div>

Hi everyone, I need some assistance, I’m trying to send a jpg file via http post to a page in PHP, the file is sent in base64 encode, so the page can convert it and save it to a directory in the server. I have been ab…

---

## [Running ruby script from my own .NET code is slow](https://www.ruby-forum.com/t/running-ruby-script-from-my-own-net-code-is-slow/194879)

<div class="topic-metadata">

**Author:** [@Anton\_F](https://www.ruby-forum.com/u/Anton_F)\
**Replies:** 3\
**Last updated:** [September 24, 2010, 5:59pm UTC](https://www.ruby-forum.com/t/running-ruby-script-from-my-own-net-code-is-slow/194879 "2010-09-24T17:59:17Z")

</div>

Hi all! Why it is ~5 times slower to run the same .rb script from my .NET application (using ScriptEngine and ScriptRuntime) classes, than doing the same with ir.exe? When I downloaded IronRuby source, and compiled …

---

## [Problem using JRuby with Rails3 and Sql Server 2008](https://www.ruby-forum.com/t/problem-using-jruby-with-rails3-and-sql-server-2008/194127)

<div class="topic-metadata">

**Author:** [@sunny36](https://www.ruby-forum.com/u/sunny36)\
**Replies:** 1\
**Last updated:** [September 24, 2010, 4:50pm UTC](https://www.ruby-forum.com/t/problem-using-jruby-with-rails3-and-sql-server-2008/194127 "2010-09-24T16:50:49Z")

</div>

I’ve tried using JRuby with Rails 2.3.8 and Sql Server 2008 and everything is smooth. But I’m facing some problems with Rails 3. Here’s an error that I get when I try to find a post by id. However if I find all the po…

---

## [Rails application deployed on glassfish3](https://www.ruby-forum.com/t/rails-application-deployed-on-glassfish3/195485)

<div class="topic-metadata">

**Author:** [@pberg](https://www.ruby-forum.com/u/pberg)\
**Replies:** 1\
**Last updated:** [September 24, 2010, 3:21pm UTC](https://www.ruby-forum.com/t/rails-application-deployed-on-glassfish3/195485 "2010-09-24T15:21:50Z")

</div>

Hi, I wrote a tiny rails application with an oracle database as backend. It worked as pure rails application. I created a war file by calling warble. I deployed the war file on a GF3 server. When I launch the rails …

---

## [Problem with igem/gem in latest ironruby from github?](https://www.ruby-forum.com/t/problem-with-igem-gem-in-latest-ironruby-from-github/195532)

<div class="topic-metadata">

**Author:** [@Davy\_B](https://www.ruby-forum.com/u/Davy_B)\
**Replies:** 0\
**Last updated:** [September 24, 2010, 2:42pm UTC](https://www.ruby-forum.com/t/problem-with-igem-gem-in-latest-ironruby-from-github/195532 "2010-09-24T14:42:37Z")

</div>

Hi, i’m using the latest ironruby from github, and when i try to run igem install it just fails with the following message: D:\\Projects\\ironruby\\bin\\Debug\>igem install rspec ERROR: http://rubygems.org/ does not appe…

---

## [Output buffering](https://www.ruby-forum.com/t/output-buffering/51543)

<div class="topic-metadata">

**Author:** [@mark](https://www.ruby-forum.com/u/mark)\
**Replies:** 7\
**Last updated:** [September 24, 2010, 12:46pm UTC](https://www.ruby-forum.com/t/output-buffering/51543 "2010-09-24T12:46:23Z")

</div>

Hi, Is there any way to do php-style output buffering with ruby or rails? as in: ob\_start() %\> html goes in here \<% html=ob\_get\_contents() ob\_end\_clean() puts html

---

## [Defining a class without opening an existent one](https://www.ruby-forum.com/t/defining-a-class-without-opening-an-existent-one/195492)

<div class="topic-metadata">

**Author:** [@hagbard](https://www.ruby-forum.com/u/hagbard)\
**Replies:** 4\
**Last updated:** [September 24, 2010, 12:42pm UTC](https://www.ruby-forum.com/t/defining-a-class-without-opening-an-existent-one/195492 "2010-09-24T12:42:36Z")

</div>

Hi there! I want to define a class which happens to have the same name as a builtin class. It shouldn’t be a problem because it’s in an extra namespace, but Ruby opens the existing class instead of defining a new one…

---

## [Inheritance in IronRuby - possibly a bug or two?](https://www.ruby-forum.com/t/inheritance-in-ironruby-possibly-a-bug-or-two/195517)

<div class="topic-metadata">

**Author:** [@valdar](https://www.ruby-forum.com/u/valdar)\
**Replies:** 2\
**Last updated:** [September 24, 2010, 11:46am UTC](https://www.ruby-forum.com/t/inheritance-in-ironruby-possibly-a-bug-or-two/195517 "2010-09-24T11:46:59Z")

</div>

I have a couple questions about deriving from C# class from IronRuby. For context, here’s a code example that I will refer to here in a bit: ======================================== using System; using System.Reflec…

---

## [Linear Programming/Simplex Algorithm](https://www.ruby-forum.com/t/linear-programming-simplex-algorithm/195523)

<div class="topic-metadata">

**Author:** [@taura](https://www.ruby-forum.com/u/taura)\
**Replies:** 0\
**Last updated:** [September 24, 2010, 10:48am UTC](https://www.ruby-forum.com/t/linear-programming-simplex-algorithm/195523 "2010-09-24T10:48:02Z")

</div>

Hi, I’m looking for a way, to solve a linear optimization within ruby. I already tried this gem: http://rglpk.rubyforge.org/rglpk/ but wasn’t able to get it to work, because I have Windows and somehow the gem doesn’…

---

## [Getting notification that a subprocess is killed on Windows](https://www.ruby-forum.com/t/getting-notification-that-a-subprocess-is-killed-on-windows/194507)

<div class="topic-metadata">

**Author:** [@ralphshnelvar](https://www.ruby-forum.com/u/ralphshnelvar)\
**Replies:** 2\
**Last updated:** [September 24, 2010, 10:31am UTC](https://www.ruby-forum.com/t/getting-notification-that-a-subprocess-is-killed-on-windows/194507 "2010-09-24T10:31:27Z")

</div>

What is the proper way, under Windows, to detect that a process was killed? Crashed? Signal.list.each\_key do |key| puts key Signal.trap(key, lambda {|signo| puts "#{key}: pid #{$$} with signo #{signo}"}) …

---

## [Composition vs 'leaf-class mixins' (vs class inheritance)](https://www.ruby-forum.com/t/composition-vs-leaf-class-mixins-vs-class-inheritance/195161)

<div class="topic-metadata">

**Author:** [@woahdae](https://www.ruby-forum.com/u/woahdae)\
**Replies:** 5\
**Last updated:** [September 24, 2010, 9:18am UTC](https://www.ruby-forum.com/t/composition-vs-leaf-class-mixins-vs-class-inheritance/195161 "2010-09-24T09:18:17Z")

</div>

I have a design question inspired by Rails 3 internals. In Design Patterns in Ruby, the Strategy pattern is cited as a way to vary an algorithm following the oft-spoken “prefer composition over inheritance” advice. Fo…

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

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