<?xml version="1.0" encoding="UTF-8" standalone="yes"?><rss version="2.0"><channel><title>Java, PHP, MySQL, Ruby, and more at Sagewire.org</title><link>http://www.sagewire.org/</link><description>Blogs and forums for Java, PHP, MySQL, and more.</description><language>en</language><item><title>A memcached-like server in Ruby - feasible?</title><link>http://www.sagewire.org/ruby-programming/memcachedlike-server-in-Ruby-feasible-1998879.aspx</link><description>Hi group,

I'm running a very high-load website done in Rails.

The number and duration of queries per-page is killing us. So we're
thinking of using a caching layer like memcached. Except we'd like
something more sophisticated than memcached.

Allow me to explain.

memcached is like an object, with a very limited API: basically
#get_value_by_key and #set_value_by_key.

One thing we need, that is not supported by memcached, is to be able to
store a large set of very large objects, ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/memcachedlike-server-in-Ruby-feasible-1998879.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 22:07:16 GMT</pubDate></item><item><title>Duplicate elements in array</title><link>http://www.sagewire.org/ruby-programming/Duplicate-elements-in-array-1999424.aspx</link><description>Hello

I am trying to output the duplicate elements in an array. I looked into
the API (application programming interface)of ruby I found uniq method which outputs the array with no
duplication. What I want is to know which elements is duplicated.
For example

array = [&amp;quot;apple&amp;quot;, &amp;quot;banana&amp;quot;, &amp;quot;apple&amp;quot;, &amp;quot;orange&amp;quot;]
=&amp;gt; [&amp;quot;apple&amp;quot;, &amp;quot;banana&amp;quot;, &amp;quot;apple&amp;quot;, &amp;quot;orange&amp;quot;]
array.uniq
=&amp;gt; [&amp;quot;apple&amp;quot;, &amp;quot;banana&amp;quot;, &amp;quot;orange&amp;quot;]

I want the method to tell me that apple is the duplicated element

I tried this but it does...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Duplicate-elements-in-array-1999424.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:47:28 GMT</pubDate></item><item><title>[ANN] GeoIP C lib bindings</title><link>http://www.sagewire.org/ruby-programming/ANN-GeoIP-lib-bindings-1997719.aspx</link><description>This is a library which provides a single function. The function takes
as input an IP address and it outputs a hash containing best-guess
geographical information (like city, country, latitude, and
longitude).

Actually this is only a Ruby binding to a C library which provides
this function. Also, you must download a large binary database with
all this mapping information. It is kindly provided free of charge by
MaxMind.com.

There are other attempts at providing this functionality in ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/ANN-GeoIP-lib-bindings-1997719.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:40:19 GMT</pubDate></item><item><title>Racc error recovery</title><link>http://www.sagewire.org/ruby-programming/Racc-error-recovery-1995105.aspx</link><description>Hi everyone,

I'm writing a racc parser, and I need to recover from parse errors.
Basically I'm writing a CSS parser, and I need to handle poorly
formatted CSS.

Unfortunately I can not seem to find any good documentation or examples on
error recovery.  I have read the Racc documentation about on_error and
entering &amp;quot;error recovering mode&amp;quot;, as well as calling yyerrok to leave
error recovering mode, but I do not know what that actually means.

I have also discovered the &amp;quot;error&amp;quot; rule, bu...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Racc-error-recovery-1995105.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:35:08 GMT</pubDate></item><item><title>[ANN] RMagick 2.0.0 beta5 builds with Ruby 1.9.0</title><link>http://www.sagewire.org/ruby-programming/ANN-RMagick-200-beta5-builds-with-Ruby-190-1998878.aspx</link><description>I have just uploaded RMagick 2.0.0 beta5. This beta release can be built 
with the latest rev of Ruby 1.9.0.

RMagick 2.0.0 Highlights
------------------------------
o New installation uses setup.rb exclusively
o Requires Ruby 1.8.2 or later
o Requires ImageMagick 6.3.0 or later
o GraphicsMagick not supported
o New Image#destroy! method destroys individual image objects,
   making the memory available for reuse
o New Magick.trace_proc method helps monitor memory usage
o Many new meth...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/ANN-RMagick-200-beta5-builds-with-Ruby-190-1998878.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:17:37 GMT</pubDate></item><item><title>how to find what the sql excepion was with mysql</title><link>http://www.sagewire.org/ruby-programming/how-to-find-what-the-sql-excepion-was-with-1999519.aspx</link><description>I got an exception
E:/TradingTools/CODE/ImportTrade.rb:20:in `execute'

The associated piece of code is
st= dbConn.prepare(&amp;quot;insert into raw_data
 
(SYMBOL,ACTION,SIZE,PRICE,DATE_TIME_OF_TRADE ,EXECUTION,ACCOUNT_ID)
                VALUES(?,?,?,?,?,?,?)&amp;quot;)
st.execute(dataArray[0],dataArray[1],dataArray[2],dataArray[3],tradeDate,dataArray[5],dataArray[6])
        st.close

How do I find out what the exception details were that was triggered
at st.execute   in this case.
any assistance ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/how-to-find-what-the-sql-excepion-was-with-1999519.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:09:54 GMT</pubDate></item><item><title>How fast does your Ruby run?</title><link>http://www.sagewire.org/ruby-programming/How-fast-does-your-Ruby-run-1941038.aspx</link><description>How fast does your Ruby run?

I got 53648 iterations per second running the following program,
on an Intel 3.2 GHz HT, Win XP machine:

--------

C:\&amp;gt; ruby calculate.rb
55

Ruby 1.8.6 patch 0 on i386-mswin32
It took 18.64 seconds to run. 53648 iterations per second.

--------

n = 1_000_000

start_time = Time.now

for I in 1..n
  t = (1..10).inject {|x, y| x + y }
end

finish_time = Time.now

p t

puts
print &amp;quot;Ruby &amp;quot;, RUBY_VERSION, &amp;quot; patch &amp;quot;, RUBY_PATCHLEVEL, &amp;quot; on &amp;quot;,
...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/How-fast-does-your-Ruby-run-1941038.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 18:07:42 GMT</pubDate></item><item><title>[ANN] Ruby Changes in Leopard</title><link>http://www.sagewire.org/ruby-programming/ANN-Ruby-Changes-in-Leopard-1996361.aspx</link><description>Hi,

Leopard, Mac OS X 10.5, will very soon be available to everyone!

Many of you've been wondering about the changes that will impact the
Ruby environment. We preventively compiled a list of all changes, and
you can now access it from here:

http://ruby.macosforge.org
http://trac.macosforge.org/projects/ruby/wiki/WhatsNewInLeopard

As you can see we also just created a new Ruby project on MacOSForge,
with the aim of providing more information regarding the usage of Ruby
on the Mac...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/ANN-Ruby-Changes-in-Leopard-1996361.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 17:54:49 GMT</pubDate></item><item><title>Talking more about JRuby</title><link>http://www.sagewire.org/ruby-programming/Talking-more-about-JRuby-1999255.aspx</link><description>For the most part, we have been pretty good about keeping JRuby 
discussions off the ruby-talk list, because in general it seemed like 
the right thing to do. But lately, it seems like people are missing 
information about what JRuby can do, how complete the implementation is, 
and where we're going with it. So I'd like to start talking more about 
JRuby on this mailing list.

I will start it off with a little introduction to JRuby and what it can do 
right now.

JRuby is Ruby for the ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Talking-more-about-JRuby-1999255.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 17:43:04 GMT</pubDate></item><item><title>JRuby disabling ObjectSpace: what implications?</title><link>http://www.sagewire.org/ruby-programming/JRuby-disabling-ObjectSpace-what-implications-1999256.aspx</link><description>As some of you may have heard, we're considering disabling 
ObjectSpace.each_object by default in JRuby. Primarily, this is for 
performance; to support each_object, we've to bend over backwards, 
maintaining lists of weak references to all objects in the system and 
periodically cleaning out those lists. Here's some example performance, 
from a fractal benchmark in the JRuby source:

With ObjectSpace: Ruby Elapsed 45.967000
Without ObjectSpace: Ruby Elapsed 4.280000

What's most frust...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/JRuby-disabling-ObjectSpace-what-implications-1999256.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 17:39:02 GMT</pubDate></item><item><title>Email address for Huihoo site (http://www.huihoo.com/)?</title><link>http://www.sagewire.org/ruby-programming/Email-address-for-Huihoo-site-httpwwwhuihoocom-1999521.aspx</link><description>Does anyone have an email address for the Huihoo site (http://www.huihoo.com/) 
or the owner of the site?

I found their summary of Ruby Syntax, and the first part was helpful to me, 
but there are some what I will call Japanese Englishisms  (???) and I was going 
to offer some corrections.

That page is: http://docs.huihoo.com/ruby/ruby-man-1.4/syntax.html

Much of the site is in Japanese, some isn't, but I could not find anything 
that looked like an email address while using my mous...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Email-address-for-Huihoo-site-httpwwwhuihoocom-1999521.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 16:39:25 GMT</pubDate></item><item><title>Subversion Ruby Bindings access to URL</title><link>http://www.sagewire.org/ruby-programming/Subversion-Ruby-Bindings-access-to-URL-1203446.aspx</link><description>So I struggled through the installation of swig, subversion and the
ruby bindings, and now I want to connect to subversion from ruby.

It turns out this is usually done through the filesystem with:

Svn::Repos.open

But, I do not have filesystem access to my repository, I only have web
access

So I need to do something like this:

url = 'http://trac-hacks.swapoff.org/svn'
ctx = Svn::Client::Context.new
cb = Svn::Ra::Callbacks.new(ctx.auth_baton)
cb.auth_baton = Svn::Core.auth_open...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Subversion-Ruby-Bindings-access-to-URL-1203446.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 15:55:36 GMT</pubDate></item><item><title>Checkers library</title><link>http://www.sagewire.org/ruby-programming/Checkers-library-1998654.aspx</link><description>Does anyone know if there's a sort of library for the game Checkers in
Ruby? Something that'd, at least:

1. given a board state and a player, tell me what the legal moves are;
2. given a board state and a move, tell me if it's legal;
3. given a board state, tell me if it's a draw or a win (and who won).

Also, if there is not a library (very likely), a complete game that's
open source, from which I could extract that,'d be good enough.

Cheers,

Helder

P.S.: for the curious, I'm ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Checkers-library-1998654.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 15:30:47 GMT</pubDate></item><item><title>FTP size incorrect for files &gt; 4GB</title><link>http://www.sagewire.org/ruby-programming/FTP-size-incorrect-for-files-4GB-1998352.aspx</link><description>The net/ftp size method is supposed to return the size of a remote file,
but when the size of the remote file is &amp;gt; 4GB it seems to return the
wrong size.

The size of the remote file I'm testing is about 4.5 GB and size()
returns about 0.5 GB.  Anyone having the same problems?  Is there
somewhere I can report this problem?

Thanks
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/FTP-size-incorrect-for-files-4GB-1998352.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 14:13:52 GMT</pubDate></item><item><title>NOT reading an entire file into memory</title><link>http://www.sagewire.org/ruby-programming/NOT-reading-an-entire-file-into-memory-1998825.aspx</link><description>I am trying to write a parser for a text-based file format. Files in
this format frequently become very large. While the specification
specifically allows applications to crash on large files, I know
several people who have taken to editing these files by hand in
Notepad or other basic text editors. This format isn't at all
friendly for this type of editing, and it is extremely tedious work,
but their programs all crash due to the size of these files.
What I really want to know is:
I had...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/NOT-reading-an-entire-file-into-memory-1998825.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 12:51:27 GMT</pubDate></item><item><title>Building an extension in C++</title><link>http://www.sagewire.org/ruby-programming/Building-an-extension-in-1986715.aspx</link><description>I'm using cygwin to try to build an extension in C++.  I have stripped
down the pickaxe book's example (http://www.rubycentral.com/pickaxe/
ext_ruby.html) to the bare minimum.  It looks like:

#include &amp;quot;ruby.h

VALUE cTest;

void Init_Test() {
  cTest = rb_define_class(&amp;quot;Test&amp;quot;, rb_cObject);
}

If I name the file Test.c, it works nicely.  If I name the file
Test.cpp I get the following error when I try to require the file in
irb.

LoadError: No such file or directory - /usr/lib/rub...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Building-an-extension-in-1986715.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 12:48:55 GMT</pubDate></item><item><title>convert string format</title><link>http://www.sagewire.org/ruby-programming/convert-string-format-1998934.aspx</link><description>Hello
I have a date like 20070801 in a string. how do I change it to
2007/08/01 using regex
thanks</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/convert-string-format-1998934.aspx</guid><author>rss@sagewire.org</author><pubDate>Sun, 28 Oct 2007 12:32:04 GMT</pubDate></item><item><title>Truth value evaluating of an object</title><link>http://www.sagewire.org/ruby-programming/Truth-value-evaluating-of-an-object-1998518.aspx</link><description>I know ruby treat an object as false whenever it is nil or false.
However, I wonder if there are any other ways to change this behavior.

For example, I define a class called AreYouOk.
class AreYouOk
      def initialize(ok)
            @xxxxxxxxxxx = ok
      end
end

x = AreYouOk.new(false)
puts &amp;quot;you are ok&amp;quot; if x

Since x isn't nil, ruby prints &amp;quot; you are ok&amp;quot;.
However, I want ruby to make the decision based on the @xxxxxxxxxxx instance
variable. Are there any ways to do that?

...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Truth-value-evaluating-of-an-object-1998518.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 23:30:30 GMT</pubDate></item><item><title>how modify $: permanently?</title><link>http://www.sagewire.org/ruby-programming/how-modify-permanently-1998826.aspx</link><description>Is there a way to add a path to $: permanently so I do not have to append
a path at the start of every script that needs it?
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/how-modify-permanently-1998826.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 22:37:17 GMT</pubDate></item><item><title>Error in Ruby text comparison?</title><link>http://www.sagewire.org/ruby-programming/Error-in-Ruby-text-comparison-1998402.aspx</link><description>'1sqHmb5b8G9mN' &amp;lt; '1Xv5LeB9bMdar'

Would not you think that is supposed to be TRUE ?

All my text editors and Excel and Numbers all sort it so that 1s...
comes before 1X...

But Ruby says the above comparison is false.

What am I missing?

-- gw
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Error-in-Ruby-text-comparison-1998402.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 22:15:40 GMT</pubDate></item><item><title>.each do |foo, bar|     what does bar do?</title><link>http://www.sagewire.org/ruby-programming/each-do-foo-bar-what-does-bar-do-1994907.aspx</link><description>&amp;quot;code_words.each do |real, code|
idea.gsub!( real, code )
end
You see the each method? The each method is all over in Ruby. It's
available for Arrays, Hashes, even Strings. Here, our code_words
dictionary is kept in a Hash. This each method will hurry through all
the pairs of the Hash, one dangerous word matched with its code word,
handing each pair to the gsub! method for the actual replacement.&amp;quot;

from page 33 of whys-poignant-guide-to-ruby.pdf
Is this similar to nested for statements...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/each-do-foo-bar-what-does-bar-do-1994907.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 21:36:59 GMT</pubDate></item><item><title>[QUIZ] Editing Text (#145)</title><link>http://www.sagewire.org/ruby-programming/QUIZ-Editing-Text-145-1997397.aspx</link><description>The three rules of Ruby Quiz:

1.  Please don't post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.

2.  Support Ruby Quiz by submitting ideas as often as you can:

http://www.rubyquiz.com/

3.  Enjoy!

Suggestion:  A [QUIZ] in the subject of emails about the problem helps everyone
on Ruby Talk follow the discussion.  Please reply to the original quiz message,
if you can.

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/QUIZ-Editing-Text-145-1997397.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 21:13:09 GMT</pubDate></item><item><title>Problem using FileUtils to sort JPEG files</title><link>http://www.sagewire.org/ruby-programming/Problem-using-FileUtils-to-sort-JPEG-files-1988387.aspx</link><description>This is an odd problem, I admit. I'm currently working on a short script
to sort a set of JPEGs by size, but right now I'm just trying to move
them from point A to point B (I'm still learning Ruby, so I do this to
try and figure things out before getting into the big stuff), and so far
I have gotten so far as:

####################CODE####################

#!/usr/bin/ruby -wd

require &amp;quot;RMagick&amp;quot;
require &amp;quot;fileutils&amp;quot;

Dir.chdir(ARGV[0])

for pix in Dir.glob(&amp;quot;*.{jpeg,jpg,png}&amp;quot;)
	file...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Problem-using-FileUtils-to-sort-JPEG-files-1988387.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 18:57:18 GMT</pubDate></item><item><title>A Little Ruby, A Lot of Objects</title><link>http://www.sagewire.org/ruby-programming/Little-Ruby-Lot-of-Objects-1998096.aspx</link><description>I just stumbled across this. It's an absolute beginning programmer's
tutorial (for programming and ruby), supposedly in the style of A
Little Lisper (or A Little Schemer)(I have not read either). Anyhow, I
have never seen it referenced anywhere.

A Little Ruby, A Lot of Objects
http://www.visibleworkings.com/little-ruby/-------------------------------------------
Daniel Brumbaugh Keeney
Devi Web Development
Devi.WebMaster@xxxxxxxxxxx
-------------------------------------------</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Little-Ruby-Lot-of-Objects-1998096.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 18:50:05 GMT</pubDate></item><item><title>open-uri + OpenSSL</title><link>http://www.sagewire.org/ruby-programming/openuri-OpenSSL-1998231.aspx</link><description>Hello,

I am usring open-uri to open an https:// link and when it tries to read
it, I get the 'connect' : certificate verify failed error. How can I
bypass this SSL verification?

Thanks,
M
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/openuri-OpenSSL-1998231.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 17:26:19 GMT</pubDate></item><item><title>Mac OS X Tiger comes with Tk?</title><link>http://www.sagewire.org/ruby-programming/Mac-OS-Tiger-comes-with-Tk-1977604.aspx</link><description>I thought it is said that Mac OS X Tiger comes with Tk?

when I do ruby

require 'tk'

it gives the following

dyld: NSLinkModule() error
dyld: Library not loaded: /usr/X11R6/lib/libX11.6.dylib
  Referenced from: /usr/lib/ruby/1.8/powerpc-darwin8.0/tcltklib.bundle
  Reason: image not found
Trace/BPT trap
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Mac-OS-Tiger-comes-with-Tk-1977604.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 16:59:39 GMT</pubDate></item><item><title>find all member in a class</title><link>http://www.sagewire.org/ruby-programming/find-all-member-in-class-1997068.aspx</link><description>how to find all members list(member functions &amp;amp; member variables for all
access specifiers like public, private and protected) ?
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/find-all-member-in-class-1997068.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 13:59:25 GMT</pubDate></item><item><title>Learning the fine points of Ruby</title><link>http://www.sagewire.org/ruby-programming/Learning-the-fine-points-of-Ruby-1859716.aspx</link><description>Hey all,
I adore Ruby. I love everything about it. The debugging, the  
community, the syntax....

But my code sorta looks like VBScript - simple and generic. I have  
seen some really great Ruby code - some I can understand, others I  
just can not wrap my mind around. But how do you learn to think like that?

Can anyone recommend a book or site that teaches you to write Ruby  
succinctly and rubily?

thanks,
aRi
--------------------------------------------|
If you're not living o...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Learning-the-fine-points-of-Ruby-1859716.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 13:45:16 GMT</pubDate></item><item><title>ActiveRecord / SQL Server / ADO</title><link>http://www.sagewire.org/ruby-programming/ActiveRecord-SQL-Server-ADO-1997869.aspx</link><description>I'm trying to use ActiveRecord with SQL Server and ADO in a regular ruby
script, but can not get it working.  I have seen a bunch of examples but
can not get them to work.

Here's what I have got:

require 'rubygems'
require 'active_record'
class TestMO [code]&amp;lt; ActiveRecord::Base

    ActiveRecord::Base.establish_connection(
        :adapter  =&amp;gt;[/code] &amp;quot;sqlserver&amp;quot;,
        :mode =&amp;gt;  &amp;quot;ado&amp;quot;,
        :database =&amp;gt;  &amp;quot;mydb&amp;quot;,
        :username =&amp;gt;  &amp;quot;user&amp;quot;,
        :password =&amp;gt;  &amp;quot;pass&amp;quot;
  ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/ActiveRecord-SQL-Server-ADO-1997869.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 09:35:05 GMT</pubDate></item><item><title>Garbled Email</title><link>http://www.sagewire.org/ruby-programming/Garbled-Email-1996592.aspx</link><description>Hi,

I seem to receive messages with garbled headers. Does anybode else
experience this?

Kind regards

robertSample:

                                          [code]&amp;lt;empty line&amp;gt;[/code]
Delivered-To: shortcutter@xxxxxxxxxxx
Received: by 10.142.158.20 with SMTP id g20cs16864wfe;
        Thu, 25 Oct 2007 14:29:55 -0700 (PDT)
Received: by 10.141.53.1 with SMTP id f1mr1200373rvk.1193347792451;
        Thu, 25 Oct 2007 14:29:52 -0700 (PDT)
Return-Path: [code]&amp;lt;ruby-talk-admin@xxxxxxxxx...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Garbled-Email-1996592.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 08:42:42 GMT</pubDate></item><item><title>Problem with RubyForge and gems</title><link>http://www.sagewire.org/ruby-programming/Problem-with-RubyForge-and-gems-1998193.aspx</link><description>All,

Just to let you know there is an unknown problem right now with the  
gems service on RubyForge that folks thought was Leopard related but  
its not...I get the same thing in Tiger (and other OSes may get the  
same):

gem search --remote jabber

*** REMOTE GEMS ***
Bulk updating Gem source index for: http://gems.rubyforge.org
ERROR:  While executing gem ... (TypeError)
     can not instantiate uninitialized class

We'll identify the problem as soon as is possible and fix it....</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Problem-with-RubyForge-and-gems-1998193.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 04:53:54 GMT</pubDate></item><item><title>ruby-opengl on a g4 mac 10.4</title><link>http://www.sagewire.org/ruby-programming/rubyopengl-on-g4-mac-104-1998141.aspx</link><description>irb(main):001:0&amp;gt; require 'rubygems'
=&amp;gt; true
irb(main):002:0&amp;gt; gem 'ruby-opengl'
=&amp;gt; true
irb(main):003:0&amp;gt; require 'gl'
LoadError: Failed to lookup Init function /usr/local/lib/ruby/gems/1.8/
gems/ruby-opengl-0.40.1/lib/gl.bundle
        from /usr/local/lib/ruby/gems/1.8/gems/ruby-opengl-0.40.1/lib/
gl.bundle
        from /usr/local/lib/ruby/site_ruby/1.8/rubygems/
custom_require.rb:32:in `require'
        from (irb):3
irb(main):004:0&amp;gt; require 'glut'
LoadError: Failed to lookup Init fu...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/rubyopengl-on-g4-mac-104-1998141.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 04:24:16 GMT</pubDate></item><item><title>Ruby Radius Dictionary</title><link>http://www.sagewire.org/ruby-programming/Ruby-Radius-Dictionary-1996957.aspx</link><description>Hie,

Im trying to communicate with radius server using example file from
ruby-radius-0.9.9 and encountered with this error

&amp;quot;/usr/lib/ruby/site_ruby/1.8/radius/dictionary.rb:294:in
`vsattr_numtype': undefined method `[]' for nil:NilClass (NoMethodError)
        from /usr/lib/ruby/site_ruby/1.8/radius/packet.rb:145:in
`unpack'
        from radiusclient.rb:50&amp;quot;

Can anyone help.

Thanks,
Aby Azid
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Ruby-Radius-Dictionary-1996957.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 02:30:52 GMT</pubDate></item><item><title>How can I 'Clear' a TkText...box???</title><link>http://www.sagewire.org/ruby-programming/How-can-Clear-TkTextbox-1997792.aspx</link><description>This is what I got ....i need to clear the big text box, when the user
hits the 'clear' button.

[code]&amp;lt;code&amp;gt;[/code]

irb

# Start up Tk with Ruby
require 'tk'

#def delete(first, last)
 #  @xxxxxxxxxxx(0, end)
#end

#def initialize

# Main Window
root = TkRoot.new {title &amp;quot;Homework #4&amp;quot;}

# Frames
left_frame = TkFrame.new(root).pack('side' =&amp;gt; 'left', 'padx' =&amp;gt; 10,
'pady' =&amp;gt; 10)

right_frame = TkFrame.new(root).pack('side' =&amp;gt; 'right', 'padx' =&amp;gt; 10,
'pady' =&amp;gt; 10, 'fill' =&amp;gt; '...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/How-can-Clear-TkTextbox-1997792.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 02:29:12 GMT</pubDate></item><item><title>cant seem to get system() &amp; pipe to work together</title><link>http://www.sagewire.org/ruby-programming/cant-seem-to-get-system-pipe-to-work-together-1996590.aspx</link><description>I am trying to run a command line utility which converts a wma file to
a mp3 (i want to be able to do this for batch files) using FFMpeg &amp;amp;
LAME. I am trying to run the following command from ruby:

&amp;quot;C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\ffmpeg.exe&amp;quot; - I &amp;quot;C:\Documents and Settings\dt\Desktop\my stuff\songs\Who The
\Quadrophenia\07-0 - Who The - Love Reign O'er Me.wma&amp;quot; -vn -f wav - |
&amp;quot;C:\Documents and Settings\dt\Desktop\my stuff\songs\wma\lame.exe&amp;quot; -V
6 - &amp;quot;C:\Documents an...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/cant-seem-to-get-system-pipe-to-work-together-1996590.aspx</guid><author>rss@sagewire.org</author><pubDate>Sat, 27 Oct 2007 01:46:26 GMT</pubDate></item><item><title>background on String#unpack?</title><link>http://www.sagewire.org/ruby-programming/background-on-Stringunpack-1997793.aspx</link><description>I'm just looking for historical context on this method. It looks like
one of those old-school Unix-isms that must have been incredibly
useful in the past but never comes up in the course of run-of-the-mill
Web programming. I'm pretty sure I first saw it ten years ago in Perl
and never once used it myself. I think I did copy/paste it in some
encryption code or something related, but I'm not sure. Just
wondering, what's it for? Who uses it, and why?

-- 
Giles Bowkett

Blog: http://gile...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/background-on-Stringunpack-1997793.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 22:46:31 GMT</pubDate></item><item><title>bash to ruby</title><link>http://www.sagewire.org/ruby-programming/bash-to-ruby-1992965.aspx</link><description>Hi people,

I'm not a ruby developer just yet, but I have been reading a couple of
in-depth references and I already like it... a lot.

Today I got, once again as usual, annoyed by having to get into cygwin
*just* to run build-related bash scripts from within windows. But I must
be developing some ruby cells in my blood already since I thought: that's
it... I'm rewritting them in ruby!

So, is there any guideline on how to port bash scripts to ruby?

TIA--
Fernando Cacciola
SciSoft...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/bash-to-ruby-1992965.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 22:39:55 GMT</pubDate></item><item><title>Overriding private methods</title><link>http://www.sagewire.org/ruby-programming/Overriding-private-methods-1997599.aspx</link><description>So I'm hacking on rails and in activerecord there are two methods that
have public and private versions.  I need to override the private
method.  How'd I go about doing that?

Chris</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Overriding-private-methods-1997599.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 21:38:18 GMT</pubDate></item><item><title>Rounding to the nearest 0.05</title><link>http://www.sagewire.org/ruby-programming/Rounding-to-the-nearest-005-1997868.aspx</link><description>Hey guys.

Having difficulty figuring out where to begin with trying to round a
calculation to the nearest 0.05. Can anyone offer any suggestions
please?

Kind Regards

Pete
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Rounding-to-the-nearest-005-1997868.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 21:14:48 GMT</pubDate></item><item><title>Can class methods be in a module?</title><link>http://www.sagewire.org/ruby-programming/Can-class-methods-be-in-module-1988324.aspx</link><description>Is it possible to put a class method in a module, for example:

module FtpClientMod
  def self.do_send(file_template, show_progress)

and include it in a class as follows?

require 'ftpclientmod'

class FtpClient
  include FtpClientMod

When I try this I get an error that the method cannot be found.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Can-class-methods-be-in-module-1988324.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 20:15:57 GMT</pubDate></item><item><title>Ruby TK</title><link>http://www.sagewire.org/ruby-programming/Ruby-TK-1996881.aspx</link><description>i know im doing alot wrong, but I need all the help I can
get...so....plz spare the time, thanks

here is what I got ---

[code]&amp;lt;code&amp;gt;[/code]
irb

# Start up Tk with Ruby
require 'tk'
root = TkRoot.new {title &amp;quot;Homework #4&amp;quot;}

top = TkFrame.new(root) { relief 'raised'; border 5 }

TkButton.new(top) do
   text &amp;quot;Clear&amp;quot;
   command { delete(0,0, end) }
   pack('side' =&amp;gt; 'left', 'padx' =&amp;gt; 15, 'pady' =&amp;gt; 15)
end
TkButton.new(top) do
   text &amp;quot;Cancel&amp;quot;
   command { exit }
   pack('side...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Ruby-TK-1996881.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 18:40:49 GMT</pubDate></item><item><title>A Ruby/Rails bibliography</title><link>http://www.sagewire.org/ruby-programming/RubyRails-bibliography-1980287.aspx</link><description>Howdy all,
I have noticed an influx of &amp;quot;What book should I buy?&amp;quot; questions lately,
so I thought I'd put together a number of bibliographies/curriculums
based on experience, role, and so on.  You can view them at:
http://blog.mrneighborly.com/2007/10/ruby-and-rails-bibliography-of-sorts.html

I want this to be a resource to point people to, so if one of these
becomes out of date or you've a better suggestion, then please tell
me.  I will try my best to keep it up to date.

Thanks!
Jere...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/RubyRails-bibliography-1980287.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 18:16:42 GMT</pubDate></item><item><title>Need help understanding metaclassing</title><link>http://www.sagewire.org/ruby-programming/Need-help-understanding-metaclassing-1996250.aspx</link><description>I have been reading lots of Ruby tutorials trying to figure out
metaclassing - the one that got me closest was Why?s poignant guide to
Ruby, but I'm still struggling over some of the Ruby-specific syntax.

I attached a class I have been writing that needs to be highly extensible,
wrote in message to try to understand each part of
it. If any part of the comments are wrong, it'd be nice to have my
misconceptions cleared up. I have only been using Ruby for a day and, wow.

Here's the part ...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Need-help-understanding-metaclassing-1996250.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 18:15:00 GMT</pubDate></item><item><title>Skip the first invocation e.g. skip_first { foo }</title><link>http://www.sagewire.org/ruby-programming/Skip-the-first-invocation-eg-skipfirst-foo-1996667.aspx</link><description>Consider the following code:

first = true
3.times do
  if first
    first = false
  else
    puts 'foo'
  end
  ...
end

I'd like to be able to do the following instead:

3.times do
  skip_first { puts 'foo' }
  ...
end

However, I'm pretty sure that's impossible - especially when you
consider running the above code twice'd require state to be
initialized twice, so I expect some initialization outside the loop is
necessary.

So, what's the most elegant way to solve this?...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Skip-the-first-invocation-eg-skipfirst-foo-1996667.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 17:23:26 GMT</pubDate></item><item><title>how to use JAVAscript in rhtml</title><link>http://www.sagewire.org/ruby-programming/how-to-use-JAVAscript-in-rhtml-1996004.aspx</link><description>hello,

I needed to know a JAVAscript function which I can use for focusing my
cursor on the first text field of a given page.

That is as soon as I load a page, my cursor should start blinking in the
first text field

Regards

Advait
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/how-to-use-JAVAscript-in-rhtml-1996004.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 16:27:51 GMT</pubDate></item><item><title>What's in YOUR Ruby???  Could Ruby ever be a g.p. dev language?</title><link>http://www.sagewire.org/ruby-programming/Whats-in-YOUR-Ruby-Could-Ruby-ever-be-gp-1996589.aspx</link><description>Hi Folks,
I just finished my first 40+ hours with plain old Ruby (without rails
for now), and I love this stuff!!  Everyone relates it to smalltalk,
and that seems mostly true.

Being a Certified Old Dude (and sometimes a quant-heavy economist), it
does remind me of the pleasurable experience of learning serious
programming tripping along with smalltalk on one end and various lisp
incarnations on the other, circa xerox/parc days.  So...

What are you doing with ruby?
What'd you *like*...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Whats-in-YOUR-Ruby-Could-Ruby-ever-be-gp-1996589.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 16:07:22 GMT</pubDate></item><item><title>a=Time.now;(Time.parse(a.to_s)-a)!=0</title><link>http://www.sagewire.org/ruby-programming/aTimenowTimeparseatosa0-1996956.aspx</link><description>Hmm. Ooh yuck.

Try this...

$ ruby -r time -e 'a=Time.now;p a-Time.parse(a.to_s)'
0.00848
$ ruby -r time -e 'a=Time.now;p a-Time.parse(a.to_s)'
0.446575
$ ruby -r time -e 'a=Time.now;p a-Time.parse(a.to_s)'
0.142796

ie. Time#to_s does not represent the full precision of the internal
time format.

Bit of a bummer if you want to round trip an exact timestamp onto disk
and back.

This does it right...
$ ruby -e 'a=Time.now;p a-Marshal::load(Marshal::dump(a))'
0.0..but look at w...</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/aTimenowTimeparseatosa0-1996956.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 16:03:33 GMT</pubDate></item><item><title>Ruby and C# Integration</title><link>http://www.sagewire.org/ruby-programming/Ruby-and-Integration-1995107.aspx</link><description>Does anyone know of a way or have any links for how to integrate c# and
ruby?  I'd like to be able to write ruby scripts for testing and have
them talk to my c# program.

Thanks.
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/Ruby-and-Integration-1995107.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 10:15:19 GMT</pubDate></item><item><title>whole class into a text file...</title><link>http://www.sagewire.org/ruby-programming/whole-class-into-text-file-1997069.aspx</link><description>Is there any method or idea to get whole class into a text file ?
-- 
Posted via http://www.ruby-forum.com/.</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/whole-class-into-text-file-1997069.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 08:54:10 GMT</pubDate></item><item><title>State of the art in setup.rb land?</title><link>http://www.sagewire.org/ruby-programming/State-of-the-art-in-setuprb-land-1997067.aspx</link><description>Greetings,

I have been a little slow to hitch onto the 'gem' and 'rake'
train, but I'm creating a new ruby C extension I'd like to
release as a gem.

The tools I'm familiar with are mkmf.rb and setup.rb.

I have gotten the sense that mkmf.rb may still be used, but
that setup.rb may have been replaced by some more powerful
rake-based automatic gem building solution?

Anyway, any tips, hints, or links'd be appreciated!Thanks,

Bill</description><guid isPermaLink="true">http://www.sagewire.org/ruby-programming/State-of-the-art-in-setuprb-land-1997067.aspx</guid><author>rss@sagewire.org</author><pubDate>Fri, 26 Oct 2007 06:32:49 GMT</pubDate></item></channel></rss>