# Ruby

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

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

---

## [Efficiency of string parsing](https://www.ruby-forum.com/t/efficiency-of-string-parsing/88550)

<div class="topic-metadata">

**Author:** [@Kev](https://www.ruby-forum.com/u/Kev)\
**Replies:** 7\
**Last updated:** [March 13, 2007, 9:40am UTC](https://www.ruby-forum.com/t/efficiency-of-string-parsing/88550 "2007-03-13T09:40:33Z")

</div>

I have written a loop to basically parse a string, and at every 50th character check to see if is a space, if not, work back until it finds one, then insert a newline. I am turning masses of text (copy) from a DB int…

---

## [Extending ta-lib using SWIG](https://www.ruby-forum.com/t/extending-ta-lib-using-swig/88639)

<div class="topic-metadata">

**Author:** [@BENI](https://www.ruby-forum.com/u/BENI)\
**Replies:** 0\
**Last updated:** [March 13, 2007, 9:25am UTC](https://www.ruby-forum.com/t/extending-ta-lib-using-swig/88639 "2007-03-13T09:25:28Z")

</div>

ta-lib (http://ta-lib.org/) is a package availiable which has port for perl,python?,excel etc. I needed it in ruby… since no port is availiable (AFAIK) … i thought of building a port. i have read along the pickaxe bo…

---

## [YAML.load\_file problems](https://www.ruby-forum.com/t/yaml-load-file-problems/88531)

<div class="topic-metadata">

**Author:** [@RebhanS\_Gilbert](https://www.ruby-forum.com/u/RebhanS_Gilbert)\
**Replies:** 4\
**Last updated:** [March 13, 2007, 9:16am UTC](https://www.ruby-forum.com/t/yaml-load-file-problems/88531 "2007-03-13T09:16:27Z")

</div>

Hi, i have a program where several things are hard coded for production i need a config file now, must be editable and readable by hand, so i decided to try with YAML program with hard coded stuff = require “highlin…

---

## [Secure Random Number Generator](https://www.ruby-forum.com/t/secure-random-number-generator/88629)

<div class="topic-metadata">

**Author:** [@davis](https://www.ruby-forum.com/u/davis)\
**Replies:** 8\
**Last updated:** [March 13, 2007, 7:05am UTC](https://www.ruby-forum.com/t/secure-random-number-generator/88629 "2007-03-13T07:05:17Z")

</div>

Hi- Is there a secure random number generator for Ruby that works on Windows and Linux? Thanks, Dave

---

## [Newbie: best way to connect to MySQL?](https://www.ruby-forum.com/t/newbie-best-way-to-connect-to-mysql/88612)

<div class="topic-metadata">

**Author:** [@planetthoughtful](https://www.ruby-forum.com/u/planetthoughtful)\
**Replies:** 6\
**Last updated:** [March 13, 2007, 5:56am UTC](https://www.ruby-forum.com/t/newbie-best-way-to-connect-to-mysql/88612 "2007-03-13T05:56:12Z")

</div>

Hi All, I’m teaching myself Ruby, and thus far I’ve managed to successfully attach to and INSERT / SELECT / etc records from a MSSQL server using the ODBC driver. I’ve been trying to do the same thing with a MySQL se…

---

## [How to check for group membership in windows?](https://www.ruby-forum.com/t/how-to-check-for-group-membership-in-windows/87780)

<div class="topic-metadata">

**Author:** [@BallS\_Donald\_A\_Jr\_S](https://www.ruby-forum.com/u/BallS_Donald_A_Jr_S)\
**Replies:** 4\
**Last updated:** [March 13, 2007, 5:42am UTC](https://www.ruby-forum.com/t/how-to-check-for-group-membership-in-windows/87780 "2007-03-13T05:42:11Z")

</div>

Apologies if this is too off-topic, but I can’t think of where else to start looking. I need to test for group membership on windows in a ruby program. I’ve got some authentication code working just fine: require ‘dl/…

---

## [OpenStruct,, know what keys are set](https://www.ruby-forum.com/t/openstruct-know-what-keys-are-set/88378)

<div class="topic-metadata">

**Author:** [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Replies:** 13\
**Last updated:** [March 13, 2007, 1:36am UTC](https://www.ruby-forum.com/t/openstruct-know-what-keys-are-set/88378 "2007-03-13T01:36:16Z")

</div>

I need to use an OpenStruct to mimic what an object acts like in another language. is it possible somehow to find what keys are set on an OpenStruct at any given time? thanks

---

## [Ntlm example](https://www.ruby-forum.com/t/ntlm-example/88364)

<div class="topic-metadata">

**Author:** [@sean\_nakasone](https://www.ruby-forum.com/u/sean_nakasone)\
**Replies:** 1\
**Last updated:** [March 13, 2007, 1:32am UTC](https://www.ruby-forum.com/t/ntlm-example/88364 "2007-03-13T01:32:51Z")

</div>

Can someone please provide me with a simple ntlm example? Basically, I just want to make an HTTP GET request to my web site, but it does not work because it requires NTLM authentication. Here’s what I’m doing, but I…

---

## [String to int: ruby documentation?](https://www.ruby-forum.com/t/string-to-int-ruby-documentation/88459)

<div class="topic-metadata">

**Author:** [@7stud](https://www.ruby-forum.com/u/7stud)\
**Replies:** 9\
**Last updated:** [March 12, 2007, 11:58pm UTC](https://www.ruby-forum.com/t/string-to-int-ruby-documentation/88459 "2007-03-12T23:58:11Z")

</div>

Hi, In trying to convert a string to an integer, I found this passage in the ruby documentation: http://dev.rubycentral.com/ref/ str.to\_i → anInteger Returns the result of interpreting leading characters in str as…

---

## [Calling a setter method in self (without self.)](https://www.ruby-forum.com/t/calling-a-setter-method-in-self-without-self/88598)

<div class="topic-metadata">

**Author:** [@Tapio\_K](https://www.ruby-forum.com/u/Tapio_K)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 11:31pm UTC](https://www.ruby-forum.com/t/calling-a-setter-method-in-self-without-self/88598 "2007-03-12T23:31:07Z")

</div>

Hi I’m writing a code where it would be desirable to be able to call setter methods in self without having to specify self explicitly. Like: x = 0 # calls self.x=, does not assign to a local variable In Ruby 1.6 this…

---

## [\- RubySSPI 1.2.2 released and now compatible with Rubygems](https://www.ruby-forum.com/t/rubysspi-1-2-2-released-and-now-compatible-with-rubygems/88600)

<div class="topic-metadata">

**Author:** [@vtphysguy](https://www.ruby-forum.com/u/vtphysguy)\
**Replies:** 0\
**Last updated:** [March 12, 2007, 11:28pm UTC](https://www.ruby-forum.com/t/rubysspi-1-2-2-released-and-now-compatible-with-rubygems/88600 "2007-03-12T23:28:06Z")

</div>

The release of Rubygems 0.9.2 (and possibly earlier) introduced an incompatibility with the patch supplied with RubySSPI. The newest releases fixes that incompatibility. This release does, however, introduce new clas…

---

## [Proper usr/bin/env ruby shebang](https://www.ruby-forum.com/t/proper-usr-bin-env-ruby-shebang/84031)

<div class="topic-metadata">

**Author:** [@rsanheim](https://www.ruby-forum.com/u/rsanheim)\
**Replies:** 24\
**Last updated:** [March 12, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/proper-usr-bin-env-ruby-shebang/84031 "2007-03-12T23:00:55Z")

</div>

I’m trying to convert some bash scripts to use /usr/bin/env ruby instead of hardcoded shebang lines, and running into an issue. Using this: #!/usr/bin/env ruby -w results in this error: /usr/bin/env: ruby -w: No su…

---

## [Help with NET::SMTP](https://www.ruby-forum.com/t/help-with-net-smtp/88461)

<div class="topic-metadata">

**Author:** [@peter](https://www.ruby-forum.com/u/peter)\
**Replies:** 13\
**Last updated:** [March 12, 2007, 10:01pm UTC](https://www.ruby-forum.com/t/help-with-net-smtp/88461 "2007-03-12T22:01:48Z")

</div>

I’m trying to use Net::SMTP which appears to do most everything I need except for one thing. In the example below I need to replace removed\_email\_address@domain.invalid with a variable based on the submitting users ema…

---

## [CORRECTION (Re: Phoenix Ruby Users Group March Meeting)](https://www.ruby-forum.com/t/correction-re-phoenix-ruby-users-group-march-meeting/88587)

<div class="topic-metadata">

**Author:** [@byrnejb](https://www.ruby-forum.com/u/byrnejb)\
**Replies:** 0\
**Last updated:** [March 12, 2007, 9:21pm UTC](https://www.ruby-forum.com/t/correction-re-phoenix-ruby-users-group-march-meeting/88587 "2007-03-12T21:21:39Z")

</div>

James B. wrote: What: Phoenix Ruby U. Group When: March 13, 2007, 6:15 PM That is a lie. In fact, the meeting is today, Monday, March 12, at 6:15pm. (I would blame my error on the new shift to DST, but, being in A…

---

## [New Date from Time.now().to\_a](https://www.ruby-forum.com/t/new-date-from-time-now-to-a/88492)

<div class="topic-metadata">

**Author:** [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Replies:** 5\
**Last updated:** [March 12, 2007, 8:50pm UTC](https://www.ruby-forum.com/t/new-date-from-time-now-to-a/88492 "2007-03-12T20:50:07Z")

</div>

I don’t see any obvious ways of making a new Date object based off of what Time.now rerurns. I’m ultimately trying to make a new Date from milliseconds: tn = Time.now ms = ("%.6f" % tn.to\_f) #this would ultimately be…

---

## [Receiving signals in Win32/Process](https://www.ruby-forum.com/t/receiving-signals-in-win32-process/85462)

<div class="topic-metadata">

**Author:** [@soroe](https://www.ruby-forum.com/u/soroe)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 8:31pm UTC](https://www.ruby-forum.com/t/receiving-signals-in-win32-process/85462 "2007-03-12T20:31:33Z")

</div>

Hey Guys, I’ve created some Window’s processes uing the Win32/Process (by Daniel Berger) library. When I send a signal to these processes using Win32/Process.kill(\[1,3…9\], pid), the processes are always killed. I’ve …

---

## [Svg in rhtml](https://www.ruby-forum.com/t/svg-in-rhtml/88570)

<div class="topic-metadata">

**Author:** [@Hanan\_M](https://www.ruby-forum.com/u/Hanan_M)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 8:15pm UTC](https://www.ruby-forum.com/t/svg-in-rhtml/88570 "2007-03-12T20:15:30Z")

</div>

hello Is there a way to embed svg file in rhtml page. I tried to use the object tag but it never loads Thanks

---

## [Dl memory leak](https://www.ruby-forum.com/t/dl-memory-leak/88547)

<div class="topic-metadata">

**Author:** [@sheepman](https://www.ruby-forum.com/u/sheepman)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 7:34pm UTC](https://www.ruby-forum.com/t/dl-memory-leak/88547 "2007-03-12T19:34:26Z")

</div>

e$B$3$s$P$s$O!"e(Bsheepman e$B$G$9!#e(B e$B%j%j!\<%94V6a$G5$$,0z$1$^$9$,!"e(Bruby/dl e$B$,%a%b%j!\<%j!\<%/$re(B e$B5/$3$7$F$$$^$9!#0J2\<$O%Q%C%A$G$9!#e(B Index: ptr.c — ptr.c (revision 12047) +++ ptr.c (worki…

---

## [DRb freezes YARV?](https://www.ruby-forum.com/t/drb-freezes-yarv/88076)

<div class="topic-metadata">

**Author:** [@Meinrad\_R](https://www.ruby-forum.com/u/Meinrad_R)\
**Replies:** 3\
**Last updated:** [March 12, 2007, 7:09pm UTC](https://www.ruby-forum.com/t/drb-freezes-yarv/88076 "2007-03-12T19:09:24Z")

</div>

dear all, Has anyone tried out drb on latest ruby1.9 including VM? Well, I tried out drb and found that DRb#start\_service won’t return on YARV as it does on Ruby1.8. It is so strange that I can not find a reasonable …

---

## [Generate UUID](https://www.ruby-forum.com/t/generate-uuid/88205)

<div class="topic-metadata">

**Author:** [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Replies:** 10\
**Last updated:** [March 12, 2007, 7:01pm UTC](https://www.ruby-forum.com/t/generate-uuid/88205 "2007-03-12T19:01:20Z")

</div>

Anyone have a fast way of generating a verson 4 UUID? I have found some libraries to do this, but it seems like it could be done in about 8 lines of code. Any faster approches? what about this? def rand\_hex(l) valid…

---

## [Shutting irb up](https://www.ruby-forum.com/t/shutting-irb-up/87475)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 6\
**Last updated:** [March 12, 2007, 5:55pm UTC](https://www.ruby-forum.com/t/shutting-irb-up/87475 "2007-03-12T17:55:10Z")

</div>

i looked forever, didn’t find this, and am posting for posterity harp:~ \> cat .irbrc IRB.conf\[:PROMPT\]\[ IRB.conf\[:PROMPT\_MODE\] \]\[:RETURN\]=’’ harp :~ \> irb irb(main):001:0\> 42 irb(main):002:0\> 43 irb(main):003:0\> pu…

---

## [Installing ruby and rails on linux without using internet co](https://www.ruby-forum.com/t/installing-ruby-and-rails-on-linux-without-using-internet-co/88541)

<div class="topic-metadata">

**Author:** [@spashokkumar](https://www.ruby-forum.com/u/spashokkumar)\
**Replies:** 7\
**Last updated:** [March 12, 2007, 5:40pm UTC](https://www.ruby-forum.com/t/installing-ruby-and-rails-on-linux-without-using-internet-co/88541 "2007-03-12T17:40:07Z")

</div>

Hi, i am a newbie. i don’t have internet connetion at home. so all i can do is, i can download individually in internet browsing centre and install on my home pc. currently i am using fedora core 6. i don’t know ho…

---

## [Single Table Inheritance Association Issue](https://www.ruby-forum.com/t/single-table-inheritance-association-issue/88556)

<div class="topic-metadata">

**Author:** [@mike](https://www.ruby-forum.com/u/mike)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 5:21pm UTC](https://www.ruby-forum.com/t/single-table-inheritance-association-issue/88556 "2007-03-12T17:21:05Z")

</div>

Hi there, I’m using STI in a new application, and something is terribly wrong with has\_many associations. Right, so I have number of subclasses that inherit from one concrete base class. Each sub class can possibly h…

---

## [Possible bug in regexp engine?](https://www.ruby-forum.com/t/possible-bug-in-regexp-engine/88539)

<div class="topic-metadata">

**Author:** [@greg](https://www.ruby-forum.com/u/greg)\
**Replies:** 2\
**Last updated:** [March 12, 2007, 5:06pm UTC](https://www.ruby-forum.com/t/possible-bug-in-regexp-engine/88539 "2007-03-12T17:06:03Z")

</div>

Given the following regular expression: /(\[^\*#\]+|#(?!#|\*)|\*(?!#))+/ I wanted to make it more readable by inserting some comments, so I tried adding the “x” option and it no longer compiled: /(\[^\*#\]+|#(?!#|\*)|\*(?!#))+…

---

## [Can't install rubygems](https://www.ruby-forum.com/t/cant-install-rubygems/82885)

<div class="topic-metadata">

**Author:** [@lijie](https://www.ruby-forum.com/u/lijie)\
**Replies:** 16\
**Last updated:** [March 12, 2007, 4:41pm UTC](https://www.ruby-forum.com/t/cant-install-rubygems/82885 "2007-03-12T16:41:58Z")

</div>

The rubygems installer can’t finish, and CPU is 100% used in several hours. localhost rubygems-0.9.1 # uname -a Linux localhost 2.6.17.13 #1 SMP Wed Jan 3 09:30:41 Local time zone must be set–see zic m i686 Genuine …

---

## [Code organisation "template" interference(?) with RUBYLIB en](https://www.ruby-forum.com/t/code-organisation-template-interference-with-rubylib-en/88358)

<div class="topic-metadata">

**Author:** [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Replies:** 3\
**Last updated:** [March 12, 2007, 3:51pm UTC](https://www.ruby-forum.com/t/code-organisation-template-interference-with-rubylib-en/88358 "2007-03-12T15:51:50Z")

</div>

(Warning: this post is waaaaay longer than I intended) Hello, Apologies if the subject line is a bit cryptic, but it’s not easy to describe in a single line. Anyway… A while back an astute fellow on comp.lang.ruby (…

---

## [Re: Code organisation "template" interference(?) with RUBYLI](https://www.ruby-forum.com/t/re-code-organisation-template-interference-with-rubyli/88359)

<div class="topic-metadata">

**Author:** [@Joseph\_Schiller](https://www.ruby-forum.com/u/Joseph_Schiller)\
**Replies:** 1\
**Last updated:** [March 12, 2007, 3:35pm UTC](https://www.ruby-forum.com/t/re-code-organisation-template-interference-with-rubyli/88359 "2007-03-12T15:35:48Z")

</div>

Hi, If you don’t need ADMIN rights to shuffle files from place to place, you might want to point your browser to http://www.obsession.se/gentoo and give gentoo file manager a try. It is fast and has all the features …

---

## [OptionParser patch](https://www.ruby-forum.com/t/optionparser-patch/88344)

<div class="topic-metadata">

**Author:** [@twp](https://www.ruby-forum.com/u/twp)\
**Replies:** 2\
**Last updated:** [March 12, 2007, 3:03pm UTC](https://www.ruby-forum.com/t/optionparser-patch/88344 "2007-03-12T15:03:43Z")

</div>

Hi, I wanted to submit a patch for optparse.rb to make it easier to add general text to the usage summary. There were three things I wanted to change: Fix OptionParser#separator so that it correctly handles strings …

---

## [Opening a large file many times / optimisation](https://www.ruby-forum.com/t/opening-a-large-file-many-times-optimisation/88470)

<div class="topic-metadata">

**Author:** [@Paul\_Nulty](https://www.ruby-forum.com/u/Paul_Nulty)\
**Replies:** 8\
**Last updated:** [March 12, 2007, 2:30pm UTC](https://www.ruby-forum.com/t/opening-a-large-file-many-times-optimisation/88470 "2007-03-12T14:30:36Z")

</div>

hello, I have a method that basically searches through a largish (5mb) text file for a word. I need to call this method about 1400 times, and i care about speed. If i open the file at the start of the script and then…

---

## [Dhaka-2.1.0 : Fun with lexers](https://www.ruby-forum.com/t/dhaka-2-1-0-fun-with-lexers/88473)

<div class="topic-metadata">

**Author:** [@Mushfeq\_K](https://www.ruby-forum.com/u/Mushfeq_K)\
**Replies:** 3\
**Last updated:** [March 12, 2007, 1:53pm UTC](https://www.ruby-forum.com/t/dhaka-2-1-0-fun-with-lexers/88473 "2007-03-12T13:53:27Z")

</div>

require ‘dhaka’ class MyLexerSpec \< Dhaka::LexerSpecification for\_pattern(‘\\w+’) { puts “word #{current\_lexeme.value}” } for\_pattern(‘\\s+’) { puts “whitespace” } for\_pattern(‘\*’) { puts “bullet point” } for\_pattern…

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

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