# Ruby

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

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

---

## [Referring to method in enclosing class](https://www.ruby-forum.com/t/referring-to-method-in-enclosing-class/127652)

<div class="topic-metadata">

**Author:** [@richever](https://www.ruby-forum.com/u/richever)\
**Replies:** 5\
**Last updated:** [February 1, 2008, 12:05am UTC](https://www.ruby-forum.com/t/referring-to-method-in-enclosing-class/127652 "2008-02-01T00:05:58Z")

</div>

I need to do something like what is being attempted in the code below. The commented out code is what I can’t figure out: how do methods in a nested classes call methods in their enclosing class? Is this even possibl…

---

## [Do I need to Know C++ to use QTRuby](https://www.ruby-forum.com/t/do-i-need-to-know-c-to-use-qtruby/127753)

<div class="topic-metadata">

**Author:** [@matthewmurcia](https://www.ruby-forum.com/u/matthewmurcia)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 11:40pm UTC](https://www.ruby-forum.com/t/do-i-need-to-know-c-to-use-qtruby/127753 "2008-01-31T23:40:07Z")

</div>

This is a spawn from a previous post: The KDE web site says to learn QT before using QtRuby, but when you go to follow the link it says “We assume you already know C++”. How frustrating and intimidating… The question…

---

## [Warning when running sqlite3 with Ruby on Windows](https://www.ruby-forum.com/t/warning-when-running-sqlite3-with-ruby-on-windows/127612)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 3\
**Last updated:** [January 31, 2008, 11:37pm UTC](https://www.ruby-forum.com/t/warning-when-running-sqlite3-with-ruby-on-windows/127612 "2008-01-31T23:37:47Z")

</div>

Hello, I installed ruby-sqlite3 as a gem from Rubyforge to my Windows PC. I’ve also downloaded the sqlite3 DLL and placed it in the same directory with my script, for testing. This simple code: require ‘sqlite3’ db …

---

## [Memory considerations when parsing XML file](https://www.ruby-forum.com/t/memory-considerations-when-parsing-xml-file/127735)

<div class="topic-metadata">

**Author:** [@mr\_tibs](https://www.ruby-forum.com/u/mr_tibs)\
**Replies:** 2\
**Last updated:** [January 31, 2008, 11:26pm UTC](https://www.ruby-forum.com/t/memory-considerations-when-parsing-xml-file/127735 "2008-01-31T23:26:00Z")

</div>

Hi, I need to quickly parse a large XML file. I didn’t want to use DOM parsing since this way you end up with the whole file in the memory. I looked at writing my own SAX-style parser and came across this post: http…

---

## [Howto perfom Image.read](https://www.ruby-forum.com/t/howto-perfom-image-read/127722)

<div class="topic-metadata">

**Author:** [@der\_guido](https://www.ruby-forum.com/u/der_guido)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 10:59pm UTC](https://www.ruby-forum.com/t/howto-perfom-image-read/127722 "2008-01-31T22:59:31Z")

</div>

Hey mates, I tried to read images (full-sized DSLR-images) more faster, but I canÂ´t find some information howto perform reading images… When I try Image.read(“myImageName”).first then it takes a long time (more the…

---

## [Problems trying to "make" it](https://www.ruby-forum.com/t/problems-trying-to-make-it/127747)

<div class="topic-metadata">

**Author:** [@Alexandre\_Almeida](https://www.ruby-forum.com/u/Alexandre_Almeida)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 10:41pm UTC](https://www.ruby-forum.com/t/problems-trying-to-make-it/127747 "2008-01-31T22:41:19Z")

</div>

Hi! I’m new here. My name is Alexandre and this is my first post. Well, I bought a book (here in Brazil, where I live) about Ruby and tryed to follow the steps to add gtk2 interface. I downloaded the ruby-gtk2 on htt…

---

## [Wxruby2 problems](https://www.ruby-forum.com/t/wxruby2-problems/127713)

<div class="topic-metadata">

**Author:** [@eliben](https://www.ruby-forum.com/u/eliben)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 10:15pm UTC](https://www.ruby-forum.com/t/wxruby2-problems/127713 "2008-01-31T22:15:58Z")

</div>

Hello, I’ve recently installed wxruby2 (version 1.9.4) from a precompiled mswin32 gem. It seems to work fine, and the samples in the distribution all work, but I have a couple of peculiar problems: When I package a…

---

## [Re: Gedankenexperiment on method duck type safety](https://www.ruby-forum.com/t/re-gedankenexperiment-on-method-duck-type-safety/127741)

<div class="topic-metadata">

**Author:** [@phil](https://www.ruby-forum.com/u/phil)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 9:14pm UTC](https://www.ruby-forum.com/t/re-gedankenexperiment-on-method-duck-type-safety/127741 "2008-01-31T21:14:26Z")

</div>

hi, i’m curious if there is a better (in the means of faster) way to transform an utf8 encoded string to ascii, than this str.unpack(‘U\*’).pack(‘c\*’) g phil

---

## [Validate email address?](https://www.ruby-forum.com/t/validate-email-address/127710)

<div class="topic-metadata">

**Author:** [@miracleofmagick](https://www.ruby-forum.com/u/miracleofmagick)\
**Replies:** 7\
**Last updated:** [January 31, 2008, 9:10pm UTC](https://www.ruby-forum.com/t/validate-email-address/127710 "2008-01-31T21:10:54Z")

</div>

Anyone have a code snippet that tells whether an email address is “valid” but not necessarily whether it is a working address because that much I can sort out through my mail server through any bounces. I have a datab…

---

## [Graceful Console Handling?](https://www.ruby-forum.com/t/graceful-console-handling/127703)

<div class="topic-metadata">

**Author:** [@dreamwave](https://www.ruby-forum.com/u/dreamwave)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/graceful-console-handling/127703 "2008-01-31T20:28:58Z")

</div>

So I’ve created a project utilizing the DLR and IronRuby (http://www.codeplex.com/ironlogo) The Console classes seemed pretty tied to having an actual console open, and then there’s no real way to shut them down grac…

---

## [Ruport Book pre-orders shipped](https://www.ruby-forum.com/t/ruport-book-pre-orders-shipped/196587)

<div class="topic-metadata">

**Author:** [@naething](https://www.ruby-forum.com/u/naething)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 7:40pm UTC](https://www.ruby-forum.com/t/ruport-book-pre-orders-shipped/196587 "2008-01-31T19:40:49Z")

</div>

Hi folks, Sorry for the noise if this doesn’t apply to you, but I want to make sure I reach the folks that need to see this. I’ve shipped out all the pre-orders of the Ruport Book\[0\] that I knew I was supposed to shi…

---

## [Ruby milter and C code](https://www.ruby-forum.com/t/ruby-milter-and-c-code/127248)

<div class="topic-metadata">

**Author:** [@barjunk](https://www.ruby-forum.com/u/barjunk)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 7:11pm UTC](https://www.ruby-forum.com/t/ruby-milter-and-c-code/127248 "2008-01-31T19:11:10Z")

</div>

I’ve been looking at the code at: http://ruby-asp.rubyforge.org/svn/trunk/ruby-sendmail-milter/milter.c and although it doesn’t work as presented, I was able to get it working. As I was going through the code I found…

---

## [Can ik make this more beautifull?](https://www.ruby-forum.com/t/can-ik-make-this-more-beautifull/127689)

<div class="topic-metadata">

**Author:** [@remcoh](https://www.ruby-forum.com/u/remcoh)\
**Replies:** 16\
**Last updated:** [January 31, 2008, 6:04pm UTC](https://www.ruby-forum.com/t/can-ik-make-this-more-beautifull/127689 "2008-01-31T18:04:45Z")

</div>

nowadays i try to improve my coding style to produce nicer and beter readable code. I try to improve the following code but i dont know how. if condtion1 x=1 else if condition2 x=2 else if condition3 x=3 end e…

---

## [How to get rid of escaped characters](https://www.ruby-forum.com/t/how-to-get-rid-of-escaped-characters/127625)

<div class="topic-metadata">

**Author:** [@liquidrails](https://www.ruby-forum.com/u/liquidrails)\
**Replies:** 2\
**Last updated:** [January 31, 2008, 4:47pm UTC](https://www.ruby-forum.com/t/how-to-get-rid-of-escaped-characters/127625 "2008-01-31T16:47:18Z")

</div>

How do you get rid of unwanted escape characters that rails adds to a user inputted string? Thanks

---

## [Net::HTTP using SSL certificate](https://www.ruby-forum.com/t/net-http-using-ssl-certificate/127660)

<div class="topic-metadata">

**Author:** [@julianparry](https://www.ruby-forum.com/u/julianparry)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 4:25pm UTC](https://www.ruby-forum.com/t/net-http-using-ssl-certificate/127660 "2008-01-31T16:25:41Z")

</div>

Hi, I’m attempting to login to a URL over SSL using Net:HTTP. CERT\_FILE = ‘cert.pem’ http = Net::HTTP.new('dev.company.com, 443) http.use\_ssl = true http.cert = OpenSSL::X509::Certificate.new( File.read(CERT\_FILE) ) …

---

## [Writing text files with an explicit encoding (UTF-16LE)](https://www.ruby-forum.com/t/writing-text-files-with-an-explicit-encoding-utf-16le/127698)

<div class="topic-metadata">

**Author:** [@timperrett](https://www.ruby-forum.com/u/timperrett)\
**Replies:** 4\
**Last updated:** [January 31, 2008, 4:16pm UTC](https://www.ruby-forum.com/t/writing-text-files-with-an-explicit-encoding-utf-16le/127698 "2008-01-31T16:16:15Z")

</div>

Hey all, I cant seem to find any documentation on how to write a text file to the filesystem with an explicit encoding type? Can someone point me in the right direction? Its a simple text file, but it needs to be UTF-…

---

## [Newbie: add few lines to file ..?](https://www.ruby-forum.com/t/newbie-add-few-lines-to-file/127699)

<div class="topic-metadata">

**Author:** [@newman](https://www.ruby-forum.com/u/newman)\
**Replies:** 3\
**Last updated:** [January 31, 2008, 3:55pm UTC](https://www.ruby-forum.com/t/newbie-add-few-lines-to-file/127699 "2008-01-31T15:55:30Z")

</div>

Hi! I try to write code which adding extra lines to my file ruby -e 'readlines.each{… } ’ myfile\_name~ \> myfile\_name How to make it. I should use readlines…?

---

## [Reverse RegEx or How to write a KeywordGenerator for a given](https://www.ruby-forum.com/t/reverse-regex-or-how-to-write-a-keywordgenerator-for-a-given/127701)

<div class="topic-metadata">

**Author:** [@muescha](https://www.ruby-forum.com/u/muescha)\
**Replies:** 2\
**Last updated:** [January 31, 2008, 3:53pm UTC](https://www.ruby-forum.com/t/reverse-regex-or-how-to-write-a-keywordgenerator-for-a-given/127701 "2008-01-31T15:53:39Z")

</div>

im new to ruby and have not the deep knowledge of all the possible ways to get a solution. but for to the sequence generator im very surprised of the clean short ruby solution… My Goal: write a parser for some patter…

---

## [Hash Sorting](https://www.ruby-forum.com/t/hash-sorting/121615)

<div class="topic-metadata">

**Author:** [@pie-social](https://www.ruby-forum.com/u/pie-social)\
**Replies:** 24\
**Last updated:** [January 31, 2008, 3:19pm UTC](https://www.ruby-forum.com/t/hash-sorting/121615 "2008-01-31T15:19:59Z")

</div>

Can not understand how the block after sort works! Need help. thanks. h = { “a” =\> 20, “b” =\> 30, “c” =\> 10 } puts h.sort #=\> \[\[“a”, 20\], \[“b”, 30\], \[“c”, 10\]\] puts h.sort {|a,b| a\[0\]\<=\>b\[0\]} # as…

---

## [Making Change (#154)](https://www.ruby-forum.com/t/making-change-154/127161)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 105\
**Last updated:** [January 31, 2008, 3:02pm UTC](https://www.ruby-forum.com/t/making-change-154/127161 "2008-01-31T15:02:15Z")

</div>

The three rules of Ruby Q.: Please do not post any solutions or spoiler discussion for this quiz until 48 hours have passed from the time on this message. Support Ruby Q. by submitting ideas as often as you can: …

---

## [Making Change (#154)](https://www.ruby-forum.com/t/making-change-154/127702)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 2:59pm UTC](https://www.ruby-forum.com/t/making-change-154/127702 "2008-01-31T14:59:50Z")

</div>

One submitter commented that our solutions were pretty complex. The reason for that is that we all sat around dreaming up pathological edge cases that took a long time to solve without some complex code. The good n…

---

## [Gem API](https://www.ruby-forum.com/t/gem-api/127425)

<div class="topic-metadata">

**Author:** [@john\_old](https://www.ruby-forum.com/u/john_old)\
**Replies:** 4\
**Last updated:** [January 31, 2008, 2:10pm UTC](https://www.ruby-forum.com/t/gem-api/127425 "2008-01-31T14:10:35Z")

</div>

I’m curious is there a flag or an easy way to extend gem when calling it from the command line to do the following: remove lines such as: \\n\*\*\* LOCAL GEMS \\n\\n and \\n REMOTE GEMS \*\*\*\\n\\n and to control the output f…

---

## [Neat idea from arc](https://www.ruby-forum.com/t/neat-idea-from-arc/127513)

<div class="topic-metadata">

**Author:** [@Martin\_DeMello](https://www.ruby-forum.com/u/Martin_DeMello)\
**Replies:** 10\
**Last updated:** [January 31, 2008, 1:51pm UTC](https://www.ruby-forum.com/t/neat-idea-from-arc/127513 "2008-01-31T13:51:05Z")

</div>

Paul Graham just released Arc (Arc's Out), a lisp dialect with an emphasis on “quick-and-dirty” exploratory programming, and compactness of code. One of the ideas he threw in seems like it might fit well into Ruby too…

---

## [Counting the number of repititions in an array](https://www.ruby-forum.com/t/counting-the-number-of-repititions-in-an-array/127613)

<div class="topic-metadata">

**Author:** [@scudco](https://www.ruby-forum.com/u/scudco)\
**Replies:** 9\
**Last updated:** [January 31, 2008, 11:29am UTC](https://www.ruby-forum.com/t/counting-the-number-of-repititions-in-an-array/127613 "2008-01-31T11:29:53Z")

</div>

Hi if i want to count the number of times values are repeated in an array how do i go about it…is there a method? My solution is list.sort loop through list and compare one element to the next and count repetitions. …

---

## [String#inspect may raise Exception](https://www.ruby-forum.com/t/string-inspect-may-raise-exception/127678)

<div class="topic-metadata">

**Author:** [@NARUSES\_Yui](https://www.ruby-forum.com/u/NARUSES_Yui)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 10:55am UTC](https://www.ruby-forum.com/t/string-inspect-may-raise-exception/127678 "2008-01-31T10:55:31Z")

</div>

e$B@.@%$G$9!#e(B \["\\x82\\xa0".force\_encoding(“sjis”), “\\xa4\\xa2”.force\_encoding(“euc-jp”), “\\xe3\\x81\\x82”.force\_encoding(“utf-8”)\].inspect ArgumentError: append incompatible encoding strings: Shift\_JIS and EUC-JP e…

---

## [Hoe 1.5.0 Released](https://www.ruby-forum.com/t/hoe-1-5-0-released/127672)

<div class="topic-metadata">

**Author:** [@aguynamedryan](https://www.ruby-forum.com/u/aguynamedryan)\
**Replies:** 1\
**Last updated:** [January 31, 2008, 10:10am UTC](https://www.ruby-forum.com/t/hoe-1-5-0-released/127672 "2008-01-31T10:10:40Z")

</div>

hoe version 1.5.0 has been released! http://rubyforge.org/projects/seattlerb/ http://seattlerb.rubyforge.org/hoe/ removed\_email\_address@domain.invalid Hoe is a simple rake/rubygems helper for project Rakefiles. It ge…

---

## [$B8=:\_$N(B script encoding $B$NCM$rF@$kJ}K!$O!)(B](https://www.ruby-forum.com/t/b8-n-b-script-encoding-b-ncm-rf-kj-k-o-b/127428)

<div class="topic-metadata">

**Author:** [@Hidetoshi\_NAGAI](https://www.ruby-forum.com/u/Hidetoshi_NAGAI)\
**Replies:** 19\
**Last updated:** [January 31, 2008, 8:50am UTC](https://www.ruby-forum.com/t/b8-n-b-script-encoding-b-ncm-rf-kj-k-o-b/127428 "2008-01-31T08:50:32Z")

</div>

e$B1J0f!wCNG=!%6e9)Bg$G$9!%e(B e$B$9$$^$;$s$,!$$o$+$i$J$+$C$?$N$G65$($F$/$@$5$$!%e(B -K e$B%\*%W%7%g%s$de(B magic comment e$B$K4p$E$$$F7hDj$5$l$?e(B e$B8=:$Ne(B script encoding e$B$r\<B9TCf$N%9%/%j%W%HFb$GCN$k$K$Oe(B e…

---

## [Quizzical?](https://www.ruby-forum.com/t/quizzical/127653)

<div class="topic-metadata">

**Author:** [@Wyatt\_G](https://www.ruby-forum.com/u/Wyatt_G)\
**Replies:** 3\
**Last updated:** [January 31, 2008, 8:15am UTC](https://www.ruby-forum.com/t/quizzical/127653 "2008-01-31T08:15:54Z")

</div>

Can you guess what this program will do when run? a = ???:???:??:???:?? puts a Feel free to post answers and spoilers to this below. If you don’t want to see the answer, stop reading! :slight\_smile:

---

## [Fwd: Please Forward: Ruby Quiz Submission](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229145)

<div class="topic-metadata">

**Author:** [@bbazzarrakk](https://www.ruby-forum.com/u/bbazzarrakk)\
**Replies:** 0\
**Last updated:** [January 31, 2008, 5:13am UTC](https://www.ruby-forum.com/t/fwd-please-forward-ruby-quiz-submission/229145 "2008-01-31T05:13:37Z")

</div>

Begin forwarded message:

---

## [Is there a way to send chat message via AOL AIM (with ruby of course!)](https://www.ruby-forum.com/t/is-there-a-way-to-send-chat-message-via-aol-aim-with-ruby-of-course/127639)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [January 31, 2008, 4:58am UTC](https://www.ruby-forum.com/t/is-there-a-way-to-send-chat-message-via-aol-aim-with-ruby-of-course/127639 "2008-01-31T04:58:24Z")

</div>

poking around, there seem to be numerous walking dead projects, anyone have any first hand experience before I go down this path?

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

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