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

<channel>
	<title>The Joy of Hack</title>
	<atom:link href="http://www.aijazansari.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aijazansari.com</link>
	<description>For people who like to make things</description>
	<lastBuildDate>Wed, 10 Mar 2010 13:44:48 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>David duChemin On Being A Professional Photographer</title>
		<link>http://www.aijazansari.com/2010/03/10/david-duchemin-on-being-a-professional-photographer/</link>
		<comments>http://www.aijazansari.com/2010/03/10/david-duchemin-on-being-a-professional-photographer/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 13:44:48 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=518</guid>
		<description><![CDATA[I recently discovered David duChemin&#8217;s blog.  I&#8217;d like to share a couple of  his posts with you.  In &#8216;Just?&#8217; he offers advice to people who consider themselves &#8216;just an amateur photographer.&#8217;  In his follow-up piece &#8216;Confessions of a So-Called PRO&#8217; he serves up an &#8216;anti-pep-talk&#8217; that demonstrates that professional photographers aren&#8217;t necessarily that different from [...]]]></description>
			<content:encoded><![CDATA[<p>I recently discovered David duChemin&#8217;s blog.  I&#8217;d like to share a couple of  his posts with you.  In <a href="http://www.pixelatedimage.com/blog/2009/11/just/">&#8216;Just?&#8217;</a> he offers advice to people who consider themselves &#8216;just an amateur photographer.&#8217;  In his follow-up piece <a href="http://www.pixelatedimage.com/blog/2010/03/not-much-of-a-pro-really/">&#8216;Confessions of a So-Called PRO&#8217;</a> he serves up an &#8216;anti-pep-talk&#8217; that demonstrates that professional photographers aren&#8217;t necessarily that different from amateurs like you and me.</p>
<p><a href="http://www.flickr.com/photos/aijazansari/3182995057/"><img class="alignnone" title="Fish" src="http://farm4.static.flickr.com/3507/3182995057_20b902ceba.jpg" alt="Fish" width="500" height="333" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/03/10/david-duchemin-on-being-a-professional-photographer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sometimes Text Files Are Better Than Databases</title>
		<link>http://www.aijazansari.com/2010/03/08/sometimes-text-files-are-better-than-databases/</link>
		<comments>http://www.aijazansari.com/2010/03/08/sometimes-text-files-are-better-than-databases/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 03:08:33 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Data]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[Diff]]></category>
		<category><![CDATA[Editors]]></category>
		<category><![CDATA[Grep]]></category>
		<category><![CDATA[GUI]]></category>
		<category><![CDATA[Persistence]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[RDBMS]]></category>
		<category><![CDATA[Representation]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[TaskForest]]></category>
		<category><![CDATA[Text]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=499</guid>
		<description><![CDATA[There are many classes of applications for which text files are the preferred means of storing data.  One of the main reasons is that when data is stored in a relational database, editing it is not a trivial task.  A well-normalized database is not easily updated via an SQL command line.  More often than not, a dedicated, graphical editor is needed to model the complex relationships.    ]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-504" href="http://www.aijazansari.com/2010/03/08/sometimes-text-files-are-better-than-databases/file/"><img class="alignleft size-full wp-image-504" title="A File" src="http://www.aijazansari.com/wp-content/uploads/2010/03/File.png" alt="A File" width="108" height="136" /></a>I remember in my first Computer Programming class in college, the instructors wanted to make sure we understood the concept of persistence by saving application data to disk.  To keep things simple we would serialize data and save it to text files.  Once we learned advanced concepts we migrated to using relational databases.  As a professional, most of the apps I see use an RDBMS like DB2, PostgreSQL, Sybase or Oracle.  Text files have been relegated to the simple homework assignments of Programming 101.</p>
<p>There are, however, many classes of applications for which text files are the preferred means of storing data.  One of the main reasons is that <strong>when data is stored in a relational database, editing it is not a trivial task</strong>.  A well-normalized database is not easily updated via an SQL command line.  More often than not, a dedicated, graphical editor is needed to model the complex relationships.</p>
<p>Several years ago, when I wrote <a href="http://www.taskforest.com/">TaskForest</a>, one of the initial design requirements was that it be easily configurable with just a shell prompt and one&#8217;s favorite text editor. Many of the servers I cared for for schools and non-profits were old boxes which I administered by logging into them via ssh. So when it came to designing job definitions and dependencies, I chose a text file representation. The benefits of text files over a graphical user interface for this include:</p>
<dl>
<dt>Easy Remote Access</dt>
<dd>All you need is the ability to get to a command line and a text editor on the machine that holds the data files. With the such low client access requirements, virtually any old machine that has internet access and an ssh client can be used to administer the system. I have often worked on my own taskforestd server from a local internet cafe using a Putty.exe downloaded minutes earlier.</dd>
<dt>Mobile Access</dt>
<dd>Text files also make work relatively easy using a mobile ssh client like Idokorro Mobile SSH. A dedicated mobile client would be ideal, but short of that, the text file approach assures low bandwidth usage and easy-to-make changes.</dd>
<dt>Flexibility</dt>
<dd>The simple, easily parseable format of text files allows us to build richer graphical clients later that would use a graphical interface to specify relationships between jobs.</dd>
<dt>Source Control</dt>
<dd> The text based format makes it easy to place the data files under source control. You can also easily <em>diff</em> different versions of the same data file.</dd>
<dt><em>Grep</em></dt>
<dd> When you have dozens of job group files and hundreds of jobs, you may need to answer questions like: &#8220;Are we still running Job J?&#8221; This can easily be answered by <em>grep</em>ping the files for job J.</dd>
<dt>Low footprint</dt>
<dd>When you&#8217;re designing an open-source application you may want to minimize the complexity of the system by not forcing dependencies on major subsystems like GUI libraries and Relational Databases.  Of course there is a point at which a such dependencies are inevitable &#8211; you have to periodically re-evaluate your decisions and determine whether decisions that were correct, say, a year ago are still correct today.</dd>
</dl>
<h2>Choosing A Text Format</h2>
<p>In the case of the TaskForest project, the most difficult task by far was choosing which text format to use.  I went through several iterations trying to find one that was simple to read and write, and yet rich enough to model the domain space completely.  What worked for me (and might work for you) was to ask myself how I would represent the data I&#8217;m trying to save given just a pencil and paper.  Drawing in a notebook gave me the flexibility to sketch and edit easily, and once I had a good representation, converting that to a text file was a simple task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/03/08/sometimes-text-files-are-better-than-databases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding A Grid To Your Websites</title>
		<link>http://www.aijazansari.com/2010/03/05/adding-a-grid-to-your-websites/</link>
		<comments>http://www.aijazansari.com/2010/03/05/adding-a-grid-to-your-websites/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 05:26:47 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Grids]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=492</guid>
		<description><![CDATA[The #grid website has a great tool for web designers -it &#8220;inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.&#8221;  Go to their website and have a look.  It&#8217;s pretty impressive.  Simple, but impressive.  I think I&#8217;m gonna give this [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_493" class="wp-caption alignleft" style="width: 199px"><a rel="attachment wp-att-493" href="http://www.aijazansari.com/2010/03/05/adding-a-grid-to-your-websites/20100305-_jaz1036-edit/"><img class="size-medium wp-image-493" title="190 S. La Salle St." src="http://www.aijazansari.com/wp-content/uploads/2010/03/20100305-_JAZ1036-Edit-189x285.jpg" alt="190 S. La Salle St." width="189" height="285" /></a><p class="wp-caption-text">190 S. La Salle St. - Downtown Chicago</p></div>
<p>The <a href="http://hashgrid.com/">#grid</a> website has a great tool for web designers -it &#8220;inserts a layout grid in web pages, allows you to hold it in place, and toggle between displaying it in the foreground or background.&#8221;  Go to their <a href="http://hashgrid.com">website</a> and have a look.  It&#8217;s pretty impressive.  Simple, but impressive.  I think I&#8217;m gonna give this a shot for the next web site I design.  I think it would be really useful in development, not as much in a production environment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/03/05/adding-a-grid-to-your-websites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Willis Tower (Sears Tower)</title>
		<link>http://www.aijazansari.com/2010/03/04/willis-tower-sears-tower/</link>
		<comments>http://www.aijazansari.com/2010/03/04/willis-tower-sears-tower/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 03:31:51 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Photos]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=488</guid>
		<description><![CDATA[

SearsTower by AijazAnsari




Camera:
NIKON D700


Exposure:
1/125


Aperture:
f/5.6


Focal Length:
50 mm


Exposure Bias:
0 EV


ISO Speed:
1250


Flash:
No Flash



]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div class="wp-caption alignnone" style="width: 343px;"><a href="http://www.flickr.com/photos/aijazansari/4407199631/"><img class="aligncenter" title="SearsTower" src="http://farm5.static.flickr.com/4055/4407199631_dd1f9d239d.jpg" alt="SearsTower" width="333" height="500" /></a></p>
<p class="wp-caption-text"><a href="http://www.flickr.com/photos/aijazansari/4407199631/">SearsTower</a> by <a href="http://www.flickr.com/photos/aijazansari/">AijazAnsari</a></p>
</div>
<table class="flickr-exif">
<tbody>
<tr>
<td>Camera:</td>
<td>NIKON D700</td>
</tr>
<tr>
<td>Exposure:</td>
<td>1/125</td>
</tr>
<tr>
<td>Aperture:</td>
<td>f/5.6</td>
</tr>
<tr>
<td>Focal Length:</td>
<td>50 mm</td>
</tr>
<tr>
<td>Exposure Bias:</td>
<td>0 EV</td>
</tr>
<tr>
<td>ISO Speed:</td>
<td>1250</td>
</tr>
<tr>
<td>Flash:</td>
<td>No Flash</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/03/04/willis-tower-sears-tower/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Most Dangerous Programming Errors</title>
		<link>http://www.aijazansari.com/2010/02/26/the-most-dangerous-programming-errors/</link>
		<comments>http://www.aijazansari.com/2010/02/26/the-most-dangerous-programming-errors/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 15:00:10 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Bugs]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=478</guid>
		<description><![CDATA[The Common Weakness Enumeration (CWE) has released their list of Top 25 Most Dangerous Programming Errors. This list and the explanations of the errors are very instructive and should help both novice and expert programmers.  If you&#8217;re a developer, I strongly urge you to read this document and make sure you understand the concepts it [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_481" class="wp-caption alignleft" style="width: 295px"><a rel="attachment wp-att-481" href="http://www.aijazansari.com/2010/02/26/the-most-dangerous-programming-errors/mac-00117-img_6318_2/"><img class="size-medium wp-image-481" title="Streams at the Great Smoky Mountains" src="http://www.aijazansari.com/wp-content/uploads/2010/02/Mac-00117-IMG_6318_2-285x190.jpg" alt="Streams at the Great Smoky Mountains" width="285" height="190" /></a><p class="wp-caption-text">Streams at the Great Smoky Mountains</p></div>
<p>The Common Weakness Enumeration (CWE) has released their list of <a href="http://cwe.mitre.org/top25/">Top 25 Most Dangerous Programming Errors</a>. This list and the explanations of the errors are very instructive and should help both novice and expert programmers.  If you&#8217;re a developer, I strongly urge you to read this document and make sure you understand the concepts it covers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/26/the-most-dangerous-programming-errors/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Tautline Hitch Knot</title>
		<link>http://www.aijazansari.com/2010/02/24/the-tautline-hitch-knot/</link>
		<comments>http://www.aijazansari.com/2010/02/24/the-tautline-hitch-knot/#comments</comments>
		<pubDate>Wed, 24 Feb 2010 07:10:33 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Camping]]></category>
		<category><![CDATA[Knots]]></category>
		<category><![CDATA[Hitches]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=427</guid>
		<description><![CDATA[If you've ever had to tie a volleyball net or a tent guy line to a stake, you know difficult it is to tie the knot at just the right place to keep the line tight. The tautline hitch knot is perfect for this application.]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-445" href="http://www.aijazansari.com/2010/02/24/the-tautline-hitch-knot/_jaz0650_tautlinehitch-2/"><img class="alignleft size-medium wp-image-445" title="_JAZ0650_TautlineHitch-2" src="http://www.aijazansari.com/wp-content/uploads/2010/02/JAZ0650_TautlineHitch-2-189x285.jpg" alt="" width="189" height="285" /></a>Humans have been using rope as a tool for thousands of years, even before we started recording history.  Knots and rope-tying is one of the few technologies that have persisted essentially unchanged in all of the known human history.  As you can imagine, there are different knots for different applications, and in this series of posts, I would like to share with you the knots that I&#8217;ve found most useful both at home and outdoors.</p>
<h2>The Tautline Hitch</h2>
<p>It is very common to want a taut line (rope) between two objects.  In these cases it is not enough to just connect a rope to the two endpoints.  The rope must also stay stretched and not sag.  If you&#8217;ve ever had to tie a volleyball net or a tent guy line to a stake, you know difficult it is to tie the knot at just the right place to keep the line tight.  It doesn&#8217;t help when the line sags every so often and needs to be retightened.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/m8NkEp7Cxsw&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/m8NkEp7Cxsw&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>The tautline hitch knot is perfect for this application.  It makes a loop in the rope and the position of the knot affects length of the loop.  The more you move the knot towards the opposite end of the rope, the tighter the line gets.  The knot is like a ratchet.  It can be slid up and down the rope, but it does not slide when the rope is under tension.  It only moves when you hold the knot and push it one way or the other.  This way when a rope sags, you can hold the knot and move it from one endpoint to the other without having to untie the knot and retie it.</p>
<p>There are many resources out there for learning how to tie knots.  My favorites are the <a href="http://www.amazon.com/Klutz-Book-Knots-John-Cassidy/dp/1591748089/ref=sr_1_45?ie=UTF8&amp;s=books&amp;qid=1266977750&amp;sr=1-45">Klutz Book of Knots</a>, <a href="http://www.amazon.com/Complete-Book-Knots-Geoffrey-Budworth/dp/1558216324/ref=sr_1_6?ie=UTF8&amp;s=books&amp;qid=1266977657&amp;sr=1-6">The Complete Book of Knots</a>, and the <a href="http://www.animatedknots.com/">Animated Knots website</a>.  Of course, no discussion on knots can be complete without mentioning the definitive reference, <a href="http://www.amazon.com/Ashley-Book-Knots-Clifford/dp/0385040253/ref=sr_1_5?ie=UTF8&amp;s=books&amp;qid=1266977657&amp;sr=1-5">Ashley Book of Knots</a>, with more than 3,900 different knots and 7,000 illustrations.</p>
<p><a rel="attachment wp-att-446" href="http://www.aijazansari.com/2010/02/24/the-tautline-hitch-knot/_jaz0650_tautlinehitch/"><img class="alignleft size-large wp-image-446" title="The Tautline Hitch" src="http://www.aijazansari.com/wp-content/uploads/2010/02/JAZ0650_TautlineHitch-389x585.jpg" alt="" width="389" height="585" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/24/the-tautline-hitch-knot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Navigating the Directory Stack in &#8216;bash&#8217;</title>
		<link>http://www.aijazansari.com/2010/02/20/navigating-the-directory-stack-in-bash/</link>
		<comments>http://www.aijazansari.com/2010/02/20/navigating-the-directory-stack-in-bash/#comments</comments>
		<pubDate>Sat, 20 Feb 2010 23:40:22 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[My Software]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Shell]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=338</guid>
		<description><![CDATA[If you&#8217;re like me, you spend a lot of time jumping from project to project in a Linux shell.  I find that I have to switch back and forth between directories.  The bash shell has commands to maintain a stack of directories.  I&#8217;ve written some functions that use these utilities to make directory navigation easier. [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-431" href="http://www.aijazansari.com/2010/02/20/navigating-the-directory-stack-in-bash/img_4950-edit/"><img class="alignleft size-medium wp-image-431" title="Barracks by the Taj Mahal" src="http://www.aijazansari.com/wp-content/uploads/2010/02/IMG_4950-Edit-285x190.jpg" alt="Barracks by the Taj Mahal" width="285" height="190" /></a>If you&#8217;re like me, you spend a lot of time jumping from project to project in a Linux shell.  I find that I have to switch back and forth between directories.  The <em>bash</em> shell has commands to maintain a <a title="What is a stack?" href="http://www.ece.cmu.edu/~koopman/stack_computers/sec1_2.html">stack</a> of directories.  I&#8217;ve written some functions that use these utilities to make directory navigation easier. I&#8217;ve found these functions very useful, and perhaps you will too.  Let&#8217;s see them in action first with some examples, and then look at the code:</p>
<div class="aaa_code_section">
<p>In this first snippet, I start working in the Documents/Training/qt/ch1 directory:</p>
<pre class="brush: bash;">
$ pwd
/Users/aijaz
$ cd Documents/Training/qt/ch1/
$ ls
p1    t2
$
</pre>
</div>
<div class="aaa_code_section">
<p>Now let&#8217;s say I have to work in the TaskForest lib directory for a while:</p>
<pre class="brush: bash;">
$ cd ~/Projects/projects/taskforest/lib/TaskForest/
$ ls -l
total 352
-rw-r--r--   1 aijaz  aijaz   8816 May 25  2009 Calendar.pm
...
-rw-r--r--   1 aijaz  aijaz   4558 May 25  2009 TimeDependency.pm
$
</pre>
</div>
<div class="aaa_code_section">
<p>Now my work gets preempted because I have to work in the &#8216;rates&#8217; directory:</p>
<pre class="brush: bash;">
$ cd ~/tc/config/rates/
$ ls -l
total 27544
drwxr-xr-x  21 aijaz  aijaz       714 Sep  3  2007 Text
...
-rwxr-xr-x   1 aijaz  aijaz       569 Sep  3  2007 findVoipAccess.pl
$
</pre>
</div>
<div class="aaa_code_section">
<p>After finishing my work in the rates directory, I want to get back to what I was doing, but I can&#8217;t remember exactly what where I was before I got interrupted.  So I enter the &#8216;d&#8217; command which displays the stack of directories.  Every time I used the &#8216;cd&#8217; command, the system pushed the directory I was in onto a stack.  The &#8216;d&#8217; command displays the stack and prompts me for an entry. If I enter a number, it pushes the directory that&#8217;s at that position in the stack to the top, and enters that directory.</p>
<pre class="brush: bash;">
$ d
 0  ~/tc/config/rates
 1  ~/Projects/projects/taskforest/lib/TaskForest
 2  ~/Documents/Training/qt/ch1
 3  ~
#: 2
$ pwd
/Users/aijaz/Documents/Training/qt/ch1
$ d
 0  ~/Documents/Training/qt/ch1
 1  ~/tc/config/rates
 2  ~/Projects/projects/taskforest/lib/TaskForest
 3  ~
#: q
$
</pre>
<p>You can see that when I entered &#8216;2&#8242; above, the &#8216;d&#8217; command pushed the &#8216;~/Documents/Training/qt/ch1&#8242; directory to the top of the stack and entered that directory.  You can see the modified directory stack above.  I entered &#8216;d&#8217; again to view the directory stack, but this time entered &#8216;q&#8217; to do nothing.</p>
</div>
<div class="aaa_code_section">
<p>I&#8217;ve also created the &#8216;p&#8217; command, which pops the current directory off the top of the stack and enters the directory that was under it.</p>
<pre class="brush: bash;">
$ p
$ pwd
/Users/aijaz/tc/config/rates
$ d
 0  ~/tc/config/rates
 1  ~/Projects/projects/taskforest/lib/TaskForest
 2  ~
#: q
$
</pre>
</div>
<p>Now let&#8217;s have a look at the code that makes this work.  You can copy and paste this code directly into your <em>.bashrc</em> file.</p>
<pre class="brush: bash;">
# An enhanced 'cd' - push directories
# onto a stack as you navigate to it.
#
# The current directory is at the top
# of the stack.
#
function stack_cd {
    if [ $1 ]; then
        # use the pushd bash command to push the directory
        # to the top of the stack, and enter that directory
        pushd &quot;$1&quot; &gt; /dev/null
    else
        # the normal cd behavior is to enter $HOME if no
        # arguments are specified
        pushd $HOME &gt; /dev/null
    fi
}
# the cd command is now an alias to the stack_cd function
#
alias cd=stack_cd

# Swap the top two directories on the stack
#
function swap {
    pushd &gt; /dev/null
}
# s is an alias to the swap function
alias s=swap

# Pop the top (current) directory off the stack
# and move to the next directory
#
function pop_stack {
    popd &gt; /dev/null
}
alias p=pop_stack

# Display the stack of directories and prompt
# the user for an entry.
#
# If the user enters 'p', pop the stack.
# If the user enters a number, move that
# directory to the top of the stack
# If the user enters 'q', don't do anything.
#
function display_stack
{
    dirs -v
    echo -n &quot;#: &quot;
    read dir
    if [[ $dir = 'p' ]]; then
        pushd &gt; /dev/null
    elif [[ $dir != 'q' ]]; then
        d=$(dirs -l +$dir);
        popd +$dir &gt; /dev/null
        pushd &quot;$d&quot; &gt; /dev/null
    fi
}
alias d=display_stack
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/20/navigating-the-directory-stack-in-bash/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Follow up: Google Admits Buzz Was Only Tested Internally</title>
		<link>http://www.aijazansari.com/2010/02/16/follow-up-google-admits-buzz-was-only-tested-internally/</link>
		<comments>http://www.aijazansari.com/2010/02/16/follow-up-google-admits-buzz-was-only-tested-internally/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 04:29:50 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Buzz]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=345</guid>
		<description><![CDATA[In yesterday&#8217;s article about Google Buzz, I guessed that &#8220;the problem was that the population for whom the system was designed wasn’t necessarily the only population actually using the system.&#8221;  I gave Google the benefit of the doubt:
I am certain Google tested their application thoroughly.  They’ve been known to do extensive usability tests for the [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-408" href="http://www.aijazansari.com/2010/02/16/follow-up-google-admits-buzz-was-only-tested-internally/3043988249_165091e8e7_b/"><img class="alignleft size-medium wp-image-408" title="Kite Flying on a Summer's Day" src="http://www.aijazansari.com/wp-content/uploads/2010/02/3043988249_165091e8e7_b-190x285.jpg" alt="Kite Flying on a Summer's Day" width="133" height="200" /></a>In <a href="http://www.aijazansari.com/2010/02/15/sometimes-testing-isnt-enough/">yesterday&#8217;s article</a> about Google Buzz, I guessed that &#8220;the problem was that the population for whom the system was designed wasn’t necessarily the only population actually using the system.&#8221;  I gave Google the benefit of the doubt:</p>
<blockquote><p>I am certain Google tested their application thoroughly.  They’ve been known to do extensive usability tests for the seemingly tiniest of changes to their web site.  But even the most well-implemented tests are incomplete if they’re not performed on a statistically representative sample of the audience.</p></blockquote>
<p>But today, the BBC reported that <a href="http://news.bbc.co.uk/2/hi/technology/8517613.stm">Google has admitted that they only tested Buzz internally</a>, and bypassed their regular rigorous testing procedures &#8212; possibly in an attempt to get it out the door as soon as possible. I&#8217;ll let the pundits decide if it did more harm than good to the firm, but it&#8217;s a warning to other software developers: skipping testing can lead to embarrassing failures.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/16/follow-up-google-admits-buzz-was-only-tested-internally/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sometimes Testing Isn&#8217;t Enough</title>
		<link>http://www.aijazansari.com/2010/02/15/sometimes-testing-isnt-enough/</link>
		<comments>http://www.aijazansari.com/2010/02/15/sometimes-testing-isnt-enough/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 07:41:07 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Buzz]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[My Software]]></category>
		<category><![CDATA[Privacy]]></category>
		<category><![CDATA[Services]]></category>
		<category><![CDATA[SMS]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Virgin Mobile]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=318</guid>
		<description><![CDATA[In the first few days after the release of Google Buzz many people (including myself) criticized Google for exposing their users' private information.  This was a couple of weeks after Apple got a lot flak for their unfortunately-named iPad, and the same week that we heard reports of a woman who broke up with her boyfriend after finding some suggestive text messages on his cell phone - messages that came pre-loaded on the phone.  I think that all these cases were not caused by a lack testing, but by testing the wrong audience.  Let's examine these three cases and see what we can learn from them:]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-333" href="http://www.aijazansari.com/2010/02/15/sometimes-testing-isnt-enough/img_7679/"><img class="alignleft size-thumbnail wp-image-333" title="A Bee.  Buzzing." src="http://www.aijazansari.com/wp-content/uploads/2010/02/IMG_7679-170x170.jpg" alt="A Bee.  Buzzing." width="170" height="170" /></a>In the first few days after the release of <a title="Google Buzz" href="http://www.google.com/buzz">Google Buzz</a> many people (including myself) criticized Google for <a title="Google Buzz Has A Huge Privacy Flaw" href="http://www.businessinsider.com/warning-google-buzz-has-a-huge-privacy-flaw-2010-2">exposing their users&#8217; private information</a>.  This was a couple of weeks after Apple got a lot flak for their unfortunately-named iPad, and the same week that we heard <a title="Built-in text messages ruined his life" href="http://www.winnipegfreepress.com/local/built-in-text-messages-ruined-life-says-city-man-83622857.html">reports</a> of a woman who broke up with her boyfriend after finding some suggestive text messages on his cell phone &#8211; messages that came pre-loaded on the phone.  I think that all these cases were not caused by a lack testing, but by testing the wrong audience.  Let&#8217;s examine these three cases and see what we can learn from them:<span id="more-318"></span></p>
<h4>Google Buzz</h4>
<p>Almost immediately after Google started rolling out Buzz to its Gmail clients various blogs reported that there was an egregious flaw in the system that exposed people&#8217;s private contacts to the rest of the world.  When a Gmail user logged in, they were presented with a dialog box that asked them if they wanted an introduction to Buzz or not.  If the user declined, it didn&#8217;t mean that Buzz was disabled &#8211; it only meant that they didn&#8217;t want the intro.  What Google did behind the scenes was that they scanned the user&#8217;s emails and collected the emails of the people with whom the user corresponded most often.  Then, it automatically modified the user&#8217;s Gmail account to &#8216;follow&#8217; those people in Buzz.</p>
<p>But here&#8217;s the thing that infuriated most people &#8211; it made that list of the people that user&#8217;s following public: Anyone who looked at the user&#8217;s public Google profile could see who that person was following.  In other words, anyone looking at that user&#8217;s public profile could see who that user emailed most often.</p>
<p>Now pretend you&#8217;re a reporter who&#8217;s communicating with dissidents in Myanmar or Iran.  Would you want your heretofore anonymous sources made public?  <a title="Google Buzz Privacy Issues Have Real Life Implications" href="http://techcrunch.com/2010/02/12/google-buzz-privacy/">In one reported case</a>, a woman&#8217;s most frequent contacts were her boyfriend and her mother.  Her third-most-frequent contact (with a lot fewer emails) was her abusive ex-husband, from whom she had kept her email address hidden.  But what Google did when they released Buzz is automatically have her follow her ex, and share her shared Google Reader messages, including her location and workplace with her ex.</p>
<p><a title="Google Buzz: Privacy Nightmare" href="http://news.cnet.com/8301-31322_3-10451428-256.html">Another blogger reported</a> that her Android phone uploaded to her public profile a photo that she had taken, but not uploaded. She thought her photo was private, but Google&#8217;s assumption was that if the photo was on her phone, it would be okay to upload it to her public profile.</p>
<p><a title="Watch Out Who You Reply To On Google Buzz" href="http://techcrunch.com/2010/02/11/reply-google-buzz-exposing-email/">The third problem</a> that surfaced in the two days after Buzz was released was that in some cases users thought that they were referencing a person&#8217;s public email address in a buzz (think of it as a retweet or a reply) but in reality were referencing a private email address.  When they selected a person by their name, it wasn&#8217;t clear which email address was linked to that name.  For example, if John Smith&#8217;s public email address is john_smith@example.com, and his personal address is js_123@example.com, and the public address is associated with a Google profile, a Buzz user may inadvertently select the private email address in a buzz, thus exposing John&#8217;s private address to everyone he follows.</p>
<h4>The iPad</h4>
<p>In the minutes after Apple&#8217;s Steve Jobs announced the new mobile appliance&#8217;s name, people started making very funny, original and sometimes vulgar jokes about the name iPad.  I could post them here, but the jokes are old by now.</p>
<h4>Salacious Texts On Samsung Virgin Mobile Phones</h4>
<p>According to <a title="Built-in text messages ruined his life" href="http://www.winnipegfreepress.com/local/built-in-text-messages-ruined-life-says-city-man-83622857.html">this article</a>, a 49 year old man from Winnipeg can no longer have a relationship with the woman he loved because she accused him of cheating on him.  Her proof?  Sexy text messages on his cell phones.  He denied the affair, but couldn&#8217;t explain how they got there.  Only later did he learn that the messages were pre-loaded by Virgin Mobile.</p>
<h4>What Do These Cases Have in Common?</h4>
<p>As an outsider it appears to me that in each of the three cases the problem was that the population for whom the system was designed wasn&#8217;t necessarily the only population actually using the system.  Let&#8217;s look at the Google Buzz case.  If we claim that Google is neither evil nor stupid, what went wrong?  I think there were several assumptions that the Google developers and designers made that were incorrect.</p>
<p>Buzz seemed to have be designed for people who collaborate together in tightly knit groups.  The assumption is that people who want to share information with each other communicate a lot with each other.  In real life that isn&#8217;t always true, and neither is the converse.  In many cases the people that I want to share the most with are people with whom I have so many channels of communication (including the dinner table) that any single channel like email contains a fraction of the actual communication taking place.  Similarly, as in the case of the lady who was hiding her online identity from her ex, the people we communicate with aren&#8217;t always the people we want to share information with.  If Google&#8217;s designers approached their product with that bias, they could have made (and did make) a technically excellent product that worked as they intended, and whose test cases passed, but which did exactly the wrong thing.</p>
<p>I think that that&#8217;s essentially the core problem with the issue of the publication of private photos and email addresses.  The joke in the blogs was that Buzz was designed for an people like engineers at Google, not for people who go to parties and take pictures that they would regret the next morning (and I know they&#8217;re not mutually exclusive groups).  Unlike in the business world and the networks of sites like LinkedIn, people sometimes guard their email addresses jealously and do not want them published without their authorization.</p>
<p>I am certain Google tested their application thoroughly.  They&#8217;ve been known to do extensive usability tests for the seemingly tiniest of changes to their web site.  But even the most well-implemented tests are incomplete if they&#8217;re not performed on a statistically representative sample of the audience.</p>
<p>The same can be said for Apple and Virgin Mobile.  On of the most insightful questions asked after the iPad announcement was, &#8220;Did Apple not have any women on the product naming committee?&#8221;  Did Virgin Mobile think that their only consumers would be teenagers who would find the default text messages cute and funny and have the technical expertise to realize that these messages were pre-loaded?  While Apple seemed to have failed to consider about half of the human race while naming their product, Virgin failed to consider the less savvy part of the population who are their customers.</p>
<p>What I don&#8217;t know is this: Let&#8217;s assume I&#8217;m wrong, and that in all three cases a statistically-representative portion of the population was tested or considered.  If that&#8217;s true, then could these three cases be considered edge conditions?  While a problem could exist in theory could the actual problems be so few that they&#8217;re statistically insignificant?  If you&#8217;re the person whose lost a relationship or now have to worry about being stalked by an ex it doesn&#8217;t really matter.  It&#8217;s affected your life in a significant way.</p>
<h4>What Can Software Developers Learn From This?</h4>
<p>I don&#8217;t think anyone or any company (not even Google) can make the perfect application that pleases everyone.  But I think that there are a few rules of thumb that we should follow, to prevent embarrassing and distressing problems.</p>
<p>First: Applications like these should not take action on behalf of the user.  The system should assume that the user always knows what&#8217;s best for them.  The most the program should do is make suggestions that the user can then decide to obey or ignore.  This is exactly what Google did (among other things) to change Buzz after the huge public outcry.</p>
<p>Second: Features, no matter how well-intentioned, no should never be opt-out.  They should always be opt-in.  Buzz was essentially an opt-out system.  You could be vulnerable by not doing anything. It isn&#8217;t that way now, but it was for those two days when Google&#8217;s reputation took a massive hit.</p>
<p>Third: Designers and service providers need to pay careful attention to who their users actually are.  They&#8217;re not necessarily men, not necessarily tech-savvy teens or professionals looking to increase their network.  They could include people very different from us.</p>
<p>As developers and designers we need to realize that the products we make will be used in manners that we never imagined, by people who we don&#8217;t understand.  If we give our customers the ability to control how our products and services are used, we&#8217;ll be helping them and thus helping ourselves.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/15/sometimes-testing-isnt-enough/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why Should I Use CPAN?</title>
		<link>http://www.aijazansari.com/2010/02/13/why-should-i-use-cpan/</link>
		<comments>http://www.aijazansari.com/2010/02/13/why-should-i-use-cpan/#comments</comments>
		<pubDate>Sun, 14 Feb 2010 01:01:08 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[CPAN]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[TaskForest]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=296</guid>
		<description><![CDATA[Why should a program depend on so many external modules when it could implement what it needs itself?]]></description>
			<content:encoded><![CDATA[<p>I came across some comments made about an open source program that I had written in perl.  The user was complaining about how he couldn&#8217;t get it to install.  The reason was that the program relies on other modules from the archive of open source perl software known as <a href="http://www.cpan.org/">CPAN (Comprehensive Perl Archive Network)</a>, and one of them failed to install.</p>
<p>This got me thinking about the benefits of using third-party libraries in our own code.  Why should a program depend on so many external modules when it could implement what it needs itself?</p>
<p>The answer, in one word, is &#8220;Testing.&#8221;  A well-written piece of software isn&#8217;t considered complete if it doesn&#8217;t have well-documented tests that exercise every part of the program.</p>
<p>There are many common tasks that most programs perform &#8211; such as reading configuration food, performing date arithmetic and writing to log files.  Every popular language has third-party libraries that perform these tasks correctly and reliably.  If I were to try to duplicate them, it would almost certainly result in inferior code; the mature libraries have had the benefits of extensive testing as well as enhancements and fixes of bugs reported by users.  Using third-party software allows me to focus on my program and what makes it unique.</p>
<div id="attachment_297" class="wp-caption alignnone" style="width: 449px"><a rel="attachment wp-att-297" href="http://www.aijazansari.com/2010/02/13/why-should-i-use-cpan/camel/"><img class="size-medium wp-image-297" title="Persuading the Camel" src="http://www.aijazansari.com/wp-content/uploads/2010/02/camel-439x293.jpg" alt="Getting the Camel to Do What You Want" width="439" height="293" /></a><p class="wp-caption-text">Perl can be a little stubborn, sometimes.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/02/13/why-should-i-use-cpan/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
