<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Jonathan's Techno-tales</title>
	<atom:link href="http://technotales.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://technotales.wordpress.com</link>
	<description>no magic - just tricks</description>
	<lastBuildDate>Sat, 21 Jan 2012 16:48:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='technotales.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jonathan's Techno-tales</title>
		<link>http://technotales.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://technotales.wordpress.com/osd.xml" title="Jonathan&#039;s Techno-tales" />
	<atom:link rel='hub' href='http://technotales.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Node, JSLint and Vim</title>
		<link>http://technotales.wordpress.com/2011/05/21/node-jslint-and-vim/</link>
		<comments>http://technotales.wordpress.com/2011/05/21/node-jslint-and-vim/#comments</comments>
		<pubDate>Sat, 21 May 2011 15:46:40 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=658</guid>
		<description><![CDATA[It&#8217;s always nice to get something for free. That&#8217;s how I feel about JSLint. Running your JavaScript code through JSLint gives you a few advantages: Coding style consistency &#8212; always use ; at the end of a line Syntax error detection &#8212; did you forget that ) ? Logical error detection &#8212; did you forget [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=658&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s always nice to get something for free. That&#8217;s how I feel about <a href="http://www.jslint.com/">JSLint</a>. Running your JavaScript code through JSLint gives you a few advantages:</p>
<ul>
<li>Coding style consistency &#8212; always use ; at the end of a line</li>
<li>Syntax error detection &#8212; did you forget that ) ?</li>
<li>Logical error detection &#8212; did you forget that <tt>var</tt>?</li>
</ul>
<p>There&#8217;s a <a href="http://www.jslint.com/lint.html">whole bunch of stuff</a> JSLint will pick up for you.</p>
<p>I have talked before about <a href="http://technotales.wordpress.com/2009/06/21/jslint-with-spidermonkey/">JSLint in the context of SpiderMonkey</a>, but, nowadays, I install <a href="http://nodejs.org/">node.js</a> for a few things. If I run JSLint through node.js, that means I won&#8217;t have to install SpiderMonkey anymore.</p>
<h2>Installing Node and NPM</h2>
<p>I admit, these pieces of software are moving fast and the instructions (or lack thereof) are limited. But these things will vary with your OS and skill level.</p>
<p>I&#8217;m going to focus on the Vim integration, but go ahead and <a href="https://github.com/joyent/node/wiki/Installation">install Node</a> and <a href="https://github.com/isaacs/npm#readme">install NPM</a>.</p>
<h2>Installing JSLint</h2>
<p>Which one?<a href="http://technotales.files.wordpress.com/2011/05/jslint_which.png"><img src="http://technotales.files.wordpress.com/2011/05/jslint_which.png?w=500&#038;h=236" alt="" title="jslint_which" width="500" height="236" class="aligncenter size-full wp-image-666" /></a></p>
<p>I recommend the simply named &#8220;jslint&#8221;. You can look it up on GitHub as <a href="https://github.com/reid/node-jslint">node-jslint</a>.<a href="http://technotales.files.wordpress.com/2011/05/jslint_install.png"><img src="http://technotales.files.wordpress.com/2011/05/jslint_install.png?w=500&#038;h=281" alt="" title="jslint_install" width="500" height="281" class="aligncenter size-full wp-image-668" /></a></p>
<p>Make sure you don&#8217;t forget that &#8220;-g&#8221; flag with NPM. NPM changed a lot in <a href="http://blog.nodejs.org/2011/05/01/npm-1-0-released/">version 1.0</a>.</p>
<h2>Vim Integration</h2>
<p>The end goal is:</p>
<p><a href="http://technotales.files.wordpress.com/2011/05/stupid.png"><img src="http://technotales.files.wordpress.com/2011/05/stupid.png?w=500&#038;h=228" alt="" title="stupid" width="500" height="228" class="aligncenter size-full wp-image-663" /></a></p>
<p> You are in a JavaScript file, you press F4, Vim runs JSLint on your file, parses the errors and puts your cursors on the exact location of the first error with the others one waiting in the <a href="http://vimdoc.sourceforge.net/htmldoc/quickfix.html">quickfix</a> list.</p>
<p>The main part of integrating with Vim to &#8220;compile&#8221; something is to set <tt>makeprg</tt> and <tt>errorformat</tt> (aka <tt>efm</tt>). If you ever need to integrate with something else, be sure to Google for those.</p>
<p>Since we are going to invoke <tt>:make</tt> all the time, I&#8217;m going to bind it to F4. (put it in your .vimrc)</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:0 10px 10px;">
<font face="monospace"><br />
<font color="#87afd7">nmap</font>&nbsp;<font color="#d78787">&lt;</font><font color="#d78787">F4</font><font color="#d78787">&gt;</font>&nbsp;:w<font color="#d78787">&lt;</font><font color="#d78787">CR</font><font color="#d78787">&gt;</font>:make<font color="#d78787">&lt;</font><font color="#d78787">CR</font><font color="#d78787">&gt;</font>:cw<font color="#d78787">&lt;</font><font color="#d78787">CR</font><font color="#d78787">&gt;</font><br />
</font>
</div>
<p>Step by step:</p>
<ul>
<li>:w &#8212; save the file, doesn&#8217;t hurt if it&#8217;s already saved</li>
<li>:make &#8212; invoke make</li>
<li>:cw &#8212; open the quickfix window if there are errors. Close it if there are no errors.</li>
</ul>
<p>Next, create $HOME/.vim/ftplugin/javascript.vim. Put these lines into it:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:0 10px 10px;">
<font face="monospace"><br />
<font color="#87afd7">setlocal</font>&nbsp;<font color="#afd787">makeprg</font>=jslint\&nbsp;%<br />
<font color="#87afd7">setlocal</font>&nbsp;<font color="#afd787">errorformat</font>=%-P%f,<br />
<font color="#d78787">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</font>%<font color="#87afd7">-</font>G/*jslint\ %<font color="#87afd7">.</font>%#*/,<br />
<font color="#d78787">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</font>%*[\ ]<font color="#d7af87">%</font><font color="#87afd7">n</font>\&nbsp;<font color="#d7af87">%</font><font color="#87afd7">l</font>\\,<font color="#d7af87">%</font><font color="#87afd7">c</font>:\&nbsp;<font color="#d7af87">%</font><font color="#87afd7">m</font>,<br />
<font color="#d78787">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</font>%<font color="#87afd7">-</font>G\ \ \ \ %<font color="#87afd7">.</font>%#,<br />
<font color="#d78787">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</font>%<font color="#87afd7">-</font>GNo\&nbsp;errors\&nbsp;found<font color="#87afd7">.</font>,<br />
<font color="#d78787">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\</font>%<font color="#87afd7">-</font>Q<br />
</font>
</div>
<p>The variable <tt>makeprg</tt> is just was it invoked when you do <tt>:make</tt>. The variable <tt>errorformat</tt> are instructions on how to parse the error messages of the &#8220;compiler&#8221;. That variable and how to configure it are <a href="http://vimdoc.sourceforge.net/htmldoc/quickfix.html#error-file-format">a whole world of complexity</a>.</p>
<p>Now, restart Vim and open some JavaScript file you have lying around. Press F4. Be ready for a lesson in humility.</p>
<h2>Troubleshooting</h2>
<p>If things don&#8217;t work out, try this:</p>
<ul>
<li>try to run &#8220;jslint&#8221; from the command-line, if it doesn&#8217;t work Vim won&#8217;t work either</li>
<li>if the output of &#8220;jslint&#8221; changes format, you&#8217;ll have to tweak <tt>errorformat</tt></li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/658/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/658/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/658/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=658&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2011/05/21/node-jslint-and-vim/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2011/05/jslint_which.png" medium="image">
			<media:title type="html">jslint_which</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2011/05/jslint_install.png" medium="image">
			<media:title type="html">jslint_install</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2011/05/stupid.png" medium="image">
			<media:title type="html">stupid</media:title>
		</media:content>
	</item>
		<item>
		<title>CoffeeScript, Vim and Pathogen</title>
		<link>http://technotales.wordpress.com/2011/04/15/coffeescript-vim-and-pathogen/</link>
		<comments>http://technotales.wordpress.com/2011/04/15/coffeescript-vim-and-pathogen/#comments</comments>
		<pubDate>Sat, 16 Apr 2011 03:24:41 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=629</guid>
		<description><![CDATA[It all started with CoffeeScript. Like all languages I play with, one of my first step is to look for a Vim syntax file. Thankfully, the CoffeeScript page itself links to kchmck&#8216;s vim-coffee-script on github. So far, so good. Here&#8217;s the first step: Wait … what?! I hate having to install software to … install [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=629&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It all started with <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>. Like all languages I play with, one of my first step is to look for a Vim syntax file. Thankfully, the CoffeeScript page itself links to <a href="https://github.com/kchmck">kchmck</a>&#8216;s <a href="https://github.com/kchmck/vim-coffee-script">vim-coffee-script</a> on github. So far, so good.</p>
<p>Here&#8217;s the first step:</p>
<p><a href="http://technotales.files.wordpress.com/2011/04/install_pathogen.png"><img class="aligncenter size-full wp-image-633" title="install_pathogen" src="http://technotales.files.wordpress.com/2011/04/install_pathogen.png?w=500&#038;h=59" alt="" width="500" height="59" /></a></p>
<p>Wait … what?! I hate having to install software to … install software. At this point, I was ready to close the tab but it was a <a href="https://github.com/tpope">tpope</a> project. That&#8217;s usually a sign of quality. I was ready to give this <a href="https://github.com/tpope/vim-pathogen">pathogen</a> thing another look.</p>
<p>So … pathogen lets you dump &#8220;bundle&#8221; directories under <tt>~/.vim/bundle/</tt> and will setup the various Vim variables so that the plugin, ftplugin, syntax, ftdetect are all hooked up correctly. That&#8217;s nice; it solves a lot of the pain I&#8217;ve felt over the years about trying various vim plugins and messing with my setup.</p>
<p>In theory, you would do something like:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace">$&nbsp;<font color="#87afd7">cd</font>&nbsp;~/.vim/bundle<br />
$ git clone https://github.com/kchmck/vim-coffee-script.git<br />
</font>
</div>
<p>And add at the top of your .vimrc:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><font color="#808080">&quot; pathogen bundles</font><br />
<font color="#87afd7">filetype</font>&nbsp;<font color="#afafd7">off</font><br />
<font color="#87afd7">call</font>&nbsp;pathogen#<span style="background-color:#1c1c1c;"><font color="#d0d0d0">helptags</font></span><font color="#d78787">()</font><br />
<font color="#87afd7">call</font>&nbsp;pathogen#<span style="background-color:#1c1c1c;"><font color="#d0d0d0">runtime_append_all_bundles</font></span><font color="#d78787">()</font><br />
</font>
</div>
<p>That&#8217;s pretty close to how I have it setup. While I was making my mind about pathogen, I found Tammer Saleh&#8217;s <a href="http://tammersaleh.com/posts/the-modern-vim-config-with-pathogen">post about pathogen</a>. Besides the details I outlined above, he suggests git cloning the repository and removing the <tt>.git</tt> instead of playing with git submodules. I could not agree more. Of course, I have to deal with that situation only because my <tt>~/.vim</tt> is under git. (like all my <a href="https://github.com/jpalardy/dotfiles">dotfiles</a>, read <a href="http://technotales.wordpress.com/2007/02/21/dotfiles-best-practice/">more</a>)</p>
<p>I simplified his script for my own purposes: (<a href="https://github.com/jpalardy/dotfiles/blob/master/vim/bundle/refresh">on github</a>)</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><font color="#808080">#!/bin/bash</font></p>
<p><font color="#d7afd7">refresh() {</font><br />
&nbsp;&nbsp;<font color="#87afd7">local</font>&nbsp;<font color="#d7afd7">url</font>=<font color="#87afd7">&quot;</font><font color="#afd787">$1</font><font color="#87afd7">&quot;</font><br />
&nbsp;&nbsp;<font color="#87afd7">local</font>&nbsp;<font color="#d7afd7">dir</font>=<font color="#87afd7">&quot;</font><font color="#afd787">$2</font><font color="#87afd7">&quot;</font></p>
<p>&nbsp;&nbsp;<font color="#87afd7">rm</font>&nbsp;<font color="#d78787">-rf</font>&nbsp;<font color="#afd787">$dir</font><br />
&nbsp;&nbsp;git clone&nbsp;<font color="#afd787">$url</font>&nbsp;<font color="#afd787">$dir</font>&nbsp;<font color="#d78787">&#8211;depth=1</font><br />
&nbsp;&nbsp;<font color="#87afd7">rm</font>&nbsp;<font color="#d78787">-rf</font>&nbsp;<font color="#afd787">$dir</font>/.git</p>
<p>&nbsp;&nbsp;<font color="#87afd7">if&nbsp;</font><font color="#87afd7">[</font>&nbsp;<font color="#87afd7">-f</font>&nbsp;<font color="#87afd7">&quot;</font><font color="#afd787">$dir</font><font color="#ffffaf">/.gitignore</font><font color="#87afd7">&quot;</font>&nbsp;<font color="#87afd7">]</font><font color="#87afd7">;</font>&nbsp;<font color="#87afd7">then</font><br />
&nbsp;&nbsp;&nbsp;&nbsp;<font color="#87afd7">rm</font>&nbsp;<font color="#87afd7">&quot;</font><font color="#afd787">$dir</font><font color="#ffffaf">/.gitignore</font><font color="#87afd7">&quot;</font><br />
&nbsp;&nbsp;<font color="#87afd7">fi</font><br />
<font color="#d7afd7">}</font></p>
<p>refresh https://github.com/scrooloose/nerdcommenter.git nerdcommenter<br />
refresh https://github.com/vim-scripts/matchit.zip.git&nbsp;&nbsp;matchit<br />
refresh https://github.com/tpope/vim-haml.git&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vim-haml<br />
refresh https://github.com/timcharper/textile.vim.git&nbsp;&nbsp; textile<br />
refresh https://github.com/kchmck/vim-coffee-script.git vim-coffee-script</p>
<p></font>
</div>
<p>I think the <tt>--depth=1</tt> on the git clone is a nice touch … especially since I delete the git directory right after the download. The CoffeeScript plugin is working well and it keeps being committed to. The refresh script is quite useful.</p>
<p>I&#8217;m planning on packaging a few of the plugins I wrote and &#8220;bundle&#8221; them too. (<a href="https://github.com/jpalardy/vim-slime">vim-slime</a>)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/629/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/629/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/629/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=629&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2011/04/15/coffeescript-vim-and-pathogen/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://technotales.files.wordpress.com/2011/04/install_pathogen.png" medium="image">
			<media:title type="html">install_pathogen</media:title>
		</media:content>
	</item>
		<item>
		<title>Books I read in 2010</title>
		<link>http://technotales.wordpress.com/2011/01/01/books-i-read-in-2010/</link>
		<comments>http://technotales.wordpress.com/2011/01/01/books-i-read-in-2010/#comments</comments>
		<pubDate>Sat, 01 Jan 2011 21:35:58 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[books]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=617</guid>
		<description><![CDATA[2010 is over and, like last year, here&#8217;s what I read during the year: January nothing&#8230; February March April May June July August September October November December Notes I read 42 books in 2010. That&#8217;s 8 books more than last year, or a 23% increase. I&#8217;m not sure how representative that is, however. It seems [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=617&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>2010 is over and, like <a href="http://technotales.wordpress.com/2010/01/24/books-i-read-in-2009/">last year</a>, here&#8217;s what I read during the year:</p>
<h3>January</h3>
<p>nothing&#8230;</p>
<h3>February</h3>
<p><img alt="Amusing Ourselves to Death: Public Discourse in the Age of Show Business" title="Amusing Ourselves to Death: Public Discourse in the Age of Show Business" src="http://assets.bookpiles.ca/covers/014303653X.jpg" /> </p>
<h3>March</h3>
<p><img alt="The Talent Code: Greatness Isn't Born. It's Grown. Here's How." title="The Talent Code: Greatness Isn't Born. It's Grown. Here's How." src="http://assets.bookpiles.ca/covers/055380684X.jpg" /> </p>
<h3>April</h3>
<p><img alt="The Definitive Book of Body Language" title="The Definitive Book of Body Language" src="http://assets.bookpiles.ca/covers/0553804723.jpg" /><img alt="The Demon-Haunted World: Science as a Candle in the Dark" title="The Demon-Haunted World: Science as a Candle in the Dark" src="http://assets.bookpiles.ca/covers/039453512X.gif" /><img alt="The Omnivore's Dilemma: A Natural History of Four Meals" title="The Omnivore's Dilemma: A Natural History of Four Meals" src="http://assets.bookpiles.ca/covers/0143038583.jpg" /><img alt="Extreme Programming Explained: Embrace Change (2nd Edition) (XP Series)" title="Extreme Programming Explained: Embrace Change (2nd Edition) (XP Series)" src="http://assets.bookpiles.ca/covers/0321278658.jpg" /><img alt="The Best That Money Can't Buy: Beyond Politics, Poverty, &amp; War" title="The Best That Money Can't Buy: Beyond Politics, Poverty, &amp; War" src="http://assets.bookpiles.ca/covers/0964880679.jpg" /><img alt="Being Logical: A Guide to Good Thinking" title="Being Logical: A Guide to Good Thinking" src="http://assets.bookpiles.ca/covers/0812971159.jpg" /> </p>
<h3>May</h3>
<p><img alt="The Now Habit: A Strategic Program for Overcoming Procrastination and Enjoying Guilt-Free Play" title="The Now Habit: A Strategic Program for Overcoming Procrastination and Enjoying Guilt-Free Play" src="http://assets.bookpiles.ca/covers/0874775043.jpg" /><img alt="The Count of Monte Cristo (Penguin Classics)" title="The Count of Monte Cristo (Penguin Classics)" src="http://assets.bookpiles.ca/covers/0140449264.jpg" /> </p>
<h3>June</h3>
<p><img alt="Secrets of Consulting: A Guide to Giving and Getting Advice Successfully" title="Secrets of Consulting: A Guide to Giving and Getting Advice Successfully" src="http://assets.bookpiles.ca/covers/0932633013.jpg" /><img alt="How We Decide" title="How We Decide" src="http://assets.bookpiles.ca/covers/0618620117.jpg" /><img alt="The Ten-Day MBA 3rd Ed.: A Step-By-Step Guide To Mastering The Skills Taught In America's Top Business Schools" title="The Ten-Day MBA 3rd Ed.: A Step-By-Step Guide To Mastering The Skills Taught In America's Top Business Schools" src="http://assets.bookpiles.ca/covers/0060799072.jpg" /><img alt="Brain Rules: 12 Principles for Surviving and Thriving at Work, Home, and School (Book &amp; DVD)" title="Brain Rules: 12 Principles for Surviving and Thriving at Work, Home, and School (Book &amp; DVD)" src="http://assets.bookpiles.ca/covers/0979777704.jpg" /><img alt="The Elements of Computing Systems: Building a Modern Computer from First Principles" title="The Elements of Computing Systems: Building a Modern Computer from First Principles" src="http://assets.bookpiles.ca/covers/026214087X.jpg" /> </p>
<h3>July</h3>
<p><img alt="Millennium Volume 2 La fille qui rÃªvait d'un bidon d'essence et d'une allumette The girl who dreamed of a can of gasoline and a match (French Language)" title="Millennium Volume 2 La fille qui rÃªvait d'un bidon d'essence et d'une allumette The girl who dreamed of a can of gasoline and a match (French Language)" src="http://assets.bookpiles.ca/covers/2742765018.jpg" /><img alt="The Road (Oprah's Book Club)" title="The Road (Oprah's Book Club)" src="http://assets.bookpiles.ca/covers/0307387895.jpg" /><img alt="Basic Economics 3rd Ed: A Common Sense Guide to the Economy" title="Basic Economics 3rd Ed: A Common Sense Guide to the Economy" src="http://assets.bookpiles.ca/covers/0465002609.jpg" /><img alt="In Defense of Food: An Eater's Manifesto" title="In Defense of Food: An Eater's Manifesto" src="http://assets.bookpiles.ca/covers/0143114964.jpg" /><img alt="The Four Steps to the Epiphany" title="The Four Steps to the Epiphany" src="http://assets.bookpiles.ca/covers/0976470705.jpg" /><img alt="Eat to Live: The Revolutionary Formula for Fast and Sustained Weight Loss" title="Eat to Live: The Revolutionary Formula for Fast and Sustained Weight Loss" src="http://assets.bookpiles.ca/covers/0316735507.jpg" /><img alt="The Alchemist" title="The Alchemist" src="http://assets.bookpiles.ca/covers/0061122416.jpg" /> </p>
<h3>August</h3>
<p><img alt="Understanding Comics: The Invisible Art" title="Understanding Comics: The Invisible Art" src="http://assets.bookpiles.ca/covers/006097625X.jpg" /><img alt="Dracula" title="Dracula" src="http://assets.bookpiles.ca/covers/145058666X.jpg" /> </p>
<h3>September</h3>
<p><img alt="High Performance Web Sites: Essential Knowledge for Front-End Engineers" title="High Performance Web Sites: Essential Knowledge for Front-End Engineers" src="http://assets.bookpiles.ca/covers/0596529309.jpg" /><img alt="Atlas Shrugged" title="Atlas Shrugged" src="http://assets.bookpiles.ca/covers/0451191145.jpg" /><img alt="Even Faster Web Sites: Performance Best Practices for Web Developers" title="Even Faster Web Sites: Performance Best Practices for Web Developers" src="http://assets.bookpiles.ca/covers/0596522304.jpg" /><img alt="Looking Backward 2000-1887 (Oxford World's Classics)" title="Looking Backward 2000-1887 (Oxford World's Classics)" src="http://assets.bookpiles.ca/covers/0199552576.jpg" /><img alt="Dismantling the Empire: America's Last Best Hope (American Empire Project)" title="Dismantling the Empire: America's Last Best Hope (American Empire Project)" src="http://assets.bookpiles.ca/covers/0805093036.jpg" /><img alt="Flow: The Psychology of Optimal Experience" title="Flow: The Psychology of Optimal Experience" src="http://assets.bookpiles.ca/covers/0060920432.jpg" /><img alt="CouchDB: The Definitive Guide: Time to Relax (Animal Guide)" title="CouchDB: The Definitive Guide: Time to Relax (Animal Guide)" src="http://assets.bookpiles.ca/covers/0596155891.jpg" /> </p>
<h3>October</h3>
<p><img alt="Catch-22" title="Catch-22" src="http://assets.bookpiles.ca/covers/0684833395.jpg" /><img alt="Millenium: Vol 3" title="Millenium: Vol 3" src="http://assets.bookpiles.ca/covers/2742770313.jpg" /><img alt="Ray Bradbury's Fahrenheit 451: The Authorized Adaptation" title="Ray Bradbury's Fahrenheit 451: The Authorized Adaptation" src="http://assets.bookpiles.ca/covers/080905101X.jpg" /><img alt="Ruby Best Practices" title="Ruby Best Practices" src="http://assets.bookpiles.ca/covers/0596523009.jpg" /> </p>
<h3>November</h3>
<p><img alt="Information Dashboard Design: The Effective Visual Communication of Data" title="Information Dashboard Design: The Effective Visual Communication of Data" src="http://assets.bookpiles.ca/covers/0596100167.jpg" /><img alt="Uncle Tom's Cabin: Or, Life Among the Lowly (The John Harvard Library)" title="Uncle Tom's Cabin: Or, Life Among the Lowly (The John Harvard Library)" src="http://assets.bookpiles.ca/covers/0674034074.jpg" /><img alt="The New Peoplemaking" title="The New Peoplemaking" src="http://assets.bookpiles.ca/covers/0831400706.jpg" /><img alt="Lolita" title="Lolita" src="http://assets.bookpiles.ca/covers/0679723161.jpg" /> </p>
<h3>December</h3>
<p><img alt="Scalable Internet Architectures" title="Scalable Internet Architectures" src="http://assets.bookpiles.ca/covers/067232699X.jpg" /><img alt="Essential SNMP, Second Edition" title="Essential SNMP, Second Edition" src="http://assets.bookpiles.ca/covers/0596008406.jpg" /><img alt="Domain-Driven Design: Tackling Complexity in the Heart of Software" title="Domain-Driven Design: Tackling Complexity in the Heart of Software" src="http://assets.bookpiles.ca/covers/0321125215.jpg" /> </p>
<h3>Notes</h3>
<p>I read 42 books in 2010. That&#8217;s 8 books more than last year, or a 23% increase. I&#8217;m not sure how representative that is, however. It seems that, on average, I read about 3 books a month.</p>
<p>Out of those 42 books, 16 were audio books. (38%)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/617/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/617/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=617&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2011/01/01/books-i-read-in-2010/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/014303653X.jpg" medium="image">
			<media:title type="html">Amusing Ourselves to Death: Public Discourse in the Age of Show Business</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/055380684X.jpg" medium="image">
			<media:title type="html">The Talent Code: Greatness Isn&#039;t Born. It&#039;s Grown. Here&#039;s How.</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0553804723.jpg" medium="image">
			<media:title type="html">The Definitive Book of Body Language</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/039453512X.gif" medium="image">
			<media:title type="html">The Demon-Haunted World: Science as a Candle in the Dark</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0143038583.jpg" medium="image">
			<media:title type="html">The Omnivore&#039;s Dilemma: A Natural History of Four Meals</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0321278658.jpg" medium="image">
			<media:title type="html">Extreme Programming Explained: Embrace Change (2nd Edition) (XP Series)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0964880679.jpg" medium="image">
			<media:title type="html">The Best That Money Can&#039;t Buy: Beyond Politics, Poverty, &#38; War</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0812971159.jpg" medium="image">
			<media:title type="html">Being Logical: A Guide to Good Thinking</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0874775043.jpg" medium="image">
			<media:title type="html">The Now Habit: A Strategic Program for Overcoming Procrastination and Enjoying Guilt-Free Play</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0140449264.jpg" medium="image">
			<media:title type="html">The Count of Monte Cristo (Penguin Classics)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0932633013.jpg" medium="image">
			<media:title type="html">Secrets of Consulting: A Guide to Giving and Getting Advice Successfully</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0618620117.jpg" medium="image">
			<media:title type="html">How We Decide</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0060799072.jpg" medium="image">
			<media:title type="html">The Ten-Day MBA 3rd Ed.: A Step-By-Step Guide To Mastering The Skills Taught In America&#039;s Top Business Schools</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0979777704.jpg" medium="image">
			<media:title type="html">Brain Rules: 12 Principles for Surviving and Thriving at Work, Home, and School (Book &#38; DVD)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/026214087X.jpg" medium="image">
			<media:title type="html">The Elements of Computing Systems: Building a Modern Computer from First Principles</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/2742765018.jpg" medium="image">
			<media:title type="html">Millennium Volume 2 La fille qui rÃªvait d&#039;un bidon d&#039;essence et d&#039;une allumette The girl who dreamed of a can of gasoline and a match (French Language)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0307387895.jpg" medium="image">
			<media:title type="html">The Road (Oprah&#039;s Book Club)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0465002609.jpg" medium="image">
			<media:title type="html">Basic Economics 3rd Ed: A Common Sense Guide to the Economy</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0143114964.jpg" medium="image">
			<media:title type="html">In Defense of Food: An Eater&#039;s Manifesto</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0976470705.jpg" medium="image">
			<media:title type="html">The Four Steps to the Epiphany</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0316735507.jpg" medium="image">
			<media:title type="html">Eat to Live: The Revolutionary Formula for Fast and Sustained Weight Loss</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0061122416.jpg" medium="image">
			<media:title type="html">The Alchemist</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/006097625X.jpg" medium="image">
			<media:title type="html">Understanding Comics: The Invisible Art</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/145058666X.jpg" medium="image">
			<media:title type="html">Dracula</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596529309.jpg" medium="image">
			<media:title type="html">High Performance Web Sites: Essential Knowledge for Front-End Engineers</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0451191145.jpg" medium="image">
			<media:title type="html">Atlas Shrugged</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596522304.jpg" medium="image">
			<media:title type="html">Even Faster Web Sites: Performance Best Practices for Web Developers</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0199552576.jpg" medium="image">
			<media:title type="html">Looking Backward 2000-1887 (Oxford World&#039;s Classics)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0805093036.jpg" medium="image">
			<media:title type="html">Dismantling the Empire: America&#039;s Last Best Hope (American Empire Project)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0060920432.jpg" medium="image">
			<media:title type="html">Flow: The Psychology of Optimal Experience</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596155891.jpg" medium="image">
			<media:title type="html">CouchDB: The Definitive Guide: Time to Relax (Animal Guide)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0684833395.jpg" medium="image">
			<media:title type="html">Catch-22</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/2742770313.jpg" medium="image">
			<media:title type="html">Millenium: Vol 3</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/080905101X.jpg" medium="image">
			<media:title type="html">Ray Bradbury&#039;s Fahrenheit 451: The Authorized Adaptation</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596523009.jpg" medium="image">
			<media:title type="html">Ruby Best Practices</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596100167.jpg" medium="image">
			<media:title type="html">Information Dashboard Design: The Effective Visual Communication of Data</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0674034074.jpg" medium="image">
			<media:title type="html">Uncle Tom&#039;s Cabin: Or, Life Among the Lowly (The John Harvard Library)</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0831400706.jpg" medium="image">
			<media:title type="html">The New Peoplemaking</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0679723161.jpg" medium="image">
			<media:title type="html">Lolita</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/067232699X.jpg" medium="image">
			<media:title type="html">Scalable Internet Architectures</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0596008406.jpg" medium="image">
			<media:title type="html">Essential SNMP, Second Edition</media:title>
		</media:content>

		<media:content url="http://assets.bookpiles.ca/covers/0321125215.jpg" medium="image">
			<media:title type="html">Domain-Driven Design: Tackling Complexity in the Heart of Software</media:title>
		</media:content>
	</item>
		<item>
		<title>Minimal Statistics on the Command-Line</title>
		<link>http://technotales.wordpress.com/2010/11/10/minimal-statistics-on-the-command-line/</link>
		<comments>http://technotales.wordpress.com/2010/11/10/minimal-statistics-on-the-command-line/#comments</comments>
		<pubDate>Thu, 11 Nov 2010 03:23:35 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=605</guid>
		<description><![CDATA[I was curious to know how many books, on average, I read a month. I don&#8217;t expose this information directly on bookpiles either. You could extract it from the RSS feed. It&#8217;s one the features I would like to add when I understand what information I want to present and how it is best presented. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=605&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was curious to know how many books, on average, I read a month. I don&#8217;t expose this information directly on <a href="http://bookpiles.ca/">bookpiles</a> either. You <strong><em>could</em></strong> extract it from the RSS feed. It&#8217;s one the features I would like to add when I understand what information I want to present and how it is best presented.</p>
<p>In the meantime, I ran a query in the database and came up with this:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace">2009-01 3<br />
2009-02 2<br />
2009-03 4<br />
2009-04 3<br />
2009-05 3<br />
2009-06 3<br />
2009-07 2<br />
2009-08 3<br />
2009-09 3<br />
2009-10 3<br />
2009-11 4<br />
2009-12 1<br />
2010-01 0<br />
2010-02 1<br />
2010-03 1<br />
2010-04 6<br />
2010-05 2<br />
2010-06 5<br />
2010-07 7<br />
2010-08 2<br />
2010-09 7<br />
2010-10 4<br />
</font>
</div>
<p>I felt 80% done. Then, I realized I didn&#8217;t quite know how I would extract, from the command-line, the sum, mean, standard deviation, minimum and maximum value. Of course, I <strong><em>could</em></strong> run it through R. Or Excel… The question wasn&#8217;t how to do statistics in general &#8212; it was how to do it as a filter … easily … right now.</p>
<p>A little research didn&#8217;t turn out any obvious answer. (please, correct me if I missed an obvious solution)</p>
<p>I wrote my own in awk. (awk is present on ALL the machines I use)</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace">min ==&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;&quot;</font></span>&nbsp;{min=max=<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>}<br />
<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>&nbsp;&lt; min&nbsp;&nbsp;{min =&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>}<br />
<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>&nbsp;&gt; max&nbsp;&nbsp;{max =&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{sum+=<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span>&nbsp;sumsq+=<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>*<span style="background-color:#1c1c1c;"><font color="#d78787">$1</font></span>}<br />
<span style="background-color:#1c1c1c;"><font color="#d78787">END</font></span>&nbsp;{<br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;lines: &quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">NR</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;min:&nbsp;&nbsp; &quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;min<span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;max:&nbsp;&nbsp; &quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;max<span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;sum:&nbsp;&nbsp; &quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;sum<span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;mean:&nbsp;&nbsp;&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;sum/<span style="background-color:#1c1c1c;"><font color="#d78787">NR</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">;</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">print</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7d7af">&quot;stddev:&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">,</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#afd787">sqrt</font></span>(sumsq<span style="background-color:#1c1c1c;"><font color="#d7d7af">/NR &#8211; (sum/</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">NR</font></span>)**<span style="background-color:#1c1c1c;"><font color="#d7af87">2</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">)</font></span><br />
}</p>
<p></font>
</div>
<p>Here&#8217;s what the output looks like:<br />
<img src="http://mps.s3.amazonaws.com/images/numstats/numstats.png" /></p>
<p>I included it in my <a href="https://github.com/jpalardy/dotfiles">dotfiles</a>: the <a href="https://github.com/jpalardy/dotfiles/blob/master/bin/numstats.awk">awk code</a> and a <a href="https://github.com/jpalardy/dotfiles/blob/master/bin/numstats">bootstrap shell script</a> (used above).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/605/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/605/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/605/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=605&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/11/10/minimal-statistics-on-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/numstats/numstats.png" medium="image" />
	</item>
		<item>
		<title>Bookpiles</title>
		<link>http://technotales.wordpress.com/2010/10/25/bookpiles/</link>
		<comments>http://technotales.wordpress.com/2010/10/25/bookpiles/#comments</comments>
		<pubDate>Mon, 25 Oct 2010 18:04:15 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=596</guid>
		<description><![CDATA[This project started out as a list of books in a text file. When I think about a book, I think about its content, the people who talked about it and how it made me feel. Central to those thoughts is the visual representation of the book itself: its cover. A list in a text [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=596&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This <a href="http://bookpiles.ca/">project</a> started out as a list of books in a text file.</p>
<p><img src="http://mps.s3.amazonaws.com/images/bookpiles/How_to.jpeg" alt="screenshot" /></p>
<p>When I think about a book, I think about its content, the people who talked about it and how it made me feel. Central to those thoughts is the visual representation of the book itself: its cover. A list in a text file was not the best way to think about books. Over time, I realized that it would be the kind of problem suited for a small web application.</p>
<p><img src="http://mps.s3.amazonaws.com/images/bookpiles/Details.jpeg" alt="screenshot" /></p>
<p>I spent many hours working on this project. It used to be an excuse to play with Ruby on Rails. It used to be an excuse to play the limits of rich-client Javascript applications. It used to be an excuse to play with client and server-side optimizations, not by necessity but by a conscious effort to want to try things on a project I fully understand.</p>
<p>This is an application I designed for myself and that I use, for the lack of a better word, religiously. Hearing about books I want to read, buying a book, starting a new book, or finishing one, these are events that make me want to go to my profile and update it.</p>
<p>This application was initially meant to replace a text file. But the nature of a public display of books created new possibilities. When it comes to people I know, I want to know what they are reading so that we can talk about it the next time we meet.</p>
<p>“How was that book?”</p>
<p>Also, you can look at what people have read and discover what interests them. I have had a lot of interesting discussions after people browsed the books I have read.</p>
<p>Finally, this is also meant to be a portfolio piece. I can send people to the site to have a look at what I can do. The project is open-source and people can read the code and reach their own conclusions.</p>
<p>I&#8217;m open to comments and suggestions. Let me know what you think.</p>
<p>Code: <a href="http://github.com/jpalardy/bookpiles">http://github.com/jpalardy/bookpiles</a><br />
Live app: <a href="http://bookpiles.ca">http://bookpiles.ca</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/596/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/596/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/596/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=596&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/10/25/bookpiles/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/bookpiles/How_to.jpeg" medium="image">
			<media:title type="html">screenshot</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/bookpiles/Details.jpeg" medium="image">
			<media:title type="html">screenshot</media:title>
		</media:content>
	</item>
		<item>
		<title>Command-line One-liner Challenges</title>
		<link>http://technotales.wordpress.com/2010/10/15/command-line-one-liner-challenges/</link>
		<comments>http://technotales.wordpress.com/2010/10/15/command-line-one-liner-challenges/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 02:39:48 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=583</guid>
		<description><![CDATA[A few years ago, when I was more into python, I stumbled on python challenge. It was great fun, I learned a bunch of stuff and it forced me to play with libraries I wasn&#8217;t familiar with. In their own words: (about) Python Challenge is a game in which each level can be solved by [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=583&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A few years ago, when I was more into python, I stumbled on <a href="http://www.pythonchallenge.com/">python challenge</a>. It was great fun, I learned a bunch of stuff and it forced me to play with libraries I wasn&#8217;t familiar with.</p>
<p>In their own words: (<a href="http://www.pythonchallenge.com/about.php">about</a>)</p>
<blockquote><p>
Python Challenge is a game in which each level can be solved by a bit of (Python) programming.</p>
<p>The Python Challenge was written by Nadav Samet.</p>
<p>All levels can be solved by straightforward and very short1 scripts.</p>
<p>Python Challenge welcomes programmers of all languages. You will be able to solve most riddles in any programming language, but some of them will require Python.</p>
<p>Sometimes you&#8217;ll need extra modules. All can be downloaded for free from the internet.</p>
<p>It is just for fun &#8211; nothing waits for you at the end.</p>
<p>Keep the scripts you write &#8211; they might become useful. </p></blockquote>
<h2>Learning</h2>
<p>People who know me know that <a href="http://bookpiles.ca/jonathan/books#done">I read a lot</a>. I am, therefore, painfully aware that books are <strong><em>not</em></strong> the best way to learn things.</p>
<p>What is the best way to learn something?</p>
<p>To be honest … I don&#8217;t know. Not books, not screencasts… There are better ways: a one-on-one session, pair programming. On the side of DOING there is always: DOING more. Read more code, program more, release more.</p>
<h2>Doing</h2>
<p>In the spirit of the python challenge, I released today <a href="http://github.com/jpalardy/Command-line-one-liner-challenges">Command-line One-liner Challenges</a>.</p>
<p>The idea is not exactly the same: I do provide solutions and you are allowed to move on based on your interests (or frustration).</p>
<p>I strive to make each challenge look and feel like any other challenge. The directory structure will be something like this:<br />
<img src="http://mps.s3.amazonaws.com/images/command_line_challenges/structure.png" alt="directory structure" /><br />
Each challenge is its own directory (numbered). Inside it, you can find a very short instructions.txt file. There are 2 subdirectories: problem and solution. Those subdirectories should be the same except for the content of the compare.sh file.</p>
<p>Look at the input.txt file. Then, look at the expected.txt file. Imagine how, as a one-liner, you could transform input.txt into expected.txt.</p>
<p>You are supposed to run compare.sh. Just open it and fill in the blanks, so to speak.</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><span style="background-color:#1c1c1c;"><font color="#808080">#!/bin/sh</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#afd787">convert() {</font></span><br />
&nbsp;&nbsp;cat <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$@</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#afd787">}</font></span></p>
<p>convert input.txt <span style="background-color:#1c1c1c;"><font color="#5fafd7">&gt;</font></span>&nbsp;actual.txt</p>
<p><span style="background-color:#1c1c1c;"><font color="#d7afd7">${</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">DIFF</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">:-</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">diff -q</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">}</font></span>&nbsp;actual.txt expected.txt</p>
<p></font></div>
<p>The project&#8217;s <a href="http://github.com/jpalardy/Command-line-one-liner-challenges/blob/master/README.md">README</a> contains more information.</p>
<h2>Comments</h2>
<p>This is meant to be fun. Clone the repository and give it a go. I&#8217;m going to push more challenges over time, you might want to watch the repo.</p>
<p>If you have a better solution than what I provide, please send it to me, I&#8217;ll find a way to include it in the project.</p>
<p>Also, if you have an idea for a challenge, let me know.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/583/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/583/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/583/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=583&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/10/15/command-line-one-liner-challenges/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/command_line_challenges/structure.png" medium="image">
			<media:title type="html">directory structure</media:title>
		</media:content>
	</item>
		<item>
		<title>How MANPATH works</title>
		<link>http://technotales.wordpress.com/2010/09/21/how-manpath-works/</link>
		<comments>http://technotales.wordpress.com/2010/09/21/how-manpath-works/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 15:06:08 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=575</guid>
		<description><![CDATA[Just after I was done writing Managing PATH and MANPATH, I stumbled on &#8220;man man&#8221; and put to rest the mysteries of MANPATH. How it works If MANPATH is defined, it will be used to lookup man pages. If MANPATH is NOT defined, the manpath config file is going to be used. Depending on the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=575&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Just after I was done writing <a href="http://technotales.wordpress.com/2010/09/19/managing-path-and-manpath/">Managing PATH and MANPATH</a>, I stumbled on &#8220;man man&#8221; and put to rest the mysteries of MANPATH.</p>
<h2>How it works</h2>
<p>If MANPATH is defined, it will be used to lookup man pages.</p>
<p>If MANPATH is <strong><em>NOT</em></strong> defined, the manpath config file is going to be used. Depending on the OS your are using, it might be something like /etc/man.conf (Mac OS X) or /etc/manpath.config (Ubuntu).</p>
<p>Here&#8217;s an excerpt for &#8220;man man&#8221; (Mac OS X):</p>
<p><img src="http://mps.s3.amazonaws.com/images/how_manpath_works/man_man_excerpt.png" /></p>
<p>It says there&#8217;s a command line flag to override MANPATH (-M), but I don&#8217;t think that&#8217;s excessively useful.</p>
<p>Here&#8217;s something useful: when you aren&#8217;t sure what man page you&#8217;re going to get, try the -w flag.</p>
<p><img src="http://mps.s3.amazonaws.com/images/how_manpath_works/the_w_flag.png" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/575/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/575/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/575/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=575&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/09/21/how-manpath-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/how_manpath_works/man_man_excerpt.png" medium="image" />

		<media:content url="http://mps.s3.amazonaws.com/images/how_manpath_works/the_w_flag.png" medium="image" />
	</item>
		<item>
		<title>Managing PATH and MANPATH</title>
		<link>http://technotales.wordpress.com/2010/09/19/managing-path-and-manpath/</link>
		<comments>http://technotales.wordpress.com/2010/09/19/managing-path-and-manpath/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 19:14:36 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[cli]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=564</guid>
		<description><![CDATA[PATH My PATH variable used to be a mess. I have used UNIX-like systems for 10 years and have carried around my configuration files in one form or another since then. Think about Solaris, think about /opt (or /sw), and change the order based on different requirements. I have seen a lot of people devise [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=564&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>PATH</h2>
<p>My PATH variable used to be a mess. I have used UNIX-like systems for 10 years and have carried around my <a href="http://github.com/jpalardy/dotfiles">configuration files</a> in one form or another since then.</p>
<p><img src="http://mps.s3.amazonaws.com/images/path_and_manpath/path.png" /></p>
<p>Think about Solaris, think about /opt (or /sw), and change the order based on different requirements.</p>
<p>I have seen a lot of people devise clever if-then-else logic with OS-detection. I have seen yet other, myself included, who tried to aim for the most comprehensive and all-inclusive PATH.</p>
<p>In the end, all that matters is that when you type a command, it <strong><em>IS</em></strong> in your path</p>
<h2>MANPATH</h2>
<p>As for MANPATH, the situation was even worse. I used to depend (and hope) that the OS-inherited MANPATH contained everything I needed. For a long time, I didn&#8217;t bother to set it right and just googled for the man pages if/when I was in need.</p>
<p>Invoking man for something I just installed often meant getting no help at all.</p>
<p><img src="http://mps.s3.amazonaws.com/images/path_and_manpath/man_ack.png" /></p>
<h2>Where to look?</h2>
<p>When it comes to <tt>bin</tt> and <tt>share/man</tt> directories, there are a handful of predictable places to look for. For PATH:</p>
<ul>
<li><tt>/usr/X11/bin</tt></li>
<li><tt>/bin</tt></li>
<li><tt>/sbin</tt></li>
<li><tt>/usr/bin</tt></li>
<li><tt>/usr/sbin</tt></li>
<li><tt>/usr/local/bin</tt></li>
<li><tt>/opt/local/bin</tt></li>
<li><tt>/opt/local/sbin</tt></li>
</ul>
<p>Notice the <tt>bin</tt> and <tt>sbin</tt> combinations. And for MANPATH:</p>
<ul>
<li><tt>/usr/X11/share/man</tt></li>
<li><tt>/usr/share/man</tt></li>
<li><tt>/usr/local/share/man</tt></li>
<li><tt>/opt/local/share/man</tt></li>
</ul>
<p>It should be clear that there is a lot of duplication there. Also, if you change the order of your PATH, you should probably change the order of your MANPATH so that the command you get the man page for is the command invoked by your shell. The GNU man pages are not very useful when you are using the BSD commands, on Darwin, for example.</p>
<h2>A solution</h2>
<p>Here&#8217;s the plan:</p>
<ol>
<li>Clear both PATH and MANPATH.</li>
<li>Given a path, detect the presence of a <tt>bin</tt>, <tt>sbin</tt> and <tt>share/man</tt> subdirectories.</li>
<li>Prepend the existing directories from step 2 to both PATH and MANPATH (as appropriate).</li>
</ol>
<p>What you get:</p>
<ul>
<li>Only existing paths go in PATH and MANPATH. No more just-in-case™ and for-some-other-OS™ paths polluting your variables.</li>
<li>Order of the paths is the same for both PATH and MANPATH. If you change the order in one, the order is changed for the other.</li>
<li>Easier to read configuration files. Colon-separated lists are no fun to parse visually.</li>
</ul>
<p>Here&#8217;s something you can put in your <tt>.bashrc</tt></p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><br />
<span style="background-color:#1c1c1c;"><font color="#808080"># prepend_colon(val, var)</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#afd787">prepend_colon() {</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">if </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">[</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">-z</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$2</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">]</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">;</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">then</font></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">echo</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">else</font></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">echo</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">:</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$2</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">fi</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#afd787">}</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#808080"># unshift_path(path)</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#afd787">unshift_path() {</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">if </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">[</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">-d</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span>/sbin <span style="background-color:#1c1c1c;"><font color="#5fafd7">]</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">;</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">then</font></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;PATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">$(</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">prepend_colon </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/sbin</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$PATH</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">)</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">fi</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">if </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">[</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">-d</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span>/bin <span style="background-color:#1c1c1c;"><font color="#5fafd7">]</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">;</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">then</font></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;PATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">$(</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">prepend_colon </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/bin</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$PATH</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">)</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">fi</font></span></p>
<p>&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">if </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">[</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">-d</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span>/share/man <span style="background-color:#1c1c1c;"><font color="#5fafd7">]</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">;</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">then</font></span><br />
&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;MANPATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">$(</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">prepend_colon </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$1</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/share/man</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$MANPATH</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">)</font></span><br />
&nbsp;&nbsp;<span style="background-color:#1c1c1c;"><font color="#5fafd7">fi</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#afd787">}</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#808080"># TABULA RASA</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;PATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=&quot;&quot;</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;MANPATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=&quot;&quot;</font></span></p>
<p>unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/usr/X11</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/usr</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/usr/local</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/opt/local</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$HOME</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/local</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><br />
unshift_path <span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$HOME</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">/etc</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#5fafd7">export</font></span><span style="background-color:#1c1c1c;"><font color="#afd787">&nbsp;PATH</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">=</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">$(</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">prepend_colon </font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">.local</font></span><span style="background-color:#1c1c1c;"><font color="#5fafd7">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&nbsp;</font></span><span style="background-color:#1c1c1c;"><font color="#d7afd7">$PATH</font></span><span style="background-color:#1c1c1c;"><font color="#ff0000">)</font></span><br />
</font></div>
<h2>Notes</h2>
<p>I use <tt>$HOME/local</tt> to store machine-specific binaries/scripts. For example, that&#8217;s where I install <a href="http://github.com/mxcl/homebrew">homebrew</a> on Mac OS X. That&#8217;s also where I would put cron scripts or other &#8220;I just use this script on this machine&#8221; type of things.</p>
<p>I use <tt>$HOME/etc</tt> to store binaries I carry around with my configuration files. That&#8217;s where I clone my <a href="http://github.com/jpalardy/dotfiles">dotfiles project</a>.</p>
<p>Finally, the relative path <tt>.local</tt> is an interesting hack. It allows for directory-specific binaries. This solves the &#8220;I just use this script when I&#8217;m in that directory&#8221; problem. This trick is discussed in <a href="http://technotales.wordpress.com/2010/06/15/directory-specific-executable-override">this blog post</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/564/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/564/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/564/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=564&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/09/19/managing-path-and-manpath/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/path_and_manpath/path.png" medium="image" />

		<media:content url="http://mps.s3.amazonaws.com/images/path_and_manpath/man_ack.png" medium="image" />
	</item>
		<item>
		<title>Bundler Without Rails</title>
		<link>http://technotales.wordpress.com/2010/08/22/bundler-without-rails/</link>
		<comments>http://technotales.wordpress.com/2010/08/22/bundler-without-rails/#comments</comments>
		<pubDate>Sun, 22 Aug 2010 14:56:58 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=549</guid>
		<description><![CDATA[Yesterday I reached into a project I had not touched in months. When I wrote that Ruby script, it was supposed to be a one-off effort, but, as it usually goes for things like these, it had ended sticking around for much longer than anticipated. I have RVM installed and I had installed many Rubies [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=549&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I reached into a project I had not touched in months. When I wrote that Ruby script, it was supposed to be a one-off effort, but, as it usually goes for things like these, it had ended sticking around for much longer than anticipated.</p>
<p>I have <a href="http://rvm.beginrescueend.com/">RVM</a> installed and I had installed many Rubies and done all kinds of gem manipulations. In short, the &#8220;environment&#8221; in which that project had worked was gone.</p>
<p>I had the &#8220;require&#8221; statements to guide me:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><br />
<span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">rubygems</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">dm-core</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">dm-timestamps</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">json</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><br />
</font></div>
<p>However, that&#8217;s not the whole story. In this specific case, DataMapper requires<br />
more gems based on the connection string you give it.</p>
<p>I think we have all tried this:</p>
<ol>
<li>try to run a script</li>
<li>see what &#8220;require&#8221; crashed the whole thing</li>
<li>install some gems (hopefully with the version needed)</li>
<li>repeat</li>
</ol>
<p>Isn&#8217;t <a href="http://gembundler.com/">Bundler</a> supposed to solve that problem?</p>
<h2>Bundler</h2>
<p>I have used Bundler with Rails 3. But that&#8217;s all configured and just automagically works. In a standalone project, there are a few things you need to do yourself.</p>
<p>First:</p>
<p><code>
<pre>
&gt; bundle init
</pre>
<p></code></p>
<p>All that command did was to create an empty Gemfile.</p>
<p>Open the Gemfile with your favorite editor and add your gem dependencies. Mine looked like this:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><br />
<span style="background-color:#1c1c1c;"><font color="#808080"># A sample Gemfile</font></span><br />
source <span style="background-color:#1c1c1c;"><font color="#d7d7af">:gemcutter</font></span></p>
<p>gem <span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">dm-core</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><br />
gem <span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">dm-timestamps</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><br />
gem <span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">dm-sqlite-adapter</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span></p>
<p>gem <span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">json</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&quot;</font></span><br />
</font></div>
<p>Then, run:</p>
<p><code>
<pre>
&gt; bundle install
</pre>
<p></code></p>
<p>So far, this is all regular Bundler stuff. What about your script?</p>
<p>Bundler knows about all your dependencies, surely it will &#8220;require&#8221; all I need, right?</p>
<p>Yes and &#8230; no.</p>
<h2>Bundler Documentation Fail</h2>
<p>Here&#8217;s a screenshot from <a href="http://gembundler.com/v1.0/index.html">Bundler&#8217;s documentation</a></p>
<p><img src="http://mps.s3.amazonaws.com/images/bundler_standalone/require_as_usual.jpg" /></p>
<p>Thank you Bundler, I &#8220;require&#8221; you and now &#8230; huh &#8230; I still require all the gems I need?! I doesn&#8217;t sound very DRY to me.</p>
<p>What the &#8220;bundler/setup&#8221; line did was to configure the load path.</p>
<p>And you <em>could</em> do your requires manually&#8230;</p>
<p>If I&#8217;m writing this it&#8217;s because there&#8217;s a way. I&#8217;m just surprised that the Bundler website doesn&#8217;t seem to document this useful feature. If there are good reasons why this is not documented (tradeoffs or something) or, even, the default behavior &#8212; we can only guess.</p>
<p>Here&#8217;s what your script should do:</p>
<div style="background:#1c1c1c;color:#d0d0d0;font-size:120%;padding:10px;"><font face="monospace"><br />
<span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">rubygems</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><br />
<span style="background-color:#1c1c1c;"><font color="#d7afd7">require</font></span>&nbsp;<span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span><span style="background-color:#1c1c1c;"><font color="#d7d7af">bundler/setup</font></span><span style="background-color:#1c1c1c;"><font color="#d78787">&#8216;</font></span></p>
<p><span style="background-color:#1c1c1c;"><font color="#afafd7">Bundler</font></span>.require<br />
</font></div>
<p>The &#8220;Bundler.require&#8221; line will require all your dependencies.</p>
<p>One last note, do lock (bundle lock) your Gemfile so that the dependency resolution phase is skipped. It will make loading your script much faster. (this also applies to Rails projects)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/549/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/549/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/549/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=549&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/08/22/bundler-without-rails/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>

		<media:content url="http://mps.s3.amazonaws.com/images/bundler_standalone/require_as_usual.jpg" medium="image" />
	</item>
		<item>
		<title>Book Reading Opportunity Cost</title>
		<link>http://technotales.wordpress.com/2010/08/20/book-reading-opportunity-cost/</link>
		<comments>http://technotales.wordpress.com/2010/08/20/book-reading-opportunity-cost/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 18:50:22 +0000</pubDate>
		<dc:creator>Jonathan Palardy</dc:creator>
				<category><![CDATA[books]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://technotales.wordpress.com/?p=536</guid>
		<description><![CDATA[Reading a book takes time. The time you spend reading a book is not spent doing something else. Opportunity cost: (source) Benefit, profit, or value of something that must be given up to acquire or achieve something else. Since every resource (land, money, time, etc.) can be put to alternative uses, every action, choice, or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=536&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Reading a book takes time.</p>
<p>The time you spend reading a book is not spent doing something else.</p>
<p>Opportunity cost: (<a href="http://www.businessdictionary.com/definition/opportunity-cost.html">source</a>)</p>
<blockquote><p>Benefit, profit, or value of something that must be given up to acquire or achieve something else. Since every resource (land, money, time, etc.) can be put to alternative uses, every action, choice, or decision has an associated opportunity cost.</p></blockquote>
<p>Does it sound obvious? Lately, however, I&#8217;ve made a few such mistakes with respect to some books I bought.</p>
<h2>Atlas Shrugged</h2>
<p><a href="http://www.amazon.com/gp/product/0451191145?ie=UTF8&amp;tag=acidfogsbookl-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0451191145">Atlas Shrugged</a> has been recommended many times, by many different people. Consequently, it raised above my <a href="http://technotales.wordpress.com/2007/03/16/rising-noise-the-threshold/">threshold of consciousness</a> and I had decided to buy it, read it and reach my own conclusions about it.</p>
<p>I have been to Chapters and I had remembered about Atlas Shrugged. Of course, it was in the shelves and I looked through it. What sealed the deal was the price: $10! How could I go wrong?!</p>
<h2>Where did I go wrong?</h2>
<p>It could have been an audio book.</p>
<p>I&#8217;m writing this with the book on my lap. It stands at 1069 pages in something that feels like 6-pt font. More so than other books I&#8217;ve had, I will feel the impact of the time invested in reading it. Even in audio, Atlas Shrugged stands tall with 63 hours of narration.<a href="#note_1"><sup>1</sup></a></p>
<p>I bought the physical book with good intentions. However, it has been gathering dust for a while now. I wondered when, if ever, I would have enough time to decide to read it.</p>
<p>If only I had bought it in audio format. But it was too late now&#8230; I had already bought it in paper format. Buying the audio book meant paying &#8220;twice&#8221;. There was something very unpleasant about that thought.</p>
<h2>Opportunity Cost</h2>
<p>Then, a few days ago, I realized that the $15 it would cost me to buy the audio book was not completely lost.</p>
<p>It meant that I could spend the time I listened to the book doing other things: dishes, chores, exercising. It meant I could start the book right away, instead of some perfect moment in the future, <em>because</em> I could do other things at the same time.</p>
<p>Am I happy that I paid twice? No. But the total cost of the book, $25 ($10 paper + $15 audio), must be contrasted against the time I just saved by not having to sit down while reading.</p>
<p>I have a few other books with which I will have to repeat this process. <a href="http://www.amazon.com/gp/product/0674034074?ie=UTF8&amp;tag=acidfogsbookl-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0674034074">Uncle Tom&#8217;s Cabin</a> comes to mind. That was another &#8220;cheap&#8221; book I bought in the spur of the moment. I&#8217;m learning this lesson about the total cost of a book.</p>
<h2>Notes</h2>
<ol>
<li><a name="note_1" />I have been buying audio books for a while. Duration is the closest thing to an absolute measure of the &#8220;bigness&#8221; of a book that I have found. While printed books can play with font size, line spacing, margin and other things to fit the content in different formats, most narration are done in predictable speed.
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/technotales.wordpress.com/536/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/technotales.wordpress.com/536/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/technotales.wordpress.com/536/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=technotales.wordpress.com&amp;blog=761277&amp;post=536&amp;subd=technotales&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://technotales.wordpress.com/2010/08/20/book-reading-opportunity-cost/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ecfd1bdc5d3aab1e40f25658817712ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">jpalardy</media:title>
		</media:content>
	</item>
	</channel>
</rss>
