# Ruby

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

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

---

## [Simple, simple socket question](https://www.ruby-forum.com/t/simple-simple-socket-question/147303)

<div class="topic-metadata">

**Author:** [@willdeluca](https://www.ruby-forum.com/u/willdeluca)\
**Replies:** 2\
**Last updated:** [September 1, 2008, 11:35am UTC](https://www.ruby-forum.com/t/simple-simple-socket-question/147303 "2008-09-01T11:35:28Z")

</div>

Hello all, I am very sorry if this has already been asked and answered; I have, however, searched to the best of my ability and cannot seem to come up with anything. I am merely a beginner with real programming langu…

---

## [Arrays, difference of operation](https://www.ruby-forum.com/t/arrays-difference-of-operation/147390)

<div class="topic-metadata">

**Author:** [@Mayuresh\_K](https://www.ruby-forum.com/u/Mayuresh_K)\
**Replies:** 2\
**Last updated:** [September 1, 2008, 11:25am UTC](https://www.ruby-forum.com/t/arrays-difference-of-operation/147390 "2008-09-01T11:25:40Z")

</div>

Hello, I tried the following; a = \[3, 2, 1\] followed by; a\[3\] = a\[2\] - 1 then, a contained \[3, 2, 1, 0\] but, if I did the following; b = “hello everybody” followed by; b\[“body”\] = “one” then, b contained “hello…

---

## [Problems inserting PDF (Blob) to Mysql DB](https://www.ruby-forum.com/t/problems-inserting-pdf-blob-to-mysql-db/147374)

<div class="topic-metadata">

**Author:** [@rbermejo](https://www.ruby-forum.com/u/rbermejo)\
**Replies:** 1\
**Last updated:** [September 1, 2008, 11:10am UTC](https://www.ruby-forum.com/t/problems-inserting-pdf-blob-to-mysql-db/147374 "2008-09-01T11:10:04Z")

</div>

Hi List /. I need to insert a PDF file as a Blob to a Mysql DB. I’m doing something like this: f=File.open(x).read insert=%^INSERT INTO main\_recibos ( recibo\_id, sso , periodo , recibo ) VALUES ( ‘#{recibo\_id}’ , …

---

## [How to replace a string with given pattern?](https://www.ruby-forum.com/t/how-to-replace-a-string-with-given-pattern/147388)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 4\
**Last updated:** [September 1, 2008, 10:55am UTC](https://www.ruby-forum.com/t/how-to-replace-a-string-with-given-pattern/147388 "2008-09-01T10:55:41Z")

</div>

I want to replace a string with the new value on a given regular pattern. For example: “Hello”.replace("/H/", “h”) #=\> hello

---

## [How to make a string upcase?](https://www.ruby-forum.com/t/how-to-make-a-string-upcase/147380)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 5\
**Last updated:** [September 1, 2008, 10:54am UTC](https://www.ruby-forum.com/t/how-to-make-a-string-upcase/147380 "2008-09-01T10:54:30Z")

</div>

I want to change a string to upcase like below: name=@value.upcase But got this error: dynamic constant assignment

---

## [Difference between dir/\*\*/\* and dir/\*?](https://www.ruby-forum.com/t/difference-between-dir-and-dir/147330)

<div class="topic-metadata">

**Author:** [@benjohnson](https://www.ruby-forum.com/u/benjohnson)\
**Replies:** 12\
**Last updated:** [September 1, 2008, 10:51am UTC](https://www.ruby-forum.com/t/difference-between-dir-and-dir/147330 "2008-09-01T10:51:33Z")

</div>

I’ve noticed the following when specifying a wildcard array of files: dir/\*\*/\* dir/\* What’s the difference? Thanks for your help.

---

## [Instance\_eval/class\_eval including/extending modules](https://www.ruby-forum.com/t/instance-eval-class-eval-including-extending-modules/147319)

<div class="topic-metadata">

**Author:** [@pedro-silva](https://www.ruby-forum.com/u/pedro-silva)\
**Replies:** 13\
**Last updated:** [September 1, 2008, 10:32am UTC](https://www.ruby-forum.com/t/instance-eval-class-eval-including-extending-modules/147319 "2008-09-01T10:32:11Z")

</div>

Consider the following example: module SomeModule def some\_method puts “Some Method - #{self}” end end class SomeClass def self.metaclass class \<\< self; self; end end end SomeClass.instance\_eval {include SomeM…

---

## [Another Chris Pine Tutorial Question](https://www.ruby-forum.com/t/another-chris-pine-tutorial-question/147317)

<div class="topic-metadata">

**Author:** [@danielj](https://www.ruby-forum.com/u/danielj)\
**Replies:** 7\
**Last updated:** [September 1, 2008, 9:35am UTC](https://www.ruby-forum.com/t/another-chris-pine-tutorial-question/147317 "2008-09-01T09:35:18Z")

</div>

Let’s write a program which asks us to type in as many words as we want (one word per line, continuing until we just press Enter on an empty line), and which then repeats the words back to us in alphabetical order. OK…

---

## [Euc-jp-ms](https://www.ruby-forum.com/t/euc-jp-ms/147377)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 9:24am UTC](https://www.ruby-forum.com/t/euc-jp-ms/147377 "2008-09-01T09:24:44Z")

</div>

EUC-JP-MS e$B$NJQ49$G$9$,!"F0$$$F$J$$$h$&$J5$$,$7$^$9!#e(B % ./ruby -ve ’ 0xa1.upto(0xfe) {|h| 0xa1.upto(0xfe) {|l| m = (\[h,l\].pack(“C\*”).encode(“UTF-8”, “EUC-JP-MS”) rescue $!.class) e = (\[h,l\].pack(“C\*”).encode(“U…

---

## [How can I set the ruby loadpath?](https://www.ruby-forum.com/t/how-can-i-set-the-ruby-loadpath/147376)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 2\
**Last updated:** [September 1, 2008, 9:23am UTC](https://www.ruby-forum.com/t/how-can-i-set-the-ruby-loadpath/147376 "2008-09-01T09:23:46Z")

</div>

How can I set the ruby loadpath outside of the source code? for example, set up an environment variable or add a command-line parameter.

---

## [Oniguruma in 1.8.x?](https://www.ruby-forum.com/t/oniguruma-in-1-8-x/147362)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 2\
**Last updated:** [September 1, 2008, 6:40am UTC](https://www.ruby-forum.com/t/oniguruma-in-1-8-x/147362 "2008-09-01T06:40:18Z")

</div>

I seem to recall reading that Oniguruma had been backported to CRuby 1.8.x, but that doesn’t seem to be the case as of 1.8.6 (it doesn’t recognize named groups.) Is it somehow available in CRuby, or was I just plain m…

---

## [Getting tk to work on OS X?](https://www.ruby-forum.com/t/getting-tk-to-work-on-os-x/147373)

<div class="topic-metadata">

**Author:** [@Kenneth\_McDonald](https://www.ruby-forum.com/u/Kenneth_McDonald)\
**Replies:** 1\
**Last updated:** [September 1, 2008, 5:50am UTC](https://www.ruby-forum.com/t/getting-tk-to-work-on-os-x/147373 "2008-09-01T05:50:02Z")

</div>

I installed the latest ActiveState version of Tcl, then downloaded, compiled, and installed the most recent 1.8.7 version of Ruby. During the compilation, it confirmed that tk was compiled, but when I try to access it…

---

## [Beginner's problem with sqlite3](https://www.ruby-forum.com/t/beginners-problem-with-sqlite3/147370)

<div class="topic-metadata">

**Author:** [@his2000x](https://www.ruby-forum.com/u/his2000x)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 4:51am UTC](https://www.ruby-forum.com/t/beginners-problem-with-sqlite3/147370 "2008-09-01T04:51:24Z")

</div>

hi! I know that it needs rubygems sqlite3 to run so i rubygems installed. however, fxri in “require ‘rubygems’” , type the following error. require ‘rubygems’ =\> false this code,the same error occurs. require ‘sql…

---

## [How to load a program into interpreter?](https://www.ruby-forum.com/t/how-to-load-a-program-into-interpreter/147364)

<div class="topic-metadata">

**Author:** [@ssecorp](https://www.ruby-forum.com/u/ssecorp)\
**Replies:** 0\
**Last updated:** [September 1, 2008, 2:42am UTC](https://www.ruby-forum.com/t/how-to-load-a-program-into-interpreter/147364 "2008-09-01T02:42:21Z")

</div>

When using emacs-mode for Ruby when I do C-c C-l it asks for a file to be loaded and provides the directory fo the current file. How do I load the file that I am in directly? Also how do I load a file form irb?

---

## [Gem command works locally, not on remote machine](https://www.ruby-forum.com/t/gem-command-works-locally-not-on-remote-machine/147193)

<div class="topic-metadata">

**Author:** [@eeby](https://www.ruby-forum.com/u/eeby)\
**Replies:** 1\
**Last updated:** [August 31, 2008, 11:41pm UTC](https://www.ruby-forum.com/t/gem-command-works-locally-not-on-remote-machine/147193 "2008-08-31T23:41:41Z")

</div>

I’m having some trouble with the gem command. On my local MacBook Pro the gem command works fine… $ sudo gem outdated Password: …just returns nothing, as expected. $ sudo gem update --system Updating RubyGems Noth…

---

## [Code Review: YamlTestCleanup](https://www.ruby-forum.com/t/code-review-yamltestcleanup/147286)

<div class="topic-metadata">

**Author:** [@Oleg\_T](https://www.ruby-forum.com/u/Oleg_T)\
**Replies:** 1\
**Last updated:** [August 31, 2008, 10:29pm UTC](https://www.ruby-forum.com/t/code-review-yamltestcleanup/147286 "2008-08-31T22:29:37Z")

</div>

tfpt review “/shelveset:YamlTestCleanup;REDMOND\\olegtk” Comment : Cleans up YamlTest folder: removes obsolete YamlTest project files moves all yaml files from YamlTest\\tests to YamlTest\\yaml moves all ruby test file…

---

## [Windows-31J roundtrip](https://www.ruby-forum.com/t/windows-31j-roundtrip/147346)

<div class="topic-metadata">

**Author:** [@Tanaka\_A](https://www.ruby-forum.com/u/Tanaka_A)\
**Replies:** 0\
**Last updated:** [August 31, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/windows-31j-roundtrip/147346 "2008-08-31T19:06:28Z")

</div>

e$B0J2\<$N$h$&$K!“e(B0xfa4a (”\\xFAJ") e$B$,e(B Windows-31J → UTF-8 → Windows-31J e$B$Ge(B round trip e$B$7$^$9!#e(B % ./ruby -ve ‘puts “\\xFAJ”.encode(“UTF-8”, “Windows-31J”).encode(“Windows-31J”, “UTF-8”).dump’ ruby 1…

---

## [Wanted: Script to convert to/from UTF-8/UTF-16/UTF-32](https://www.ruby-forum.com/t/wanted-script-to-convert-to-from-utf-8-utf-16-utf-32/147321)

<div class="topic-metadata">

**Author:** [@Siegfried\_Heintze](https://www.ruby-forum.com/u/Siegfried_Heintze)\
**Replies:** 2\
**Last updated:** [August 31, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/wanted-script-to-convert-to-from-utf-8-utf-16-utf-32/147321 "2008-08-31T18:57:41Z")

</div>

Does someone have a little ruby script that will read a file in UTF-8/UTF-16/UTF-32 (my choice) and search for all the characters between 0x7f-0xffffff and convert them to an ASCII digit string that begins with “&#” …

---

## [Simple conditional causing hanging?](https://www.ruby-forum.com/t/simple-conditional-causing-hanging/147323)

<div class="topic-metadata">

**Author:** [@willdeluca](https://www.ruby-forum.com/u/willdeluca)\
**Replies:** 8\
**Last updated:** [August 31, 2008, 4:59pm UTC](https://www.ruby-forum.com/t/simple-conditional-causing-hanging/147323 "2008-08-31T16:59:58Z")

</div>

I have the following conditional inside a method: if ( @thisLine.class != ‘NilClass’ ) return @thisLine.class.to\_s else return ‘nope’ end Obviously, all I’m trying to do is test if @thisLine is nil or not. When I …

---

## [1.9$B$N(Bcgi.rb$B$rJ,3d(B](https://www.ruby-forum.com/t/1-9-b-n-bcgi-rb-b-rj-3d-b/147190)

<div class="topic-metadata">

**Author:** [@Fujioka](https://www.ruby-forum.com/u/Fujioka)\
**Replies:** 4\
**Last updated:** [August 31, 2008, 3:58pm UTC](https://www.ruby-forum.com/t/1-9-b-n-bcgi-rb-b-rj-3d-b/147190 "2008-08-31T15:58:32Z")

</div>

xibbare$B$3$HF#2,$G$9!#e(B cgi.rbe$B$,J|CV$5$l$F5W$7$$$N$G$9$,!"J35/$7$F%P%0$r$A$g$m$A$g$m\<h$j!"e(B e$B%F%9%H$,=q$$$FF0$/$3$H$r3NG’$7!“e(B e$B\<g$K@.@%$5$s$K%3%\_%C%H$7$F$b$i$$$^$7$?!#e(B cgi.rbe$B$,0l1~F0$/$3$H$^$G$O3…

---

## [Please don't flame me...why is there no "++" in Ruby again?](https://www.ruby-forum.com/t/please-dont-flame-me-why-is-there-no-in-ruby-again/147163)

<div class="topic-metadata">

**Author:** [@johnpetterson](https://www.ruby-forum.com/u/johnpetterson)\
**Replies:** 23\
**Last updated:** [August 31, 2008, 1:39pm UTC](https://www.ruby-forum.com/t/please-dont-flame-me-why-is-there-no-in-ruby-again/147163 "2008-08-31T13:39:13Z")

</div>

There’s must be very good simple reason why there is no ‘x++’ method Ruby right? Just generally interested why there isn’t… I did check my Ruby books by the way, but they just “unlike C there is no ++ operator in Rub…

---

## [Capturing stdout during unit tests](https://www.ruby-forum.com/t/capturing-stdout-during-unit-tests/111520)

<div class="topic-metadata">

**Author:** [@mslagell](https://www.ruby-forum.com/u/mslagell)\
**Replies:** 6\
**Last updated:** [August 31, 2008, 8:44am UTC](https://www.ruby-forum.com/t/capturing-stdout-during-unit-tests/111520 "2008-08-31T08:44:12Z")

</div>

I’ve written a script for use with Nagios (a monitoring tool) that I’d like to test. The requirements for the script is that it output a single line of text to STDOUT and then exit with a status code (0 - 3). My scrip…

---

## [\[ANN\] Ribs 0.0.1](https://www.ruby-forum.com/t/ann-ribs-0-0-1/147310)

<div class="topic-metadata">

**Author:** [@Ola\_B](https://www.ruby-forum.com/u/Ola_B)\
**Replies:** 3\
**Last updated:** [August 31, 2008, 8:39am UTC](https://www.ruby-forum.com/t/ann-ribs-0-0-1/147310 "2008-08-31T08:39:10Z")

</div>

I am extremely pleased to announce the first release of Ribs. Ribs is a library for JRuby, that allows you to persist Ruby objects using Hibernate. Some time ago I wrote about ActiveHibernate. I have now decided to im…

---

## [How can I invoke super class's method](https://www.ruby-forum.com/t/how-can-i-invoke-super-classs-method/147300)

<div class="topic-metadata">

**Author:** [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Replies:** 3\
**Last updated:** [August 31, 2008, 4:42am UTC](https://www.ruby-forum.com/t/how-can-i-invoke-super-classs-method/147300 "2008-08-31T04:42:26Z")

</div>

My class include a Module and overwrite a method of the Module. In this method, I want to invoke the Module’s method first. Just like “super.method()” in Java. How can I do this?

---

## [Silverlight Dynamic Languages SDK 0.3.0](https://www.ruby-forum.com/t/silverlight-dynamic-languages-sdk-0-3-0/147322)

<div class="topic-metadata">

**Author:** [@jsoho](https://www.ruby-forum.com/u/jsoho)\
**Replies:** 0\
**Last updated:** [August 31, 2008, 4:16am UTC](https://www.ruby-forum.com/t/silverlight-dynamic-languages-sdk-0-3-0/147322 "2008-08-31T04:16:12Z")

</div>

Just wanted to let everyone know that I pushed out a new version of the Silverlight Dynamic Languages SDK. http://www.codeplex.com/sdlsdk/Release/ProjectReleases.aspx?ReleaseId=16845 Details here: http://blog.jimmy.s…

---

## [Working with Amazon: through right\_aws or Typica](https://www.ruby-forum.com/t/working-with-amazon-through-right-aws-or-typica/147262)

<div class="topic-metadata">

**Author:** [@pianophase](https://www.ruby-forum.com/u/pianophase)\
**Replies:** 1\
**Last updated:** [August 31, 2008, 3:16am UTC](https://www.ruby-forum.com/t/working-with-amazon-through-right-aws-or-typica/147262 "2008-08-31T03:16:50Z")

</div>

Hello, I’m trying to get a smart interface between Jruby and Amazon (specifically sdb at the moment). My first path was using the RightScale gem “right\_aws”. However, I found, even with jruby-openssl updated to 0.3,…

---

## [Bug #496 (DRb slow)](https://www.ruby-forum.com/t/bug-496-drb-slow/147320)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 0\
**Last updated:** [August 31, 2008, 12:34am UTC](https://www.ruby-forum.com/t/bug-496-drb-slow/147320 "2008-08-31T00:34:13Z")

</div>

Since I don’t have access to Ruby-core, I’ll just post a couple observations here in the hope of giving someone a head start with this problem. I have experienced the same problem as the original poster (Hongli L.) i…

---

## [Annotations](https://www.ruby-forum.com/t/annotations/147173)

<div class="topic-metadata">

**Author:** [@chrisdwan](https://www.ruby-forum.com/u/chrisdwan)\
**Replies:** 3\
**Last updated:** [August 31, 2008, 12:27am UTC](https://www.ruby-forum.com/t/annotations/147173 "2008-08-31T00:27:02Z")

</div>

This is a quick ping to see where JRuby is on Java 5 annotation support. Charles posted about it nearly a year ago and I was just wondering where that had gone.

---

## [Re: Convert an array of strings from JRuby -\> Java?](https://www.ruby-forum.com/t/re-convert-an-array-of-strings-from-jruby-java/146968)

<div class="topic-metadata">

**Author:** [@James\_Chang](https://www.ruby-forum.com/u/James_Chang)\
**Replies:** 4\
**Last updated:** [August 31, 2008, 12:16am UTC](https://www.ruby-forum.com/t/re-convert-an-array-of-strings-from-jruby-java/146968 "2008-08-31T00:16:30Z")

</div>

(Source: http://wiki.jruby.org/wiki/index.php?title=JRuby\_Cookbook&printable=yes) Creating Java Arrays You can convert ruby arrays to java arrays very simply: \[1,2,3\].to\_java =\> makes an object array \[1,2,3\].to\_java…

---

## [Another really subtle bug](https://www.ruby-forum.com/t/another-really-subtle-bug/147313)

<div class="topic-metadata">

**Author:** [@lynchnco](https://www.ruby-forum.com/u/lynchnco)\
**Replies:** 2\
**Last updated:** [August 30, 2008, 11:54pm UTC](https://www.ruby-forum.com/t/another-really-subtle-bug/147313 "2008-08-30T23:54:15Z")

</div>

Hi, I seem to be running into a lot of subtle bugs lately. This one is stranger than most. def shake @engine.inject do @engine.run do |key| @engine.sleepForTime(key, 0.6) do |timePassed, timeSlept| @x = (rand2-1)(…

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

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