<?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/"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>ahabman</title>
	<atom:link href="http://www.ahabman.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ahabman.com/blog</link>
	<description></description>
	<lastBuildDate>Sun, 23 May 2010 03:55:18 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.4" -->
		<copyright>2007-2008 </copyright>
		<managingEditor>andy@ahabman.com (ahabman)</managingEditor>
		<webMaster>andy@ahabman.com (ahabman)</webMaster>
		<category>music</category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary></itunes:summary>
		<itunes:author>ahabman</itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name>ahabman</itunes:name>
			<itunes:email>andy@ahabman.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="" />
		<image>
			<url></url>
			<title>ahabman</title>
			<link>http://www.ahabman.com/blog</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>nomad</title>
		<link>http://www.ahabman.com/blog/2010/04/nomad/</link>
		<comments>http://www.ahabman.com/blog/2010/04/nomad/#comments</comments>
		<pubDate>Sat, 03 Apr 2010 01:15:37 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=94</guid>
		<description><![CDATA[A little flavor of Tinariwen. Tuned D G D G A D.
]]></description>
			<content:encoded><![CDATA[<p>A little flavor of <a href="http://www.tinariwen.com/">Tinariwen</a>. Tuned D G D G A D.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2010/04/nomad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.ahabman.com/blog/wp-content/uploads/nomad.mp3" length="7348805" type="audio/mpeg" />
		<enclosure url="http://www.ahabman.com/blog/podpress_trac/feed/94/0/nomad.mp3" length="1" type="audio/mpeg"/>
<itunes:duration>00:01:01</itunes:duration>
		<itunes:subtitle>A little flavor of Tinariwen. Tuned D G D G A D. </itunes:subtitle>
		<itunes:summary>A little flavor of Tinariwen. Tuned D G D G A D.</itunes:summary>
		<itunes:keywords>music</itunes:keywords>
		<itunes:author>andy@ahabman.com</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Visual Metronome</title>
		<link>http://www.ahabman.com/blog/2009/09/visual-metronome/</link>
		<comments>http://www.ahabman.com/blog/2009/09/visual-metronome/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 02:19:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=67</guid>
		<description><![CDATA[

/*
 * metronome
 */
int stage = 600;
int mains = int(random(3,9) );
int subs = int(random(3,6) );
float moon_size = 3;
int bpm = 60;
int active_main = 0;
int active_sub = 0;
color main_color = #292B89;
color first_color = #1A1B55;
color active_color = 0x95FFFFFF;
int my_frame_rate = 12;
float bps = float(bpm) / 60 ;

void setup() {
  size(stage, stage);
  frameRate(my_frame_rate);
  noStroke();
}
void draw() [...]]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://www.ahabman.com/blog/wp-content/uploads/metronome-js/metronome.html" width="650" height="850"  style="border:none;"></iframe></p>
<pre class="brush: javascript;">
/*
 * metronome
 */
int stage = 600;
int mains = int(random(3,9) );
int subs = int(random(3,6) );
float moon_size = 3;
int bpm = 60;
int active_main = 0;
int active_sub = 0;
color main_color = #292B89;
color first_color = #1A1B55;
color active_color = 0x95FFFFFF;
int my_frame_rate = 12;
float bps = float(bpm) / 60 ;

void setup() {
  size(stage, stage);
  frameRate(my_frame_rate);
  noStroke();
}
void draw() {
  background(#989898);
  if( frameCount % (my_frame_rate/bps) &amp;lt; 1 ){
    active_main+=1;
    if(active_main&amp;gt;=mains){
      active_main=0;
    }
  }
  if( frameCount % (my_frame_rate/bps/subs) &amp;lt; 1 ){
    active_sub+=1;
    if(active_sub==subs){
      active_sub=0;
    }
  }
  Circle a = new Circle(width/2, height/2, stage/2, mains);
  a.make_moons( active_main );
  a.moons[active_main].make_moons( active_sub );
}
void mouseMoved(){
  mains = 2 + mouseX /(stage/10);
  moon_size = mains/1.555;
  active_main=0;
}
class Circle{
  float r, x, y;
  int active_moon, each_angle, sections;
  Circle moons[] = new Circle[23];

  Circle(float x_init,float y_init,float r_init, int divisions_init){
    x = x_init;
    y = y_init;
    r = r_init;
    sections = divisions_init;
    each_angle = 360 / sections;
  }
  void make(){
    ellipse(x, y, r, r);
  }
  void make_moons( int active_moon ){
    int angle = each_angle;
    for(int i = 0; i &amp;lt; sections; i+=1 ){
      float moon_x = x + cos(radians(angle)) * (r/2);
      float moon_y = y + sin(radians(angle)) * (r/2);
      moons[i] = new Circle(moon_x, moon_y, r / 4, subs);
      if(i==active_moon){fill(active_color);}else if(i==0){fill(first_color);} else{fill(main_color);} // HIGHLIGHT FIRST &amp;amp; ACTIVE MOON
      moons[i].make();
      angle = angle + each_angle;
    }
  }
}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2009/09/visual-metronome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Splash</title>
		<link>http://www.ahabman.com/blog/2009/06/splash/</link>
		<comments>http://www.ahabman.com/blog/2009/06/splash/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 12:59:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[music]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=53</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2009/06/splash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<enclosure url="http://www.ahabman.com/blog/podpress_trac/feed/53/0/Splash.mp3" length="1" type="audio/mpeg"/>
<itunes:duration>00:01:01</itunes:duration>
		<itunes:subtitle>Splash</itunes:subtitle>
		<itunes:summary></itunes:summary>
		<itunes:keywords>music</itunes:keywords>
		<itunes:author>andy@ahabman.com</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Ruby Duration</title>
		<link>http://www.ahabman.com/blog/2009/06/ruby-duration/</link>
		<comments>http://www.ahabman.com/blog/2009/06/ruby-duration/#comments</comments>
		<pubDate>Fri, 12 Jun 2009 13:02:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=39</guid>
		<description><![CDATA[[download id="1" format="1"]
Duration.new recieves a string describing a duration of time, and converts it into:  seconds, and a standard readable format.
Or, you can pass Duration.new an integer representing seconds, and receive the same standard readable format.
Usage:
Passing a String

duration = Duration.new(&#34;2weeks 8 hr 30m&#34;)
duration.seconds  # =&#62; 1240200
duration.readable  # =&#62; &#34;2 weeks, 8 hours [...]]]></description>
			<content:encoded><![CDATA[<p>[download id="1" format="1"]</p>
<p>Duration.new recieves a string describing a duration of time, and converts it into:  seconds, and a standard readable format.<br />
Or, you can pass Duration.new an integer representing seconds, and receive the same standard readable format.</p>
<p>Usage:</p>
<p>Passing a String</p>
<pre class="brush: ruby;">
duration = Duration.new(&quot;2weeks 8 hr 30m&quot;)
duration.seconds  # =&gt; 1240200
duration.readable  # =&gt; &quot;2 weeks, 8 hours and 30 mins&quot;
</pre>
<p>Passing an Fixnum (of seconds)</p>
<pre class="brush: ruby;">
duration = Duration.new(1240200)
duration.readable  # =&gt; &quot;2 weeks, 8 hours and 30 mins&quot;
</pre>
<p>Example valid input strings<br />
&#8220;2 weeks&#8221;, &#8220;2wks&#8221;, &#8220;2w&#8221;,<br />
&#8220;8h&#8221;, &#8220;8 hrs&#8221;,&#8221;8 hours&#8221;,<br />
&#8220;30m&#8221;, &#8220;0:30&#8243;, &#8220;30 minutes&#8221;, &#8220;30min&#8221;,<br />
&#8220;2 weeks, 8 hours and 30 minutes&#8221;, &#8220;2w 8h 30m&#8221;,  &#8220;2w 8:30&#8243;,<br />
&#8220;4 hours 30 minutes&#8221;, &#8220;4 hours and 30m&#8221;, &#8220;4h 30min&#8221;, &#8220;4:30&#8243;, &#8220;4.5&#8243;,  &#8220;4.50&#8243;, &#8220;4h, 30 min&#8221;, &#8220;4.5 hours&#8221;, &#8220;4.50h&#8221;</p>
<p>http://ahabman.com added functionallity, extended and mashed-up  http://stackoverflow.com/questions/657309/how-to-parse-days-hours-minutes-seconds-in-ruby  and  http://www.postal-code.com/binarycode/2007/04/04/english-friendly-timespan/</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2009/06/ruby-duration/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>rails template</title>
		<link>http://www.ahabman.com/blog/2009/03/rails-template/</link>
		<comments>http://www.ahabman.com/blog/2009/03/rails-template/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 04:14:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=37</guid>
		<description><![CDATA[Usage $ rails app_name -m ./ahabman_template.rb


run &#34;rm README&#34;
run &#34;rm public/index.html&#34;
run &#34;rm public/favicon.ico&#34;
run &#34;rm public/robots.txt&#34;
run &#34;rm -f public/javascripts/*&#34;

gem 'ruby-openid', :lib =&#62; 'openid'
rake(&#34;gems:install&#34;, :sudo =&#62; true)

plugin &#34;kamui_restful_authentication&#34;, :git =&#62; 'git://github.com/kamui/restful-authentication.git'
plugin 'exception_notifier', :git =&#62; 'git://github.com/rails/exception_notification.git'
plugin 'open_id_authentication', :git =&#62; 'git://github.com/rails/open_id_authentication.git'
#plugin 'asset_packager', :git =&#62; 'http://synthesis.sbecker.net/pages/asset_packager'
plugin 'role_requirement', :git =&#62; 'git://github.com/timcharper/role_requirement.git'
#plugin 'acts_as_taggable_redux', :git =&#62; 'http://github.com/geemus/acts_as_taggable_redux/tree/master'
#plugin 'restful-authentication', :git =&#62; 'git://github.com/technoweenie/restful-authentication.git'

generate(&#34;authenticated user sessions --include-activation [...]]]></description>
			<content:encoded><![CDATA[<p>Usage $ rails app_name -m ./ahabman_template.rb</p>
<pre class="brush: ruby;">

run &quot;rm README&quot;
run &quot;rm public/index.html&quot;
run &quot;rm public/favicon.ico&quot;
run &quot;rm public/robots.txt&quot;
run &quot;rm -f public/javascripts/*&quot;

gem 'ruby-openid', :lib =&gt; 'openid'
rake(&quot;gems:install&quot;, :sudo =&gt; true)

plugin &quot;kamui_restful_authentication&quot;, :git =&gt; 'git://github.com/kamui/restful-authentication.git'
plugin 'exception_notifier', :git =&gt; 'git://github.com/rails/exception_notification.git'
plugin 'open_id_authentication', :git =&gt; 'git://github.com/rails/open_id_authentication.git'
#plugin 'asset_packager', :git =&gt; 'http://synthesis.sbecker.net/pages/asset_packager'
plugin 'role_requirement', :git =&gt; 'git://github.com/timcharper/role_requirement.git'
#plugin 'acts_as_taggable_redux', :git =&gt; 'http://github.com/geemus/acts_as_taggable_redux/tree/master'
#plugin 'restful-authentication', :git =&gt; 'git://github.com/technoweenie/restful-authentication.git'

generate(&quot;authenticated user sessions --include-activation --include-forgot-password --email-as-login&quot;)
generate(&quot;roles&quot;, &quot;Role User&quot;)

#rake('acts_as_taggable:db:create')
rake(&quot;open_id_authentication:db:create&quot;)
rake('db:migrate')

route &quot;map.root :controller =&gt; 'sessions', :action =&gt; 'signup' &quot;

run &quot;echo generated from ahabman_template &gt; README&quot;
run &quot;cp config/database.yml config/example_database.yml&quot;

#if yes?(&quot;Do you want this thing?&quot;)
# ...
#end

#my_var = ask(&quot;was up&quot;)
#generate :something, my_var

puts &quot;SUCCESS!&quot;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2009/03/rails-template/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby on rails &#8211; has and belongs to many view plugin</title>
		<link>http://www.ahabman.com/blog/2008/10/ruby-on-rails-has-and-belongs-to-many-view-plugin/</link>
		<comments>http://www.ahabman.com/blog/2008/10/ruby-on-rails-has-and-belongs-to-many-view-plugin/#comments</comments>
		<pubDate>Thu, 16 Oct 2008 12:59:27 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=35</guid>
		<description><![CDATA[So I&#8217;ll never have to write another has_and_belongs_to_many view again, here&#8217;s a plugin that dynamically makes 2 &#60;ul&#62; lists which you drag and drop both ways to manage the association.
http://svn.ahabman.com/public/many_to_many_view/
From the readme:
Assumming you have an @project var and you want to associate people with it.
&#60;div id="m2m_container"&#62;
&#60;%= render :partial =&#62; "shared/m2m", :locals =&#62; {
:thing =&#62; @project,
:association [...]]]></description>
			<content:encoded><![CDATA[<p>So I&#8217;ll never have to write another has_and_belongs_to_many view again, here&#8217;s a plugin that dynamically makes 2 &lt;ul&gt; lists which you drag and drop both ways to manage the association.</p>
<p><a href="http://svn.ahabman.com/public/many_to_many_view/">http://svn.ahabman.com/public/many_to_many_view/</a></p>
<p>From the readme:</p>
<p>Assumming you have an @project var and you want to associate people with it.</p>
<pre>&lt;div id="m2m_container"&gt;</pre>
<pre>&lt;%= render :partial =&gt; "shared/m2m", :locals =&gt; {</pre>
<pre>:thing =&gt; @project,</pre>
<pre>:association =&gt; 'people',</pre>
<pre>:association_attr =&gt; 'first_name' }   %&gt;</pre>
<pre>&lt;/div&gt;</pre>
<p>:thing take the current object<br />
:association takes the pluralized association, a string.<br />
:association_attr takes the attribute of the associated object that will be displayed.</p>
<p><a href="http://www.ahabman.com/blog/wp-content/uploads/2008/10/many-to-many-view-plugin.png"><img class="alignnone size-medium wp-image-36" title="many-to-many-view-plugin" src="http://www.ahabman.com/blog/wp-content/uploads/2008/10/many-to-many-view-plugin.png" alt="" width="471" height="253" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2008/10/ruby-on-rails-has-and-belongs-to-many-view-plugin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You can&#8217;t use class variables in rails.</title>
		<link>http://www.ahabman.com/blog/2008/10/you-cant-use-class-variables-in-rails/</link>
		<comments>http://www.ahabman.com/blog/2008/10/you-cant-use-class-variables-in-rails/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 12:51:12 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=34</guid>
		<description><![CDATA[You can&#8217;t use class variables in rails.  Unless you&#8217;d like to develop in production mode (specifically with config.cache_classes = true).  In development mode all classes are reloaded on each request, which clears all class variables.
I had the perfect place to use them &#8211; while running a mass synchronization, and needing to store the timestamp (I [...]]]></description>
			<content:encoded><![CDATA[<p>You can&#8217;t use class variables in rails.  Unless you&#8217;d like to develop in production mode (specifically with config.cache_classes = true).  In development mode all classes are reloaded on each request, which clears all class variables.</p>
<p>I had the perfect place to use them &#8211; while running a mass synchronization, and needing to store the timestamp (I couldn&#8217;t use the latest last_updated from each record).  It worked perfect in ./script/console but failed entirely through the browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2008/10/you-cant-use-class-variables-in-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ruby csv to structured hash</title>
		<link>http://www.ahabman.com/blog/2008/09/ruby-csv-to-structured-hash/</link>
		<comments>http://www.ahabman.com/blog/2008/09/ruby-csv-to-structured-hash/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 20:29:02 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=31</guid>
		<description><![CDATA[I had a csv like this:



object
color
flavor
shape


apple
red
sweet
round


banana
yellow
sweet
long


lemon
yellow
sour
round



and I wanted a ruby hash structured like this:

{
'apple'=&#62; { 'color'=&#62;'red',  'flavor'=&#62;'sweet', 'shape'=&#62;'round'},
'banana'=&#62; {  'color'=&#62;'yellow',  'flavor'=&#62;'sweet', 'shape'=&#62;'long'},
'lemon'=&#62; {   'color'=&#62;'yellow',  'flavor'=&#62;'sour', 'shape'=&#62;'round'}
}

So I wrote this, which does the job:

require &#34;faster_csv&#34;

def csv_to_structured_hash
	arr_of_arrs = FasterCSV.read( 'your.csv' )
	stuff = {}
	header = arr_of_arrs.shift
		arr_of_arrs.each_with_index do &#124;row, i&#124;
		thing = { row[0] =&#62; {} }
			header.each_with_index do &#124;col, header_index&#124;
			thing[ [...]]]></description>
			<content:encoded><![CDATA[<p>I had a csv like this:</p>
<table style="height: 84px;" border="1" width="166">
<tbody>
<tr>
<th>object</th>
<th>color</th>
<th>flavor</th>
<th>shape</th>
</tr>
<tr>
<td>apple</td>
<td>red</td>
<td>sweet</td>
<td>round</td>
</tr>
<tr>
<td>banana</td>
<td>yellow</td>
<td>sweet</td>
<td>long</td>
</tr>
<tr>
<td>lemon</td>
<td>yellow</td>
<td>sour</td>
<td>round</td>
</tr>
</tbody>
</table>
<p>and I wanted a ruby hash structured like this:</p>
<pre class="brush: ruby;">
{
'apple'=&gt; { 'color'=&gt;'red',  'flavor'=&gt;'sweet', 'shape'=&gt;'round'},
'banana'=&gt; {  'color'=&gt;'yellow',  'flavor'=&gt;'sweet', 'shape'=&gt;'long'},
'lemon'=&gt; {   'color'=&gt;'yellow',  'flavor'=&gt;'sour', 'shape'=&gt;'round'}
}
</pre>
<p>So I wrote this, which does the job:</p>
<pre class="brush: ruby;">
require &quot;faster_csv&quot;

def csv_to_structured_hash
	arr_of_arrs = FasterCSV.read( 'your.csv' )
	stuff = {}
	header = arr_of_arrs.shift
		arr_of_arrs.each_with_index do |row, i|
		thing = { row[0] =&gt; {} }
			header.each_with_index do |col, header_index|
			thing[ row[0] ][ header[header_index] ] = row[ header_index]
			end
		stuff.update( thing )
		end
	return stuff
end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2008/09/ruby-csv-to-structured-hash/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django Tango</title>
		<link>http://www.ahabman.com/blog/2008/07/django-tango/</link>
		<comments>http://www.ahabman.com/blog/2008/07/django-tango/#comments</comments>
		<pubDate>Fri, 04 Jul 2008 17:21:05 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[music]]></category>
		<category><![CDATA[acoustic]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[grisman]]></category>
		<category><![CDATA[gypsy]]></category>
		<category><![CDATA[jazz]]></category>
		<category><![CDATA[mandolin]]></category>
		<category><![CDATA[tango]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=29</guid>
		<description><![CDATA[A Django Reinhardt and David Grisman fusion.
multitrack mandolins, nylon guitars,  and percusion.
]]></description>
			<content:encoded><![CDATA[<p>A Django Reinhardt and David Grisman fusion.</p>
<p>multitrack mandolins, nylon guitars,  and percusion.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2008/07/django-tango/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<enclosure url="http://www.ahabman.com/blog/podpress_trac/feed/29/0/Andy%20Weber%20-%20Django%20Tango.mp3" length="1" type="audio/mpeg"/>
<itunes:duration>00:01:01</itunes:duration>
		<itunes:subtitle>A Django Reinhardt and David Grisman fusion.

multitrack mandolins, nylon guitars,nbsp; and percusion. </itunes:subtitle>
		<itunes:summary>A Django Reinhardt and David Grisman fusion.

multitrack mandolins, nylon guitars,nbsp; and percusion.</itunes:summary>
		<itunes:keywords>music</itunes:keywords>
		<itunes:author>andy@ahabman.com</itunes:author>
		<itunes:explicit>no</itunes:explicit>
		<itunes:block>No</itunes:block>
	</item>
		<item>
		<title>Ruby conversion module</title>
		<link>http://www.ahabman.com/blog/2008/07/ruby-conversion-module/</link>
		<comments>http://www.ahabman.com/blog/2008/07/ruby-conversion-module/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 12:52:11 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.ahabman.com/blog/?p=26</guid>
		<description><![CDATA[This is a ruby module useful for conversions dealing with length, weight, torque.

 module Convert 

   def Convert.number_with_precision(number, precision=2)
     &#34;%01.#{precision}f&#34; % number
   rescue
     number
   end 

   def Convert.mm_to_in(mm, precision=2)
     number_with_precision(mm * 0.03937, precision)
   [...]]]></description>
			<content:encoded><![CDATA[<p>This is a <a href="http://www.ahabman.com/blog/wp-content/uploads/2008/07/convert.rb">ruby module useful for conversions</a> dealing with length, weight, torque.</p>
<pre class="brush: ruby;">
 module Convert 

   def Convert.number_with_precision(number, precision=2)
     &quot;%01.#{precision}f&quot; % number
   rescue
     number
   end 

   def Convert.mm_to_in(mm, precision=2)
     number_with_precision(mm * 0.03937, precision)
   end 

   def Convert.in_to_mm(inches, precision=2)
     number_with_precision(inches / 0.03937 , precision)
   end 

   def Convert.feet_to_meters(f, precision=2)
     number_with_precision( f * 0.3048, precision)
   end 

   def Convert.meters_to_inches(m, precision=2)
     number_with_precision( m * 39.37, precision)
   end 

   def Convert.meters_to_feet(m, precision=2)
     number_with_precision( m * 3.281, precision)
   end 

   def Convert.kg_to_lbs(kg, precision=2)
     number_with_precision( kg * 2.2   , precision)
   end 

   def Convert.lbs_to_kg(lbs, precision=2)
     number_with_precision( lbs / 2.2   , precision)
   end 

   def Convert.nm_to_inch_pounds(nm, precision=1)
     number_with_precision( nm * 8.850   , precision)
   end 

   def Convert.inch_pounds_to_nm(inlb, precision=1)
     number_with_precision( inlb / 8.850   , precision)
   end 

 end
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.ahabman.com/blog/2008/07/ruby-conversion-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
