<?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>Jottings on Software</title>
	<atom:link href="http://beanary.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://beanary.wordpress.com</link>
	<description>Thoughts from a developer</description>
	<lastBuildDate>Fri, 22 May 2009 09:41:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='beanary.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Jottings on Software</title>
		<link>http://beanary.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://beanary.wordpress.com/osd.xml" title="Jottings on Software" />
	<atom:link rel='hub' href='http://beanary.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Jotting #17: Domains, Values and Null</title>
		<link>http://beanary.wordpress.com/2009/04/02/jotting-17-domains-values-and-null/</link>
		<comments>http://beanary.wordpress.com/2009/04/02/jotting-17-domains-values-and-null/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 16:19:52 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=39</guid>
		<description><![CDATA[I always find NullPointerExceptions a real pain in the neck. And often they shouldn&#8217;t occur since the object in question shouldn&#8217;t be null. But languages like the {}-family (C,C++,C#, Java, &#8230;) make it difficult or even impossible to guarantee that null values cannot occur. The situation is very different in other languages like Haskell. Let&#8217;s [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=39&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always find NullPointerExceptions a real pain in the neck. And often they shouldn&#8217;t occur since the object in question shouldn&#8217;t be null. But languages like the {}-family (C,C++,C#, Java, &#8230;) make it difficult or even impossible to guarantee that null values cannot occur. The situation is very different in other languages like Haskell.</p>
<p>Let&#8217;s take an example of a particular class, viz. String. The String domain is the set of all possible strings including the empty string &#8220;&#8221;. And null! Since</p>
<pre>String x = null;</pre>
<p>is a valid statement. But in my experience, I can&#8217;t remember where I really needed or wanted to distinguish between null and empty string.</p>
<p>A similar example applies to List, Set or Map: the empty list, set or map is perfectly fine, and null is not needed.</p>
<p>In (nearly) all cases, I would prefer to know that a null object is not an option. Ever. It would make arguing about possible cases so much easier and a lot of safety code could be removed. In my recent projects we always agreed to never return null list (set,map) but use an empty one instead.</p>
<p>Value objects: should have a defined domain, must include decision whether null is an acceptable member (usually it shouldn&#8217;t).</p>
<p>As an interesting side note, <a href="http://en.wikipedia.org/wiki/C._A._R._Hoare" target="_blank">Tony Hoare</a> has <a href="http://qconlondon.com/london-2009/presentation/Null+References%3A+The+Billion+Dollar+Mistake" target="_blank">admitted </a>that the introduction of <code>null</code> was a big mistake. Hopefully I will be able to listen to his talk later this year. Others like C. J. Date have long <a href="http://www.amazon.co.uk/Introduction-Database-Systems-e-Book/dp/0201787229/" target="_blank">argued</a> against <code>null</code> values in database tables, partly because it forces three-valued logic upon you (unlike the better defined two-value logic of <code>true</code> or <code>false</code>).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=39&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2009/04/02/jotting-17-domains-values-and-null/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #16: SSH for Windows+Cygwin</title>
		<link>http://beanary.wordpress.com/2009/02/02/jotting-16-ssh-for-windowscygwin/</link>
		<comments>http://beanary.wordpress.com/2009/02/02/jotting-16-ssh-for-windowscygwin/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 18:37:47 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Miscel]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=52</guid>
		<description><![CDATA[I have struggled with this a bit but I think it is a common scenario. So for my (future and maybe your) benefit here is the current way I have been setting up SSH under Windows (XP) with cygwin. Windows+Cygwin Preliminaries Place the following windows script in the start-up folder, e.g., C:\Documents and Settings\All Users\Start [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=52&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have struggled with this a bit but I think it is a common scenario. So for my (future and maybe your) benefit here is the current way I have been setting up SSH under Windows (XP) with cygwin.</p>
<h2>Windows+Cygwin Preliminaries</h2>
<ol>
<li>Place the following windows script in the start-up folder, e.g., <tt>C:\Documents and Settings\All Users\Start Menu\Programs\Startup:
<p>@echo off<br />
C:<br />
chdir c:\cygwin\bin<br />
set HOME=/home/%USERNAME%<br />
bash --login c:\cygwin\sshagentrc<br />
</tt></li>
<li>Edit <tt>cygwin.bat</tt> file so that it looks like this:
<div class="code panel" style="border-width:1px;">
<div class="codeContent panelContent">
<pre>@echo off
REM Script to start ssh-agent each time user logs into machine
C:
chdir C:\cygwin\bin

set HOME=/home/%USERNAME%
bash --login -i</pre>
</div>
</div>
</li>
<li>Place the following code in a file <tt>.sshagentrc</tt> in the <tt>c:\cygwin</tt> directory
<div class="code panel" style="border-width:1px;">
<div class="codeContent panelContent">
<pre>#!/bin/bash
# Creates an ssh-agent,
# writes ssh agent info to the file '~/.ssh-agent-info-`hostname`'
# and then prompts user <span class="code-keyword">for</span> keys.
# Then any shell can use the agent by sourcing the contents of ~/.ssh-agent-info-`hostname`:
#  . ~/ssh-agent-info-`hostname`
HOME=/home/$USERNAME
SSH_INFO_FILE=$HOME/.ssh-agent-info-`hostname`

<span class="code-keyword">if</span> test -e $HOME/.ssh/identity; then
   /usr/bin/echo <span class="code-quote">"ssh_info:   $SSH_INFO_FILE"</span>
   /usr/bin/ssh-agent &gt; $SSH_INFO_FILE
   /usr/bin/chmod 600 $SSH_INFO_FILE
   . $SSH_INFO_FILE
   /usr/bin/ssh-add $HOME/.ssh/identity
<span class="code-keyword">else</span>
   /usr/bin/echo ""
   /usr/bin/echo <span class="code-quote">"ERROR: No <span class="code-keyword">private</span> key defined in $HOME/.ssh"</span>
fi</pre>
</div>
</div>
</li>
<li></li>
</ol>
<h2>Individual User Setups</h2>
<ol>
<li>Modify your <tt>.bashrc</tt> file to include the following lines:
<div class="code panel" style="border-width:1px;">
<div class="codeContent panelContent">
<pre># Hook into SSH agent session
SSH_INFO_FILE=~/.ssh-agent-info-`hostname`
<span class="code-keyword">if</span> test -e $SSH_INFO_FILE; then
   . $SSH_INFO_FILE &gt; /dev/<span class="code-keyword">null</span>
fi
export SVN_SSH=ssh</pre>
</div>
</div>
</li>
</ol>
<p style="padding-left:30px;">The SVN_SSH is useful when using subversion with ssh (svn+ssh protocol); you can also create a  Windows environment variable.</p>
<ol>
<li>Goto <tt>HOME</tt> directory</li>
<li>Run
<div class="code panel" style="border-width:1px;">
<div class="codeContent panelContent">
<pre>ssh-keygen [-t rsa]</pre>
</div>
</div>
</li>
<li>Enter the required passphrase (and remember it!)</li>
<li>This should create a file named <em>identity</em> (or similar) in folder <em>~/.ssh</em>.</li>
<li>Email the <strong>public</strong> key, in files <tt>*.pub</tt>, to your administrator so that he can add the public key to the required servers.</li>
</ol>
<h2>PuTTY</h2>
<p>If you want to run PuTTY (Pageant) as well because you like apps like TortoiseSVN, then</p>
<ol>
<li>Import the OpenSSH key into PuTTYgen and create a PuTTY-compatible key (I store it with the OpenSSH keys in my cygwin home directory: c:\cygwin\home\&lt;userid&gt;\.ssh\identity.ppk)</li>
<li>Place the pageant.exe shortcut into your startup directory</li>
<li>Modify the short-cut property to &#8220;c:\PUTTY_HOME\pageant.exe&#8221; &#8220;HOME\.ssh\identity.ppk&#8221;</li>
</ol>
<p>This will start up pageant when you log in, asks for your SSH key passphrase and you&#8217;re set for the day.</p>
<h2>Results</h2>
<p>The setup initialises ssh-agent when you log into windows and adds your SSH key to the agent&#8217;s session. When starting a cygwin terminal, the .bashrc script ensures that the terminal shares the agent&#8217;s session.</p>
<p>Overall, you only have to type in your SSH key&#8217;s passphrase once and the rest is easy sailing <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/52/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/52/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/52/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=52&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2009/02/02/jotting-16-ssh-for-windowscygwin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #15: Eclipse Tips and Moans</title>
		<link>http://beanary.wordpress.com/2009/02/02/jotting-15-eclipse-tips-and-moans/</link>
		<comments>http://beanary.wordpress.com/2009/02/02/jotting-15-eclipse-tips-and-moans/#comments</comments>
		<pubDate>Mon, 02 Feb 2009 18:16:47 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=55</guid>
		<description><![CDATA[Some Eclipse tips and moans that I&#8217;ve experienced on and off. I like to start Eclipse with the option -showlocation; it helps to identify which workspace I am working on, especially when I need to work on two version (trunk and branch). Workspaces Just upgraded to Eclipse 3.4 (Ganymede) and had to get rid of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=55&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Some Eclipse tips and moans that I&#8217;ve experienced on and off.</p>
<p>I like to start Eclipse with the option -showlocation; it helps to identify which workspace I am working on, especially when I need to work on two version (trunk and branch).</p>
<h2>Workspaces</h2>
<p>Just upgraded to Eclipse 3.4 (Ganymede) and had to get rid of a wrongly created workspace. While it is easy to move between workspaces many have commented that is difficult to get rid of workspaces.</p>
<p>In Eclipse 3.4, go to file <code>&lt;Eclipse_HOME&gt;/configuration/.settings/org.eclipse.ui.ide.prefs</code> and remove any workspace in the key-value <code>RECENT_WORKSPACES</code>. Voila. Done. <a href="http://michael.zanussi.com/2007/09/14/removing-old-workspaces-in-eclipse/" target="_blank">Thanks</a>.</p>
<h2>Working Sets</h2>
<p>I sometimes like to group projects into working sets, especially in workspaces with many Eclipse projects; but in Eclipse these sets are somewhat second class objects:</p>
<ul>
<li>many menu options don&#8217;t work on sets</li>
<li>can&#8217;t export/import sets</li>
</ul>
<p>I would like to export sets because when I branch my code it would be nice to carry things over to the branch.</p>
<h2>Bookmarks</h2>
<p>Similarly, you cannot export/import bookmarks. What a shame/hazzle/waste-of-time. My current workaround is to take a snapshot with Faststone Capture (version 4.8, great little helper app!) and keep the picture.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=55&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2009/02/02/jotting-15-eclipse-tips-and-moans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #14: Commenting &#8211; sometimes it&#8217;s crucial</title>
		<link>http://beanary.wordpress.com/2008/06/01/jotting-14-commenting-sometimes-its-crucial/</link>
		<comments>http://beanary.wordpress.com/2008/06/01/jotting-14-commenting-sometimes-its-crucial/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 22:31:10 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=54</guid>
		<description><![CDATA[Recently, some controversy (see, for example, here) erupted around a mistake made in the OpenSSL library used by the Debian project. The mistake was traced back to this change. The various comments hint at problems on several layers which led to this mistake, but I can&#8217;t help thinking that two basic practices would have gone [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=54&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently, some controversy (see, for example, <a href="http://www.links.org/?p=327" target="_blank">here</a>) erupted around a <a href="http://www.technologyreview.com/Infotech/20801/" target="_blank">mistake</a> made in the OpenSSL library used by the Debian project. The mistake was traced back to <a href="http://svn.debian.org/viewsvn/pkg-openssl/openssl/trunk/rand/md_rand.c?rev=141&amp;view=diff&amp;r1=141&amp;r2=140&amp;p1=openssl/trunk/rand/md_rand.c&amp;p2=/openssl/trunk/rand/md_rand.c" target="_blank">this change</a>. The various comments hint at problems on several layers which led to this mistake, but I can&#8217;t help thinking that two basic practices would have gone a long way to avoid this problem.</p>
<h3>Comments</h3>
<p>Looking at the changes and the surrounding code, there is just no hint, viz. comment, there that tells you what is happening and why the line of code is important.</p>
<p>Now, I don&#8217;t like to comment the obvious; many style guidelines ask for far too much commenting when the code is quite obvious. But in this case, several good practices were <strong>not</strong> employed:</p>
<ul>
<li>Using an obvious self-documenting procedure name</li>
<li>Add a warning to crucial code lines or code ordering</li>
<li>Commenting in detail (or providing a URL)</li>
</ul>
<p>If you&#8217;re implementing a complex algorithm, you need documentation somewhere. The lessons of <a href="http://en.wikipedia.org/wiki/Literate_programming" target="_blank">Literate Programming</a>, as exemplified in Donald Knuth&#8217;s <a href="http://en.wikipedia.org/wiki/TeX" target="_blank">TeX</a> programme, seem to have fallen on deaf ears. But Knuth at least put a challenge down that he would pay out money for each verified TeX bug. (It didn&#8217;t bankrupt him.  Firstly, the error rate per kLOC was very, very low and, secondly, people treasured a cheque signed by him so much that they preferred to frame rather than cash it!).</p>
<h3>Testing</h3>
<p>The cause of mistake is also touching other areas, among them testing. The problem with testing algorithms like the OpenSSL one is that you sometimes need to test a lot of combinations. And I mean <strong>A Lot</strong>! In his recent talk at the Cambridge BCS meeting (see <a href="http://beanary.wordpress.com/2008/03/13/review-simon-peyton-jones-on-type-driven-testing-in-haskell/" target="_blank">my review</a>), Peyton-Jones showed an example where the error only revealed itself after running several hundred different data inputs for the same test-case! We usually don&#8217;t go anywhere near that length to test our code. But sometimes you need to do it, usually by generating random data in order to cover as many possibilities as possible in order to avoid any bias of excluding certain cases (we humans are often good at rationalising away potential sources of error a la <em>That can never happen</em>).</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/54/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/54/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=54&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2008/06/01/jotting-14-commenting-sometimes-its-crucial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #13: Management, Responsibility &amp; Authority</title>
		<link>http://beanary.wordpress.com/2008/05/16/jotting-13-management-responsibility-authority/</link>
		<comments>http://beanary.wordpress.com/2008/05/16/jotting-13-management-responsibility-authority/#comments</comments>
		<pubDate>Fri, 16 May 2008 00:06:17 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Management]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=34</guid>
		<description><![CDATA[Leadership, responsibility, authority and teamwork are crucial ingredients in software projects. Some thoughts, triggered by recent blog entries, readings and accidental finds, may help to shed some light on these aspects. (Disclaimer: Apologies if parts seem like ramblings but I haven&#8217;t been able yet to make more consistent connections between all concepts.) Responsibility and Authority [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=34&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:left;">Leadership, responsibility, authority and teamwork are crucial ingredients in software projects. Some thoughts, triggered by recent blog entries, readings and accidental finds, may help to shed some light on these aspects.</p>
<p style="text-align:left;">(Disclaimer: Apologies if parts seem like ramblings but I haven&#8217;t been able yet to make more consistent connections between all concepts.)</p>
<h3>Responsibility and Authority</h3>
<p style="text-align:left;">When you are charged with managing a project, you are typically charged with achieving some objective with a budget (time, money). But are you always given the right parameters to achieve that objective? One important aspect is the right balance of responsibility and authority. If you feel to have a lot of the former but not enough of the latter then please read on!</p>
<p style="text-align:left;">Johanna Rothman, author of [1], writes on <a href="http://www.projectsatwork.com/content/Articles/238567.cfm" target="_blank">Responsibility is Authority</a> (see also <a href="http://www.jrothman.com/weblog/2006/02/responsibility-vs-authority.html" target="_blank">here</a>):</p>
<blockquote><p><strong>As a project manager, you have the responsibility to take authority, rather than wait for someone to give you the authority.<br />
</strong>No manager ever has enough real authority to do what he or she wants to do. There&#8217;s always someone with a bigger title. Even if you&#8217;re a CEO, you report to a board. Even though titular authority is useful, it&#8217;s not enough. If the project is strategically important to the organization, act first (doing whatever the project needs) and ask forgiveness later. You&#8217;ll know whether the project is strategically important by how many people ask about the status and what levels of people ask. The more people ask at the higher levels, the more strategic the project is. If the project is not strategically important, don&#8217;t waste your time trying to accomplish it. In reality, if the project is important enough to the organization, you have the authority to do just about anything you need to do. (You need the self-esteem to do what you need to do.) But if the project is not important enough to the organization, you can never get enough authority to do what you need to do.</p></blockquote>
<p>A good definition of <a href="http://www.maxwideman.com/issacons3/iac1367/index.htm" target="_blank">authority and responsibility</a>:</p>
<blockquote><p><strong>Authority:</strong> The legitimate power given to a person to use resources and exercise discipline to reach an objective <strong></strong></p>
<p><strong>Responsibility:</strong> The duties, assignments and accountability for results associated with a function or position</p></blockquote>
<p>(Definitions on related concepts can also be found there). The author also quips that <em>sometimes you just have to grab it [authority] and run with it</em> and a person should be <em>granted at least as much authority as she can handle</em>, which seems in agreement with Rothman.</p>
<h3>Leadership</h3>
<p>How should you use it? You should mainly use to enable your team to perform well, i.e., it&#8217;s not a license to tightly control your team but rather to remove obstacles that hinder your team. In other words don&#8217;t lead by command but rather <a href="http://en.wikipedia.org/wiki/Mission-based_tactics" target="_blank">by mission</a>, be an enabler. This is at least my understanding of leadership as espoused by <a href="http://en.wikipedia.org/wiki/Scrum_%28development%29" target="_blank">SCRUM</a> and <a href="http://en.wikipedia.org/wiki/Scrum_%28development%29" target="_blank">DSDM Atern</a>.</p>
<p>Key principles of leading-by-task (or mission) were developed in the 19th century Prussian Army and state that the leader [2]:</p>
<ul>
<li>informs what his intention is,</li>
<li>sets clear achievable objectives,</li>
<li>provides the required [...] resources,</li>
<li>will only order details regarding execution if measures which serve the same objective have to be harmonized, [...],</li>
<li>gives latitude to subordinate leaders in the execution of their task [mission].</li>
</ul>
<p>This approach certainly takes a very dim view of <a href="http://en.wikipedia.org/wiki/Micromanagement" target="_blank">micromanagement</a> [2]:</p>
<blockquote><p>It is, therefore, out of the question that a colonel or even a general appoint himself squad leader to direct traffic at a road intersection or to instruct a patrol leader about his mission.</p></blockquote>
<p><a href="http://en.wikipedia.org/wiki/Rupert_Smith" target="_blank">Rupert Smith</a>, as a former general in Bosnia, demonstrates in [3] how a lack of clear intentions and goals and a lack of understanding of the capabilities of his resources (viz. armed forces) from his political leaders did leave him in difficult situations and often rendered him unable to use his resources with their full utility. True leadership is not easy.</p>
<h3>The Team: Collective Wisdom</h3>
<p>Current agile approaches place great importance on the project team, especially one that self-organises and  is not managed by an old-style project manager. Important issues and results from social experiments relating to small teams are reported and discussed in [4], especially in <em>Committees, Juries and Teams: The Columbia Disaster and How Small Groups Can Be Made to Work</em> (Ch. 9). We tend to rely on a single person to make a decision rather than trust a (small) group of people to make a better and more consistent decision, sometimes with <a href="http://en.wikipedia.org/wiki/Space_Shuttle_Columbia_disaster#Columbia_Accident_Investigation_Board" target="_blank">disastrous results</a>. [4] concludes that:</p>
<blockquote><p>[...] that there is no point in making small groups part of the leadership structure if you do not give the group a method of aggregating the opinions of its members. If small groups are included in the decision-making process, then they should be allowed to make decisions. If an organisation sets up teams and then uses them for purely advisory purposes, it loses the true advantage that a team has: namely, collective wisdom.</p></blockquote>
<p>(Some people even seem to be able to <a href="http://www.newyorker.com/reporting/2008/05/12/080512fa_fact_gladwell" target="_blank">overturn</a> the image of the genius inventor by using teamwork.)</p>
<h3>Quotes</h3>
<p>These are all from <a href="http://en.wikiquote.org/wiki/Leadership" target="_blank">wikiquote on leadership</a> and too fitting not to mention them:</p>
<blockquote><p>Don&#8217;t tell people how to do things, tell them what to do and let them surprise you with their results. (<a title="George S. Patton" href="http://en.wikiquote.org/wiki/George_S._Patton">George S. Patton)</a></p></blockquote>
<blockquote><p>If it&#8217;s a good idea, go ahead and do it. It is much easier to apologize than it is to get permission. (<a class="new" title="Admiral Grace Hopper (not yet written)" href="http://en.wikiquote.org/w/index.php?title=Admiral_Grace_Hopper&amp;action=edit&amp;redlink=1">Admiral Grace Hopper)</a></p></blockquote>
<blockquote><p>A clear vision is usually assumed and rarely communicated. (Unknown)</p></blockquote>
<h3>References</h3>
<ol>
<li>Johanna Rothman: <a href="http://www.pragprog.com/titles/jrpm/manage-it" target="_blank">Manage It!</a> (       ISBN: 978-0-9787392-4-9, 2007)</li>
<li>Werner Widder: <a href="http://usacac.leavenworth.army.mil/CAC/milreview/English/SepOct02/SepOct02/widder.pdf" target="_blank">Auftragstaktik und Innere Fuehrung </a>(eng, PDF)<a href="http://usacac.leavenworth.army.mil/CAC/milreview/English/SepOct02/SepOct02/widder.pdf" target="_blank"><br />
</a></li>
<li>Sir Ruper Smith: The Utility of Force: The Art of War in the Modern World (ISBN 0-713-99836-9, 2005)</li>
<li>James Surowiecki: The Wisdom of Crowds (ISBN 0-349-11605-9, 2004)</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/34/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/34/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=34&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2008/05/16/jotting-13-management-responsibility-authority/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Review: Simon Peyton Jones on Type-driven Testing in Haskell</title>
		<link>http://beanary.wordpress.com/2008/03/13/review-simon-peyton-jones-on-type-driven-testing-in-haskell/</link>
		<comments>http://beanary.wordpress.com/2008/03/13/review-simon-peyton-jones-on-type-driven-testing-in-haskell/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 22:57:42 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[functional]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=47</guid>
		<description><![CDATA[Simon Peyton Jones gave a talk at the Cambridge BCS-SPA group on testing with functional languages (esp. Haskell). (Someone&#8217;s already posted the video and slides; careful it&#8217;s large!). Some important points: Future of programming will be about &#8220;Control of (Side) Effects&#8221; Programming languages will become more functional than imperative Purity is good for understanding, verification, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=47&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://research.microsoft.com/~simonpj" target="_blank">Simon Peyton Jones</a> gave a <a href="http://www.bcs-spa.org/cgi-bin/view/SPA/TypeDrivenTestingInHaskell" title="Type-driven Testing in Haskell" target="_blank">talk </a>at the <a href="http://www.bcs-spa.org/cgi-bin/view/SPA/SpaCambridge" target="_blank">Cambridge BCS-SPA</a> group on testing with functional languages (esp. Haskell). (Someone&#8217;s already posted the <a href="http://www.foomongers.org.uk/videos/spj-typedriventestinginhaskell.html" target="_blank">video and slides;</a> careful it&#8217;s large!).</p>
<p>Some important points:</p>
<ul>
<li>Future of programming will be about &#8220;Control of (Side) Effects&#8221;</li>
<li>Programming languages will become more functional than imperative</li>
<li>Purity is good for understanding, verification, maintenance,</li>
<li>Purity pays back in performance, parallelism, testing</li>
<li>Functional/value-oriented is easier to test than object-oriented stateful</li>
<li>Functional is good for generating tests (domain-specific language)</li>
</ul>
<p>After a short intro into Haskell (10 min Haskell 101:)) SPJ moved onto testing in Haskell. In his demo, he tested a programme that would pack 7-bit words into 8-bits, so that eight ASCII characters would take up only 7 byte instead of 8. This sort of space saving is done in SMS where bandwith is precious.</p>
<p>One fundamental test tried to assert that <code>unpack(pack(x))==x</code>. After testing some hand-written cases, which succeeded, the test started to use randomly generated words and started to fail after after a few hundred attempts. Due to its random nature, it took a randomly varying number of cases, but typically it failed after less than a 1000 cases. (It turned out that words of 8-byte length ending in a particular bit sequence were not correctly packed.)</p>
<p>The beauty of the underlying <a href="http://www.cs.chalmers.se/~rjmh/QuickCheck/" title="QuickCheck" target="_blank">Haskell testing framework</a> was that it took very few lines of code to express a  generic testing framework.</p>
<p>The talk also showed that sometimes testing with large random test data is necessary to find bugs; something we rarely do!?</p>
<p>Overall, I found the speaker very engaging and the talk enjoyable even if I won&#8217;t claim of having understood or remembered everything.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/47/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/47/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=47&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2008/03/13/review-simon-peyton-jones-on-type-driven-testing-in-haskell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #12: Find empty strings in Oracle table</title>
		<link>http://beanary.wordpress.com/2008/03/12/jotting-12-find-empty-strings-in-oracle-table/</link>
		<comments>http://beanary.wordpress.com/2008/03/12/jotting-12-find-empty-strings-in-oracle-table/#comments</comments>
		<pubDate>Wed, 12 Mar 2008 23:26:54 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Database]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=46</guid>
		<description><![CDATA[Had to find some strings (varchar2) in a table that were just blanks with optional end-of-line characters thrown in. Luckily, regular expressions make that an easy task. Here is the query: SELECT * FROM myTable x WHERE REGEXP_LIKE( x.myColumn, '(^[[:space:]]*$)' ); A short explanation: ^...$ says that pattern applies to the string from start to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=46&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Had to find some strings (varchar2) in a table that were just blanks with optional end-of-line characters thrown in.</p>
<p>Luckily, regular expressions make that an easy task. Here is the query:</p>
<pre>SELECT *
  FROM myTable x
 WHERE REGEXP_LIKE( x.myColumn, '(^[[:space:]]*$)' );</pre>
<p>A short explanation:</p>
<ul>
<li><code>^...$</code> says that pattern applies to the string from start to finish, i.e., it&#8217;s not just a sub-string pattern,</li>
<li><code>[...]*</code> says that pattern occurs 0 or more times (could also have been [...]+ in this case),</li>
<li><code>[:space:]</code> defines a pattern of all white-space characters, including blank, \t, \r and \n.</li>
</ul>
<p>Sometimes, regular expression just make tasks like these very easy.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/46/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/46/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/46/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/46/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/46/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=46&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2008/03/12/jotting-12-find-empty-strings-in-oracle-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #11: Apple Macbook Pro &#8211; Still Cheap?</title>
		<link>http://beanary.wordpress.com/2008/03/01/jotting-11-apple-macbook-pro-still-cheap/</link>
		<comments>http://beanary.wordpress.com/2008/03/01/jotting-11-apple-macbook-pro-still-cheap/#comments</comments>
		<pubDate>Sat, 01 Mar 2008 17:39:17 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Miscel]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[laptop]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/?p=44</guid>
		<description><![CDATA[The perennial question: Should I buy an Apple or a Windows-based laptop? The question came up recently for me since my old systems were getting a tad too old, and I also happened to come across this blog (a bit outdated of course by now, see below). Some basic facts as they are available today [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=44&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The perennial question: Should I buy an Apple or a Windows-based laptop? The question came up recently for me since my old systems were getting a tad too old, and I also happened to come across <a href="http://www.codinghorror.com/blog/archives/000591.html" title="Jeff Atwood (Coding Horror) on Apple Laptops" target="_blank">this blog</a> (a bit outdated of course by now, see below).</p>
<p>Some basic facts as they are available today (March 2008) in the table below. I chose a Dell since it is widely available and a very common and representative competitor.</p>
<table>
<tr>
<th>Category</th>
<th>Macbook Pro</th>
<th>Dell XPS M1530</th>
</tr>
<tr>
<td>Processor</td>
<td>2.4 GHz Core 2 Duo (?, 3MB L2-cache)</td>
<td>2.4 GHz Core 2 Duo T7700 (800 MHz FSB, 4 MB L2-cache)</td>
</tr>
<tr>
<td>Memory</td>
<td>2 GB memory@667MHz DDR2 SDRAM</td>
<td>3 GB memory@667MHz DDR2 SDRAM</td>
</tr>
<tr>
<td>Display Size</td>
<td>15.4 in</td>
<td>ditto</td>
</tr>
<tr>
<td>Graphics Card</td>
<td>GeForce 8600M GT, 256MB SDRAM</td>
<td>ditto</td>
</tr>
<tr>
<td>Resolution</td>
<td>1440 x 900</td>
<td>1280 x 800</td>
</tr>
<tr>
<td>Hard Drive</td>
<td>200 GB@5400rpm</td>
<td>320 GB@5400 rpm</td>
</tr>
<tr>
<td>OS</td>
<td>Mac OS X v10.5 Leopard</td>
<td>MS Windows Vista Home Premium</td>
</tr>
<tr>
<td>Price (£)</td>
<td>1299</td>
<td>926</td>
</tr>
</table>
<p>The Dell version has been customised slightly by choosing a faster matching processor.</p>
<p>This is the best match in terms of hardware components I could find. They are quite close: the Dell scores better in the memory and hard-drive specs, the Apple in the resolution.</p>
<p>Hence, we are down to Max OS vs Windows Vista, the various bits of pre-installed software, the quality of the components (hard to judge from the outside) and the very personal matter of taste.</p>
<p>Currently, I personally just can&#8217;t get myself to pay a 40% premium for the Apple. One problem for me is that Apple seems to update its hardware specs only infrequently while others constantly upgrade or adjust prices (downwards). And so the Apple laptop starts to look more and more expensive over time. I will keep looking and comparing &#8230;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/44/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/44/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/44/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/44/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/44/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=44&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2008/03/01/jotting-11-apple-macbook-pro-still-cheap/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #10: Branching Models and all that</title>
		<link>http://beanary.wordpress.com/2007/11/21/jotting-10-branching-models-and-all-that/</link>
		<comments>http://beanary.wordpress.com/2007/11/21/jotting-10-branching-models-and-all-that/#comments</comments>
		<pubDate>Wed, 21 Nov 2007 00:56:33 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/2007/11/21/jotting-10-branching-models-and-all-that/</guid>
		<description><![CDATA[Proper software configuration management (SCM) is often treated like an unloved child in software projects. I am talking not just committing code into a repository, but about creating reproducible releases, merging code between code-lines and all those things that are sometimes boring but necessary to provide proper control over your team&#8217;s coding efforts. Let me [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=35&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Proper software configuration management (SCM) is often treated like an unloved child in software projects. I am talking not just committing code into a repository, but about creating reproducible releases, merging code between code-lines and all those things that are sometimes boring but necessary to provide proper control over your team&#8217;s coding efforts.</p>
<p>Let me tell you what we did in our current project;  I learned a lot during it, mainly since I had to manage the releases most of the time. In the end, the whole process is less scary than I thought; I&#8217;ve become even quite relaxed about it, and merging code is no longer scary (but a bit boring).</p>
<p>I must stress that you must adopt your own release process and fit it to your circumstances.</p>
<p>A few words on our software and its installation as it has some bearing on our choice of branching model. The code is a Java webstart application, written using Swing, connecting to enterprise beans on a server. This implies that whenever a user starts the application he will be forced to worked with the most recently installed version; i.e., there is ever only one release in production.</p>
<p>Here is our process to release (assuming we are currently at production version 2.2.1 and use the <a href="http://en.wikipedia.org/wiki/Version_number#Odd-numbered_versions_for_development_releases" target="_blank">Linux convention for numbering</a>):</p>
<ol>
<li> A set of features is defined for the next release.</li>
<li>When the features are implemented a release branch is created and named (e.g., release-2.4).</li>
<li>Part of the team, the release team, completes the new release code, incl. final configuration, acceptance testing, release notes, etc.</li>
<li>The release team releases a candicate for acceptance testing on a test server (tagged 2.4.0rc1).</li>
<li>Bugs in acceptance testing are fixed and a new candidate (tagged 2.4.0rc2) is released. This continues until the code is accepted.</li>
<li>The code is released (tagged 2.4.0).</li>
<li>Any  upcoming  bugs of  the  released code  will be fixed on the branch line, repeating steps 4-6, and releasing the fixed version (tagged 2.4.1, 2.4.2, &#8230;)</li>
<li>After each release (candidate), the code changes are merged back into the development line (merges are tagged appropriately).</li>
<li>The development team starts to work on the next set of features on the development line, repeating steps 1-9 for the next release (2.6 or 3.0).</li>
</ol>
<p>(If I have time I may add a picture of this process.)</p>
<p>What are the advantages that we obtained from this process?</p>
<ul>
<li>We have a clear, easily understandable and reproducible release process.</li>
<li>There is no significant code freeze period when preparing a release.</li>
<li>The process allows the team to allocate time efficiently and in parallel.</li>
<li>The process is quite agile and flexible; there is minimal burden on developers as many can continue working as if unaware of the release process.</li>
<li>The code can be placed under coninuous integration at all stages.</li>
<li>We can reproduce production releases at any time quickly.</li>
<li>Even during the testing process for a new release (e.g., 2.4.0rc2), we can release an emergency fix for the current production version (e.g., 2.2.1 to 2.2.2) without major upheaval.</li>
</ul>
<p>It is also obvious that our installation allows us to choose this branching model since we never have more than three versions out there: the current production (e.g., 2.2.1), the current release candidate (e.g., 2.4.0rc2) and the development line (named 2.5).</p>
<p>If your circumstances are different (e.g, customers paid for different feature sets), you will have to come up with a different branching model to make it fit for your needs.</p>
<p>Some recommendations:</p>
<ul>
<li>Think early about the branching model and release process suitable for your project; at least no later than when the first feature set is complete</li>
<li>Learn and use some of the branching patterns (see references)</li>
<li>Merge early and often (before the deltas become too large and are hard too merge)</li>
</ul>
<p>Don&#8217;t be afraid of branching and merging; once you understand the process, its limitations and benefits, everything beomes much easier.</p>
<h3>References:</h3>
<ul>
<li>M  Shuttleworth: <a href="http://http://www.markshuttleworth.com/archives/126" target="_blank" rel="bookmark">Merging is the key to software developer collaboration</a></li>
<li>B Appleton, S Berczuk, R Cabrera, R Orenstein<i>:</i><a href="http://www.cmcrossroads.com/bradapp/acme/branching/" title="Top" target="_blank" name="Top"><i>Streamed Lines:</i> Branching Patterns for Parallel Software Development</a></li>
<li>C Walrad, D Strom: <a href="http://www.accurev.com/product/docs/SCMBranchingModels1.pdf" target="_blank">The Importance of Branching Models in SCM</a>, IEEE Software 2002, September, p31-38.  See also comments in <i>Letter to Editor</i>, IEEE Software 2003, January, p11.</li>
</ul>
<h4>PS</h4>
<p>Eric Raymonds has started a <a href="http://www.catb.org/esr/writings/version-control/version-control.html" target="_blank">page</a> on version control systems. Worth keeping an eye on it.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/35/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/35/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/35/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/35/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/35/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=35&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2007/11/21/jotting-10-branching-models-and-all-that/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
		<item>
		<title>Jotting #9: To be checked or Not to be checked &#8211; That&#8217;s the Java Exception</title>
		<link>http://beanary.wordpress.com/2007/11/13/jotting-9-to-be-checked-or-not-to-be-checked-thats-the-java-exception/</link>
		<comments>http://beanary.wordpress.com/2007/11/13/jotting-9-to-be-checked-or-not-to-be-checked-thats-the-java-exception/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 02:56:08 +0000</pubDate>
		<dc:creator>beanary</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://beanary.wordpress.com/2007/11/13/jotting-9-to-be-checked-or-not-to-be-checked-thats-the-java-exception/</guid>
		<description><![CDATA[Always arousing some emotions (see this recent example), this question whether you should use checked or unchecked exceptions in Java. Other languages don&#8217;t have that &#8220;choice&#8221;, so this is a pure Java problem. Elliot Rusty Harold posted his rules about this problem, introducing so-called external and internal exceptions, some time ago in July. I think [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=33&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Always arousing some emotions (see this <a href="http://gafter.blogspot.com/2007/05/removing-language-features.html" target="_blank">recent example</a>), this question whether you should use checked or unchecked exceptions in Java. Other languages don&#8217;t have that &#8220;choice&#8221;, so this is a pure Java problem. Elliot Rusty Harold posted <a href="http://cafe.elharo.com/java/internal-and-external-exceptions/" target="_blank">his rules</a> about this problem, introducing so-called <em>external</em> and <em>internal</em> exceptions, some time ago in July. I think these are too complicated and unnecessary but I promised myself to write about it.</p>
<p>Let me come out with my point-of-view right now: <em>Avoid checked exceptions, stay away from them.</em> They are not worth it.  OK so that&#8217;s out. But some clarifications are in order:</p>
<ul>
<li>I do <strong>not</strong> argue against declaring exceptions in a method&#8217;s signature:
<ul>
<li>In Java you can list both, checked and unchecked, exceptions in the method signature.</li>
<li>You should document the most important contract violations that the method will reject.</li>
<li>Better still, document the contract in the spirit of B Meyer&#8217;s Object-oriented Software Design.</li>
</ul>
</li>
<li>I don&#8217;t ask that rather obvious requirements, like arguments not being null, are documented in detail.</li>
<li>I argue <strong>against the rule</strong> that checked exceptions have to be declared in each method of the calling stack unless they catch the exception.</li>
</ul>
<p>What is the main purpose of an exception? It&#8217;s to indicate a contract violation (I think Bertrand Meyer&#8217;s language is the most appropriate to use).</p>
<p>Does the method raising the exception care about the context in which it is called? No, the method provides its own context: its contract.  The rules of ERH about internal and external exceptions make no sense whatsoever in this model. Whether I can write to a file (object) or not, whether the provided argument is of the wrong type or not, whether the object&#8217;s state is within the method&#8217;s control or not, is <strong>irrelevant</strong> and is <strong>not</strong> the question that is being asked.</p>
<p>The method asks a much simpler and more general question: Do you obey my pre-conditions? It does not care what the intent of the caller is, what the calling context or the semantics are. Only the programmer may know that. No, the method just promises to fulfil its side of the contract (post-conditions) if the pre-conditions are fulfilled.</p>
<p>If a file instance is passed as an argument, the file is always outside the control of the called method. If it cannot write to the file because the file doesn&#8217;t exist or is write-protected, the method doesn&#8217;t care. It just says: You&#8217;re not fulfilling the pre-conditions  of my contract; here is my exceptional response.</p>
<p>The whole distinction between external and internal exceptions makes no longer any sense (and you could always argue ERH&#8217;s examples in different ways depending on context). So we established that any distinction between checked and unchecked exceptions is based on some arbitrary classification of the caller that cannot be maintained inside the method throwing the exception. (You can easily do this for any other model, the checked-unchecked cases are always based on such classifications.)</p>
<p>So we are left with the question whether the compiler-enforced rule on checked exception provides any benefits, and we have to ask the questions:</p>
<ul>
<li>Is it beneficial that every calling method repeats the exception in its signature?</li>
<li>In a proper object-oriented design, who carries the information about the problem?</li>
<li>Where is the exception being handled and resolved?</li>
</ul>
<p>The first question should remind you immediately of DRY: don&#8217;t repeat yourself. The answer to the second is obviously the exception itself, not the method signature. And the final one is more based on the experience that, at least in applications with a user-interface, it is standard practice to throw the exception back to the user rather than to resolve the problem programmatically. There are some exceptions (no pun intended) like in message-based applications where the queue may try to re-send the message a few times and finally succeed, adding some robustness, but ultimately the problem is thrown back to the user (or left on the dead-letter queue!).</p>
<p>Developers of embedded systems could tell you how hard it can be to resolve exceptions adequately to prevent the system from crashing. Sometimes they just reset the system and log the fault; sometimes they just skip the faulty data and continue (and interpolate, for example, when taking sensor readings). (You may want to read more on this issue and exception design &amp; patterns in the <a href="http://www.wirfs-brock.com/Resources.html#IEEE%20Design%20Column" target="_blank">recent series of IEEE Software articles</a> by R Wirfs-Brock.)</p>
<p>In the end we are left with the conclusion that Java&#8217;s checked exception were an experiment of good intentions but one that ultimately failed and didn&#8217;t provide any significant benefits but rather gave rise to a new anti-pattern: the silently caught exception a la <code>catch(Exception e){ /* do nothing */ }</code>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/beanary.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/beanary.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/beanary.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/beanary.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/beanary.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=beanary.wordpress.com&amp;blog=1174581&amp;post=33&amp;subd=beanary&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://beanary.wordpress.com/2007/11/13/jotting-9-to-be-checked-or-not-to-be-checked-thats-the-java-exception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a7465cd77c4994d17b2a19d8d673d880?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">beanary</media:title>
		</media:content>
	</item>
	</channel>
</rss>
