<?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 &#187; TaskForest</title>
	<atom:link href="http://www.aijazansari.com/tag/taskforest/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.aijazansari.com</link>
	<description>For people who like to make things</description>
	<lastBuildDate>Tue, 20 Jul 2010 13:20:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Google Now Considers Website Speed In Its Ranking</title>
		<link>http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/</link>
		<comments>http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 19:55:15 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Firebug]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[SEO]]></category>
		<category><![CDATA[TaskForest]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[YUI]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=617</guid>
		<description><![CDATA[Google reported yesterday that their search engine will now include a website&#8217;s speed in the list of factors it uses to decide how high to rank the site in its search results.  In this post I consider what this means for web developers and what steps you can take to make your site faster. Google [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment wp-att-634" href="http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/googlewebmaster/"></a></p>
<p><img class="alignleft size-medium wp-image-634" title="GoogleWebmaster" src="http://www.aijazansari.com/wp-content/uploads/2010/04/GoogleWebmaster-285x156.png" alt="" width="285" height="156" /><a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">Google reported yesterday</a> that their search engine will now include a website&#8217;s speed in the list of factors it uses to decide how high to rank the site in its search results.  In this post I consider what this means for web developers and what steps you can take to make your site faster.<span id="more-617"></span></p>
<p>Google has made it clear that speed is not the primary factor when determining page rank:</p>
<blockquote><p>While site speed is a new signal, it doesn&#8217;t carry as much weight as the  <a href="http://www.youtube.com/watch?v=muSIzHurn4U">relevance of a  page</a>. Currently, fewer than 1% of search queries are affected by the  site speed signal in our implementation and the signal for site speed  only applies for visitors searching in English on Google.com at this  point.</p></blockquote>
<p>It is, however, a turning point for web site developers.  What Google is really doing is putting a tangible value on the User Experience.  A fast site makes for a more satisfactory experience, and linking to fast sites also makes users happier with Google.  I know how frustrating it is to see what appears to be a promising search result on Google, only to find the site very sluggish once I click through Google&#8217;s recommendation.  So, like it or not, you and I will now have to make sure we at least consider our sites&#8217; rendering speeds.</p>
<p>As I had mentioned in a <a title="The Performace Cost of Using WordPress" href="http://www.aijazansari.com/2010/03/31/performance-cost-of-using-wordpress/">earlier post</a>, I recently changed the taskforest.com website to static HTML from a template-based system.   After reading Google&#8217;s blog entry, I installed <a title="Firebug" href="http://getfirebug.com/">Firebug</a> on Firefox, as well as two different page performance measuring tools: <a title="Page Speed for Firebug" href="http://code.google.com/speed/page-speed/index.html">PageSpeed</a> and <a href="http://developer.yahoo.com/yslow/">YSlow from Yahoo</a> and started testing out the TaskForest web site.  To my dismay, the site scored a paltry 76/100 on PageSpeed and a &#8216;D&#8217; (67/100) on YSlow.  I&#8217;m glad to say that in less than an hour I was able to make the changes that most significantly improved my site&#8217;s speed.</p>
<p>There were four major areas in which the two tools recommended changes:</p>
<dl>
<dt>Exploiting Browsers&#8217; Caches</dt>
<dd>The site was not using the Expires response headers. As <a title="Optimizing Page Performance Via Caching" href="http://code.google.com/speed/page-speed/docs/caching.html">this document from Google</a> shows, proper usage of this HTTP header can greatly reduce load on the server as well as clients.The Expires header tells the client how long the server expects the resource to stay unchanged.  For images like logos and screenshots that don&#8217;t change very often, this period could (and should) be as high as few months, possibly even the maximum allowed value &#8211; one year.  For HTML pages that change often, you could set it to 2-7 days. </dd>
<dd>The taskforest site which was using Apache 1.41, was not sending the Expires HTTP response header. The reason is that the module that sets this, <em>mod_expires</em>, is not enabled by default. </dd>
<dt>Combining External CSS</dt>
<dd>The website was using three CSS style sheets.  One was my own &#8216;styles.css,&#8217; but the other two were Yahoos YUI style sheets.  For every request for a web page, there were 3 additional requests for style sheets. </dd>
<dt>Combining External Javascript</dt>
<dd>Just like style sheets, There were 6 Javascript files that were being served with every page. </dd>
<dt>Using Compression</dt>
<dd>The website was not compressing the data it sent to the client.  As <a title="Using Compression" href="http://code.google.com/speed/articles/use-compression.html">this article</a> and the video below from Google shows, data compression can have a major impact on the size of the payload the server delivers to the client, thus making the site faster.</dd>
<dd><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/Mjab_aZsdxw&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/Mjab_aZsdxw&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></dd>
</dl>
<h3>Optimizing the site</h3>
<p>So the first order of business was to enable <em>mod-expires</em> and install and activate <em>mod_gzip</em>.  These are the Apache modules that enable the Expires header and Response compression.  I reconfigured Apache with the &#8211;enable-module=expires and &#8211;activate-module=src/modules/gzip/mod_gzip.c options.  Previously, the relevant lines in my httpd.conf file looked like this:</p>
<pre class="brush: plain;">
&lt;VirtualHost 216.139.227.47&gt;
 ServerName www.taskforest.com
 DocumentRoot &quot;.../taskforest/htdocs/website&quot;
&lt;/VirtualHost&gt;
</pre>
<p>After installing the two new modules, my httpd.conf file looked like this:</p>
<pre class="brush: plain;">
&lt;VirtualHost 216.139.228.44&gt;
 ServerName www.taskforest.com
 DocumentRoot &quot;.../taskforest/htdocs/website&quot;

 FileEtag None

 # enable expirations
 ExpiresActive On

 # unless overridden elsewhere resources expires
 # after 60 days in the client's cache
 #
 ExpiresDefault &quot;access plus 60 days&quot;

 # The site's feed expires after 1 day in the cache
 ExpiresByType application/xml A86400

 # HTML files expire after 1 day in the cache
 ExpiresByType text/html A86400

 # Turn compressing on
 mod_gzip_on Yes

 # Don't bother compressing tiny files
 mod_gzip_minimum_file_size  1002

 mod_gzip_maximum_file_size  0
 mod_gzip_maximum_inmem_size 60000

 # Compress XML files, text files (including HTML)
 # and directory listings
 mod_gzip_item_include mime &quot;application/xml&quot;
 mod_gzip_item_include mime text/*
 mod_gzip_item_include mime &quot;httpd/unix-directory&quot;

 # Compress files based on their names as well
 mod_gzip_item_include file &quot;\.txt$&quot;
 mod_gzip_item_include file &quot;\.html$&quot;
 mod_gzip_item_include file &quot;\.css$&quot;
 mod_gzip_item_include file &quot;\.js$&quot;

 mod_gzip_dechunk Yes
 mod_gzip_temp_dir &quot;/tmp&quot;
 mod_gzip_keep_workfiles No

&lt;/VirtualHost&gt;
&lt;VirtualHost 216.139.228.44&gt;
 ServerName taskforest.com
 RedirectMatch (.*) http://www.taskforest.com$1
&lt;/VirtualHost&gt;
</pre>
<p>For the multiple CSS files, I just copied both of the YUI  style sheets into my styles.css file, preserving the copyright comments.  As for the YUI javascript files, it turns out that none of them were being used!  They were just copied and pasted from the taskforestd webserver web site, which does use the javascript files.  I was able to delete them altogether.  It was rather embarrassing to realize that the site was serving unused files.  But I was glad to have the tools that helped me realize this.</p>
<h3>Results of Optimization</h3>
<p>The results of the optimization were startling.  The PageTest scores originally looked like this:</p>
<div id="attachment_639" class="wp-caption alignnone" style="width: 385px"><a rel="attachment wp-att-639" href="http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/pagespeedorig/"><img class="size-full wp-image-639 " title="PageSpeed Results Before Optimization" src="http://www.aijazansari.com/wp-content/uploads/2010/04/PageSpeedOrig.png" alt="PageSpeed Results Before Optimization" width="375" height="436" /></a><p class="wp-caption-text">PageSpeed Results Before Optimization</p></div>
<p>Now, after the optimization, the report was much more respectable:</p>
<div id="attachment_640" class="wp-caption alignnone" style="width: 457px"><a rel="attachment wp-att-640" href="http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/pagespeed/"><img class="size-full wp-image-640" title="PageSpeed Results After Optimization" src="http://www.aijazansari.com/wp-content/uploads/2010/04/PageSpeed.png" alt="PageSpeed Results After Optimization" width="447" height="473" /></a><p class="wp-caption-text">PageSpeed Results After Optimization</p></div>
<p>This exercise gave me new insight into what is needed to make a website faster.  It&#8217;s not just the fastest machine and the most optimized database that matters.  One also has to consider the fundamental characteristics of the Web, and HTTP in particular, where a little effort can bring significant improvement.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/04/10/google-now-considers-website-speed-in-its-ranking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>TaskForest Write-up at SourceForge</title>
		<link>http://www.aijazansari.com/2010/04/02/taskforest-write-up-at-sourceforge/</link>
		<comments>http://www.aijazansari.com/2010/04/02/taskforest-write-up-at-sourceforge/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 17:10:50 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[My Software]]></category>
		<category><![CDATA[SourceForge]]></category>
		<category><![CDATA[TaskForest]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=606</guid>
		<description><![CDATA[SourceForge.net has a blog in which they feature a different hosted project every day.  Today&#8217;s blog entry features my open-source job scheduler, TaskForest.  I&#8217;d like to take this opportunity to thank SourceForge for their support of open source software.]]></description>
			<content:encoded><![CDATA[<p><a rel="attachment  wp-att-607" href="http://www.aijazansari.com/2010/04/02/taskforest-write-up-at-sourceforge/taskforestlogo/"><img class="alignleft  size-full wp-image-607" title="TaskForest Logo" src="http://www.aijazansari.com/wp-content/uploads/2010/04/TaskForestLogo.gif" alt="TaskForest Logo" width="154" height="74" /></a>SourceForge.net has a blog in which they feature a different hosted project every day.  <a href="https://sourceforge.net/blog/robust-job-scheduling-lives-in-taskforest/">Today&#8217;s blog entry</a> features my open-source job scheduler, <a href="http://www.taskforest.com/">TaskForest</a>.  I&#8217;d like to take this opportunity to thank SourceForge for their support of open source software.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/04/02/taskforest-write-up-at-sourceforge/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The Performance Cost of Using WordPress</title>
		<link>http://www.aijazansari.com/2010/03/31/performance-cost-of-using-wordpress/</link>
		<comments>http://www.aijazansari.com/2010/03/31/performance-cost-of-using-wordpress/#comments</comments>
		<pubDate>Wed, 31 Mar 2010 17:57:48 +0000</pubDate>
		<dc:creator>Aijaz Ansari</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Caching]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Efficiency]]></category>
		<category><![CDATA[Etag]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[Metrics]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Safari Web Browser]]></category>
		<category><![CDATA[Spiders]]></category>
		<category><![CDATA[TaskForest]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Websites]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.aijazansari.com/?p=531</guid>
		<description><![CDATA[I recently tried to switch a website over from a homegrown content management system to WordPress.  The results were thoroughly disheartening.  This post illustrates the steps I took, and how I managed to move in the opposite direction and optimize my site even more.  ]]></description>
			<content:encoded><![CDATA[<p>Happy with my experience with a custom WordPress installation for this blog, I decided to try using the blogging platform for the <a title="TaskForest Job Scheduler" href="http://www.taskforest.com/">TaskForest</a> website.  The two main reasons were the ease of creating RSS feeds and the ability for users to comment on posts or articles.  After a few days of tinkering around, I&#8217;ve come to the conclusion that, at least for TaskForest, WordPress would cause more problems than it would solve. Here&#8217;s how I came to that conclusion:</p>
<h2>Setting up a Sandbox Domain</h2>
<p>The first step in trying out WordPress was to set up a new domain just for testing out the WordPress installation.  This way, I wouldn&#8217;t affect the taskforest.com domain during my experiments.  I happen to run my own name servers using Daniel Bernstein&#8217;s <a href="http://cr.yp.to/djbdns.html"><em>tinydns</em></a>, so I decided to create a new domain called <em>tf.enoor.com</em>, a subdomain of my defunct company&#8217;s domain.  Since I use bluehost.com&#8217;s WordPress hosting service, I had to make their name servers responsible for the domain.  All that&#8217;s needed is adding the following two lines to <em>/etc/tinydns/root/data</em>:</p>
<pre class="brush: plain;">
&amp;tf.enoor.com:74.220.195.31:ns1.bluehost.com:300
&amp;tf.enoor.com:69.89.16.4:ns2.bluehost.com:300
</pre>
<h2>Selecting a Theme</h2>
<p>After setting up WordPress, the next step was to select a theme.  I wanted something similar to TaskForest&#8217;s current design, so I chose the remarkably customizable <a title="Suffusion" href="http://www.aquoid.com/news/themes/suffusion/">Suffusion</a> theme.  After some tinkering I was able to get a site that was quite similar to the original, with one compromise &#8211; I could get either the logo or the site&#8217;s name in the header, but not both.  Not the way they are on the current site.  It&#8217;s quite important that the site&#8217;s name appear in the header, because that helps with Search Engine Ranking.  So with a heavy heart I decided to omit the logo.</p>
<h2>The Problem with Content</h2>
<p>TaskForest ships with its own web server to support <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a> interface.  As part of the included website is all the documentation for the system. Just like the code, this documentation is under source control, and it&#8217;s also used to populate the taskforest.com website.  This way, I can ensure that both the taskforest.com website and a user&#8217;s local install have the most up-to-date docs, as long as the user is running the latest version of the software.  What this also means is that I have a few dozen webpages that need to be transfered to WordPress before the new site can go live.  I was already resigned to the fact that the URLs of these pages would be different &#8211; the current site has URLs that look like <em>http://www.taskforest.com/about.html</em>, but the default WordPress installation would use URLs that look like <em>http://www.taskforest.com/about/</em>.  It&#8217;s not a huge deal, but I prefer my way.</p>
<p>The bigger issue is that when a new version of the software is released, the pages change.  The current build process ensures that the client website and the taskforest.com website stay in sync.  Now if I use WordPress, I don&#8217;t want to manually edit the pages using the WP admin site.  I need to install a new plugin that handles inclusion of files.  So, I installed the WP Include plugin.  I&#8217;d have to change my build process, but I could get it to work.</p>
<h2>Putting It All Together</h2>
<p>Okay, so I got the themes and plugins installed, and I&#8217;ve got the process worked out.  It was then time to try a proof of concept with a single page.  It worked just as expected, but the site seemed very sluggish.  I made sure I didn&#8217;t have anything enabled that I didn&#8217;t need.  Still, the site was noticeably slower than the existing site, and that&#8217;s with only one non-blank page and zero blog posts.  I thought that maybe the problem was that the bluehost.com shared server was too slow.  I just happened to have an unused server in the same data center that hosts taskforest.com.  The same kind of server as well. It took the better part of the morning, but I installed PHP, mysql and WordPress on that server.  In installed PHP as a static module within Apache, for optimal performance.  Even then, on a pristine machine running nothing else, it was <strong>slow</strong>.</p>
<h2>How Slow is Slow?</h2>
<p>Anyone who knows me knows that I&#8217;m an Engineer, and as an Engineer I like metrics.  I wanted to know that it wasn&#8217;t just my own bias that was penalizing WordPress over my established way of doing things.  So, I looked at the Safari web browser on the Mac.  Safari has a really useful feature called the Web Inspector that, among other things, displays the amount of time it takes for different parts of a page to load.  The numbers were very surprising.  With WordPress, a new page would take <strong>1.75</strong> seconds to load &#8211; an eternity on a high-speed broadband connection.  A subsequent request of the same page would take about <strong>700ms</strong>. Switching to the TaskForest website&#8217;s strategy would take about <strong>800ms</strong> for a new page, and <strong>275ms</strong> for a cached page.  That&#8217;s more than a <strong>20</strong><strong>0%</strong> increase in speed!  The TaskForest website used a preprocessor that allowed for including header files.  It ran under mod_perl.  I decided to write a spider that crawled the website and convert everything to static pages, and serve those pages without mod_perl.  With this enhancement, the results were even better.  I saw a <strong>400% to 800% speed increase</strong>, with cached pages taking just <strong>140ms</strong> to load.</p>
<p>One of the reasons WordPress&#8217;s numbers were so poor is that if articles like <a href="http://www.codinghorror.com/blog/2008/04/behold-wordpress-destroyer-of-cpus.html">this one</a> are still correct, WordPerfect does not cache the content of pages by default.  Resources within the HTML page, like images or javascript files seem to be cached, but every page still does upto 120 database accesses depending on the setup.  Apache is a lot better at caching requests for static HTML pages.  Even the TaskForest webserver used for the REST API, caches data very intelligently using the HTTP headers.</p>
<h2>What Does This All Mean?</h2>
<p>Given the amount of compromises I would have to make in the design, layout and build process, switching to WordPress would have been very painful.  However, with the performance hit the site would be taking, it seems unlikely that I&#8217;ll switch to WP any for the TaskForest website any time soon.  I think I&#8217;d rather write a script to generate RSS feeds on demand and automatically submit the feed to feed notification sites like pingomatic. I think this was a great learning experience that will help me with similar decisions in the future.  And I also got to write a cool spider and increase the speed of the TaskForest web site.</p>
<div id="attachment_559" class="wp-caption alignnone" style="width: 595px"><a rel="attachment wp-att-559" href="http://www.aijazansari.com/2010/03/31/performance-cost-of-using-wordpress/webinspector/"><img class="size-large wp-image-559" title="Safari's Web Inspector" src="http://www.aijazansari.com/wp-content/uploads/2010/03/WebInspector-585x351.png" alt="" width="585" height="351" /></a><p class="wp-caption-text">Safari&#39;s Web Inspector</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.aijazansari.com/2010/03/31/performance-cost-of-using-wordpress/feed/</wfw:commentRss>
		<slash:comments>4</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>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>
