<?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>Miscellaneous-B &#187; coding</title>
	<atom:link href="http://lawley.id.au/blog/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://lawley.id.au/blog</link>
	<description>Whatever was I thinking...</description>
	<lastBuildDate>Fri, 07 Nov 2008 05:44:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image><title>Miscellaneous-B</title><link>http://lawley.id.au/blog</link><url>http://www.lawley.id.au/images/headshot.jpg</url></image>		<item>
		<title>Debugging lessons</title>
		<link>http://lawley.id.au/blog/2007/11/27/debugging-lessons/</link>
		<comments>http://lawley.id.au/blog/2007/11/27/debugging-lessons/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 08:30:33 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[eHRC]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/11/27/debugging-lessons/</guid>
		<description><![CDATA[For the past 6 weeks or so I&#8217;ve been trying to track down an elusive bug in my SNOMED classifier.  The difficulty has been that it only manifest with very large input sets (I only managed to reduce it down to about 350,000 concept definitions).  This meant lots of large data-structures and long [...]]]></description>
			<content:encoded><![CDATA[<p>For the past 6 weeks or so I&#8217;ve been trying to track down an elusive bug in my SNOMED classifier.  The difficulty has been that it only manifest with very large input sets (I only managed to reduce it down to about 350,000 concept definitions).  This meant lots of large data-structures and long chains of inferences needed to be traced backwards; tedious and time-consuming work.</p>
<p>Today I found the problem.  As I had begun to suspect, there was a simple error in an underlying data-structure.</p>
<p>The lesson?  <strong>Write unit tests <em>carefully</em>!</strong>  It turns out that although I had written a test for the faulty method, the particular data-set I used in the test special-cased around the bug.  What I should have done was use multiple data-sets (pretty obvious) and made sure they were more realistic (in this case I had used a single contiguous set of bits).  If I had done this originally, then I would have found the problem much much earlier.</p>
<p><em>[Update: Ironically, I originally used java.util.BitSet instead of my hand-rolled data-structure but was running into memory usage problems so I replaced a bunch of Maps and Sets with my own versions optimised for their particular usage in the algorithm.  It turns out that for this particular case, the java.util version is entirely adequate.  There's another lesson here :-)]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/11/27/debugging-lessons/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Very high speed ontology classification</title>
		<link>http://lawley.id.au/blog/2007/08/22/very-high-speed-ontology-classification/</link>
		<comments>http://lawley.id.au/blog/2007/08/22/very-high-speed-ontology-classification/#comments</comments>
		<pubDate>Wed, 22 Aug 2007 09:17:58 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[eHRC]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/03/21/very-high-speed-ontology-classification/</guid>
		<description><![CDATA[You heard it here first, SNOMED CT classified in 440s (under 7.5 min) based on an optimised version of the Desden Algorithm written in Java.
This is more than three times faster than the best known published result.
A caveat:

correctness has been checked on small number of examples only

Benchmarking shows (as expected) quadratic time O(n2) and linear [...]]]></description>
			<content:encoded><![CDATA[<p>You heard it here first, SNOMED CT classified in 440s (under 7.5 min) based on an optimised version of the <a href="http://lat.inf.tu-dresden.de/systems/cel/">Desden Algorithm</a> written in Java.<br />
This is more than three times faster than the best known <a href="http://lat.inf.tu-dresden.de/research/papers/2006/BaaLutSun-IJCAR-06.pdf">published</a> result.</p>
<p>A caveat:</p>
<ul>
<li>correctness has been checked on small number of examples only</li>
</ul>
<p>Benchmarking shows (as expected) quadratic time O(n<sup>2</sup>) and linear space O(n).</p>
<p>Needless to say, I&#8217;m pretty pleased with this result.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/08/22/very-high-speed-ontology-classification/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More on Netbeans</title>
		<link>http://lawley.id.au/blog/2007/04/18/more-on-netbeans/</link>
		<comments>http://lawley.id.au/blog/2007/04/18/more-on-netbeans/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 01:28:12 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/04/18/more-on-netbeans/</guid>
		<description><![CDATA[Following my previous entry on Netbeans, I should mention that I was using 5.5, the current stable release, not one of the 6.0 Milestones which are supposed to have a much improved editing environment according to comments in this session  of the Java Posse Roundup.
With regards the profiler, it was indeed much nicer than [...]]]></description>
			<content:encoded><![CDATA[<p>Following my <a href="http://www.lawley.id.au/blog/2007/04/10/netbeans-gripes/">previous entry</a> on Netbeans, I should mention that I was using 5.5, the current stable release, not one of the <a href="http://wiki.netbeans.org/wiki/view/NB6Milestones">6.0 Milestones</a> which are supposed to have a much improved editing environment according to comments in <a href="http://javaposse.com/index.php?post_id=204308">this session</a> <a href="http://media.libsyn.com/media/dickwall/JavaPosse115.mp3"><img style="display: inline;" src="http://javaposse.com/img/podcastIcon.gif" alt="podcast icon" /></a> of the Java Posse Roundup.</p>
<p>With regards the profiler, it was indeed much nicer than the Eclipse TPTP experience, but you need to read the fine print.  I can&#8217;t say how much time I wasted trying to discover where all my heap was going before I <a href="http://profiler.netbeans.org/docs/help/5.5/statistical_mem_prof.html">read</a> (my bold):</p>
<blockquote><p>The total number of objects allocated for each class that Profiler presents (in both &#8220;Record Object Creation&#8221; and &#8220;Record Object Creation and Garbage Collection&#8221; modes) is exact, whereas other numbers (such as <strong>total object size</strong>) and the reverse call graphs are by default obtained <em style="font-style: normal;">statistically</em>.</p></blockquote>
<p>Ultimately, using a combination of the netbeans profiler, <code><a href="http://java.sun.com/javase/6/docs/technotes/tools/share/jmap.html">jmap -histo</a></code>, and the profiler&#8217;s ability to record the stack when allocations happen proved to be the most useful approach.  The instant illumination of seeing that it&#8217;s your Map implementation that&#8217;s responsible for all the space, then looking at the allocation stack traces and discovering that it&#8217;s actually one particular use of the Map that&#8217;s the problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/04/18/more-on-netbeans/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.libsyn.com/media/dickwall/JavaPosse115.mp3" length="45056237" type="audio/mpeg" />
		</item>
		<item>
		<title>REST micro-kernel</title>
		<link>http://lawley.id.au/blog/2007/04/12/rest-micro-kernel/</link>
		<comments>http://lawley.id.au/blog/2007/04/12/rest-micro-kernel/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 14:56:21 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/04/12/rest-micro-kernel/</guid>
		<description><![CDATA[Earlier I mused briefly about standard OS APIs based on a REST approach.
It seems that a commercial offshoot of some HP Labs research is actively developing a similar concept.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.lawley.id.au/blog/2004/08/13/rest-for-the-web-but-why-not-the-desktop/">Earlier</a> I mused briefly about standard OS APIs based on a REST approach.</p>
<p>It seems that a commercial offshoot of some HP Labs research is actively developing a <a href="http://www.1060research.com/netkernel/">similar concept</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/04/12/rest-micro-kernel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans gripes</title>
		<link>http://lawley.id.au/blog/2007/04/10/netbeans-gripes/</link>
		<comments>http://lawley.id.au/blog/2007/04/10/netbeans-gripes/#comments</comments>
		<pubDate>Mon, 09 Apr 2007 23:12:04 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/04/10/netbeans-gripes/</guid>
		<description><![CDATA[I&#8217;ve recently started using Netbeans for its profiler (I have some code that won&#8217;t run in 1.5G and I need to work out why) and while the profiler is vastly better than what Eclipse&#8217;s TPTP project provides and Netbeans is vastly better than it was when I first tried it 5+ years ago, there are [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started using Netbeans for its profiler (I have some code that won&#8217;t run in 1.5G and I need to work out why) and while the profiler is vastly better than what Eclipse&#8217;s TPTP project provides and Netbeans is vastly better than it was when I first tried it 5+ years ago, there are some constant annoyances; little things that Eclipse does that I rely on all the time (non-exhaustive and in no particular order):</p>
<ul>
<li>highlighting all occurrences of the current element (if the cursor is on a var, method or field, then all occurrences in the file are highlighted, including markers to the right of the scrollbar so I can see where it&#8217;s used elsewhere in the file)</li>
<li>toggle of comment/uncomment; netbeans has these has two separate commands (why would I ever want to comment an already commented line?)</li>
<li>support for generics in completion (and smart filtering wrt completion in general) is woeful; if I have a variable <tt>s</tt> declared to be of type <tt>java.util.Set&lt;Foo></tt> and I type <tt>s = new </tt> then I expect completion to a) offer only (non-abstract) classes that implement the <tt>Set</tt> inteface, and b) throw in the appropriate generics stuff as well, e.g., <tt>HashSet&lt;Foo></tt> rather than just <tt>HashSet</tt>.
</li>
<li>multiple launch profiles</li>
<li>junit integration</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/04/10/netbeans-gripes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Magic Ink and Information Software</title>
		<link>http://lawley.id.au/blog/2007/04/06/magic-ink-and-information-software/</link>
		<comments>http://lawley.id.au/blog/2007/04/06/magic-ink-and-information-software/#comments</comments>
		<pubDate>Fri, 06 Apr 2007 10:44:39 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/04/06/magic-ink-and-information-software/</guid>
		<description><![CDATA[I have to agree with James, &#8220;Magic Ink: Information Software and the Graphical Interface&#8221; by Bret Victor, is an excellent essay, and a must read for anyone involved in producing any kind of software.  Please do, especially if you&#8217;re responsible for sites like transinfo.qld.gov.au, yourmovies.com.au, and www3.netbank.commbank.com.au
Of course, if sites like these offered decent [...]]]></description>
			<content:encoded><![CDATA[<p>I have to agree with <a href="http://explorerstreet.blogspot.com/2007/04/paper-magic-ink-information-software.html">James</a>, &#8220;<a href="http://worrydream.com/MagicInk/">Magic Ink: Information Software and the Graphical Interface</a>&#8221; by Bret Victor, is an excellent essay, and a <strong>must read</strong> for anyone involved in producing any kind of software.  Please do, especially if you&#8217;re responsible for sites like transinfo.qld.gov.au, yourmovies.com.au, and www3.netbank.commbank.com.au</p>
<p>Of course, if sites like these offered decent RESTful interfaces then anybody could work at designing a decent piece of information software.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/04/06/magic-ink-and-information-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Relationships as first class language constructs</title>
		<link>http://lawley.id.au/blog/2007/01/31/relationships-as-first-class-language-constructs/</link>
		<comments>http://lawley.id.au/blog/2007/01/31/relationships-as-first-class-language-constructs/#comments</comments>
		<pubDate>Wed, 31 Jan 2007 09:15:52 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2007/01/31/relationships-as-first-class-language-constructs/</guid>
		<description><![CDATA[Via LtU I found a reference to First Class Relationships in an Object-oriented Language, by Gavin Bierman and Alisdair Wren, a paper published at ECOOP 2005.
This is great!  I was kicking around this kind of idea with Jim before he left for his PhD in France.
I&#8217;m looking forward to a close read of it.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://lambda-the-ultimate.org/node/2013">Via LtU</a> I found a reference to <a href="http://homepages.inf.ed.ac.uk/wadler/fool/program/final/4/4_Paper.pdf">First Class Relationships in an Object-oriented Language</a>, by Gavin Bierman and Alisdair Wren, a paper published at ECOOP 2005.</p>
<p>This is great!  I was kicking around this kind of idea with Jim before he left for his PhD in France.<br />
I&#8217;m looking forward to a close read of it.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2007/01/31/relationships-as-first-class-language-constructs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Re: Bloody EMF</title>
		<link>http://lawley.id.au/blog/2006/12/12/rel-bloody-emf/</link>
		<comments>http://lawley.id.au/blog/2006/12/12/rel-bloody-emf/#comments</comments>
		<pubDate>Tue, 12 Dec 2006 05:53:46 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[tefkat]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2006/12/12/rel-bloody-emf/</guid>
		<description><![CDATA[David Hearnden is having trouble with EMF and damn-it if I&#8217;m not having exactly the same problem and debugging experience.  Debugging this stuff is like trying to debug interpreted code by single-stepping through the interpreter!
[update: It seems that the problem is not with the serialisation, but that the Resource "contains" the objects twice.  [...]]]></description>
			<content:encoded><![CDATA[<p>David Hearnden is <a href="http://www.bloglines.com/blog/DavidHearnden?id=22">having trouble</a> with EMF and damn-it if I&#8217;m not having exactly the same problem and debugging experience.  Debugging this stuff is like trying to debug interpreted code by single-stepping through the interpreter!</p>
<p><em>[update: It seems that the problem is not with the serialisation, but that the Resource "contains" the objects twice.  How does this happen?  First the objects are added to the Resource with <code>getContents().add(objectx)</code>, then later something like <code>object1.setParent(object2)</code> is called where parent is a containment relationship.  Thus, the resource "directly" contains object1 and object2 but also transitively contains object1 via the containment from object2.</em></p>
<p><em>The real question is "why?".  In earlier versions of Tefkat this did not happen.  When the transitive containment was established the direct containment was removed (<b>I think</b> -- it could be that the serialisation was smart and ignored the duplicates).  Either way, this is something that's crept into EMF in one of the more recent releases (2.2.0 or 2.2.1 maybe?).  So far, no joy on tracking down the real root of the regression.]</em></p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2006/12/12/rel-bloody-emf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In case you&#8217;re building SOAP systems, read this</title>
		<link>http://lawley.id.au/blog/2006/12/01/in-case-youre-building-soap-systems-read-this/</link>
		<comments>http://lawley.id.au/blog/2006/12/01/in-case-youre-building-soap-systems-read-this/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 01:51:43 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2006/12/01/in-case-youre-building-soap-systems-read-this/</guid>
		<description><![CDATA[http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/

Puts it much better than I ever managed in my guest lectures at Griffith Uni on technologies for buliding distributed systems.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/">http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/<br />
</a><br />
Puts it much better than I ever managed in my guest lectures at Griffith Uni on technologies for buliding distributed systems.</p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2006/12/01/in-case-youre-building-soap-systems-read-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Pet Peeve: Irregular array literals (initialisers)</title>
		<link>http://lawley.id.au/blog/2006/08/29/java-pet-peeve-irregular-array-literals-initialisers/</link>
		<comments>http://lawley.id.au/blog/2006/08/29/java-pet-peeve-irregular-array-literals-initialisers/#comments</comments>
		<pubDate>Tue, 29 Aug 2006 03:57:46 +0000</pubDate>
		<dc:creator>lawley</dc:creator>
				<category><![CDATA[coding]]></category>

		<guid isPermaLink="false">http://www.lawley.id.au/blog/2006/08/29/java-pet-peeve-irregular-array-literals-initialisers/</guid>
		<description><![CDATA[By which I mean that I can (and have to) write code like:
    int[] foo = {1, 2, 3, 5, 7, 11};
    testPrimes(foo);

or, even worse:
    testPrimes(new int[] {1, 2, 3, 5, 7, 11});

rather than being able to just write:
    testPrimes({1, 2, 3, 5, [...]]]></description>
			<content:encoded><![CDATA[<p>By which I mean that I can (and have to) write code like:</p>
<p><code>    int[] foo = {1, 2, 3, 5, 7, 11};<br />
    testPrimes(foo);<br />
</code></p>
<p>or, even worse:</p>
<p><code>    testPrimes(new int[] {1, 2, 3, 5, 7, 11});<br />
</code></p>
<p>rather than being able to just write:</p>
<p><code>    testPrimes({1, 2, 3, 5, 7, 11});<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://lawley.id.au/blog/2006/08/29/java-pet-peeve-irregular-array-literals-initialisers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
