# Ruby

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

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

---

## [Weird thread behavior in windows](https://www.ruby-forum.com/t/weird-thread-behavior-in-windows/131912)

<div class="topic-metadata">

**Author:** [@Tim\_U](https://www.ruby-forum.com/u/Tim_U)\
**Replies:** 1\
**Last updated:** [March 14, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/weird-thread-behavior-in-windows/131912 "2008-03-14T17:03:32Z")

</div>

Hello All. I have some code that looks like this. @tasks.run do |cmd| @logger.info “Threading #{cmd} with timeout of #{@entries\[cmd\]}” Thread.new(cmd) { |cmd| Timeout::timeout(@entries\[cmd\]) do begin # Something …

---

## [Using backticks with xml](https://www.ruby-forum.com/t/using-backticks-with-xml/131901)

<div class="topic-metadata">

**Author:** [@Corbin](https://www.ruby-forum.com/u/Corbin)\
**Replies:** 1\
**Last updated:** [March 14, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/using-backticks-with-xml/131901 "2008-03-14T16:25:13Z")

</div>

I don’t know why I can’t do this but I’d like to use backticks in ruby to import some xml into a program on the command line. e.g. java -cp myjar.jar Importer %Q{@xml} the problem is that the @xml needs to be escaped…

---

## [Should --verbose be equal to -v?](https://www.ruby-forum.com/t/should-verbose-be-equal-to-v/131449)

<div class="topic-metadata">

**Author:** [@Yugui](https://www.ruby-forum.com/u/Yugui)\
**Replies:** 14\
**Last updated:** [March 14, 2008, 3:34pm UTC](https://www.ruby-forum.com/t/should-verbose-be-equal-to-v/131449 "2008-03-14T15:34:57Z")

</div>

Yuguie$B$G$9!#e(B e$B%j%U%!%l%s%9%^%K%e%"%k$de(Bmane$B$K$h$l$P5/F0%\*%W%7%g%se(B–verbose e$B$Oe(B-ve$B$NF15A8l$NH&$G$9$,!"$=$N$h$&$K$J$C$F$$$^$;$s!#e(B -ve$B$O%P!\<%8%g%sHV9f$r=PNO$7$^$9$,!"e(B–verbosee$B$O$7$^$;$s!#e(B …

---

## [Using RExchange](https://www.ruby-forum.com/t/using-rexchange/131107)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 1\
**Last updated:** [March 14, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/using-rexchange/131107 "2008-03-14T14:29:41Z")

</div>

Hello everybody, I’m trying to use RExchange to add contacts to every mailbox on my exchange server. I seem to have some problems getting it to work… All I have thus far is: RExchange::open(‘https://ex.xdev.corp/exch…

---

## [On Console options](https://www.ruby-forum.com/t/on-console-options/131891)

<div class="topic-metadata">

**Author:** [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Replies:** 4\
**Last updated:** [March 14, 2008, 1:57pm UTC](https://www.ruby-forum.com/t/on-console-options/131891 "2008-03-14T13:57:55Z")

</div>

Hi, I’m sure this is another case of PEBKAC but I’ve been looking in the code and I think that’s how it’s supposed to work. When I want to use -X:ILDebug or -X:SaveAssemblies I assume the rbx command also expects t…

---

## [Ruby Robot Help (web cam & serial)](https://www.ruby-forum.com/t/ruby-robot-help-web-cam-serial/131884)

<div class="topic-metadata">

**Author:** [@Scott\_Preston](https://www.ruby-forum.com/u/Scott_Preston)\
**Replies:** 2\
**Last updated:** [March 14, 2008, 1:22pm UTC](https://www.ruby-forum.com/t/ruby-robot-help-web-cam-serial/131884 "2008-03-14T13:22:22Z")

</div>

Hi All, I have been a Java Robot guy for some time (Author Definitive Guide to Building Java Robots by Apress) but want to do some stuff with Ruby but I am limited by two things: web cam capture and serial communicat…

---

## [(no subject)](https://www.ruby-forum.com/t/no-subject/131922)

<div class="topic-metadata">

**Author:** [@Mhalcon](https://www.ruby-forum.com/u/Mhalcon)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 1:10pm UTC](https://www.ruby-forum.com/t/no-subject/131922 "2008-03-14T13:10:29Z")

</div>

How do I know whether there was a file on a remote FTP hosts? -------- Original Message -------- Subject: ‘net/ftp’ File.exist? Date: Fri, 14 Mar 2008 09:59:13 -0200 From: Mhalcon removed\_email\_address@domain.i…

---

## [\<\< : can some body check this code?](https://www.ruby-forum.com/t/can-some-body-check-this-code/131878)

<div class="topic-metadata">

**Author:** [@chinnakaruppan](https://www.ruby-forum.com/u/chinnakaruppan)\
**Replies:** 5\
**Last updated:** [March 14, 2008, 12:46pm UTC](https://www.ruby-forum.com/t/can-some-body-check-this-code/131878 "2008-03-14T12:46:16Z")

</div>

why is it not working properly( weekly calendar)… require “Date” def mon\_days(month,year=Date.today.year) mday = \[nil,31,28,31,30,31,30,31,31,30,31,30,31\] mday\[2\] = 29 if Date.leap? year mday\[month\] end def cal\_we…

---

## [Use reqex to get the middle character and repeat it](https://www.ruby-forum.com/t/use-reqex-to-get-the-middle-character-and-repeat-it/131858)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 9\
**Last updated:** [March 14, 2008, 12:30pm UTC](https://www.ruby-forum.com/t/use-reqex-to-get-the-middle-character-and-repeat-it/131858 "2008-03-14T12:30:49Z")

</div>

say i have the string “qxq” and i want to repeat the middle char 4 times i could do this str = "qxq newstring = str.gsub(/(x)/, ‘\\1’\*4) but if i have a string full of x’s i.e. “xxx” then it will repeat all of them 4…

---

## [Segmentation Fault when I use query in Mysql/Ruby](https://www.ruby-forum.com/t/segmentation-fault-when-i-use-query-in-mysql-ruby/131911)

<div class="topic-metadata">

**Author:** [@hirodusk](https://www.ruby-forum.com/u/hirodusk)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 10:07am UTC](https://www.ruby-forum.com/t/segmentation-fault-when-i-use-query-in-mysql-ruby/131911 "2008-03-14T10:07:22Z")

</div>

Hi, I have strange problem with MySQL/Ruby (mysql-ruby-2.8pre2). When I run this simple script: #!/usr/local/bin/ruby require “mysql” dbh = Mysql.real\_connect(“localhost”, “root”, “xx”, “xx”) get server version stri…

---

## [Check if file exists for part of the filename](https://www.ruby-forum.com/t/check-if-file-exists-for-part-of-the-filename/131908)

<div class="topic-metadata">

**Author:** [@sealedsun](https://www.ruby-forum.com/u/sealedsun)\
**Replies:** 2\
**Last updated:** [March 14, 2008, 10:05am UTC](https://www.ruby-forum.com/t/check-if-file-exists-for-part-of-the-filename/131908 "2008-03-14T10:05:27Z")

</div>

Hey! How do i check if a file exists, that starts with a certain identifier? e.g. Files in Directory file\_1.rb file\_2.rb test\_1.rb I only want to know if a file exists, that starts with “file\_” thx

---

## [CGI::Cookie.new $B$r9bB.2=$9$k%P%C%A(B](https://www.ruby-forum.com/t/cgi-cookie-new-b-r9bb-2-9-k-p-c-a-b/131905)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 2\
**Last updated:** [March 14, 2008, 9:29am UTC](https://www.ruby-forum.com/t/cgi-cookie-new-b-r9bb-2-9-k-p-c-a-b/131905 "2008-03-14T09:29:23Z")

</div>

e$B7,ED$H$$$$$^$9!#e(B cgi.rb e$B$K$$$$F!"e(BCGI::Cookie.new e$B$re(B (e$BB?\>/$G$9$,e(B) e$B9bB.2=$9$ke(B e$B%Q%C%A$G$9!#e(B e$B6qBNE$K$O!“e(BCGI::cookie::parse() e$B$He(B CGI#initialize() e$B$K$\*$$$Fe(B e$BL5BL$Je…

---

## [Console arguments broken?](https://www.ruby-forum.com/t/console-arguments-broken/131865)

<div class="topic-metadata">

**Author:** [@xjivan](https://www.ruby-forum.com/u/xjivan)\
**Replies:** 4\
**Last updated:** [March 14, 2008, 9:08am UTC](https://www.ruby-forum.com/t/console-arguments-broken/131865 "2008-03-14T09:08:05Z")

</div>

Do the -X:… console arguments work for anybody? Â» C:\\tools\\IronRuby\\build\\debug\\rbx -X:TabCompletion mscorlib:0:in CanonicalizePath': The given path's format is not supported. (System::NotSupportedException) from msc…

---

## [How to Install Rails From Standalone Package?](https://www.ruby-forum.com/t/how-to-install-rails-from-standalone-package/131907)

<div class="topic-metadata">

**Author:** [@senneoko](https://www.ruby-forum.com/u/senneoko)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 9:05am UTC](https://www.ruby-forum.com/t/how-to-install-rails-from-standalone-package/131907 "2008-03-14T09:05:44Z")

</div>

I havent internet connection on my laptop. So I download zip from http://rubyforge.org/frs/?group\_id=126. How to install it offline?

---

## [Erb recursion](https://www.ruby-forum.com/t/erb-recursion/131904)

<div class="topic-metadata">

**Author:** [@gazoduc](https://www.ruby-forum.com/u/gazoduc)\
**Replies:** 1\
**Last updated:** [March 14, 2008, 8:56am UTC](https://www.ruby-forum.com/t/erb-recursion/131904 "2008-03-14T08:56:20Z")

</div>

Hi ! I found some solutions to create recursion in erb templates. What do you think of these solutions ? What problems could there be ? I have a small preference for the first solution since it keeps all the context …

---

## [Undefined method errors in rails](https://www.ruby-forum.com/t/undefined-method-errors-in-rails/131889)

<div class="topic-metadata">

**Author:** [@danmcb](https://www.ruby-forum.com/u/danmcb)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 4:57am UTC](https://www.ruby-forum.com/t/undefined-method-errors-in-rails/131889 "2008-03-14T04:57:43Z")

</div>

Hi all, I am currently developing a rails application. After a webserver reboot I often get undefined method errors which are caused by wrong types. I am using a Builder::XmlMarkup object but sometimes it is interpret…

---

## [Uint32\_t](https://www.ruby-forum.com/t/uint32-t/131765)

<div class="topic-metadata">

**Author:** [@KIMURA\_Koichi](https://www.ruby-forum.com/u/KIMURA_Koichi)\
**Replies:** 6\
**Last updated:** [March 14, 2008, 3:37am UTC](https://www.ruby-forum.com/t/uint32-t/131765 "2008-03-14T03:37:58Z")

</div>

e$BLZB\<$G$9!#e(B e$BNc$K$h$C$FJs9p$@$1$G$9!#e(B 01:53 Tuesday ruby Commit by matz :: r15743 /trunk/ (ChangeLog string.c): \* string.c (hash): replaced by MurmurHash described in http://murmurhash.googlepages.com/. …

---

## [Database Query](https://www.ruby-forum.com/t/database-query/131881)

<div class="topic-metadata">

**Author:** [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Replies:** 0\
**Last updated:** [March 14, 2008, 2:48am UTC](https://www.ruby-forum.com/t/database-query/131881 "2008-03-14T02:48:28Z")

</div>

Hello, This may sound silly, but I can’t seem to get my results out of a database query. I can do this fine in Ruby on Rails, but from a Ruby script, I can’t seem to. I know my query works because I’ve already tested…

---

## [Strange results..?](https://www.ruby-forum.com/t/strange-results/131871)

<div class="topic-metadata">

**Author:** [@psy](https://www.ruby-forum.com/u/psy)\
**Replies:** 1\
**Last updated:** [March 14, 2008, 12:43am UTC](https://www.ruby-forum.com/t/strange-results/131871 "2008-03-14T00:43:11Z")

</div>

Hello people, Here I get some strange (for me) results : irb(main):012:0\> 0.4 - 0.3 - 0.1 =\> 2.77555756156289e-17 irb(main):013:0\> 0.5 - 0.4 - 0.1 =\> -2.77555756156289e-17 irb(main):017:0\> 0.2 + 0.7 - 0.9 =\> -1.11…

---

## [Newbie:: HTTP request\_get, how server side parses parameter and response?](https://www.ruby-forum.com/t/newbie-http-request-get-how-server-side-parses-parameter-and-response/131831)

<div class="topic-metadata">

**Author:** [@Lauren](https://www.ruby-forum.com/u/Lauren)\
**Replies:** 4\
**Last updated:** [March 14, 2008, 12:39am UTC](https://www.ruby-forum.com/t/newbie-http-request-get-how-server-side-parses-parameter-and-response/131831 "2008-03-14T00:39:40Z")

</div>

I have a simple server and client application. Client side uses HTTP::request\_get to contact server file “sum.rb”, which takes parameter a and b, return the sum a+b. Client side code is as: url = “http://”+MYURL+"/sum…

---

## [Whats the error here?](https://www.ruby-forum.com/t/whats-the-error-here/131613)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 14\
**Last updated:** [March 13, 2008, 10:07pm UTC](https://www.ruby-forum.com/t/whats-the-error-here/131613 "2008-03-13T22:07:13Z")

</div>

My IDE (aptana rails) seems to complain about syntax with this code def initialize(size=2) @size = size @template = {‘1’=\> \[" # “, “@ @”,” # ", “@ @”, " # “\], ‘2’=\>\[” # “, “@ @”,” # ", “@ @”, " # “\], ‘3’=\>\[” # “, “@…

---

## [Re: String method to take subsections](https://www.ruby-forum.com/t/re-string-method-to-take-subsections/131810)

<div class="topic-metadata">

**Author:** [@glenn](https://www.ruby-forum.com/u/glenn)\
**Replies:** 1\
**Last updated:** [March 13, 2008, 9:51pm UTC](https://www.ruby-forum.com/t/re-string-method-to-take-subsections/131810 "2008-03-13T21:51:06Z")

</div>

Thanks for your help, guys. All three suggestions are great. It seems to me that returning an empty array instead of nil is actually better. Glenn ----- Original Message ---- From: Paul M. removed\_email\_address@dom…

---

## [Operations with Time objects](https://www.ruby-forum.com/t/operations-with-time-objects/131805)

<div class="topic-metadata">

**Author:** [@mex23](https://www.ruby-forum.com/u/mex23)\
**Replies:** 7\
**Last updated:** [March 13, 2008, 9:28pm UTC](https://www.ruby-forum.com/t/operations-with-time-objects/131805 "2008-03-13T21:28:14Z")

</div>

Hi guys. I want to know the time remain before an expiration. If I do t\_remained = Time.now - expiration I get a float object. how can I convert it back to Time(days hours and minute)? thanks

---

## [Need help protecting data](https://www.ruby-forum.com/t/need-help-protecting-data/131753)

<div class="topic-metadata">

**Author:** [@di3go](https://www.ruby-forum.com/u/di3go)\
**Replies:** 5\
**Last updated:** [March 13, 2008, 8:27pm UTC](https://www.ruby-forum.com/t/need-help-protecting-data/131753 "2008-03-13T20:27:05Z")

</div>

Hi I need protect some data like photos and musics from a game, i really dont know how to do this, i was thinking in something like this, take the photo, translate to a string and store in the database and the databa…

---

## [Bug in Test Unit?](https://www.ruby-forum.com/t/bug-in-test-unit/131739)

<div class="topic-metadata">

**Author:** [@Nasir\_K](https://www.ruby-forum.com/u/Nasir_K)\
**Replies:** 4\
**Last updated:** [March 13, 2008, 6:57pm UTC](https://www.ruby-forum.com/t/bug-in-test-unit/131739 "2008-03-13T18:57:50Z")

</div>

In unit.rb with “ruby 1.8.6 (2007-03-13 patchlevel 0) \[i386-mswin32\]” at\_exit do unless $! || Test::Unit.run? exit Test::Unit::AutoRunner.run end end if Test::Unit.run is set as false the autorunner will run, if it…

---

## [Mechanize 0.7.3 Released](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737)

<div class="topic-metadata">

**Author:** [@aaronpowell](https://www.ruby-forum.com/u/aaronpowell)\
**Replies:** 8\
**Last updated:** [March 13, 2008, 6:23pm UTC](https://www.ruby-forum.com/t/mechanize-0-7-3-released/131737 "2008-03-13T18:23:56Z")

</div>

mechanize version 0.7.3 has been released! http://mechanize.rubyforge.org/ The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, …

---

## [Ruby-Net-Lap - Problems to Search](https://www.ruby-forum.com/t/ruby-net-lap-problems-to-search/131828)

<div class="topic-metadata">

**Author:** [@edmz](https://www.ruby-forum.com/u/edmz)\
**Replies:** 0\
**Last updated:** [March 13, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/ruby-net-lap-problems-to-search/131828 "2008-03-13T17:21:48Z")

</div>

I’m using the ruby-net-ldap to connect in the Active Directory. I’m able to connect but for some strange reason when i try to do any search nothing is returned. Follow the code: username = 'user' password = 'passwo…

---

## [Ruby on windows](https://www.ruby-forum.com/t/ruby-on-windows/131593)

<div class="topic-metadata">

**Author:** [@t3chn0n3rd](https://www.ruby-forum.com/u/t3chn0n3rd)\
**Replies:** 7\
**Last updated:** [March 13, 2008, 5:21pm UTC](https://www.ruby-forum.com/t/ruby-on-windows/131593 "2008-03-13T17:21:05Z")

</div>

right now I am running ruby on red hat 8. Is there a compiler for windows vista?

---

## [Array#slice! may be too slow and allocate memory too much](https://www.ruby-forum.com/t/array-slice-may-be-too-slow-and-allocate-memory-too-much/131256)

<div class="topic-metadata">

**Author:** [@Yusuke\_ENDOH](https://www.ruby-forum.com/u/Yusuke_ENDOH)\
**Replies:** 1\
**Last updated:** [March 13, 2008, 5:18pm UTC](https://www.ruby-forum.com/t/array-slice-may-be-too-slow-and-allocate-memory-too-much/131256 "2008-03-13T17:18:08Z")

</div>

e$B1sF#$H?=$7$^$9!#e(B e$B0J2\<$N%W%m%0%i%\`$,$d$?$iCY$$$G$9!#$^$?!"%a%b%j$rBgNL$K\>CHq$7$^$9!#e(B $ time ./ruby -ve ’ a = \[0\] \* 10000 (1 … 10000).map { a.slice!(0, 1) } ’ ruby 1.9.0 (2008-03-07 revision 15720) \[i686…

---

## [Kill process using WIN32\_PROCESS](https://www.ruby-forum.com/t/kill-process-using-win32-process/131628)

<div class="topic-metadata">

**Author:** [@Junkone](https://www.ruby-forum.com/u/Junkone)\
**Replies:** 3\
**Last updated:** [March 13, 2008, 4:51pm UTC](https://www.ruby-forum.com/t/kill-process-using-win32-process/131628 "2008-03-13T16:51:32Z")

</div>

I was reviewing the docs for Module Process in WIN32\_PROCESS and found the following docs for Kill. What does signal 4-8 do and how does it make it nicer kill. why is it 4-8 and what is the degree of niceness as it g…

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

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