<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Parallelcoding.com &#187; Ruby</title>
	<atom:link href="http://www.parallelcoding.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parallelcoding.com</link>
	<description>Intelligent, Efficient, Parallel, and Sustainable Code</description>
	<lastBuildDate>Thu, 02 Feb 2012 15:17:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Ruby Shoes Build Error On Ubuntu</title>
		<link>http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/</link>
		<comments>http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/#comments</comments>
		<pubDate>Wed, 19 Mar 2008 05:12:32 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/?p=16</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/" title="Ruby Shoes Build Error On Ubuntu"></a>When I tried to compile Ruby Shoes I got the following error: 1 2 3 4 5 6 7 8 CC shoes/app.c In file included from /usr/include/signal.h:333, from /usr/include/sys/ucontext.h:23, from /usr/include/ucontext.h:27, from /usr/lib/ruby/1.8/i486-linux/node.h:378, from shoes/app.c:11: /usr/include/bits/sigcontext.h:28:29: error: asm/sigcontext.h: No such &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/" title="Ruby Shoes Build Error On Ubuntu"></a><p>When I tried to compile Ruby Shoes I got the following error:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;">CC shoes<span style="color: #000000; font-weight: bold;">/</span>app.c
In <span style="color: #c20cb9; font-weight: bold;">file</span> included from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>signal.h:<span style="color: #000000;">333</span>,
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>ucontext.h:<span style="color: #000000;">23</span>,
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>ucontext.h:<span style="color: #000000;">27</span>,
from <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>i486-linux<span style="color: #000000; font-weight: bold;">/</span>node.h:<span style="color: #000000;">378</span>,
from shoes<span style="color: #000000; font-weight: bold;">/</span>app.c:<span style="color: #000000;">11</span>:
<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>bits<span style="color: #000000; font-weight: bold;">/</span>sigcontext.h:<span style="color: #000000;">28</span>:<span style="color: #000000;">29</span>: error: asm<span style="color: #000000; font-weight: bold;">/</span>sigcontext.h: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory
<span style="color: #c20cb9; font-weight: bold;">make</span>: <span style="color: #000000; font-weight: bold;">***</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>shoes<span style="color: #000000; font-weight: bold;">/</span>app.o<span style="color: #7a0874; font-weight: bold;">&#93;</span> Error <span style="color: #000000;">1</span></pre></td></tr></table></div>

<p>The fix is this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span>  asm-i386<span style="color: #000000; font-weight: bold;">/</span> asm</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2008/03/19/ruby-shoes-build-error-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Import CSV Using Rails Migration</title>
		<link>http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/</link>
		<comments>http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/#comments</comments>
		<pubDate>Wed, 10 Oct 2007 21:57:00 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[CSV]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/2007/10/10/import-csv-using-rails-migration/</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/" title="Import CSV Using Rails Migration"></a>Reposted from Rails Weenie: Install FasterCSV ('gem install fasterCSV') The code to use inside the migration is similar to: 1 2 3 4 FasterCSV.foreach&#40;&#34;#{RAILS_ROOT}/lib/symbols_database/security_list.csv&#34;, :row_sep =&#62; &#34;r&#34;&#41; do &#124;row&#124; field1,field2,field3 = row Foo.create&#40;:field1 =&#62; field1, :field2 =&#62; field2, :field3 =&#62; &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/" title="Import CSV Using Rails Migration"></a><p>Reposted from Rails Weenie:</p>
<p>Install FasterCSV ('gem install fasterCSV')</p>
<p>The code to use inside the migration is similar to:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;">FasterCSV.<span style="color:#9900CC;">foreach</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{RAILS_ROOT}/lib/symbols_database/security_list.csv&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:row_sep</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">&quot;r&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>row<span style="color:#006600; font-weight:bold;">|</span>
    field1,field2,field3 = row
    Foo.<span style="color:#9900CC;">create</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:field1</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> field1, <span style="color:#ff3333; font-weight:bold;">:field2</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> field2, <span style="color:#ff3333; font-weight:bold;">:field3</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> field3<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2007/10/10/import-csv-using-rails-migration/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Comparing Directories Ruby Style</title>
		<link>http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/</link>
		<comments>http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 03:07:00 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/2007/10/08/comparing-directories-ruby-style/</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/" title="Comparing Directories Ruby Style"></a>I recently needed to recursively compare 2 directories by filename. Here's the solution: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 require 'ftools' &#8230;<p class="read-more"><a href="http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/" title="Comparing Directories Ruby Style"></a><p>I recently needed to recursively compare 2 directories by filename. Here's the solution:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'ftools'</span>
srcDir = <span style="color:#996600;">&quot;/home/Music/&quot;</span>
destDir = <span style="color:#996600;">&quot;/home/Music/iTunes/iTunes Music&quot;</span>
&nbsp;
mHash = <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">new</span>
iHash = <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">new</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#Add all files to hash</span>
<span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span>srcDir <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/**/*.mp3'</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>path<span style="color:#006600; font-weight:bold;">|</span>    
    mHash<span style="color:#006600; font-weight:bold;">&#91;</span>path.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">last</span><span style="color:#006600; font-weight:bold;">&#93;</span> = pathend
&nbsp;
    <span style="color:#008000; font-style:italic;">#Add all files to second hash</span>
    <span style="color:#CC00FF; font-weight:bold;">Dir</span><span style="color:#006600; font-weight:bold;">&#91;</span>destDir <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">&quot;/**/*.mp3&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">each</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>path<span style="color:#006600; font-weight:bold;">|</span>    
        iHash<span style="color:#006600; font-weight:bold;">&#91;</span>path.<span style="color:#CC0066; font-weight:bold;">split</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'/'</span><span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">last</span><span style="color:#006600; font-weight:bold;">&#93;</span> = path
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Source # Files: &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> mHash.<span style="color:#9900CC;">length</span>.<span style="color:#9900CC;">to_sputs</span> <span style="color:#996600;">&quot;Dest # Files: &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> iHash.<span style="color:#9900CC;">length</span>.<span style="color:#9900CC;">to_s</span>
&nbsp;
<span style="color:#008000; font-style:italic;">#Compare Hashes and copy Any data</span>
 <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">each_key</span> <span style="color:#9966CC; font-weight:bold;">do</span> <span style="color:#006600; font-weight:bold;">|</span>key<span style="color:#006600; font-weight:bold;">|</span>
    <span style="color:#9966CC; font-weight:bold;">if</span> iHash<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span> == <span style="color:#0000FF; font-weight:bold;">nil</span>  
        <span style="color:#CC0066; font-weight:bold;">puts</span> <span style="color:#996600;">&quot;Copying &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> mHash<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span> <span style="color:#006600; font-weight:bold;">+</span><span style="color:#996600;">&quot; to &quot;</span> <span style="color:#006600; font-weight:bold;">+</span> destDir
        <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">copy</span><span style="color:#006600; font-weight:bold;">&#40;</span>mHash<span style="color:#006600; font-weight:bold;">&#91;</span>key<span style="color:#006600; font-weight:bold;">&#93;</span>,destDir<span style="color:#006600; font-weight:bold;">+</span><span style="color:#996600;">&quot;/&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>   
    <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2007/10/08/comparing-directories-ruby-style/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Superators</title>
		<link>http://www.parallelcoding.com/2007/09/13/superators/</link>
		<comments>http://www.parallelcoding.com/2007/09/13/superators/#comments</comments>
		<pubDate>Thu, 13 Sep 2007 15:51:00 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Superators]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/2007/09/13/superators/</guid>
		<description><![CDATA[<a href="http://www.parallelcoding.com/2007/09/13/superators/" title="Superators"></a>This is just to cool. Superators are a way to overload the traditional, non logical ruby operators. Check it out.]]></description>
			<content:encoded><![CDATA[<a href="http://www.parallelcoding.com/2007/09/13/superators/" title="Superators"></a><p><a href="http://jicksta.com/articles/2007/08/29/superators-add-new-operators-to-ruby">This</a> is just to cool. Superators are a way to overload the traditional, non logical ruby operators. Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2007/09/13/superators/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

