# Ruby

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

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

---

## [Code Review: YamlRange](https://www.ruby-forum.com/t/code-review-yamlrange/141637)

<div class="topic-metadata">

**Author:** [@Oleg\_T](https://www.ruby-forum.com/u/Oleg_T)\
**Replies:** 4\
**Last updated:** [June 30, 2008, 8:14pm UTC](https://www.ruby-forum.com/t/code-review-yamlrange/141637 "2008-06-30T20:14:32Z")

</div>

tfpt review “/shelveset:YamlRange;REDMOND\\olegtk” Comment : Fixes Range support: implements taguri() and loading Range object from yaml. Changes constructors to hold a reference to a code context instead of Equalit…

---

## [Why can't I return "Threads.list" Array in DRb?](https://www.ruby-forum.com/t/why-cant-i-return-threads-list-array-in-drb/141700)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 6\
**Last updated:** [June 30, 2008, 8:10pm UTC](https://www.ruby-forum.com/t/why-cant-i-return-threads-list-array-in-drb/141700 "2008-06-30T20:10:25Z")

</div>

Hi, I can’t understand why I can’t return the current “Threads.list” array in a DRb server method. In the DRb server object I just do: def current\_threads Thread.list end And the DRb client calls: drb\_client.…

---

## [Question about defined? and y](https://www.ruby-forum.com/t/question-about-defined-and-y/141529)

<div class="topic-metadata">

**Author:** [@rubyfreak](https://www.ruby-forum.com/u/rubyfreak)\
**Replies:** 18\
**Last updated:** [June 30, 2008, 8:00pm UTC](https://www.ruby-forum.com/t/question-about-defined-and-y/141529 "2008-06-30T20:00:59Z")

</div>

The defined? keyword seems to have some funky behaviors. I have decided that the best way to use it is to compare the output to nil as it returns a myriad of results that all result in truth. puts (defined?(x) == nil …

---

## [Is it possible to create a hash dynamically?](https://www.ruby-forum.com/t/is-it-possible-to-create-a-hash-dynamically/141803)

<div class="topic-metadata">

**Author:** [@aidy](https://www.ruby-forum.com/u/aidy)\
**Replies:** 4\
**Last updated:** [June 30, 2008, 7:18pm UTC](https://www.ruby-forum.com/t/is-it-possible-to-create-a-hash-dynamically/141803 "2008-06-30T19:18:49Z")

</div>

Hi, I am trying to build a dynamic hash map def extract(xml, path) require 'rexml/document' xml = xml.to\_s.gsub("utf-16", "utf-8") doc = REXML::Document.new(xml) doc.root.each\_element(path) d…

---

## [Errror: Both user and Secret Are Required](https://www.ruby-forum.com/t/errror-both-user-and-secret-are-required/141810)

<div class="topic-metadata">

**Author:** [@ankit2584](https://www.ruby-forum.com/u/ankit2584)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 7:06pm UTC](https://www.ruby-forum.com/t/errror-both-user-and-secret-are-required/141810 "2008-06-30T19:06:01Z")

</div>

Hello when i try to send mail using actionmailer using gmail i get an error “Both user and Secret Are Required” Any Idea What needs to be done. here are my settings config.action\_mailer.smtp\_settings = { :address …

---

## [Re: HOME env variable required](https://www.ruby-forum.com/t/re-home-env-variable-required/141703)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 9\
**Last updated:** [June 30, 2008, 6:49pm UTC](https://www.ruby-forum.com/t/re-home-env-variable-required/141703 "2008-06-30T18:49:25Z")

</div>

Thanks for the idea. I’ll look for HOME first followed by USERPROFILE before failing with a better message than that :slight\_smile: John Sent from my phone From: Brad W. removed\_email\_address@domain.invalid Sent: …

---

## [Win32OLE and SAPI5 voice recognition problem](https://www.ruby-forum.com/t/win32ole-and-sapi5-voice-recognition-problem/141728)

<div class="topic-metadata">

**Author:** [@thomasmaas](https://www.ruby-forum.com/u/thomasmaas)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 5:33pm UTC](https://www.ruby-forum.com/t/win32ole-and-sapi5-voice-recognition-problem/141728 "2008-06-30T17:33:12Z")

</div>

I stumbled across the ruby library for this while poking around for something else in RAA, and it seemed interesting. I tried to port something relatively simple to see if I could get it working… require “win32/sapi5…

---

## [Random Generation of Characters](https://www.ruby-forum.com/t/random-generation-of-characters/141680)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 11\
**Last updated:** [June 30, 2008, 5:26pm UTC](https://www.ruby-forum.com/t/random-generation-of-characters/141680 "2008-06-30T17:26:09Z")

</div>

How could you generate a list of all possible combination’s of lowercase letters (a-z) and numbers (0-9). Example: ztd6dnck Now, I know of ways I can do this, but it’s definitely not the most efficient or fastest way…

---

## [Data structure](https://www.ruby-forum.com/t/data-structure/141716)

<div class="topic-metadata">

**Author:** [@Vandana](https://www.ruby-forum.com/u/Vandana)\
**Replies:** 8\
**Last updated:** [June 30, 2008, 5:03pm UTC](https://www.ruby-forum.com/t/data-structure/141716 "2008-06-30T17:03:18Z")

</div>

Hello All, I would like to implement a tree with the following properties. The tree is balanced. Each node has a max of 5 sub nodes and min of ceil(5/2) sub nodes. The tree remains static. Number of nodes known from t…

---

## [Rjb heap size OR call ruby methods from java](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701)

<div class="topic-metadata">

**Author:** [@shashank\_hi](https://www.ruby-forum.com/u/shashank_hi)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 4:58pm UTC](https://www.ruby-forum.com/t/rjb-heap-size-or-call-ruby-methods-from-java/141701 "2008-06-30T16:58:36Z")

</div>

I’ve been using rjb (ruby java bridge) to use a method from a Java library. Problem is, that I run out of heap while running that method. I’m on a Windows machine, and I increased the max heap size for Java from the C…

---

## [Code Review: MutableStringCenter](https://www.ruby-forum.com/t/code-review-mutablestringcenter/141668)

<div class="topic-metadata">

**Author:** [@Dave\_Remy](https://www.ruby-forum.com/u/Dave_Remy)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 4:39pm UTC](https://www.ruby-forum.com/t/code-review-mutablestringcenter/141668 "2008-06-30T16:39:48Z")

</div>

tfpt review “/shelveset:MutableStringCenter;REDMOND\\dremy” Comment : Made changes for MutableString.center to pass specs. Included flowing taint correctly, subclassing, changing signature to use object and then doi…

---

## [Re: Ruby.StandardLibrary.Yaml.YamlLibraryInitializer](https://www.ruby-forum.com/t/re-ruby-standardlibrary-yaml-yamllibraryinitializer/141706)

<div class="topic-metadata">

**Author:** [@John\_LSSIRONRUBY](https://www.ruby-forum.com/u/John_LSSIRONRUBY)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 4:33pm UTC](https://www.ruby-forum.com/t/re-ruby-standardlibrary-yaml-yamllibraryinitializer/141706 "2008-06-30T16:33:55Z")

</div>

Sorry about that. If you delete the type, var, and assignment operator everything should work. It is fixed already here. John Sent from my phone From: Peter Bacon D. removed\_email\_address@domain.invalid Sent: Sund…

---

## [Creating tables with internal borders with RedCloth](https://www.ruby-forum.com/t/creating-tables-with-internal-borders-with-redcloth/141755)

<div class="topic-metadata">

**Author:** [@crocco](https://www.ruby-forum.com/u/crocco)\
**Replies:** 7\
**Last updated:** [June 30, 2008, 4:18pm UTC](https://www.ruby-forum.com/t/creating-tables-with-internal-borders-with-redcloth/141755 "2008-06-30T16:18:39Z")

</div>

I’m having a problem using RedCloth. I know this question is more suited for a RedCloth mailing list, but the only one I found (the one on the RedCloth page on rubyforge) is for people who wants to contribute to it, …

---

## [What am I doing wrong! Arrays](https://www.ruby-forum.com/t/what-am-i-doing-wrong-arrays/141730)

<div class="topic-metadata">

**Author:** [@superfly](https://www.ruby-forum.com/u/superfly)\
**Replies:** 7\
**Last updated:** [June 30, 2008, 3:28pm UTC](https://www.ruby-forum.com/t/what-am-i-doing-wrong-arrays/141730 "2008-06-30T15:28:50Z")

</div>

title = “word word1 word2 word3 word4 word5 word6 word7 word8 word9 word10 word11 word12 word13” array = title.split if(array.length == “12”) puts array\[0\] elsif(array.length == “13”) puts array\[1\].to\_s + " " + arr…

---

## [How install a gem which needs library at a special locatin](https://www.ruby-forum.com/t/how-install-a-gem-which-needs-library-at-a-special-locatin/141775)

<div class="topic-metadata">

**Author:** [@vouters](https://www.ruby-forum.com/u/vouters)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 3:25pm UTC](https://www.ruby-forum.com/t/how-install-a-gem-which-needs-library-at-a-special-locatin/141775 "2008-06-30T15:25:20Z")

</div>

Hello, I tried to install fxruby-1.6.15 with gem 1.2 under ruby 187 on a Linux Fedora box. The Fox library is in /usr/local/fox-1633 directory. The gem install fxruby fails because (of course) the ruby extconf.rb com…

---

## [How to Fetch list of Bounce emails?](https://www.ruby-forum.com/t/how-to-fetch-list-of-bounce-emails/141773)

<div class="topic-metadata">

**Author:** [@pshah](https://www.ruby-forum.com/u/pshah)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 3:09pm UTC](https://www.ruby-forum.com/t/how-to-fetch-list-of-bounce-emails/141773 "2008-06-30T15:09:17Z")

</div>

Hi, Can Any one know how to fetch bounce emails list from application?? Means if I send many mails from my application then if any mail is bounce or not send properly because of some problem in address. so how can i …

---

## [How to doing a "grep -v" to hide "---" line added by Hash#to\_yaml?](https://www.ruby-forum.com/t/how-to-doing-a-grep-v-to-hide-line-added-by-hash-to-yaml/141697)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 7\
**Last updated:** [June 30, 2008, 2:23pm UTC](https://www.ruby-forum.com/t/how-to-doing-a-grep-v-to-hide-line-added-by-hash-to-yaml/141697 "2008-06-30T14:23:40Z")

</div>

Hi, when I convert a Hash to a YAML object and print it a line “—” is added at the beginning: cli\> require ‘yaml’ cli\> puts({1=\>2,“ABC” =\> {“a”=\>“A”,“b”=\>“B”}}.to\_yaml) ABC: a: A b: B 1: 2 =\> nil Well, how coul…

---

## [Problems reading xml from a db field and using it in REXML](https://www.ruby-forum.com/t/problems-reading-xml-from-a-db-field-and-using-it-in-rexml/141764)

<div class="topic-metadata">

**Author:** [@aidy](https://www.ruby-forum.com/u/aidy)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 1:55pm UTC](https://www.ruby-forum.com/t/problems-reading-xml-from-a-db-field-and-using-it-in-rexml/141764 "2008-06-30T13:55:59Z")

</div>

I have pulled some xml from a field in the database However, when I try to use that xml in REXML require ‘rexml/document’ doc = REXML::Document.new(xml) I recieve this exception c:/ruby/lib/ruby/1.8/rexml/source.rb:…

---

## [Sleep in a multithreaded environment](https://www.ruby-forum.com/t/sleep-in-a-multithreaded-environment/141749)

<div class="topic-metadata">

**Author:** [@melmoth](https://www.ruby-forum.com/u/melmoth)\
**Replies:** 5\
**Last updated:** [June 30, 2008, 1:16pm UTC](https://www.ruby-forum.com/t/sleep-in-a-multithreaded-environment/141749 "2008-06-30T13:16:59Z")

</div>

Hi, I’m trying to control an external process I’m running and quit it in case it got stuck. To do that I have to check that the external exe keeps writing on stdout, if it doesn’t update it for a while I’ll quit it. …

---

## [Difference in iconv between ruby and irb](https://www.ruby-forum.com/t/difference-in-iconv-between-ruby-and-irb/141683)

<div class="topic-metadata">

**Author:** [@edek](https://www.ruby-forum.com/u/edek)\
**Replies:** 2\
**Last updated:** [June 30, 2008, 1:01pm UTC](https://www.ruby-forum.com/t/difference-in-iconv-between-ruby-and-irb/141683 "2008-06-30T13:01:56Z")

</div>

Hi, I have simple script: require ‘iconv’ s = ‘±ê¶æñ¼’ # a few polish letters with accents puts Iconv.iconv(‘ASCII//TRANSLIT’, ‘UTF-8’, s) I expect result like “aescnz”. I run “ruby myscript.rb” and the effect is “…

---

## [Newbie Question On Ruby Quiz](https://www.ruby-forum.com/t/newbie-question-on-ruby-quiz/141717)

<div class="topic-metadata">

**Author:** [@kylemathews](https://www.ruby-forum.com/u/kylemathews)\
**Replies:** 3\
**Last updated:** [June 30, 2008, 10:45am UTC](https://www.ruby-forum.com/t/newbie-question-on-ruby-quiz/141717 "2008-06-30T10:45:24Z")

</div>

I’m a programming and Ruby newbie. I wanted to build some programs, so I started Best of Ruby Q… The first quiz is MadLibs (Ruby Quiz - Madlibs (#28)) and, given the answer, I can’t even get it to work. I have a rub…

---

## [How to disable rdoc method autolink](https://www.ruby-forum.com/t/how-to-disable-rdoc-method-autolink/141674)

<div class="topic-metadata">

**Author:** [@fxn](https://www.ruby-forum.com/u/fxn)\
**Replies:** 1\
**Last updated:** [June 30, 2008, 9:17am UTC](https://www.ruby-forum.com/t/how-to-disable-rdoc-method-autolink/141674 "2008-06-30T09:17:30Z")

</div>

This documentation Peak Obsession has some autolinked “scopes” that are just regular English. Reason is there’s a scopes method, see the bottom of the page. Is there a way to prevent those autolinks with markup? I’ve…

---

## [UPnP-IGD 1.0.0 Released](https://www.ruby-forum.com/t/upnp-igd-1-0-0-released/141736)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 8:48am UTC](https://www.ruby-forum.com/t/upnp-igd-1-0-0-released/141736 "2008-06-30T08:48:13Z")

</div>

UPnP-IGD version 1.0.0 has been released! http://seattlerb.org/UPnP-IGD - UPnP-IGD Documentation http://rubyforge.org/tracker/?atid=5921&group\_id=1513 - UPnP-IGD bug reports UPnP-IGD is a UPnP extension for Interne…

---

## [Leadtoasia help you explore Asian market](https://www.ruby-forum.com/t/leadtoasia-help-you-explore-asian-market/141732)

<div class="topic-metadata">

**Author:** [@leadtoasia](https://www.ruby-forum.com/u/leadtoasia)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 7:16am UTC](https://www.ruby-forum.com/t/leadtoasia-help-you-explore-asian-market/141732 "2008-06-30T07:16:38Z")

</div>

Lead To Asia One-Stop Service for your Asian Market Entry Lead To Aais â€“ Marketing and New Media for Asia Lead To Asia is a full service marketing and localisation agency for China (Hong Kong, Taiwan and Mainland Ch…

---

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

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 4\
**Last updated:** [June 30, 2008, 5:00am UTC](https://www.ruby-forum.com/t/file-question/141719 "2008-06-30T05:00:08Z")

</div>

Hi, just wondering how I would skip the first line of a file? File.open(‘file.txt’, ‘r’).each do |line| start on the 2nd line end Thanks!

---

## [BUG: Ruby 1.8.7 - io.c Argument Error in syscall,"string contains null byte"](https://www.ruby-forum.com/t/bug-ruby-1-8-7-io-c-argument-error-in-syscall-string-contains-null-byte/141720)

<div class="topic-metadata">

**Author:** [@amin1426](https://www.ruby-forum.com/u/amin1426)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 3:23am UTC](https://www.ruby-forum.com/t/bug-ruby-1-8-7-io-c-argument-error-in-syscall-string-contains-null-byte/141720 "2008-06-30T03:23:37Z")

</div>

I have opened this as bug… http://rubyforge.org/tracker/index.php?func=detail&aid=20895&group\_id=426&atid=1698 The following snippet invokes the statfs64 syscall. bug.rb===============================================…

---

## [Initial release of amalgalite - v0.1.0](https://www.ruby-forum.com/t/initial-release-of-amalgalite-v0-1-0/141100)

<div class="topic-metadata">

**Author:** [@jeremyheiler](https://www.ruby-forum.com/u/jeremyheiler)\
**Replies:** 12\
**Last updated:** [June 30, 2008, 2:57am UTC](https://www.ruby-forum.com/t/initial-release-of-amalgalite-v0-1-0/141100 "2008-06-30T02:57:53Z")

</div>

Amalgalite embeds the SQLite database engine in a ruby extension. amalgalite http://copiousfreetime.org/articles/2008/06/21/amalgalite-0-1-0-released.html I would consider Amalgalite beta right now. It is fully usa…

---

## [Stretchy NVector](https://www.ruby-forum.com/t/stretchy-nvector/141718)

<div class="topic-metadata">

**Author:** [@Joel\_VanderWerf](https://www.ruby-forum.com/u/Joel_VanderWerf)\
**Replies:** 0\
**Last updated:** [June 30, 2008, 2:20am UTC](https://www.ruby-forum.com/t/stretchy-nvector/141718 "2008-06-30T02:20:29Z")

</div>

Anyone know a way to make a NVector (from the narray extension) stretchy, i.e. support #push or #\<\< ? irb(main):001:0\> v = NVector.float(1) =\> NVector.float(1): \[ 0.0 \] irb(main):002:0\> v \<\< 1.0 NoMethodError: unde…

---

## [Two Dimensional Array](https://www.ruby-forum.com/t/two-dimensional-array/141633)

<div class="topic-metadata">

**Author:** [@jturney](https://www.ruby-forum.com/u/jturney)\
**Replies:** 5\
**Last updated:** [June 30, 2008, 1:57am UTC](https://www.ruby-forum.com/t/two-dimensional-array/141633 "2008-06-30T01:57:41Z")

</div>

class Tda def initialize(width=0, height=0) if((width==0) && width\<height) raise NotImplementedError, “(#{width}) width Tda cannot have a height.” else @tda = Array.new(width).map!{ Array.new(height) } end end d…

---

## [Is Logger thread safe?](https://www.ruby-forum.com/t/is-logger-thread-safe/141710)

<div class="topic-metadata">

**Author:** [@ISSSSaki\_Baz\_C](https://www.ruby-forum.com/u/ISSSSaki_Baz_C)\
**Replies:** 0\
**Last updated:** [June 29, 2008, 9:49pm UTC](https://www.ruby-forum.com/t/is-logger-thread-safe/141710 "2008-06-29T21:49:07Z")

</div>

Hi, in my program I use threads and a Logger instante accessible from any thread. Must I do something to make the Logger thread safe? I’ve looked at the Logger code and it seems that it uses Mutex in some methods an…

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

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