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

<channel>
	<title>Note To Self &#187; John</title>
	<atom:link href="http://www.hawksley.net/author/john/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hawksley.net</link>
	<description>John Hawksley &#124; www.hawksley.net</description>
	<lastBuildDate>Sun, 30 May 2010 14:13:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Cloning a Dell Hard Disk (HPA Problem)</title>
		<link>http://www.hawksley.net/2010/05/cloning-a-dell-hard-disk-hpa-problem/</link>
		<comments>http://www.hawksley.net/2010/05/cloning-a-dell-hard-disk-hpa-problem/#comments</comments>
		<pubDate>Sun, 30 May 2010 14:13:46 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[HPA]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=209</guid>
		<description><![CDATA[My (far) better half&#8217;s old notebook hard disk was becoming slower and slower with bad sectors; it was 4 years old and was taking quite a long time to both boot and come out of hibernation. The Hitachi tool reported a large number of bad sectors, and it was getting worse, so we decided to [...]]]></description>
			<content:encoded><![CDATA[<p>My (far) better half&#8217;s old notebook hard disk was becoming slower and slower with bad sectors;  it was 4 years old and was taking quite a long time to both boot and come out of hibernation.  The Hitachi tool reported a large number of bad sectors, and it was getting worse, so we decided to change it out.</p>
<p>We bought a new 160 GB Western Digital Scorpio Blue and a 2.5&#8243; SATA -&gt; USB enclosure.  I put Norton Ghost on her machine and set off the image, expanding both the C and D drives which were on the disk from their original 40 and 20 GB sizes to 120 and 40 GB respectively.</p>
<p>This took a good few hours as the imager had to re-read all the bad sectors multiple times.  After it completed, I swapped out the disks and rebooted.  Windows started to boot but NTLDR immediately blue-screened with <a href="http://support.microsoft.com/kb/555302"><strong>UNMOUNTABLE BOOT VOLUME</strong></a>.</p>
<p>I re-imaged the disk with Partition Magic, thinking Ghost had messed up, but had the same result.</p>
<p>Now having a disk I was sure had imaged correctly, I booted with Kubuntu Live and ran fdisk.  This showed that the disk was showing as 58 GB big, with an invalid partition table.</p>
<p>After using <a href="http://www.hdat2.com/">HDAT2</a> to get low-level info on the disk, it turns out that HPA was active on the disk.  HPA &#8211; <em>Host Protected Area</em> &#8211; is a way of changing the apparent size of a hard disk in order to &#8216;hide&#8217; a partition at the end of the disk.</p>
<p>I used HDAT2 to remove the HPA flag, and the disk returned to its full size of 160GB.</p>
<p>On the next boot, the problem returned.  Before I explain what happened, the layout of the disk is as follows:</p>
<ul>
<li><strong>Partition 0 </strong>is a small Dell utility partition</li>
<li><strong>Partition 1</strong> is Windows XP, NTFS,  <em>C:</em></li>
<li><strong>Partition 2 </strong>is NTFS <em>D:</em></li>
<li><strong>Partition 3 </strong>is <strong>beyond the HPA</strong>, i.e. <em>hidden </em>(normally), containing <strong>Dell MediaDirect</strong>.</li>
</ul>
<p>Dell MediaDirect is triggered off a hardware button which we have never pressed, and we assume boots something used to play CDs, MP3s etc.</p>
<p>So the boot sequence for a normal (non MediaDirect) boot on a Dell notebook seems to be:</p>
<ol>
<li>Power on via Power button.</li>
<li>MBR/Partition table designates partition 0 (P0) as the boot partition.</li>
<li>P0 boots.</li>
<li>MediaDirect button is not pressed.</li>
<li>Dell loader hides P3 &#8211; i.e. sets HPA  active and set to 58 BG to hide it.</li>
<li>Dell loader chain boots P1 (Windows XP).</li>
</ol>
<p>With MediaDirect active:</p>
<ol>
<li>Power on via MediaDirect button.</li>
<li>MBR/Partition table designates P0 as the boot partition.</li>
<li>P0 boots.</li>
<li>MediaDirect is pressed (or has been pressed and flagged in the BIOS).</li>
<li>Dell loader unhides P3 by removing HPA (and copies a valid partition table containing P3 in), making the apparent size of the disk the <em>full </em>size (60 GB).</li>
<li>Dell loader chain boots P3 (MediaDirect).</li>
</ol>
<p>When we transplanted the disk, step <strong>5</strong> from the Normal sequence above re-set the disk size to 58 GB, which was in the middle of the new C:, causing the <strong>UNMOUNTABLE BOOT VOLUME </strong>from Windows &#8211; which was correct:  the partition was far too short &#8212; it should have been 120 GB.  The truncated partition was (naturally) not a valid NTFS filesystem.</p>
<p>We don&#8217;t need MediaDirect at all, so here&#8217;s how I solved it:</p>
<ol>
<li>Use HDAT2 to remove the HPA, making the disk appear 160 GB on the next boot.</li>
<li><strong>Boot Kubuntu Live from CD immediately</strong>.  This is important because if you allow the hard disk boot sequence to commence, it will reset HPA to 58 GB (step 5 from the normal sequence).  If you don&#8217;t catch the boot menu in time, and start a boot from disk, reboot and go back to step 1.</li>
<li>Use <strong>fdisk</strong> in linux to delete P0 (Dell utility) and P3 (Dell MediaDirect),  then nominate P1 as the boot partition. Rewrite the partition table.  You can enlarge partitions later using Partition Magic.</li>
<li>Boot <strong>Windows Repair Mode</strong> and run <strong>bootcfg /scan </strong>to ensure Windows knows about all the Windows installations and <strong>fixboot</strong> to fix up NTLDR.  I can&#8217;t remember if I had to run <strong>fixmbr </strong>or not &#8211; try it without first.</li>
<li>Reboot, and Windows should boot from P1.</li>
</ol>
<p>The problem is, if you don&#8217;t know HPA is active (or like me, you didn&#8217;t know HPA even existed) you&#8217;ll never come up with google search terms to even start to solve the problems.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2010/05/cloning-a-dell-hard-disk-hpa-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Testfiles of Given Length</title>
		<link>http://www.hawksley.net/2010/04/creating-testfiles-of-given-length/</link>
		<comments>http://www.hawksley.net/2010/04/creating-testfiles-of-given-length/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 13:08:31 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=196</guid>
		<description><![CDATA[Use the Unix /dev/zero device (which produces an infinite stream of bytes with value zero) together with the dd block copier to create files of any length, useful for testing. dd if=/dev/zero of=test.bin bs=1024\*1024 count=4 &#8230; creates a file called test.bin (output file) by copying from /dev/zero (input file). Blocksize is 1 MB (1024*1024 bytes), [...]]]></description>
			<content:encoded><![CDATA[<p>Use the Unix <code>/dev/zero</code> device (which produces an infinite stream of bytes with value zero) together with the <code>dd</code> block copier to create files of any length, useful for testing.</p>
<pre class="brush:plain">dd if=/dev/zero of=test.bin bs=1024\*1024 count=4</pre>
<p>&#8230; creates a file called <code>test.bin</code> (output file) by copying from <code>/dev/zero</code> (input file).  Blocksize is 1 MB (1024*1024 bytes), and the count is 4, giving a 4 MB file.  Substitute your own values for blocksize and count, and create test files of any length.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2010/04/creating-testfiles-of-given-length/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse:  Bootstrapping A New Install</title>
		<link>http://www.hawksley.net/2009/11/eclipse-bootstrapping-a-new-install/</link>
		<comments>http://www.hawksley.net/2009/11/eclipse-bootstrapping-a-new-install/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 11:23:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[eclipse]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=182</guid>
		<description><![CDATA[For those of us who upgrade Eclipse regularly, it&#8217;s sometimes necessary to start &#8216;from scratch&#8217; with a new installation. I&#8217;ve had cases in the past where P2 (Eclipse&#8217;s software update mechanism) couldn&#8217;t find updates, or couldn&#8217;t resolve dependencies. There are many different causes of software update issues and it&#8217;s often quicker to abandon the update [...]]]></description>
			<content:encoded><![CDATA[<p>For those of us who upgrade Eclipse regularly, it&#8217;s sometimes necessary to start &#8216;from scratch&#8217; with a new installation.  I&#8217;ve had cases in the past where P2 (Eclipse&#8217;s software update mechanism) couldn&#8217;t find updates, or couldn&#8217;t resolve dependencies.</p>
<p>There are many different causes of software update issues and it&#8217;s often quicker to abandon the update and reinstall.  Sometimes I&#8217;m chasing milestone revisions, which I prefer to install fresh to avoid any preference store problems.</p>
<p>This procedure below is how I generally bootstrap a new Eclipse install on an existing workspace.</p>
<ol>
<li> Backup your workspace.  Make a zip or a 7z file of everything that&#8217;s in there, .svn folders and all.  Put this somewhere safe.</li>
<li> Backup your Eclipse settings:
<ol>
<li><strong>File </strong>-&gt; <strong>Export</strong>, then <strong>General </strong>-&gt; <strong>Preferences</strong>.<br />
&#8230;to a file on your desktop called <strong>eclipse.xml</strong></li>
<li>Check &#8220;<strong>Export All</strong>&#8220;</li>
</ol>
</li>
<li>Make a note of all the plugins and addons you have installed.</li>
<li>Shut down the old Eclipse.</li>
<li>Download and unzip the new version of Eclipse to a new folder somewhere.</li>
<li>Start up the new Eclipse
<ul>
<li>Do not allow the new eclipse to use your production workspace.  Pick a new, empty one.</li>
</ul>
</li>
<li>In the new Eclipse, install all the plugins and addons you need.  Do a <strong>Help </strong>-&gt;<strong> Check For Update</strong>s and let it install any updates.
<ul>
<li>You&#8217;ve doing <strong>Check For Updates</strong> on a weekly basis anyway, right?</li>
</ul>
</li>
<li>When you&#8217;ve got everything installed, do <strong>File </strong>-&gt; <strong>Import</strong>, then <strong>General </strong>-&gt; <strong>Preferences</strong>, giving it the <strong>eclipse.xml</strong> file created in step 2.2.</li>
<li>Now restart Eclipse, allowing it to start on your production workspace.</li>
<li>You may need to re-apply preferences but generally it should be ok.</li>
</ol>
<p>This procedure might seem rather long, but in reality it&#8217;s very quick and you can usually get back to a productive state in half an hour or less (depending on how many plugins and addons you have installed).</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/11/eclipse-bootstrapping-a-new-install/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OSX/Cocoa UI Event Spy</title>
		<link>http://www.hawksley.net/2009/10/osxcocoa-ui-event-spy/</link>
		<comments>http://www.hawksley.net/2009/10/osxcocoa-ui-event-spy/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 14:53:29 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=153</guid>
		<description><![CDATA[I recently had to profile an application, and one of the metrics I wanted to obtain was the performance of the GUI, without (if possible) resorting to GUI testing frameworks. This metric would be the duration of time from when the user commanded a redraw/update, until the render of that redraw actually completed (effectively a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to profile an application, and one of the metrics I wanted to obtain was the performance of the GUI, without (if possible) resorting to GUI testing frameworks.  This metric would be the duration of time from when the user commanded a redraw/update, until the render of that redraw actually completed (effectively a complete client-server-client round-trip time).</p>
<p>To cut a long story short, there doesn&#8217;t seem to be a developer tool in OS X or XCode to spy on these UI events, but you can enable them on individual applications by supplying the <code>-NSTraceEvents YES</code> flag to the binary, which you must start from Terminal.</p>
<p>For example, here&#8217;s how you&#8217;d start TextEdit and spy on its events.</p>
<p><code>/Applications/TextEdit.app/Contents/MacOS/TextEdit -NSTraceEvents YES</code></p>
<p>In my case, I actually only wanted to have the mouse-up events which would trigger the refresh.  Here&#8217;s how I did it:</p>
<p><code>/Applications/TextEdit.app/Contents/MacOS/TextEdit -NSTraceEvents YES 2>&#038;1 | grep "Received event.*LMouseUp"</code></p>
<p>NSTraceEvents outputs the trace to the <code>stderr</code> stream, which is ignored by grep, so the <code>2&gt;&amp;1</code> is there to redirect <code>stderr</code> to <code>stdout</code>.  The &#8220;<code>Received event.*LMouseUp</code>&#8221; regular expression selects the mouse-up events from the complete stream.</p>
<p>Result:</p>
<p><code>2009-10-11 16:56:13.291 TextEdit[29990:903]<br />
Received event: LMouseUp at: 320.0,243.0 time: 199375872740000 flags: 0x100 win: 1832 ctxt: f0df data: 2531,1<br />
</code></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/10/osxcocoa-ui-event-spy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mac OS X Snow Leopard Has No Java 5 &#8211; Warning!</title>
		<link>http://www.hawksley.net/2009/09/mac-os-x-snow-leopard-has-no-java-5-warning/</link>
		<comments>http://www.hawksley.net/2009/09/mac-os-x-snow-leopard-has-no-java-5-warning/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 07:59:24 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdbc]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=149</guid>
		<description><![CDATA[Here&#8217;s one I spent a day learning: OS X 10.6 &#8220;Snow Leopard&#8221; has no Java 5 installed, despite appearances to the contrary. The Java 1.5 installation is actually a symbolic link to the Java 1.6 installation. There is a fix available, which essentially entails copying the Java 1.5 installation from a Leopard install, and fixing [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s one I spent a day learning:  OS X 10.6 &#8220;Snow Leopard&#8221; has <em>no</em> Java 5 installed, despite appearances to the contrary.</p>
<p>The Java 1.5 installation is actually a symbolic link to the Java 1.6 installation.  There is a fix available, which essentially entails copying the Java 1.5 installation from a Leopard install, and fixing up the symlinks.  It&#8217;s available <a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard">here</a>.</p>
<p>I found this because we have a product which must be linked against Java 1.5, or rather, the JDBC version 3 specification.  We don&#8217;t yet support all the extended functionality of JDBC 4.</p>
<p>In Eclipse, I had selected Java 5 (= JDBC 3) as the JRE, but was still getting lots of &#8220;method unimplemented&#8221; errors for JDBC 4 (= Java 6) signatures.  These aren&#8217;t present in Java 5, so they should not have appeared.</p>
<p>After unfolding the JRE Library node in the Eclipse Package Explorer, it was clear that, although the JRE was reporting itself as Java 5, the jars within were clearly coming from Java 6.</p>
<p>I applied the <a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard">fix</a> and the compiler errors disappeared &#8211; Java 5/JDBC 3 was in use again.</p>
<p>For (my) future reference, here are the JDK / JDBC versions:</p>
<ul>
<li>JDK 1.1 → JDBC 1.2</li>
<li>JDK 1.2 → JDBC 2.1</li>
<li>JDK 1.4 → JDBC 3</li>
<li>JDK 1.5 → JDBC 3</li>
<li>JDK 1.6 → JDBC 4</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/09/mac-os-x-snow-leopard-has-no-java-5-warning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Eclipse on Small Screens</title>
		<link>http://www.hawksley.net/2009/08/using-eclipse-on-small-screens/</link>
		<comments>http://www.hawksley.net/2009/08/using-eclipse-on-small-screens/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 08:31:25 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=145</guid>
		<description><![CDATA[Two awesome plugins for those of us using Eclipse on screens with low resolutions: Eclipse Visual Studio Presentation &#8211; changes the presentation of Eclipse to require rather less height and width and a lot more besides Eclipse FullScreen Plugin &#8211; adds a context menu and keyboard shortcut (CTRL-ALT-Z) to full-screen Eclipse (covering any menu/taskbars). Also [...]]]></description>
			<content:encoded><![CDATA[<p>Two awesome plugins for those of us using Eclipse on screens with low resolutions:</p>
<ul>
<li><a href="http://andrei.gmxhome.de/skins/index.html">Eclipse Visual Studio Presentation</a> &#8211; changes the presentation of Eclipse to require rather less height and width and a lot more besides</li>
<li><a href="http://code.google.com/p/eclipse-fullscreen/">Eclipse FullScreen Plugin</a> &#8211; adds a context menu and keyboard shortcut (CTRL-ALT-Z) to full-screen Eclipse (covering any menu/taskbars).</li>
</ul>
<p>Also to consider:</p>
<ul>
<li>Is your editor font too big? Can you make it smaller and still be comfortable working with it?</li>
<li>Look at your window layout &#8211; do you have a view docked to the right of the editor &#8211; probably Outline? Do you <em>really</em> ever use outline?  Get rid of it if not, or make it a tab in the dock on the left.</li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/08/using-eclipse-on-small-screens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Misleading Java Generic Errors in Eclipse</title>
		<link>http://www.hawksley.net/2009/08/misleading-java-generic-errors-in-eclipse/</link>
		<comments>http://www.hawksley.net/2009/08/misleading-java-generic-errors-in-eclipse/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 18:22:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=129</guid>
		<description><![CDATA[An incompatibility between Java source versions in Eclipse made a generics error show up as: Type mismatch: cannot convert from Object to ILocationService. when it should really have read something like: Type mismatch: return type of TypeLoader is generic &#8211; this project is not. Here&#8217;s what happened to trigger this error. The type TypeLoader contains [...]]]></description>
			<content:encoded><![CDATA[<p>An incompatibility between Java source versions in Eclipse made a generics error show up as:</p>
<blockquote><p>Type mismatch: cannot convert from Object to ILocationService.</p></blockquote>
<p>when it should really have read something like:</p>
<blockquote><p>Type mismatch: return type of TypeLoader is generic &#8211; this project is not.</p></blockquote>
<p><span id="more-129"></span></p>
<p>Here&#8217;s what happened to trigger this error.</p>
<p>The type <code>TypeLoader</code> contains a generic method with the following signature:</p>
<pre class="brush: java">
    public static &lt;T&gt; T loadType( String name, Class&lt;T&gt; forType ) throws TypeLoaderException
</pre>
<p>My call &#8211; which was not in a generic project &#8211; looks like this:</p>
<pre class="brush: java">
        ILocationService ls = TypeLoader.loadType( locationServiceClass, ILocationService.class );
</pre>
<p>Eclipse&#8217;s exception &#8211; <em>Cannot convert from Object to ILocationService</em> &#8211; is a bit misleading, since there is no cast there:  the generic type parameter is defined by <code>ILocationService.class</code> which is of type <code>Class&lt;ILocationService&gt;</code>, and in fact the <code>TypeLoader</code> passes all its JUnit tests.</p>
<p>The solution was that I&#8217;d upated the master POM for the project containing the call, but not updated the project in Eclipse (using m2eclipse&#8217;s menu <code>Maven &gt; Update Project Configuration</code>.  Once I&#8217;d done this, m2eclipse updated the source version from 1.4 to 1.6 &#8211; and the exception went away.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/08/misleading-java-generic-errors-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing Tooltip Time in Eclipse 3.5 (Galileo) on Mac OS X</title>
		<link>http://www.hawksley.net/2009/06/reducing-tooltip-time-in-eclipse-3-5-galileo-on-mac-os-x/</link>
		<comments>http://www.hawksley.net/2009/06/reducing-tooltip-time-in-eclipse-3-5-galileo-on-mac-os-x/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 09:42:39 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=103</guid>
		<description><![CDATA[Tooltips in Mac OS X display, by default, after 2 seconds. I find this is ample time in the general operating system, but in Eclipse it&#8217;s an eternity. Eclipse uses Tooltips in the Java tooling to display all kinds of useful information, not the least of which is the javadoc for the element and the [...]]]></description>
			<content:encoded><![CDATA[<p>Tooltips in Mac OS X display, by default, after 2 seconds.  I find this is ample time in the general operating system, but in <a href="http://www.eclipse.org">Eclipse</a> it&#8217;s an eternity.  Eclipse uses Tooltips in the Java tooling to display all kinds of useful information, not the least of which is the javadoc for the element and the source.  Waiting for these is frustrating.</p>
<p>The general workaround of using OS X defaulting to change that didn&#8217;t work with previous versions of Eclipse because the SWT (IBM&#8217;s excellent widget set) was built on Carbon, OS X&#8217;s &#8220;UI Compatibility Library&#8221;, which ignored the default.  Eclipse is now available for Mac in a native Cocoa version, which <em>does </em>take the defaulting into account.</p>
<p>Here&#8217;s how to change the global OS X tooltip delay (in Terminal):</p>
<pre>defaults write -g NSInitialToolTipDelay -int 100</pre>
<p>I personally want to keep the 2-second delay for everything except Eclipse, so I applied the default just to Eclipse using the Eclipse bundle name:</p>
<pre>defaults write org.eclipse.eclipse NSInitialToolTipDelay -int 100</pre>
<p>The delay time is in milliseconds. You might have to log out and back in again to make the default take, but usually restarting Eclipse does the trick.</p>
<p>Nice work IBM!</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/06/reducing-tooltip-time-in-eclipse-3-5-galileo-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Overloading the Eclipse Job Management System</title>
		<link>http://www.hawksley.net/2009/04/overloading-the-eclipse-job-management-system/</link>
		<comments>http://www.hawksley.net/2009/04/overloading-the-eclipse-job-management-system/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 12:40:35 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=96</guid>
		<description><![CDATA[We&#8217;ve had an issue with our Eclipse-based application which would cause it to slow down exponentially under stress test.  The problem lie in the job management system:  new fast code could essentially cause it to bog down under the weight of update jobs. Eclipse is one of those pieces of software which is rather difficult [...]]]></description>
			<content:encoded><![CDATA[<p>We&#8217;ve had an issue with our Eclipse-based application which would cause it to slow down exponentially under stress test.  The problem lie in the job management system:  new fast code could essentially cause it to bog down under the weight of update jobs.</p>
<p><span id="more-96"></span></p>
<p>Eclipse is one of those pieces of software which is rather difficult to explain accurately:  it&#8217;s a platform for building GUI applications, it&#8217;s written in Java.  It provides lots of services to make writing applications easier.  It&#8217;s a pretty good choice for building cross-platform GUI apps.  If you are a Java programmer, chances are that you either work inside Eclipse&#8217;s Java Development Tools (JDT) plugins or you&#8217;ve at least evaluated the platform.</p>
<p>One of our products runs as a plugin within Eclipse, and overall we&#8217;re very happy with the platform.  Lately, though, we&#8217;ve been through a refactoring process to split out the core of our product and some of the dependencies.  Coupled with some other fixes, we&#8217;ve managed to obtain quite a significant speed increase in how our backend works.</p>
<p>When we came to stress-test the application in order to check it performed under load, we found that instead of an overall increase in speed, we were seeing quite a significant decrease.</p>
<p>To explain this we had to look at the Eclipse job system.  Internally, the Eclipse platform schedules events from the UI (button presses, pending window updates etc.) as jobs.  Corresponding updates to UI elements are also scheduled in the same way.  When a worker thread becomes free, the job manager selects a suitable job (based on priority) and allows it to run.  Ordinarily there are a handfull of jobs in the job queue and they are cleared quickly, and the UI remains responsive.</p>
<p>Our refactoring had produced such a large increase in speed, that the resulting update jobs were flooding the job manager.  After a two-minute stress test, it would take the platform somewhere in the region of 20 seconds (depending on the CPU cycles available) to clear the job queue and return to a responsive state.</p>
<p>We added debugging to show us the size of the job queue, and figures upwards of 3,000 pending jobs were not uncommon.  A single (non-stress) command event telling our backend to do something would generate around 9 internal Eclipse update jobs to update various parts of the UI.  With a suitably high injection speed (which the new code was handling fine), the number of corresponding UI update jobs quickly went through the roof.</p>
<p>The solution, in the end, was uncomplicated:  we throttled the incoming command events (by abandoning some) if the job queue started to get too large. With a suitable throttle value, the backend could be kept busy (but not <em>too </em>busy) without overloading the job manager.</p>
<p>Kudos to my teammate Peter Bailey for doing excellent work on this problem.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/04/overloading-the-eclipse-job-management-system/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Exporting &#8220;Non-Exportable&#8221; Private Keys from Vista</title>
		<link>http://www.hawksley.net/2009/03/exporting-non-exportable-private-keys-from-vista/</link>
		<comments>http://www.hawksley.net/2009/03/exporting-non-exportable-private-keys-from-vista/#comments</comments>
		<pubDate>Fri, 06 Mar 2009 09:06:37 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software Engineering]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.hawksley.net/?p=91</guid>
		<description><![CDATA[Going through the Thawte sign-up process to get a code signing certificate, I noticed that the certificate signing request (CSR) generated by Vista has the &#8220;Yes, export the private key&#8221; option grayed out.  I&#8217;m surmising that Vista marks all keys (at least those for code signing certificates) as not exportable. This is obviously bad when [...]]]></description>
			<content:encoded><![CDATA[<p>Going through the <a href="http://www.thawte.com">Thawte</a> sign-up process to get a code signing certificate, I noticed that the certificate signing request (CSR) generated by Vista has the <em>&#8220;Yes, export the private key&#8221;</em> option grayed out.  I&#8217;m surmising that Vista marks all keys (at least those for code signing certificates) as not exportable.</p>
<p>This is obviously bad when you have more than a single developer who must sign code.  After beginning the process I found an <a href="https://search.thawte.com/support/ssl-digital-certificates/index?page=content&amp;id=AD97">article</a> at Thawte which says &#8216;don&#8217;t do this on Vista!&#8217;, but I also found the <a href="http://www.isecpartners.com/jailbreak.html">Jailbreak </a>util from <a href="http://www.isecpartners.com/">iSec</a>.  This was able to export the private key with the CSR into a PFX file.  As a test I also re-imported it from the export file and that worked fine.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://www.hawksley.net/wp-content/plugins/add-to-any/share_save_120_16.png" width="120" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://www.hawksley.net/2009/03/exporting-non-exportable-private-keys-from-vista/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
