<?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</title>
	<atom:link href="http://dantwining.com/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</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>Every day is a school day, but sometimes you&#8217;ve moved down a class.</title>
		<link>http://dantwining.com/2010/02/17/every-day-is-a-school-day-but-sometimes-youve-moved-down-a-class/</link>
		<comments>http://dantwining.com/2010/02/17/every-day-is-a-school-day-but-sometimes-youve-moved-down-a-class/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:11:32 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=752</guid>
		<description><![CDATA[Another day, another chance to be a complete computard. Following on from my previous Java test, a friend gave me a similar challenge. How would you implement the following method?


	void swapArrays(byte[] a1, byte[] a2) {
		// your code here
	}

It&#8217;s a general rule that I&#8217;ll only answer questions after at least my second cup of tea of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=752&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Another day, another chance to be a complete computard. Following on from <a href="http://dantwining.com/2010/01/29/a-short-java-test-a-long-java-rant/">my previous Java test</a>, a friend gave me a similar challenge. How would you implement the following method?</p>
<p><span id="more-752"></span></p>
<pre class="brush: java;">
	void swapArrays(byte[] a1, byte[] a2) {
		// your code here
	}
</pre>
<p>It&#8217;s a general rule that I&#8217;ll only answer questions after at least my second cup of tea of the morning, and my no-cup (and no-computer) answer shows why&#8230;</p>
<pre class="brush: java;">
	void swapArrays(byte[] a1, byte[] a2) {
		byte[] tmp = a1;
		a1 = a2;
		a2 = tmp;
	}
</pre>
<p>Of course, it doesn&#8217;t work. In my defence, I knew I was doing something wrong, I just couldn&#8217;t put my finger on it. Sure, it wouldn&#8217;t work with bytes because bytes are primitives and primitives are passed-by-value, but arrays are objects, and objects are passed-by-reference, even if they&#8217;re arrays of primitives, right?</p>
<p>What I&#8217;d forgotten is that <a href="http://www.yoda.arachsys.com/java/parameters.html">pass-by-reference is a lie</a>; everything in Java is passed-by-value, it&#8217;s just a question of whether you&#8217;re passing a copy of a primitive, or a copy of a reference.</p>
<p>So, what is the right answer? I don&#8217;t know. This is the best I&#8217;ve come up with so far&#8230;</p>
<pre class="brush: java;">
	void copyArrayContents(final byte[] source, byte[] destination) {
		if (destination.length &lt; source.length) {
			throw new IllegalArgumentException(
					&quot;Destination length insufficient to hold source&quot;);
		}
		// what if destination is longer than source?
		for (int i = 0; i &lt; source.length; i++) {
			destination[i] = source[i];
		}
	}

	void swapArrays(byte[] a1, byte[] a2) {
		if (a1.length != a2.length) {
			throw new IllegalArgumentException(
					&quot;Cannot swap arrays of different lengths&quot;);
		}

		byte[] tmp = new byte[a1.length];
		copyArrayContents(a1, tmp);
		copyArrayContents(a2, a1);
		copyArrayContents(tmp, a2);
	}

	@Test
	public void swapArraysTest() {
		byte[] uno = new byte[] { 1 };
		byte[] due = new byte[] { 2 };

		Assert.assertEquals(1, uno[0]);
		Assert.assertEquals(2, due[0]);

		swapArrays(uno, due);

		Assert.assertEquals(2, uno[0]);
		Assert.assertEquals(1, due[0]);
	}
</pre>
<p>What do you think? Here&#8217;s a random list of points that go through my head when I look at this code:</p>
<ul>
<li>We could save some stack space by using a temporary element instead of a whole temporary array, but that&#8217;s lipstick-on-a-pig stuff.</li>
<li>Arrays are horrible.</li>
<li>Primitives are worse.</li>
<li>What should copyArrayContents do if the destination array is longer than the source? Bearing in mind that we could reasonably expect (and indeed should encourage) developers to reuse our method whenever they need to copy the contents of one array to another, and not necessarily access it through swapArrays.</li>
<li>[How] Can we swap arrays of differing length?</li>
<li>What ever happened to OO? Seriously, assuming that swapping arrays even makes sense in your application, it should be a method on your object. And by <em>makes sense in your application</em> I mean makes sense to the next developer who works on it. Which it won&#8217;t. So don&#8217;t do it.</li>
</ul>
<p>I don&#8217;t know if I&#8217;m just narked at making such a hash of my first answer (likely) but it really annoys me when the &#8220;right&#8221; answer involves remembering some obscure corner-case of the language that should never have allowed in the first place, and the <strong><em>right</em></strong> answer is <em>WTF are you doing writing such a retarded <del>method</del> function in the first place?!</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/752/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/752/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/752/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=752&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/02/17/every-day-is-a-school-day-but-sometimes-youve-moved-down-a-class/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>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>Protected: Christmas (?!) Letter 2009</title>
		<link>http://dantwining.com/2010/01/30/christmas-letter-2009/</link>
		<comments>http://dantwining.com/2010/01/30/christmas-letter-2009/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 16:26:35 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=708</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=708&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<form action="http://dantwining.com/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-708">Password:<br />
<input name="post_password" id="pwbox-708" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/708/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/708/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/708/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/708/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/708/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/708/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/708/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/708/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/708/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/708/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=708&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/30/christmas-letter-2009/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>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>Fewer spam?</title>
		<link>http://dantwining.com/2010/01/29/fewer-spam/</link>
		<comments>http://dantwining.com/2010/01/29/fewer-spam/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 20:27:20 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=642</guid>
		<description><![CDATA[Every time I log into Google Mail, they promise me less spam. The thing is, I&#8217;m not sure if I want them to.


Just in case you don&#8217;t know what spam, in this context, is, Google Mail is kind enough to tell us. Keep unwanted messages out of your inbox.
I know that I want fewer unwanted [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=642&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Every time I log into Google Mail, they promise me less spam. The thing is, I&#8217;m not sure if I want them to.<br />
<span id="more-642"></span><br />
<img class="aligncenter size-full wp-image-641" title="FewerSpam" src="http://dantwining.files.wordpress.com/2010/01/fewerspam.png?w=600&#038;h=144" alt="" width="600" height="144" /><br />
Just in case you don&#8217;t know what spam, in this context, is, Google Mail is kind enough to tell us. <em>Keep unwanted messages out of your inbox</em>.</p>
<p>I know that I want <em>fewer</em> unwanted messages, and I most certainly don&#8217;t want <em>less</em>. So that means I want fewer spam too, right?</p>
<p>But this test isn&#8217;t sufficient. Is <em>spam</em> directly equivalent to <em>unwanted messages</em>? Or is <em>spam</em> to <em>unwanted messages </em>what <em>hair</em> is to <em>hairs</em>?</p>
<p>No. I&#8217;m right. I know I&#8217;m right. You can have <em>less hair on your head</em> because the hairs may be shorter, rather than less numerous. Google Mail doesn&#8217;t put <em>less spam in your inbox</em> by chopping the bottom third off all those Viagra emails.</p>
<p>Now then, where can I find the email address of whoever&#8217;s in charge of the Google Mail sign-in page?&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/642/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/642/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/642/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=642&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/29/fewer-spam/feed/</wfw:commentRss>
		<slash:comments>4</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/fewerspam.png" medium="image">
			<media:title type="html">FewerSpam</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>Good with food, bad with grammar</title>
		<link>http://dantwining.com/2010/01/27/good-with-food-bad-with-grammar/</link>
		<comments>http://dantwining.com/2010/01/27/good-with-food-bad-with-grammar/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 21:04:38 +0000</pubDate>
		<dc:creator>dantwining</dc:creator>
				<category><![CDATA[Random]]></category>

		<guid isPermaLink="false">http://dantwining.com/?p=636</guid>
		<description><![CDATA[I wonder how much ink they save by leaving out their apostrophes?


       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=636&subd=dantwining&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I wonder how much ink they save by leaving out their apostrophes?<br />
<span id="more-636"></span></p>
<p><img class="aligncenter" src="http://lh3.ggpht.com/_sAVt17jP_Bg/S2CjnNjCowI/AAAAAAAACw0/fF6tc_RFDPg/s800/DSC03056.jpg" alt="" width="600" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dantwining.wordpress.com/636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dantwining.wordpress.com/636/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dantwining.wordpress.com/636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dantwining.wordpress.com/636/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dantwining.wordpress.com/636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dantwining.wordpress.com/636/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dantwining.wordpress.com/636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dantwining.wordpress.com/636/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dantwining.wordpress.com/636/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dantwining.wordpress.com/636/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dantwining.com&blog=10442765&post=636&subd=dantwining&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://dantwining.com/2010/01/27/good-with-food-bad-with-grammar/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">dantwining</media:title>
		</media:content>

		<media:content url="http://lh3.ggpht.com/_sAVt17jP_Bg/S2CjnNjCowI/AAAAAAAACw0/fF6tc_RFDPg/s800/DSC03056.jpg" medium="image" />
	</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>
	</channel>
</rss>