<?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>dantwining.com &#187; Computers</title>
	<atom:link href="http://dantwining.com/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://dantwining.com</link>
	<description>every day is a school day</description>
	<lastBuildDate>Thu, 11 Mar 2010 20:43:47 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='dantwining.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/043754a53056133c650512e916fd4dd4?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>dantwining.com &#187; Computers</title>
		<link>http://dantwining.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dantwining.com/osd.xml" title="dantwining.com" />
	<atom:link rel='hub' href='http://dantwining.com/?pushpress=hub'/>
		<item>
		<title>GWT, OpenLayers and Full Screen Maps &#8211; Solved!</title>
		<link>http://dantwining.com/2010/03/01/gwt-openlayers-and-full-screen-maps/</link>
		<comments>http://dantwining.com/2010/03/01/gwt-openlayers-and-full-screen-maps/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 21:50:24 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=768</guid>
		<description><![CDATA[I&#8217;m writing a GWT app with an OpenLayers map in it, and no matter how hard I tried, I couldn&#8217;t get the map to open full-screen.

The Problem
I wanted a full screen map. Like this.

But what I got was this.

It only happened when the page first opened. If I resized the window, or panned/zoomed the map, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=768&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m writing a GWT app with an OpenLayers map in it, and no matter how hard I tried, I couldn&#8217;t get the map to open full-screen.</p>
<p><span id="more-768"></span></p>
<h3>The Problem</h3>
<p>I wanted a full screen map. Like this.</p>
<p><img class="aligncenter size-full wp-image-770" title="FullScreenMap" src="http://dantwining.files.wordpress.com/2010/03/screen-shot-2010-03-01-at-21-36-54.png?w=600&#038;h=347" alt="" width="600" height="347" /></p>
<p>But what I got was this.</p>
<p><img class="aligncenter size-full wp-image-769" title="SmallScreenMap" src="http://dantwining.files.wordpress.com/2010/03/screen-shot-2010-03-01-at-21-36-10.png?w=600&#038;h=347" alt="" width="600" height="347" /></p>
<p>It only happened when the page first opened. If I resized the window, or panned/zoomed the map, then the map redrew to fill the page.</p>
<p>It didn&#8217;t matter if I used GWT-OpenLayers (a Widget that wraps up the OpenLayers library) or just got at the OpenLayers javascript directly. Also, it didn&#8217;t matter which browser I used, they all drew the map in the top left-hand corner.</p>
<h3>The Solution</h3>
<p>The answer is to add a DeferredCommand, which updates the map once GWT has finished doing everything else. Here&#8217;s a cut-down example which uses a GWT-OpenLayers widget, but the fix works perfectly for standard OpenLayers too.</p>
<pre class="brush: java;">

public void onModuleLoad() {

   ...

   final MapWidget mapWidget = new MapWidget(&quot;100%&quot;, &quot;100%&quot;, config);

   ...

   mapWidget.getMap().setCenter(new LonLat(lon, lat), zoom);

   DeferredCommand.addCommand(new Command() {

      @Override

      public void execute() {

         mapWidget.getMap().updateSize();

      }

   });

}
</pre>
<p>You&#8217;re welcome to <a href="https://code.google.com/p/dantwining/source/browse/trunk/FullScreenMap/src/com/dantwining/webmap/client/FullScreenMap.java#41">check out my <code>onModuleLoad()</code> method in full here</a>.</p>
<p>If you&#8217;re using OpenLayers directly, you need to jump through a little extra hoop (or at least I did, there&#8217;s probably a much better way of doing it) in order to get at the javascript redraw method&#8230;</p>
<pre class="brush: plain;">

   DeferredCommand.addCommand(new Command() {

      @Override

      public void execute() {

         updateMapSize();

      }

      private native void updateMapSize() /*-{

         $wnd.map.updateSize();

      }-*/;

   });

}
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/768/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/768/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/768/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=768&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/03/01/gwt-openlayers-and-full-screen-maps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>

		<media:content url="http://dantwining.files.wordpress.com/2010/03/screen-shot-2010-03-01-at-21-36-54.png" medium="image">
			<media:title type="html">FullScreenMap</media:title>
		</media:content>

		<media:content url="http://dantwining.files.wordpress.com/2010/03/screen-shot-2010-03-01-at-21-36-10.png" medium="image">
			<media:title type="html">SmallScreenMap</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting a full-size CD/DVD label out of CD-LabelPrint</title>
		<link>http://dantwining.com/2010/02/03/getting-a-full-size-cddvd-label-out-of-cd-labelprint/</link>
		<comments>http://dantwining.com/2010/02/03/getting-a-full-size-cddvd-label-out-of-cd-labelprint/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 21:02:31 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=746</guid>
		<description><![CDATA[My Canon Pixma iP4500 can print directly onto printable CD/DVDs, and came bundled with CD-LabelPrint for me to setup my CD labels. Unfortunately, there&#8217;s a bug in CD-LabelPrint that doesn&#8217;t allow you print right up to the inner circle of the CD/DVD. Fortunately, there&#8217;s filthy hack that allows you to print over the entire surface [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=746&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>My Canon Pixma iP4500 can print directly onto printable CD/DVDs, and came bundled with CD-LabelPrint for me to setup my CD labels. Unfortunately, there&#8217;s a bug in CD-LabelPrint that doesn&#8217;t allow you print right up to the inner circle of the CD/DVD. Fortunately, there&#8217;s filthy hack that allows you to print over the entire surface of the disc after all&#8230;<br />
<span id="more-746"></span></p>
<p>CD-LabelPrint isn&#8217;t particularly sophisticated software; it just draws two circles (an inner and an outer) on top of your image of choice, showing you which bits of your image will be printed onto the disc. The inner and outer circles can be adjusted to fit your particular printable media, but you can only shrink the diameter of the inner circle down to 33mm (even though the help says the minimum is 17mm).</p>
<p>It turns out that <a href="http://club.myce.com/f123/help-cd-labelprint-96884/" target="_blank">you can hack a registry key to make the inner circle smaller</a>. Just:</p>
<ol>
<li>Start &gt; Run &gt; type <em><strong>regedit</strong></em> and click OK</li>
<li>Use the tree on the left to find: HKEY_CURRENT_USER &gt; Software &gt; MediaNavigation &gt; CDLabelPrint &gt; 1.0 &gt; Settings &gt; SizeAdjust &gt; .Standard CD (12cm)</li>
<li>Double-click on Inner and change the value&#8230;</li>
</ol>
<p>&#8230;Change the value to what? The number is <em>10 * the number of mm to expand the inner circle&#8217;s diameter by</em>. I wanted a 20mm inner circle, which is 23mm smaller than the 43mm circle CD-LabelPrint uses by default, so mine&#8217;s set to <strong>-230</strong> (note the minus sign). You might want to measure the inner circle of your printable media and adjust accordingly.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/746/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/746/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/746/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=746&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/02/03/getting-a-full-size-cddvd-label-out-of-cd-labelprint/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Twitter IDs for comments</title>
		<link>http://dantwining.com/2010/01/30/using-twitter-ids-for-comments/</link>
		<comments>http://dantwining.com/2010/01/30/using-twitter-ids-for-comments/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 09:32:49 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.dantwining.com/?p=471</guid>
		<description><![CDATA[I wrote about 90% of this post over four months ago, before I switched to wordpress.com. It seems a bit of a shame to just throw it all away, so here it is in all its glory&#8230;
So here&#8217;s the short story &#8211; I want to use allow readers of this blog to use their Twitter [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=471&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p><em>I wrote about 90% of this post over four months ago, before I switched to wordpress.com. It seems a bit of a shame to just throw it all away, so here it is in all its glory&#8230;</em></p>
<p>So here&#8217;s the short story &#8211; I want to use allow readers of this blog to use their Twitter credentials to log in and leave comments.</p>
<p><span id="more-471"></span>A few weeks ago, Shahid bullied me into getting a twitter account. Up until today, I hadn&#8217;t found a use for it, but this morning I wanted to post a comment on <a href="http://wordaligned.org/">Word Aligned</a>, and the Disqus commenting system that Tom Guest uses there lets me log in with my Twitter credentials.</p>
<p>This is really nice. This I like.</p>
<h3>Why this is a good idea</h3>
<p>Ideally, from a security point of view, you&#8217;d use strong, unique passwords for every system/website that you can log into. Of course, in practice this never happens; either you:</p>
<ol>
<li>try to, but end up with so many that you forget them.</li>
<li>store all of your unique passwords in one place that becomes [almost] as vulnerable as just using one password everywhere anyway (and then find that you don&#8217;t have access to your master password file when you&#8217;re away from your home computer).</li>
<li>just use the same password everywhere.</li>
</ol>
<p>The inherent problem with using the same password for everywhere is that every individual website that you log into stores and validates your information themselves. I have to trust every website to hold on tight to that information. I have to trust each website to not go round and try logging into all the other websites that I&#8217;ve used the same user/password combination for.</p>
<p>The fact of the matter is that all of those websites that are storing my username and password don&#8217;t actually need a username and password from me in the first place. All they really need to know if that I&#8217;m that same user that turned up two days ago.</p>
<p>This is where <a href="http://openid.net/get-an-openid/">OpenID</a> comes in. The basic idea is this; you have one account with one website, and only that website knows your password. Then, when other websites need to know who you are, they delegate to the OpenID provider. The first website never gets to see your password, they just turn to (e.g.) Google and say &#8220;is this joe.bloggs?&#8221; and if you&#8217;re logged into Google with your joe.bloggs account, Google says &#8220;yes&#8221;.</p>
<h3>Why Twitter is better than Google</h3>
<p>You could use Google to log you into other websites, but I&#8217;d rather you didn&#8217;t. Your email account is sacred. Keep it so. You can&#8217;t buy anything with your twitter account. If you forget your Credit Card PIN, you can&#8217;t get it sent to your Twitter account. Many, many websites include a &#8220;Forgot your password?&#8221; system that emails you your credentials. If someone gets into your email account, then they&#8217;re effectively a click or two away from getting into all those places too.</p>
<p>Much better then to use your Twitter (or wordpress.com) account to log you into these places. Sure, it means remembering two passwords (your Twitter one for your trivial stuff, your Google one for Google), but even I can just about manage that.</p>
<h3>Enough already, let&#8217;s let people log in with Twitter</h3>
<p>So we know it can be done, because WordAligned does it. But Tom uses Disqus, and I don&#8217;t know if I want to. Although Disqus does more good things than I need it to, it also takes away a few good things that I want to keep; for example I don&#8217;t want to lose my WYSIWYG rich-text editor. Yes, I want to outsource my user authentication, but I don&#8217;t want to outsource everything else. Yes, there may be <a href="http://www.avc.com/a_vc/2008/05/three-reasons-t.html" target="_blank">3 good reasons to use Disqus</a>, but there are at least <a href="http://ryanspoon.com/blog/2008/05/15/disqus-after-5-days-on-disqus-im-turning-back-to-wordpress-comments/" target="_self">4 good reasons not to</a>.</p>
<p>I guess I ought to ask Tom what he thinks of Disqus; I mean, he&#8217;s been using it on his site for a lot longer than I&#8217;ve been looking into this. I had hoped that he&#8217;d already blogged about it, but  you (or, at least, I) can&#8217;t search his archieves, and <a href="http://www.google.co.uk/search?hl=en&amp;client=firefox-a&amp;rls=org.mozilla%3Aen-GB%3Aofficial&amp;hs=mGJ&amp;q=site%3Awordaligned.org+disqus&amp;btnG=Search&amp;meta=" target="_blank">Google can&#8217;t find anything</a> for me either.</p>
<p>Not only that but Shahid hasn&#8217;t even got Twitter integrated into his site, even though he&#8217;s the one who made me sign up in the first place! And I thought these MBA-types were s&#8217;posed to be ahead of the curve&#8230;</p>
<p>Oh well, I guess I&#8217;m just going to have to make up my own mind.</p>
<p>So I think I might try <a href="http://wordpress.org/extend/plugins/twitconnect/" target="_blank">Twit Connect</a>, that in the spirit of all good things, does one thing and (hopefully) one thing well (for the record, I found out about this <a href="http://planetozh.com/blog/2009/04/use-twitter-to-identify-yourself-on-wordpress-blogs/" target="_blank">here</a>, which led me to <a href="http://www.voiceoftech.com/swhitley/?p=683" target="_blank">here</a>).</p>
<p><em>Of course, now that I&#8217;m on wordpress.com, I can&#8217;t let users log in with their Twitter IDs, and I lost my WYSIWYG editor. So it&#8217;s all a bit of a moot point now. Still, at least I don&#8217;t have to keep upgrading wordpress&#8230;</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/471/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/471/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/471/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=471&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/30/using-twitter-ids-for-comments/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>A short Java test, a long Java rant</title>
		<link>http://dantwining.com/2010/01/29/a-short-java-test-a-long-java-rant/</link>
		<comments>http://dantwining.com/2010/01/29/a-short-java-test-a-long-java-rant/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 20:04:40 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=661</guid>
		<description><![CDATA[I recently came across a few little SCJP-style Java tests. There&#8217;s nothing particularly special about them, but they got me thinking about some aspects of the language that I hadn&#8217;t really thought about before. Here&#8217;s the first; I wonder what you&#8217;ll make of it&#8230;


class ExA extends RuntimeException {}

class ExB extends ExA {}

public class ExceptionTest {

 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=661&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I recently came across a few little SCJP-style Java tests. There&#8217;s nothing particularly special about them, but they got me thinking about some aspects of the language that I hadn&#8217;t really thought about before. Here&#8217;s the first; I wonder what you&#8217;ll make of it&#8230;<br />
<span id="more-661"></span></p>
<pre class="brush: java; first-line: 8;">
class ExA extends RuntimeException {}

class ExB extends ExA {}

public class ExceptionTest {

   void doStuff() throws ExA {
      throw new ExB();
   }

   @Test
   public void whichCatch() {
   try {
     doStuff();
   } catch (ExB e) {
      System.out.println(&quot;B&quot;);
   } catch (ExA e) {
      System.out.println(&quot;A&quot;);
   } finally {
      System.out.println(&quot;F&quot;);
   }
}
</pre>
<p>What do you think the output will be? The original had multiple choice answers, but really you need to decide on two things:</p>
<ol>
<li>Which <code>catch</code> block will catch the exception?</li>
<li>Will the <code>finally</code> be called?</li>
</ol>
<p>Once you&#8217;re done thinking about that, here&#8217;s the second:</p>
<pre class="brush: java; first-line: 8;">
public class CollectionsTest {

   @Test
   public void listSet() {

      List&lt;String&gt; list = new java.util.ArrayList&lt;String&gt;();
      Set&lt;String&gt; set = new HashSet&lt;String&gt;();

      list.add(&quot;hello&quot;);
      set.add(&quot;hello&quot;);

      System.out.println(list.equals(set));
      System.out.println(list.contains(set));

      set.add(&quot;hello&quot;);

      for (String s : set) {
         System.out.println(s);
      }
   }
}
</pre>
<p>Again, I&#8217;ll leave out the multiple choice answers; all you need to do is work out one or more of whether:</p>
<ol>
<li>The list and set are equal.</li>
<li>The list contains the set.</li>
<li>The second <code>set.add()</code> throws a runtime exception.</li>
<li>The set, when printed,  has one or two strings in it.</li>
</ol>
<h3>Catching exceptions</h3>
<p>Time for some answers. The short answer is:</p>
<ol>
<li>The first <code>catch</code> block will catch the exception</li>
<li>The <code>finally</code> will be called</li>
</ol>
<p>And so the output is &#8220;<code>BF</code>&#8221; (except on multiple lines, obviously).</p>
<h4>What&#8217;s your point?</h4>
<p>If the first catch block catches the exception, then the exception type is being checked at runtime; all the compiler knows is that an <code>? extends ExA</code> is going to be thrown. But that implies that exception-catching relies on mechanisms like <code>instanceof</code>, which we know are junk (where junk is indicative of poor software design, poor runtime performance, and probably a whole bunch of other stuff). This in turn implies that throwing exceptions is bad, and should be avoided, right? But I&#8217;ve seen people much more knowledgeable than I am post examples of exception usage that in turn allows exceptionally clean code.</p>
<p>I guess the bottom line, for me, is that I&#8217;d never really thought of exception handling as sharing attributes of the <code>instanceof</code> mechanism, and assuming that I&#8217;m even correct, I don&#8217;t think I&#8217;ll let it get in the way of me trying to write good, clean code that makes intelligent use of exceptions. The key word there being <em>trying</em>&#8230;</p>
<h3>Sets of Lists and Lists of Sets</h3>
<p>I did slightly worse with this one. The correct answers are:</p>
<ol>
<li>The list and set are <strong>not</strong> equal. Lists are only equal to objects that (a) are lists and (b) have the same contents in the same order, so whilst the set passes (b), it won&#8217;t pass (a).</li>
<li>The list <strong>does not</strong> contain the set. The list contains String objects; the set is a Set. <code>list.containsAll(set)</code> would&#8217;ve returned true, but that&#8217;s not what we called.</li>
<li>The second <code>set.add()</code> <strong>doesn&#8217;t</strong> throw a runtime exception. As this set already contains the element, <a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html#add(E)" target="_blank">the call leaves the set unchanged and returns </a><tt><a href="http://java.sun.com/javase/6/docs/api/java/util/Set.html#add(E)" target="_blank">false</a></tt>.</li>
<li>The set, when printed,  has <strong>one</strong> string in it.</li>
</ol>
<p>So the output is &#8220;false false hello&#8221;, although again separated by newlines and not spaces&#8230;</p>
<h4>You&#8217;d better have something interesting to say now</h4>
<p>I imagine that was at best light revision for most of you, and more likely tediously trivial. Putting aside the fact that I&#8217;d forgotten that lists are only equal to other lists, what I want to know is why does <code>list.contains(set)</code> compile? This is a post-Java 5, generic-enabled Collection. Surely the signature of <code>contains</code> is the same as <code>add</code>, and that our Set can only have Strings added to it, and therefore contain only Strings?</p>
<p>It does compile, and run, and I&#8217;m sure that there&#8217;s a good reason why the Java 5 creators kept</p>
<pre>boolean <strong>contains</strong>(<a title="class in java.lang" href="http://java.sun.com/javase/6/docs/api/java/lang/Object.html">Object</a> o)</pre>
<p>when <code>add</code> is</p>
<pre>boolean <strong>add</strong>(<a title="type parameter in Set" href="http://java.sun.com/javase/6/docs/api/java/util/Set.html">E</a> e)</pre>
<p>but I can&#8217;t think of one. Certainly not at this time on a Friday evening. Then again, that&#8217;s probably why I wasn&#8217;t in charge of putting generics into Java 5 in the first place.</p>
<p>It also crossed my mind that, if <code>contains()</code> were strongly typed, then we wouldn&#8217;t need a <code>containsAll()</code>; we could just overload <code>contains()</code> with a method that took a Collection. Of course, that&#8217;s a stupid idea; I&#8217;ll leave it as an exercise as the reader to work out why.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/661/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/661/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/661/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/661/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/661/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/661/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=661&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/29/a-short-java-test-a-long-java-rant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting Safari to open new tabs instead of new windows</title>
		<link>http://dantwining.com/2010/01/28/getting-safari-to-open-new-tabs-instead-of-new-windows/</link>
		<comments>http://dantwining.com/2010/01/28/getting-safari-to-open-new-tabs-instead-of-new-windows/#comments</comments>
		<pubDate>Thu, 28 Jan 2010 19:35:14 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=645</guid>
		<description><![CDATA[In general, I always try to favour Apple over !Apple. As such, there aren&#8217;t many non-Apple applications installed on my macbook; Firefox, Eclipse and Picasa being the main three. I&#8217;d like to use Safari, if only I could get it to favour opening links to new pages in tabs, and not in windows. Well, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=645&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In general, I always try to <em>favour Apple over !Apple</em>. As such, there aren&#8217;t many non-Apple applications installed on my macbook; Firefox, Eclipse and Picasa being the main three. I&#8217;d like to use Safari, if only I could get it to favour opening links to new pages in tabs, and not in windows. Well, it turns out that I can.</p>
<p><span id="more-645"></span> All I needed to do was <a href="http://forums.macosxhints.com/showthread.php?t=80689" target="_blank">open a terminal and execute this command</a>:</p>
<pre class="brush: plain; gutter: false;">
defaults write com.apple.Safari TargetedClicksCreateTabs -bool true
</pre>
<p>I&#8217;m not entirely sure why Safari have chosen to make it so difficult to set an option that&#8217;s a checkbox in Firefox, but, meh, it&#8217;s done now.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/645/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/645/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/645/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=645&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/28/getting-safari-to-open-new-tabs-instead-of-new-windows/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>Random thoughts whilst setting up a Java project in Eclipse on Snow Leopard</title>
		<link>http://dantwining.com/2010/01/16/random-thoughts-whilst-setting-up-a-java-project-in-eclipse-on-snow-leopard/</link>
		<comments>http://dantwining.com/2010/01/16/random-thoughts-whilst-setting-up-a-java-project-in-eclipse-on-snow-leopard/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 14:27:38 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=631</guid>
		<description><![CDATA[I thought that it was about time that I set up my java dev environment on my macbook. Sure, I could keep coding on my desktop, but why do that when I can spend my whole life chained to the source code? Here&#8217;s a list of anything out-of-the-ordinary that I found whilst setting up my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=631&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I thought that it was about time that I set up my java dev environment on my macbook. Sure, I could keep coding on my desktop, but why do that when I can spend my whole life chained to the source code? Here&#8217;s a list of anything out-of-the-ordinary that I found whilst setting up my latest project&#8230;</p>
<h3><span id="more-631"></span>Setting up Eclipse on Snow Leopard</h3>
<p>So first things first, I need the <a href="http://www.eclipse.org/downloads/" target="_blank">Eclipse IDE</a> (I use the version &#8220;for Java Developers&#8221;). Whilst there&#8217;s only one version for Windows and two for Linux, there are three for Mac (because it&#8217;s three times more awesome than Windows, right?). Which one to choose? According to the very aptly named <em>Either You Succeed Or You Explain</em> blog, <a href="http://blog.zvikico.com/2009/10/installing-eclipse-galileo-on-mac-os-x.html">Snow Leopard users should choose the 64bit Cocoa version</a>. So I have.</p>
<p>If you haven&#8217;t used Eclipse before, you might be surprised to find that the .tar.gz file you&#8217;ve just downloaded doesn&#8217;t contain an installer, just the program itself. Just drag the folder to somewhere suitable, then drag the eclipse program from there to the dock and you&#8217;re done.</p>
<h3>Installing the Subversive plug-in</h3>
<p>If you&#8217;re using subversion (which you should), you&#8217;ll want to install the Subversive plug-in. In Eclipse, go to Help &gt; Install new software, and search the Galileo update site (top of the pull-down list) for Subversive. Install the Team Connector (but not the optional &#8220;for Mylyn projects&#8221;, unless you need it). Eclipse will restart, then right click on your checked-out-from-svn project, <em>Team &gt; Share Project</em>, and a box will pop up for you to configure your connectors (you only have to do this once). I&#8217;m using &#8220;SVN Kit 1.3.0&#8243;. Eclipse will now get a bit confused, as the installation of the plug-in happens in parallel to your earlier attempt to <em>Share [your] Project</em>. Eclipse will restart once again (provided you click on &#8220;yes&#8221;), then you can have another go at right clicking on your checked-out-from-svn project, <em>Team &gt; Share Project</em>. The rest should be fairly self-explanatory; post a comment if these instructions suck&#8230;</p>
<h3>Linking your Check-in comments to your Issues on Google Code</h3>
<p>Whatever you&#8217;re doing, you&#8217;re hosting the code in version control, right? We use subversion and trac in work, and can add comments to our svn check-ins that appear in our trac tickets. It turns out that <a href="http://code.google.com/p/support/wiki/IssueTracker#Integration_with_version_control" target="_blank">you can do exactly the same thing with google code</a>, and if anything, their check-in messages are even more powerful. I look forward to trying them out on <a href="http://code.google.com/p/jade-oo/" target="_blank">my jade-oo project</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/631/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/631/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/631/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=631&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/16/random-thoughts-whilst-setting-up-a-java-project-in-eclipse-on-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>Software Companies Map</title>
		<link>http://dantwining.com/2010/01/12/software-companies-map/</link>
		<comments>http://dantwining.com/2010/01/12/software-companies-map/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 14:15:31 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=623</guid>
		<description><![CDATA[Ever wondered which software companies are near you?
I helped Matt put together this map, which gives the locations and URLs for the various software companies that we know of.

We’d love it if you could contribute updates. Just log in with your Google account and click the “edit” button on the left. If you have any [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=623&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Ever wondered which software companies are near you?</p>
<p>I helped <a href="http://www.mattburns.co.uk/blog/2010/01/12/software-company-locator/" target="_blank">Matt</a> put together this map, which gives the locations and URLs for the various software companies that we know of.</p>
<p><a href="http://maps.google.com/maps/ms?hl=en&amp;ie=UTF8&amp;oe=UTF8&amp;msa=0&amp;msid=110486494405162372809.00047cf73d0b0409aee21&amp;ll=51.45283,-2.587452&amp;spn=0.03744,0.072956&amp;z=13&amp;source=embed"><img class="aligncenter size-full wp-image-624" title="bristolmap" src="http://dantwining.files.wordpress.com/2010/01/bristolmap.png?w=437&#038;h=360" alt="" width="437" height="360" /></a></p>
<p>We’d love it if you could <a href="http://maps.google.com/maps/ms?hl=en&amp;ie=UTF8&amp;oe=UTF8&amp;msa=0&amp;msid=110486494405162372809.00047cf73d0b0409aee21&amp;ll=51.45283,-2.587452&amp;spn=0.03744,0.072956&amp;z=13&amp;source=embed">contribute updates</a>. Just log in with your Google account and click the “edit” button on the left. If you have any problems or questions, please post a comment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/623/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/623/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/623/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=623&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/12/software-companies-map/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>

		<media:content url="http://dantwining.files.wordpress.com/2010/01/bristolmap.png" medium="image">
			<media:title type="html">bristolmap</media:title>
		</media:content>
	</item>
		<item>
		<title>Fewer clicks</title>
		<link>http://dantwining.com/2009/12/14/fewer-clicks/</link>
		<comments>http://dantwining.com/2009/12/14/fewer-clicks/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 21:15:01 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=600</guid>
		<description><![CDATA[I saw an advert in my local shopping centre for Windows 7, and I was so impressed with their correct use of fewer that I almost considered upgrading.

Well, almost.
Unfortunately, it turns out that the original poster used less&#8230;

Still it&#8217;s nice to know that I&#8217;m not the only one for whom this is such an annoyance.
 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=600&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I saw an advert in my local shopping centre for Windows 7, and I was so impressed with their correct use of <em>fewer</em> that I almost considered upgrading.</p>
<p><span id="more-600"></span><img class="aligncenter size-full wp-image-601" title="09-12-09_175046" src="http://dantwining.files.wordpress.com/2009/12/09-12-09_175046.jpg?w=600&#038;h=450" alt="" width="600" height="450" /></p>
<p>Well, almost.</p>
<p>Unfortunately, it turns out that <a href="http://rsgo.blogspot.com/2009/10/fewer-clicks.html" target="_blank">the original poster used <em>less</em></a>&#8230;</p>
<p><img class="aligncenter size-full wp-image-602" title="lessclicks" src="http://dantwining.files.wordpress.com/2009/12/lessclicks.jpg?w=600&#038;h=460" alt="" width="600" height="460" /><br />
Still it&#8217;s nice to know that <a href="http://jugglinginthedark.blogspot.com/2009/10/actually-he-probably-asked-for-fewer.html" target="_blank">I&#8217;m not the only one for whom this is such an annoyance</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/600/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/600/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/600/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/600/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/600/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/600/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=600&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2009/12/14/fewer-clicks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>

		<media:content url="http://dantwining.files.wordpress.com/2009/12/09-12-09_175046.jpg" medium="image">
			<media:title type="html">09-12-09_175046</media:title>
		</media:content>

		<media:content url="http://dantwining.files.wordpress.com/2009/12/lessclicks.jpg" medium="image">
			<media:title type="html">lessclicks</media:title>
		</media:content>
	</item>
		<item>
		<title>Car Manufacturers: Where are your regression tests?</title>
		<link>http://dantwining.com/2009/12/04/car-manufacturers-where-are-your-regression-tests/</link>
		<comments>http://dantwining.com/2009/12/04/car-manufacturers-where-are-your-regression-tests/#comments</comments>
		<pubDate>Fri, 04 Dec 2009 20:59:01 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=522</guid>
		<description><![CDATA[I recently part-exchanged my old, small car (let&#8217;s say, Ford Fiesta*) for a newer, bigger car from the same manufacturer (let&#8217;s say, Ford Focus**). Whilst the newer car is better in many different ways, it&#8217;s somewhat disappointing to find that a number of useful features in the original have been lost in the intervening years.

Fumbling [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=522&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I recently part-exchanged my old, small car (let&#8217;s say, Ford Fiesta*) for a newer, bigger car from the same manufacturer (let&#8217;s say, Ford Focus**). Whilst the newer car is better in many different ways, it&#8217;s somewhat disappointing to find that a number of useful features in the original have been lost in the intervening years.</p>
<p><span id="more-522"></span></p>
<h3>Fumbling in the dark</h3>
<p>My old car had two buttons on its remote; <em>lock</em> and <em>unlock</em>. Whilst they were both the same size, the lock button had a picture of a key embossed on its surface. On a dark night, or even with the key in your pocket, it was easy to just brush the buttons with your thumb, and immediately tell which button would unlock the car, and which would lock it.</p>
<p>My new key-fob has three buttons, and whilst the middle one (for opening the boot) is raised, the top and bottom buttons (for locking and unlocking) are identical. Not only that, but the fob itself is symmetric, and so there&#8217;s no way of telling which button is which without taking it out of your pocket and squinting at it under the nearest streetlight. Urgh.</p>
<h3>Balancing Act</h3>
<p>Like many cars, my old car had a metal flap that covered the fuel filler cap (the flap being the bit of metal that was the same colour as the rest of the car; the cap being the bit you&#8217;d unscrew and hold to one side whilst you put fuel in). On my old car, the cap had two grooves in the lip round the edge, and you could hook the cap on the edge of the flap so that you didn&#8217;t have to hold onto it (or have it scrape your bodywork) whilst you filled the tank.</p>
<p>My new car still has a metal flap that covers the fuel filler cap, and still has grooves in the cap to hook it over the edge of the flap whilst filling the tank. So what&#8217;s the problem? Well, the flap on the old car was square, but the flap on my new car is round. How am I supposed to balance a fuel cap on a rounded edge? What&#8217;s the point of having two grooves in the back of the filler cap, when it&#8217;s only possible to hook one of them over the edge of the flap? Urgh.</p>
<h3>What has this got to do with regression tests?</h3>
<p>Back in 2000 when my old car was being made, someone came up with the great idea of embossing the lock button on the remote, and someone else came up with the equally useful proposal of being able to hook your filler cap on the filler flap so that it was out of the way when you filled up. Those were great ideas, but they&#8217;ve been lost. Could this have been avoided? Sure; the manufacturer could&#8217;ve kept a list of all the great ideas they had for all the individual parts of the car, and when it came round to designing and manufacturing a new model, someone could go through that list of ideas and make sure all of them got implemented on the new design.</p>
<p>For all I know, they already do this, but either ideas get forgotten, or by the time it comes to check whether good old ideas have made it into the new model, it&#8217;s too late to make drastic changes like redesigning the filler flap or key-fob.</p>
<p>With software, we can be much more thorough. We can have a whole bunch of automated regression tests, like <em>shouldBalanceCapOnFlap()</em> and <em>shouldDifferentiateKeyfobButtonsByTouch()</em>, and we can run these tests all the time. We don&#8217;t even have to wait for the design team to give us a prototype; we can start with the tests and then design the prototype to ensure that the tests are passed.</p>
<p>Even better, once we have our software for a well-tested fuel flap or key-fob, we can reuse that element <em>everywhere</em>. So long as our interfaces are good (and we can even adapt them if they aren&#8217;t) then every car can use the same type of key-fob. Add continuous deployment into the equation, and not only can you improve your key-fob for every new car that you ever make from now on, you can improve it <em>for every car that you ever made before</em> too.</p>
<p>I should probably say something about DRY, and dependency management, and open source libraries. I should also probably say something about how to write <em>good</em> regression tests; how to write <em>good</em> unit tests. But I won&#8217;t; it&#8217;s too late on a Friday, and I&#8217;m not even sure I&#8217;d be qualified to talk about it anyway.</p>
<p>All I will say is this:</p>
<ul>
<li>Writing good tests is hard.</li>
<li>Continuous deployment is worth it.</li>
<li>Favour other people&#8217;s code over your own (but make sure you adapt their interfaces).</li>
<li>Read some books.</li>
</ul>
<p>There you go. That&#8217;s four more posts that I won&#8217;t get round to writing.</p>
<p>&#8211;</p>
<p>*It wasn&#8217;t.</p>
<p>**It&#8217;s not.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=522&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2009/12/04/car-manufacturers-where-are-your-regression-tests/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
		<item>
		<title>How to remove missing, dead or otherwise broken tracks from your iTunes library</title>
		<link>http://dantwining.com/2009/09/29/how-to-remove-missing-dead-or-otherwise-broken-tracks-from-your-itunes-library/</link>
		<comments>http://dantwining.com/2009/09/29/how-to-remove-missing-dead-or-otherwise-broken-tracks-from-your-itunes-library/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 20:59:58 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Computers]]></category>

		<guid isPermaLink="false">http://www.dantwining.com/?p=516</guid>
		<description><![CDATA[I&#8217;ve been applying my first rule of technostuff (&#8220;Favour Apple Over !Apple&#8221;) to my music collection, and as such, I&#8217;ve been messing around with iTunes.
Having come to the conclusion that actually, yes, it is rather nice if Apple just sorts all of my music collection for me, I&#8217;ve been left with a bunch of previously-elsewhere, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=516&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been applying my first rule of technostuff (&#8220;Favour Apple Over !Apple&#8221;) to my music collection, and as such, I&#8217;ve been messing around with iTunes.</p>
<p><span id="more-516"></span>Having come to the conclusion that actually, yes, it is rather nice if Apple just sorts all of my music collection for me, I&#8217;ve been left with a bunch of previously-elsewhere, unlocatable, unplayable files with little exclamation marks next them.</p>
<p>It turns out that it&#8217;s really simple to flush them out; I just followed <a id="aq0g" title="the instructions right at the bottom of this article" href="http://paulmayne.org/blog/2007/11/how-to-remove-broken-or-dead-tracks-from-itunes/">the instructions right at the bottom of this article</a>, which says:</p>
<ol>
<li>Make a static playlist called “All Live Files” and copy your entire library into it.</li>
<li>Make a smart playlist called “Missing Files” with the rules set as “ ‘Playlist’ ‘is’ ‘Music’ ” and another rule set as “ ‘Playlist’ ‘is not’ ‘All Live Files’ ”</li>
<li>The broken songs will not transfer and “Missing Files” will contain all those broken songs.</li>
<li>Select all the songs in “Missing Files” and press Shift-Delete on Windows, Option-Delete on Mac.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/516/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/516/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/516/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=516&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2009/09/29/how-to-remove-missing-dead-or-otherwise-broken-tracks-from-your-itunes-library/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>
	</item>
	</channel>
</rss>