<?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>lifecoding.com Blog &#187; Programming</title>
	<atom:link href="http://lifecoding.com/blog/index.php/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://lifecoding.com/blog</link>
	<description>(define (life-coding life code) (organize life (using code)))</description>
	<lastBuildDate>Wed, 11 Jun 2008 03:29:55 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I moved</title>
		<link>http://lifecoding.com/blog/2008/06/10/i-moved/</link>
		<comments>http://lifecoding.com/blog/2008/06/10/i-moved/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 03:21:07 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[life-code]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=35</guid>
		<description><![CDATA[Stop reading here, it is no longer my hangout. All future posts are being made on TrotterCashion.com. It&#8217;s ruby, nginx, and more fun. Enjoy.
]]></description>
			<content:encoded><![CDATA[<p>Stop reading here, it is no longer my hangout. All future posts are being made on <a href="http://trottercashion.com">TrotterCashion.com</a>. It&#8217;s ruby, nginx, and more fun. Enjoy.</p>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2008/06/10/i-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nyc.rb turns 3!</title>
		<link>http://lifecoding.com/blog/2007/02/20/nycrb-turns-3/</link>
		<comments>http://lifecoding.com/blog/2007/02/20/nycrb-turns-3/#comments</comments>
		<pubDate>Tue, 20 Feb 2007 19:54:27 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[nyc.rb]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=32</guid>
		<description><![CDATA[Well, last Tuesday nyc.rb turned three years old. Of course, we were not content with just turning three, so we decided to start taping our presentations also (By we, I mean me, because I have a video camera and turned it on). Francis gave a testing clinic, while yours truly gave a talk on refactoring. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, last Tuesday nyc.rb turned three years old. Of course, we were not content with just turning three, so we decided to start taping our presentations also (By we, I mean me, because I have a video camera and turned it on). Francis gave a testing clinic, while yours truly gave a talk on refactoring. Both talks are available on Motionbox (the Rails video site at which I work) at <a href="http://www.motionbox.com/playlist/show/4a9fddb51f1cc4">this playlist</a>.</p>
<p>To make things easier for you, I&#8217;ve also embeded the videos after the jump. Francis&#8217;s video is first with mine second. Sorry for the occasional fuzzy video quality, I&#8217;m still not good at filming presentations.</p>
<p><span id="more-32"></span><br />
<embed src="http://www.motionbox.com/external/player/id%3D4a97d7b31e19c4" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="425" height="460"></embed></p>
<p></p>
<p><embed src="http://www.motionbox.com/external/player/id%3D4a97dabe1d1ac4" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" width="425" height="460"></embed></p>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2007/02/20/nycrb-turns-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Make Pound And SSL Play Nice With OS X</title>
		<link>http://lifecoding.com/blog/2006/06/09/how-to-make-pound-and-ssl-play-nice-with-os-x/</link>
		<comments>http://lifecoding.com/blog/2006/06/09/how-to-make-pound-and-ssl-play-nice-with-os-x/#comments</comments>
		<pubDate>Fri, 09 Jun 2006 22:23:31 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[SysAdmin]]></category>
		<category><![CDATA[Utilities]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=29</guid>
		<description><![CDATA[Though building sites with ssl is cool and gives your users a sense of security, configuring a webserver with ssl can be a royal pain. Thankfully, there&#8217;s pound.  Pound is a &#8220;is a reverse proxy, load balancer and HTTPS front-end for Web server(s).&#8221;
Pound is dead simple to setup and configure. Unfortunately, the darwin port [...]]]></description>
			<content:encoded><![CDATA[<p>Though building sites with ssl is cool and gives your users a sense of security, configuring a webserver with ssl can be a royal pain. Thankfully, there&#8217;s pound.  <a href="">Pound</a> is a &#8220;is a reverse proxy, load balancer and HTTPS front-end for Web server(s).&#8221;</p>
<p>Pound is dead simple to setup and configure. Unfortunately, the darwin port for pound is old and does not work. So this guide will help you build pound on your own. Besides, everyone feels cooler after compiling that hot fire. Click on for the steps.</p>
<ol>
<span id="more-29"></span></p>
<li>Open terminal.</li>
<li>Install zlib</li>
<pre>
mkdir ~/temp
curl -O http://www.zlib.net/zlib-1.2.3.tar.gz
tar xzvf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --prefix=/usr/local --shared
make
sudo make install
</pre>
<li>Install openssl</li>
<pre>
curl -O http://www.openssl.org/source/openssl-0.9.8b.tar.gz
tar xzvf openssl-0.9.8b.tar.gz
cd openssl-0.9.8b
./config -L/usr/local/lib --openssldir=/usr/local/etc/openssl \\
    zlib no-asm no-krb5 shared
make
sudo make install
</pre>
<li>Install Pound 2.0 or greater</li>
<pre>
curl -O http://www.apsis.ch/pound/Pound-2.0.tgz
tar xzvf Pound-2.0.tgz
cd Pound-2.0
sed "s/-o bin -g bin //g" < Makefile.in > Makefile.in.new
mv Makefile.in.new Makefile.in  # Hit y to override any restrictions
./configure --with-ssl=/usr/local/etc/openssl/ --prefix=/usr/local
make
sudo make install
</pre>
<li>Generate an ssl certificate.</li>
<pre>
cd /usr/local/etc
</pre>
<p>You can put the next line in ~/.bash_profile if you want openssl available everytime you open the terminal.</p>
<pre>
export PATH="/usr/local/etc/openssl/bin:$PATH"
sudo openssl/bin/openssl req -x509 -newkey rsa:1024 -keyout our_cert.pem \\
    -out our_cert.pem -days 365 -nodes
</pre>
<p>Fill out the required information to generate the ssl certificate.</p>
<li>Create a pound.cfg file.</li>
<pre>
cd /usr/local/etc # You should already be here
</pre>
<p>This next piece uses a trick called a heredoc. Instead of copying and pasting the below command into terminal, you could also just copy and paste the text into pound.cfg in /usr/local/etc/pound.cfg</p>
<pre>
cat &gt; ~/tmp_file &lt;&lt;EOF
ListenHTTP
  Address 0.0.0.0
  Port    80
  Service
    BackEnd
      Address 127.0.0.1
      Port    3000
    End
  End
End

ListenHTTPS
  Address 0.0.0.0
  Port    443
  Cert    "/usr/local/etc/our_cert.pem"
  # pass along https hint
  AddHeader "X-Forwarded-Proto: https"
  HeadRemove "X-Forwarded-Proto"
  Service
    BackEnd
      Address 127.0.0.1
      Port    3000
    End
  End
End
EOF
sudo mv ~/tmp_file ./pound.cfg
</pre>
<li>Make sure that pound works.</li>
<pre>
pound -v -c
</pre>
<p>You should see Config file /usr/local/etc/pound.cfg is OK.<br />
If not, make sure that you copied your config file correctly<br />
using &#8216;cat pound.cfg&#8217; to view what is in the file.</p>
<li>Turn off apache (assuming it&#8217;s running).</li>
<pre>sudo apachectl stop</pre>
<li>Turn on pound.</li>
<pre>sudo pound -v</pre>
<li>Start mongrel/webrick/lighty.</li>
<pre>
cd ~/work/my_killer_app
mongrel_rails start # Or ruby script/server (if you're still on lighty/webrick)
</pre>
<li>Marvel at your wonderous creation by pointing your browser to http://localhost/ or https://localhost/</li>
</ol>
<p>TODO (feel free to do these and post how to do them in the comments):
<ul>
<li>Make pound start when the computer loads.</li>
<li>Use darwin ports to install zlib and openssl, but not pound.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2006/06/09/how-to-make-pound-and-ssl-play-nice-with-os-x/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Ruby Reminder: Array Subtraction</title>
		<link>http://lifecoding.com/blog/2006/06/05/ruby-reminder-array-subtraction/</link>
		<comments>http://lifecoding.com/blog/2006/06/05/ruby-reminder-array-subtraction/#comments</comments>
		<pubDate>Mon, 05 Jun 2006 14:46:52 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=27</guid>
		<description><![CDATA[Just a reminder when working with arrays of objects generated with Active Record.

[Model.find(1), Model.find(2), Model.find(3)] -
  [Model.find(1)] != [Model.find(2), Model.find(3)]

This does not behave as you would expect, because array subtraction compares elements on their object ids. Each find generates a new object, with a new id, so subtraction does not work. To get the [...]]]></description>
			<content:encoded><![CDATA[<p>Just a reminder when working with arrays of objects generated with Active Record.</p>
<pre>
[Model.find(1), Model.find(2), Model.find(3)] -
  [Model.find(1)] != [Model.find(2), Model.find(3)]
</pre>
<p>This does not behave as you would expect, because array subtraction compares elements on their object ids. Each find generates a new object, with a new id, so subtraction does not work. To get the behavior desired, do this instead:</p>
<pre>
to_be_removed = [Model.find(1)].map{|m| m.id}
[Model.find(1), Model.find(2), Model.find(3)].
  delete_if{|m| to_be_removed.include?(m.id)}
</pre>
<p>It&#8217;s not as beautiful, but it gets the job done.</p>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2006/06/05/ruby-reminder-array-subtraction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Where am I?</title>
		<link>http://lifecoding.com/blog/2006/03/20/where-am-i/</link>
		<comments>http://lifecoding.com/blog/2006/03/20/where-am-i/#comments</comments>
		<pubDate>Mon, 20 Mar 2006 19:20:22 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=25</guid>
		<description><![CDATA[I was really on a roll there for a while, right? A gem of a post every day or so, presentations at meetings, reading on scheme and now, I&#8217;m nowhere to be found. Well, please allow me to explain.  It goes like this: got new job, quit old job, working both jobs for two [...]]]></description>
			<content:encoded><![CDATA[<p>I was really on a roll there for a while, right? A gem of a post every day or so, presentations at meetings, reading on scheme and now, I&#8217;m nowhere to be found. Well, please allow me to explain.  It goes like this: got new job, quit old job, working both jobs for two weeks until finished with my final two weeks.</p>
<p>So yes, working two jobs is keeping my quite busy right now, leaving very little time for any decent posting. Wait until next week, when I&#8217;ll once again make you privy to the thoughts bubbling around in my head.</p>
<p>In the meantime, I&#8217;ll leave you with a nice unordered list of what&#8217;s been catching my eye:</p>
<ul>
<li><a href="http://camping.rubyforge.org/files/README.html">Camping</a> is awesome.</li>
<li><a href="http://www.zedshaw.com/">Zed Shaw</a> and his <a href="http://mongrel.rubyforge.org/">Mongrel</a> project rock!</li>
<li>I want to build a proxy server in ruby using mongrel and mongrel plugins but don&#8217;t know when I&#8217;ll have time.</li>
<li>I want a piece of software that will scan and parse weather, news headlines, and my top rss feeds, placing them into a video file that I can watch on my iPod.</li>
<li>Java will probably move into the same category as VB in my about page.</li>
</ul>
<p>You can look look forward to (or know to avoid) posts on these topics as soon as I&#8217;m able to return.</p>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2006/03/20/where-am-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Picks and Keyboards</title>
		<link>http://lifecoding.com/blog/2006/03/08/picks-and-keyboards/</link>
		<comments>http://lifecoding.com/blog/2006/03/08/picks-and-keyboards/#comments</comments>
		<pubDate>Wed, 08 Mar 2006 15:09:26 +0000</pubDate>
		<dc:creator>Trotter Cashion</dc:creator>
				<category><![CDATA[All]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://lifecoding.com/blog/?p=24</guid>
		<description><![CDATA[I read an article a few years ago, I believe in Guitar World, written by famed Phish guitarist Trey Anastasio.  In it, he explained that one of the keys to being great at guitar is to know how to get to &#8216;C&#8217; from any other note on the fretboard.  Once this is known, [...]]]></description>
			<content:encoded><![CDATA[<p>I read an article a few years ago, I believe in <a href="http://www.guitarworld.com">Guitar World</a>, written by famed Phish guitarist Trey Anastasio.  In it, he explained that one of the keys to being great at guitar is to know how to get to &#8216;C&#8217; from any other note on the fretboard.  Once this is known, he explains, this knowledge can be transferred to every other key.</p>
<p>So what does this have to do with programming?  A lot I believe. <span id="more-24"></span> As programmers, many of us may know how to play a song or two.  We can program in Java, for instance, or write a web service in Ruby. But, the ability to play a song does not the master make. How many of us can get to &#8216;C&#8217; from anywhere on the guitar? How many of us can honestly say they know how to build an array from scratch in any language?  How about create an object? Sure, we can all use <code>Array#new</code> or <code>class Bob { }</code>. But, could we make our own <code>Array#new</code> if necessary?</p>
<p>It is knowledge of this sort that separates the good programmer that knows how to use tools from the great programmer that knows how to make them. The great programmer, confident in his ability to build tools to suit his needs, can be comfortable using any language thrown in front of him.  The good programmer on the other hand, shouts like a fanboy about the greatness of his languge, be it ruby, java, or python, out of fear that he may need to learn new tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://lifecoding.com/blog/2006/03/08/picks-and-keyboards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

