<?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>Datacute Blog</title>
	<atom:link href="http://datacute.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://datacute.wordpress.com</link>
	<description>Acute Information Revelation</description>
	<lastBuildDate>Fri, 18 Feb 2011 09:35:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='datacute.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Datacute Blog</title>
		<link>http://datacute.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://datacute.wordpress.com/osd.xml" title="Datacute Blog" />
	<atom:link rel='hub' href='http://datacute.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Developing Snow Fighters</title>
		<link>http://datacute.wordpress.com/2011/02/16/developing-snow-fighters/</link>
		<comments>http://datacute.wordpress.com/2011/02/16/developing-snow-fighters/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 10:02:36 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">https://datacute.wordpress.com/?p=32</guid>
		<description><![CDATA[I’ve had a lot of fun in the last few weeks developing code as part of the ACM Queue 2011 ICPC Challenge also known as the Icy Projectile Challenge. There are a lot of ideas that I never had time to investigate, but I thought I’d blog about the ideas I did investigate. As I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=32&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I’ve had a lot of fun in the last few weeks developing code as part of the ACM Queue <a href="http://queue.acm.org/icpc/">2011 ICPC Challenge</a> also known as the Icy Projectile Challenge. There are a lot of ideas that I never had time to investigate, but I thought I’d blog about the ideas I did investigate.<span id="more-32"></span></p>
<p>As I write this, I’m waiting for the tournament phase to run, so have no idea how well I’ve done. Quite early on in the competition, I had tried out the submission process, uploading minor changes to the example hunter game, so I had competed is as many preliminary rounds as anyone else, and had won 59 of the 78 of the randomly selected preliminary round matches, including 23 of the last 27, so I think I’ve got a good chance of doing well.</p>
<h2>The Game</h2>
<p>The game is basically a snow fight between two teams of four players, looking out for the trees. You write code to control one team, deciding what to do each turn, for 180 turns.</p>
<p>There were two ways of scoring points in the game, the first is by throwing snowballs at opponents, and the second is by building snowmen to increase your domain. Snowmen can be destroyed, or your opponents can build snowmen close by, both of which reduce your domain score, and it is only the domain at the end of the game that matters (except for extremely rare tie breaker scenarios).</p>
<h2>Strategy and Development History</h2>
<p>Sample code was provided for three example teams. Each example had all four players executing a single strategy, pretty much independently. There was a team that build a protective snow fort, stock piled snow balls, and threw them at any opponent that came close. There was a team of players that ran around trying to build snowmen, and there was a team of players that ran around throwing snow balls at opponents.</p>
<p>I started by adapting the snowman maker and the hunter examples into strategies that individual team members could adopt, and found that three hunters with one snowman maker seemed to work quite well.</p>
<p>I set about improving the strategies, concentrating first on the hunter, till I had code in the basic structure:</p>
<ol>
<li>Each of 4 “Player” objects have a “Strategy”</li>
<li>“Game” controller that sets up the 4 players, each with their specific strategy. Then repeatedly:
<ul>
<li>Reads game state input,</li>
<li>Determines who can throw snowballs at what,</li>
<li>Asks each of 4 players to determine their move</li>
<li>If there are combination of players that have said they could use a snowball, and players who say they’re willing to give up a snowball, and the throw is possible, do that</li>
<li>Picks a run destination for players who don’t have anything better to do, repeating till the player can follow the shortest (simple) path to:
<ul>
<li>Closest uncharted territory,</li>
<li>Closest unsighted territory,</li>
<li>Random location</li>
</ul>
</li>
<li>Report each player’s move</li>
</ul>
</li>
<li>Profit</li>
</ol>
<p>Hitting an opponent gets 10 points that can’t be taken back, and as an added bonus dazes the opponent for 4 turns. Building a snowman in a good position is worth up to 193 points, but can be easily undone by the opponent.</p>
<p>The three hunter team members ended up attempting the following actions:</p>
<ol>
<li>Finish a snowman that they’re standing next to.</li>
<li>Avoid being hit by a likely throw from an opponent.</li>
<li>Throw a snow ball at an opponent.</li>
<li>Take the head off an opponent’s snowman.</li>
<li>Pick up a snow ball.</li>
<li>Throw a snow ball at an opponent’s snowman.</li>
<li>Create a snow ball.</li>
<li>Stand up.</li>
</ol>
<p>When none of those were appropriate, the game controller would send the player running off to explore.</p>
<p>I improved the hunters to divide the targets amongst the players, and to not throw multiple snowballs at the same opponent, since each hit sets the dazed count back to 4, when there was a good chance that a new opponent would come into range and be able to be dazed next turn (particularly at the start of the game when the opponents first meet).</p>
<p>The throw calculation was extended to examine every possible throw, from each player, seeing what could be hit, rather than trying to calculate the best throw in order to try and hit a specific target.</p>
<p>I then improved my snowman builder, improving both determining the optimal places to build, and the actual build process.</p>
<p>If the opponent was seen to be moving, I estimated their next movement, and considered where they were likely to be when a thrown snowball might hit them, and also changed the targeting code to prefer the furthest throw (from each player) that would hit an opponent, rather than the first or last found.</p>
<p>I think that was the last submitted state.</p>
<h2>Snowman Difficulties</h2>
<p>The best place to build a snowman is right where an enemy snowman is, since it only takes two moves (once crouching): picking up their (snowball) head, and putting it back again. The domain change is at best -193 and +193 to me, for a differential of 386 in 2 turns… why would you bother spending 3 turns to make and throw a snowball for a measly 10 points?</p>
<p>I tried multiple snowman makers, who’d take pot-shots at the enemy too, but they all decided on the same spot to try building snowmen, and got in each other’s way.</p>
<p>I tried getting them to build in different spots, by allocating locations in turn, removing the area round each new location from consideration, but this wasn’t optimised, nor terribly good. In order for them to not be pummelled by the enemy (code for my previous submissions), they needed to be carrying around a snowball, which they’d need to drop when they started building. It wasn’t working out very well for them.</p>
<p>I tried specialising the snowman making players, having two hunters, and one player that makes the snowman base and head, while the last player makes the snowman’s middle. However that was twice as susceptible to long delays in building, since either player could get hit and dazed.</p>
<p>I tried to figure out the best player each turn to be a snowman builder, thinking that when one player is hit, another can take over, and that as soon as a snowman is built, the player who just built it is better off becoming a hunter, and someone else is more likely to be close to a better spot for building a snowman… and that’s where I started running into bugs.</p>
<p>Specifically, I’d have 2 players fighting to be the snowman maker. If one was chosen as a fighter this turn, it’d crouch to make themselves a snowball. If chosen as the snowman it’d stand to run to the best place to build the snowman. However the “best” player – new snowman location combination kept switching to the player who was crouching, so I had two players who were ignoring the fight, and pretending they were on a virtual see-saw.</p>
<h2>Route Finding</h2>
<p>I thought that the reason for the flipping of best snowman making player was due to the different path a standing person follows from that which a crouching person follows. The first time I took a good look at the situation, the closer player to the best spot was crouching next to a hedge, and I presumed that the crawling path would go along the hedge and the running path would try and fail to go through the hedge, so that player was good, was picked, would stand, and not be able to move to the best location, but another crouching player who was further away could get there, and roles would switch.</p>
<p>I had also had in the back of my mind that the simple arrangement of trees in the examples might not be so simple in the tournament, so I spent a long Sunday evening coding a variety of path finding algorithms. I implemented <a href="http://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm">Floyd-Warshall</a> first (here is a <a href="http://students.ceid.upatras.gr/~papagel/project/kef5_7_2.htm">applet</a>), since I needed to know path distances between a large combination of points, but it takes far too long to calculate. I then implemented <a href="http://cadapplets.lafayette.edu/HadlockRouter/HadlockRouter.html">Hadlock’s algorithm</a>, which was fast enough, but still had the strange flip-flopping behaviour! I then identified that I had a bug where I calculated the potential benefit of a snowman location; I was accidentally ignoring the path distance for each player, so crouching players were better, not because of any path restrictions, but because they were one move closer to picking up snow.</p>
<p>Once I’d got that fixed, I played against a number of my previous submitted players, but lost badly on more maps than I narrowly won on, so instead of submitting my new code, I decided to go with the previous code, and went to sleep.</p>
<h2>Postscript</h2>
<p>I’ve since found and squashed more bugs in my path finding algorithm, and I had only been using it to determine the distance &#8211; my players were still moving according to the much simpler path rules.</p>
<p>One interesting thing is that a really minor weighting change on whether one action is better than another, can affect a single move, and the entire game after that is different, often with a large difference in who gets pinned down and pelted with snowballs, instead of running around switching heads of opponents snowmen, and consequently a very large difference in scores.</p>
<p>The best player in the preliminary rounds appears to be winning in the prisoners dilemma stakes… by assuming a newly seen opponent able to throw at it will do so, and he’ll try and catch the throw, end up with two snowballs, and throw one right back the next turn. My strategy was to likewise assume such a throw from an opponent, and dodge sideways if I thought the dodge would work. Unfortunately dodging was pretty rare, and I think I should probably have tried to catch first too.</p>
<h2>Competition Results</h2>
<p>I hope to edit this post and write something about the actual tournament when it completes.</p>
<br />Filed under: <a href='http://datacute.wordpress.com/category/java/'>Java</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=32&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2011/02/16/developing-snow-fighters/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse Helios Mostly Works</title>
		<link>http://datacute.wordpress.com/2010/07/30/eclipse-helios-mostly-works/</link>
		<comments>http://datacute.wordpress.com/2010/07/30/eclipse-helios-mostly-works/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 05:00:23 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">https://datacute.wordpress.com/?p=25</guid>
		<description><![CDATA[For development at work, I downloaded and started using Eclipse Helios packaged for J2EE development, wanting to see what I could stumble upon as new or different, and whether I could recommend it to the rest of my team yet without having to describe a whole lot of changes to our practices. We use a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=25&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For development at work, I downloaded and started using Eclipse Helios packaged for J2EE development, wanting to see what I could stumble upon as new or different, and whether I could recommend it to the rest of my team yet without having to describe a whole lot of changes to our practices.</p>
<p>We use a multi-module maven project, using mvn eclipse:eclipse to generate our eclipse projects, and that continued to work just fine, with the projects seeming to be imported without issue.</p>
<p>I noticed that <a href="http://tomcat.apache.org/tomcat-7.0-doc/index.html">Tomcat 7</a> is now listed in the set of servers that can be configured, and indeed the <a href="http://www.eclipse.org/webtools/releases/3.2.0/NewAndNoteworthy/">WTP 3.2.0 New and Noteworthy</a> lists that in it&#8217;s &#8220;Servers&#8221; section. Handy, but as we&#8217;re hosting our own application, we do not need to test against Tomcat 7 yet.</p>
<p>I next noticed that the view of web projects added to the server included a couple of jars. Strange. I still haven&#8217;t figured out why a small number of the many included jars get shown in that view.</p>
<p>The first thing I tried to investigate showed that specifying what gets deployed as part of your web application has been changed too. That&#8217;s shown in the Java EE section of WTP&#8217;s New and Noteworthy.</p>
<p>The applications deployed and ran ok, though a number of times I&#8217;ve tried starting tomcat only to have it complain that one of the web applications can&#8217;t find hibernate classes, and looking in the deployed directory, the jar is indeed missing.</p>
<p>The next thing I noticed is that a whole lot of classes now show warnings. Apparently I should now change from using @SuppressWarnings(&#8220;unchecked&#8221;) to the new and more accurate @SuppressWarnings(&#8220;rawtypes&#8221;) or according to the <a href="http://download.eclipse.org/eclipse/downloads/drops/R-3.6-201006080911/eclipse-news-part2.html">JDT New and Noteworthy</a>, set the suppressRawWhenUnchecked=true system property when starting eclipse.</p>
<p>Another JDT change highlighted that our method of starting up one of our application included an unused object allocation. That actually highlighted that we were starting threads from within a constructor&#8230; something that is rife with difficulties, and to be discouraged.</p>
<p>While investigating what <a href="http://stackoverflow.com/questions/142357/what-are-the-best-jvm-settings-for-eclipse">various people on StackOverflow recommend for eclipse.ini options</a> I discovered the details of Oracle&#8217;s changing the executable and libraries&#8217; organisation meta-data, and how eclipse has been using those to identify Sun&#8217;s JVM and apply Sun&#8217;s -XX:MaxPermSize setting. Oracle have changed the organisation back again for build 7 of Java 6 update 21.</p>
<p>I have not yet started using Helios for personal projects, since for the last little while I&#8217;ve been trying my hand at creating an Android application, implementing a nice looking <a href="http://www.datacute.co.nz/pgquilt/pgquilt.html">Tree Mapping View</a> showing space used by a various tables and indexes of a PostgreSQL database. The page detailing how to set up the <a href="http://developer.android.com/sdk/eclipse-adt.html">eclipse plugins for Android development</a> still says: &#8220;There are known issues with the ADT plugin running with Eclipse 3.6. Please stay on 3.5 until further notice.&#8221;</p>
<p>So far this sounds like a <em>lack of any compelling reasons to upgrade</em>.</p>
<p><strong>However…</strong></p>
<p>Using the market to install the SVN plugins we use was a much nicer experience than in previous versions, and being able to find out about other plugins from within eclipse is great.</p>
<p>I’m also going to start using package name abbreviations, so that all our packages of the format:</p>
<blockquote><p>nz.co.mycompany.myproduct.subcomponentA.internalpackage1</p></blockquote>
<p>can be nicely and succinctly shown as</p>
<blockquote><p>{A}.internalpackage1</p></blockquote>
<p>Something I usually do with a new eclipse installation is tune the startup parameters, editing the eclipse.ini file to show me the workspace location. This is because I often work with multiple workspaces, one showing the current production code for investigating symptoms and behaviour of the production system, and one showing later code with a number of development changes. Eclipse 3.6 has a new preferences option that lets you specify a workspace name to show in the title, which works much better as you do not need to restart eclipse for it to take affect, you can use a short code for your workspace, and it appears first in the title, before the perspective and application name.</p>
<p>Lastly I’m looking forward to experimenting with all the new options for controlling the formatter. I believe I can finally now get it set up to alter the code formatting to my liking more consistently.</p>
<br />Filed under: <a href='http://datacute.wordpress.com/category/eclipse/'>Eclipse</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=25&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2010/07/30/eclipse-helios-mostly-works/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Towards Maintainability</title>
		<link>http://datacute.wordpress.com/2009/06/19/towards-maintainability/</link>
		<comments>http://datacute.wordpress.com/2009/06/19/towards-maintainability/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 12:58:43 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maintainability]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=14</guid>
		<description><![CDATA[My friend Bevan has linked to the tools he referenced in his &#8220;Towards Maintainability&#8221; talk at the Wellington .NET users group recently. I thought I&#8217;d add the equivalents from the perspective of an Eclipse-using Java developer&#8230; Definr.com Definr.com isn&#8217;t specific to a single programming language. I simply type things into Google Chrome&#8217;s Omnibar. FxCop &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=14&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My friend Bevan has <a href="http://www.nichesoftware.co.nz/blog/200905/towards-maintainability-links">linked to the tools</a> he referenced in his &#8220;<a href="http://www.nichesoftware.co.nz/category/blog-tags/maintainability">Towards Maintainability</a>&#8221; talk at the Wellington .NET users group recently.</p>
<p>I thought I&#8217;d add the equivalents from the perspective of an <a href="http://www.eclipse.org/">Eclipse</a>-using Java developer&#8230;</p>
<dl>
<dt>Definr.com </dt>
<dd>Definr.com isn&#8217;t specific to a single programming language. </dd>
<dd>I simply type things into <a href="http://www.google.com/support/chrome/bin/answer.py?hl=en&amp;answer=95440">Google Chrome&#8217;s Omnibar</a>. </dd>
<dt>FxCop &amp; Gendarme </dt>
<dd><a href="http://findbugs.sourceforge.net/">FindBugs</a> </dd>
<dd><a href="http://pmd.sourceforge.net/">PMD</a> </dd>
<dt>Visual Studio Class Diagrams </dt>
<dd>Perhaps <a href="http://www.agilej.com/">AgileJ</a> though I do not use it.</dd>
<dt>Snippets </dt>
<dd><a href="http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclipse.wst.sse.doc.user/topics/tsrcedt026.html">Snippets in Eclipse</a> </dd>
<dd><a href="http://www.ibm.com/developerworks/opensource/library/os-eclipse-snippet/index.html">Creating extensions to snippets</a> </dd>
<dt>StyleCop </dt>
<dd><a href="http://checkstyle.sourceforge.net/">Checkstyle</a> </dd>
<dt>NAnt </dt>
<dd><a href="http://ant.apache.org/">Ant</a> </dd>
<dd><a href="http://maven.apache.org/">Maven 2</a> </dd>
<dt>NUnit </dt>
<dd><a href="http://www.junit.org/">junit</a> </dd>
<dt>TestDriven.Net </dt>
<dd>junit is integrated into all IDEs </dd>
<dt>Sandcastle </dt>
<dd>Perhaps <a href="http://maven.apache.org/doxia/index.html">Doxia</a>? </dd>
<dt>TeamCity </dt>
<dd>TeamCity supports java </dd>
<dd><a href="http://cruisecontrol.sourceforge.net/">CruiseControl</a> </dd>
<dd><a href="http://continuum.apache.org/">Continuum</a> </dd>
<dd><a href="https://hudson.dev.java.net/">Hudson</a> </dd>
<dd><a href="http://gump.apache.org/">Gump</a> </dd>
<dt>ReSharper </dt>
<dd><a href="http://www.eclipse.org/mylyn/">Mylyn</a> is probably the closest productivity adding, IDE-changing example. </dd>
</dl>
<br />Posted in Eclipse, Java Tagged: Eclipse, Java, Maintainability <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=14&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2009/06/19/towards-maintainability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse Galileo Improvements to Java Developer Tools</title>
		<link>http://datacute.wordpress.com/2009/06/19/eclipse-galileo-improvements-to-java-developer-tools/</link>
		<comments>http://datacute.wordpress.com/2009/06/19/eclipse-galileo-improvements-to-java-developer-tools/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 12:23:52 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Galileo]]></category>
		<category><![CDATA[JDT]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=10</guid>
		<description><![CDATA[Here are some improvements to JDT Project in Galileo that I personally find useful: Support for {@inheritDoc} in the javadoc popups. This is encourages its use, which in turn encourages documenting why a method has been overridden, or what&#8217;s so special about this particular implementation, without having to repeat the purpose of the method itself. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=10&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some improvements to JDT Project in <a href="http://www.eclipse.org/galileo/">Galileo</a> that I personally find useful:</p>
<ol>
<li>Support for <code>{@inheritDoc}</code> in the javadoc popups.
<ul>
<li>This is encourages its use, which in turn encourages documenting <em>why</em> a method has been overridden, or what&#8217;s so special about this particular implementation, without having to repeat the purpose of the method itself.</li>
</ul>
</li>
<li>Warnings when a method overrides a synchronized method, but isn’t synchronized itself.
<ul>
<li>It’s hard enough as it is to ensure you get the intended multi-threaded behaviour. This change can help prevent an error that while not very common, can be very hard to spot.</li>
</ul>
</li>
<li>When auto-reformatting an entire class, I can keep the line breaks that I’ve added.
<ul>
<li>This caters for where the formatting rules are too general, and are not aware that I’d find some things much clearer if split into multiple lines in very specific places.</li>
</ul>
</li>
<li>Constructor completion has been made more useful, by offering more appropriate suggestions.
<ul>
<li>I also often save myself some typing by writing the right hand side of the assignment, then using a quick assist to assign the result to a new variable.</li>
</ul>
</li>
<li>By holding down Ctrl, and hovering on a method, I can chose whether to jump to the declaration, or the implementation.
<ul>
<li>I still find this method of navigation difficult though, preferring to keep my hands on the keyboard, navigating to the method call, pressing Ctrl-T, and choosing which implementing or declaring class I wish to view. (That’s not a new feature.)</li>
<li>What I’d like is a companion for F3’s mapping of “Go To Declaration” that with a single key press I can “Go To Implementation”. However I can’t find that command in the key binding preferences page.</li>
</ul>
</li>
</ol>
<br />Posted in Eclipse, Java Tagged: Eclipse, Galileo, Java, JDT <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=10&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2009/06/19/eclipse-galileo-improvements-to-java-developer-tools/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Best Practices</title>
		<link>http://datacute.wordpress.com/2008/08/23/best-practices/</link>
		<comments>http://datacute.wordpress.com/2008/08/23/best-practices/#comments</comments>
		<pubDate>Sat, 23 Aug 2008 03:24:15 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/2008/08/23/best-practices/</guid>
		<description><![CDATA[My friend Bevan points out a post on NUnit Best Practices by Scott White, and asks whether we agree with them. Most of my coding these days is in java, so some of Scott&#8217;s best practices need altering to my situation, e.g. junit.jar instead of nunit.framework.dll. For reference, I disagree to varying extents with #1, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=9&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My friend <a href="http://www.nichesoftware.co.nz/">Bevan</a> points out a <a href="http://scottwhite.blogspot.com/2008/05/nunit-best-practices.html">post on NUnit Best Practices</a> by <a href="http://scottwhite.blogspot.com/">Scott White</a>, and <a href="http://www.nichesoftware.co.nz/blog/200808/nunit-best-practices">asks</a> whether we agree with them.</p>
<p>Most of my coding these days is in java, so some of Scott&#8217;s best practices need altering to my situation, e.g. junit.jar instead of nunit.framework.dll.</p>
<p>For reference, I disagree to varying extents with #1, #2, #3, and #5, and agree with #4, #6, and #7.</p>
<p>However I believe that best practices are often relative to the situation you find yourself in. That situation includes which IDE you are using, and how best to use it, how large your team is, how complex your application is, etc.</p>
<p>I also think that it is an excellent idea to consider which practices consciously or unconsciously drive your coding practice, and whether any of them could be improved. Scott himself says that <a href="http://scottwhite.blogspot.com/2008/07/programming-mantras.html">best practices change over time</a>, and his blog seems to have a long running theme of identifying some of these changes. I commend him for identifying and documenting what he does, providing advice for others to consider, and asking for feedback.</p>
<p>Here are my reasons for disagreeing with some of his NUnit best practices, from my junit in eclipse standpoint:</p>
<p>#1</p>
<p>I primarily disagree since all too often the tests are not distributed with the code being tested. When dealing with some-one else&#8217;s code, I don&#8217;t have their test cases, so if I have problems with their code, I can&#8217;t simply find out whether their test cases still work in my environment, nor whether I&#8217;m using parts of their code which are not covered by their tests.</p>
<p>Secondly, I disagree with &#8220;don&#8217;t be lazy&#8221;. We should all be striving to have our best practices also be the easiest things to do.</p>
<p>#2 &amp; #3</p>
<p>These are things that should be integrated into your IDE and dependency management tools. They appear to be workarounds for poor visual studio defaults when you wish to use NUnit to test your code.</p>
<p>#5</p>
<p>I prefer the idea of starting by writing test cases in a style that documents what you want to achieve. That then drives what methods you need, and perhaps how they should be collected into various interfaces. I refer to this as an idea since I&#8217;m not particularly disciplined in developing in this way.</p>
<p>Overall though, I&#8217;d say that I agree with Scott in that solid unit testing using a tool like NUnit is best practice.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=9&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/08/23/best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Mathematics of Boxy Numbers</title>
		<link>http://datacute.wordpress.com/2008/06/22/mathematics-of-boxy-numbers/</link>
		<comments>http://datacute.wordpress.com/2008/06/22/mathematics-of-boxy-numbers/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 03:48:12 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=8</guid>
		<description><![CDATA[I&#8217;ve found some interesting mathematical concepts through researching my ideas presented in my previous blog posts on a scheme for representing numbers using Basic Primes, and drawing that representation as Boxy Numbers. There is a function named pi, (written as the greek symbol), but pi isn&#8217;t used in reference to circles&#8217; diameters and circumferences, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=8&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found some interesting mathematical concepts through researching my ideas presented in my previous blog posts on a scheme for representing numbers using <a href="/2008/04/16/basic-primes-in-scala/">Basic Primes</a>, and drawing that representation as <a href="/2008/04/16/boxy-numbers/">Boxy Numbers</a>.</p>
<p>There is a function named <a href="http://en.wikipedia.org/wiki/Prime-counting_function">pi</a>, (written as the greek symbol), but pi isn&#8217;t used in reference to circles&#8217; diameters and circumferences, but is instead (as far as I can tell) P. I. standing for prime index. pi(x) is equal to the number of primes equal to or less than x.</p>
<p>By altering my representation slightly so that the number one is represented as a single box:</p>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
<p>So that two is the first prime, so two is a box with the representation of one inside it (which is how I previously drew three).</p>
<p>Then the representation of any number <em>n</em> is drawn by producing <em>n</em>&#8216;s prime factors, <em>f</em><sub>0</sub> to <em>f</em><sub>k</sub> and each factor <em>f</em><sub>i</sub> is drawn as a box with the representation of pi(<em>f</em><sub>i</sub>) inside it.</p>
<p>To make the representation slightly more aesthetic, you can fill in all the gaps with the representation of one. This is because everything is multiplied, and you can of course multiply by one as many times as you like without altering the product. Multiplication is also commutative, so the boxes may be rearranged to give a pleasant looking number, so long as the number of boxes within any box stays the same.</p>
<p>Multiplication is simply a case of drawing both sets of boxes for the numbers being multiplied.</p>
<p>Division and rational numbers are probably best drawn with a numerator over a divisor separated by a line. Common factors are easily identified and removed.</p>
<p>By contrast, addition and subtraction are intensely difficult.</p>
<p>Here&#8217;s a walk-through of representing your birthday as a bunch of boxes:</p>
<p>You could draw the number for the day, month and year individually, but you&#8217;ll probably end up with more a more interesting drawing if you start with one large number n = YYYYMMDD. So for my birthday, 8th September 1972, n=19720908</p>
<p>The first step is to produce the prime factors. There are lots of ways of doing this. The easiest way if you are reading this online is to use an online tool. The one from <a href="http://www.mathsisfun.com/prime-factorization-tool.php">Maths Is Fun</a> says my prime factors are 6763 x 3 x 3 x 3 x 3 x 3 x 3 x 2 x 2.</p>
<p>So I need nine boxes, containing the representation of pi of each factor.</p>
<p>Though boxes can be arranged in any way you like, in order to demonstrate the technique I&#8217;ll stay consistent, showing these vertically, as otherwise by the end of the post I&#8217;ll be running out of room. Web pages have a fixed width, but can be infinitely long:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(6763)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>There&#8217;s an online calculator of pi(n) too <a href="http://primes.utm.edu/nthprime/">here</a>.</p>
<p>It reports that there are:</p>
<p>871 primes less than or equal to 6763</p>
<p>2 primes less than or equal to 3</p>
<p>1 prime less than or equal to 2</p>
<p>So our boxes need to be:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>871</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>We repeat the process for each of these numbers, drawing a box for each prime factor, and writing pi(factor) in each box.</p>
<p>The prime factors of 871 are 67 x 13, so we need two boxes.</p>
<p>2 is prime, so each of the 2s need a single box.</p>
<p>1 has been defined as a box with nothing in it.</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(67)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(13)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>pi(67) = 19</p>
<p>pi(13) = 6</p>
<p>pi(2) we&#8217;ve previously seen  = 1</p>
<p>So our boxes need to be:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>19</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>6</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Producing prime factors again, 19 is prime, so a single box is needed. 6s prime factors are 3 x 2, so two boxes needed</p>
<p>We&#8217;ll replace 1s as before.</p>
<p>So we&#8217;ve got:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(19)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(3)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Evaluating the pi functions gives:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>8</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>2</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Factorising gives:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 19 = 8th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>pi(2)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Evaluating the pi functions gives:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 19 = 8th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>1</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Replacing the last 1s with their representation of an empty box gives the final representation:</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 19 = 8th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>Rearranging this into a pleasing arrangement gives</p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 6763 = 871st prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 67 = 19th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 19 = 8th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td align="center">
		<!-- 13 = 6th prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
				<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
			<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 3 = 2nd prime --></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
		<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
<td>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>
	<!-- 2 = 1st prime--></p>
<table>
<tbody>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td>
<table border="1" cellspacing="0">
<tbody>
<tr>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tbody></table>
</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=8&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/06/22/mathematics-of-boxy-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Eclipse Ganymede Features</title>
		<link>http://datacute.wordpress.com/2008/06/08/eclipse-ganymede-features/</link>
		<comments>http://datacute.wordpress.com/2008/06/08/eclipse-ganymede-features/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 12:55:32 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[ganymede]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=6</guid>
		<description><![CDATA[The Eclipse Ganymede release is only a few weeks away. As a long time eclipse user, inquisitive, early adopter, I&#8217;ve been trying the milestone and release candidates of the java developer tools components. (Ganymede is a coordinated release of an enormous number of eclipse projects. Several packages are available here.) The list of new features [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=6&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The Eclipse Ganymede release is only a few weeks away. As a long time eclipse user, inquisitive, early adopter, I&#8217;ve been trying the milestone and release candidates of the java developer tools components. (Ganymede is a coordinated release of an <a href="http://wiki.eclipse.org/Ganymede">enormous number of eclipse projects</a>. Several packages are available <a href="http://www.eclipse.org/downloads/packages/">here</a>.)</p>
<p>The list of new features is no longer as easy to find, since it was linked to from the download page for the milestone releases, and since the releases are now release candidates, there are no new features.</p>
<p>These will no doubt be combined into a single what&#8217;s new page for the final release, but until then, the lists for each milestone release are well worth a read: <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M1-200708091105/eclipse-news-M1.html">M1</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M2-200709210919/eclipse-news-M2.html">M2</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M3-200711012000/eclipse-news-M3.html">M3</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M4-200712131700/eclipse-news-M4.html">M4</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M5-200802071530/eclipse-news-M5.html">M5</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M6-200803301350/eclipse-news-M6.html">M6</a> <a href="http://archive.eclipse.org/eclipse/downloads/drops/S-3.4M7-200805020100/eclipse-news-M7.html">M7</a></p>
<p><b>Update:</b> As expected, the release of 3.4 is accompanied by a new <a href="http://ganymede-mirror2.eclipse.org/eclipse/downloads/drops/R-3.4-200806172000/whatsnew3.4/eclipse-news.html">New and Noteworthy</a> page. What&#8217;s also worth reviewing is the <a href="http://www.eclipse.org/downloads/packages/compare-packages">feature comparison</a> page for the various Ganymede packages.</p>
<p>My personal favourite dozen new features:</p>
<ol>
<li>System Proxy Settings &#8211; One less place to change those settings when I plug the laptop in somewhere new.</li>
<li>Default console and file encoding &#8211; I develop on Windows for Linux.</li>
<li>Shearing &#8211; I love the pun.</li>
<li>The improved error log view, and the Plug-in registry view enhancements &#8211; these will help when trying out misbehaving plug-ins.</li>
<li>Line support in overview ruler &#8211; much faster navigation.</li>
<li>Runnable JAR export wizard &#8211; no more searching for and installing third party plug-ins to do this simple thing.</li>
<li>Different highlighting for read and write occurrences of the selected or searched for element &#8211; this is fantastic.</li>
<li>Direct interaction with text hovers &#8211; less hand movement is good. Being able to click through to other javadocs is fantastic.</li>
<li>Breadcrumb navigation &#8211; this is a quite good compromise between ease of use and screen real estate.</li>
<li>Support for external class folders &#8211; I haven&#8217;t used this yet, but can think of some past experiences where it would have been useful.</li>
<li>Java compiler on multi-CPU machines &#8211; parallelisation is how we go faster these days.</li>
<li>Quick Assist becomes even more helpful.</li>
</ol>
<p>Eclipse&#8217;s quick assist feature saves a huge amount of work. There&#8217;s no need to go looking through menus and dialogs to find the right place to activate the thing you want to do right now, you simply hit Ctrl-1 and what you want to do is invariably in the short list that immediately pops up. The &#8220;what&#8217;s new&#8221; pages list these additional assists and fixes:</p>
<p>M1<br />
-    Helps with regular expressions in find/replace<br />
-    Helps correct spelling in CVS commits<br />
M2<br />
-    PDE Quickfix for Java file issues<br />
-    Add @throws or @exception javadoc tag<br />
-    Select a missing method error in the Problems view and Quick Fix<br />
-    Create getter and setters for fields (encapsulate fields)<br />
-    Extract method on expressions<br />
-    Helps with the new SWT Templates<br />
-    Helps with user created templates<br />
M3<br />
-    Code completion helps with casts<br />
-    Complete static members of not yet imported types<br />
M4<br />
-    Ensure source entries found in build.properties are properly accounted for in the plug-in manifest<br />
-    Diagnosis (and removal quick fix) of redundant superinterfaces<br />
-    Improved key binding support<br />
-    Convert to StringBuffer<br />
M5<br />
-    Improved cursor jumping<br />
M6<br />
-    New Javadoc tags to annotate (PDE) API with explicit restrictions<br />
-    Quick fix provided for missing or incorrect @since tags<br />
-    The Java problem hover now offers all available quick fixes<br />
-    Use MessageFormat for string concatenation<br />
-    Extract local variable (without replacing all occurrences)<br />
-    only show templates applicable at the current location<br />
M7<br />
-    Remove invalid use of API Javadoc tags<br />
-    Inserting parameter name also shows guessed arguments<br />
-    Shows gory details of improved text search</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=6&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/06/08/eclipse-ganymede-features/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Updating Internet Explorer RSS Feeds</title>
		<link>http://datacute.wordpress.com/2008/05/18/updating-internet-explorer-rss-feeds/</link>
		<comments>http://datacute.wordpress.com/2008/05/18/updating-internet-explorer-rss-feeds/#comments</comments>
		<pubDate>Sun, 18 May 2008 11:12:23 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/2008/05/18/updating-internet-explorer-rss-feeds/</guid>
		<description><![CDATA[I tried out RikReader recently, which is one of the class of feed readers which use Internet Explorer&#8217;s (and Vista&#8217;s) list of RSS feeds. It has its pro&#8217;s and con&#8217;s, but the lack of the ability to refresh all feeds was initially a surprise. It doesn&#8217;t need that feature though, since using IE&#8217;s feeds, it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=5&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I tried out <a href="http://11011.net/software/rikreader" target="_blank">RikReader</a> recently, which is one of the class of feed readers which use Internet Explorer&#8217;s (and Vista&#8217;s) list of RSS feeds. It has its pro&#8217;s and con&#8217;s, but the lack of the ability to refresh all feeds was initially a surprise.</p>
<p>It doesn&#8217;t need that feature though, since using IE&#8217;s feeds, it also uses IE&#8217;s feed updating mechanism. I don&#8217;t really like IE&#8217;s feed updating mechanism, since it is a background task that keeps using my laptop&#8217;s resources when it wants to, rather than when I want it to.</p>
<p>Investigating how it updates, I discovered that I can disable the background task, and when I want the feeds updated, I can run:</p>
<p><strong>msfeedssync forcesync</strong></p>
<p>I thought I&#8217;d blog about it, since there are currently so few mentions (in English) of this.</p>
<p>I created a shortcut to run that on my Quick Launch bar. Can anyone comment on where to find a pre-installed rss icon?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=5&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/05/18/updating-internet-explorer-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Boxy Numbers</title>
		<link>http://datacute.wordpress.com/2008/04/16/boxy-numbers/</link>
		<comments>http://datacute.wordpress.com/2008/04/16/boxy-numbers/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 11:30:44 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=4</guid>
		<description><![CDATA[My previous post &#8220;Basic Primes in Scala&#8221; ended with some ideas of how to salvage some use out of the algorithm. I mentioned representing the numbers as concentric circles. Playing around with a text editor, I converted some of the numbers to arrangements of concentric squares. Left to right are the factors, rearrange at will. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=4&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>My previous post &#8220;<a href="http://datacute.wordpress.com/2008/04/16/basic-primes-in-scala/">Basic Primes in Scala</a>&#8221; ended with some ideas of how to salvage some use out of the algorithm. I mentioned representing the numbers as concentric circles. Playing around with a text editor, I converted some of the numbers to arrangements of concentric squares.</p>
<p><span id="more-4"></span></p>
<p>Left to right are the factors, rearrange at will. The vertical arrangement represents the power.</p>
<p>Here are some of the results shown in the previously generated style, and recreated as groups of concentric squares.</p>
<p> </p>
<pre style="line-height:95%;">2:[]

[]

3:[[]]
 ____
[    ]
[ [] ]
[____]

4:[]([])

[]

[]

5:[[[]]]
 ________
[  ____  ]
[ [    ] ]
[ [ [] ] ]
[ [____] ]
[________]

6:[[]][]
 ____
[    ]
[ [] ]
[____] []

7:[[]([])]
 ____
[    ]
[ [] ]
[    ]
[ [] ]
[____]

8:[]([[]])
 ____
[    ]
[ [] ]
[____]

[]

9:[[]]([])

[]
 ____
[    ]
[ [] ]
[____]

10:[[[]]][]
 ________
[  ____  ]
[ [    ] ]
[ [ [] ] ]
[ [____] ]
[________] []

11:[[[[]]]]
 ____________
[  ________  ]
[ [  ____  ] ]
[ [ [    ] ] ]
[ [ [ [] ] ] ]
[ [ [____] ] ]
[ [________] ]
[____________]

...

293:[[[[[[]]]]][]]
 _______________________
[  ________________     ]
[ [  ____________  ]    ]
[ [ [  ________  ] ]    ]
[ [ [ [  ____  ] ] ]    ]
[ [ [ [ [    ] ] ] ]    ]
[ [ [ [ [ [] ] ] ] ]    ]
[ [ [ [ [____] ] ] ]    ]
[ [ [ [________] ] ]    ]
[ [ [____________] ]    ]
[ [________________] [] ]
[_______________________]

294:[[]([])]([])[[]][]

[]
 ____
[    ]
[ [] ]  ____
[    ] [    ]
[ [] ] [ [] ]
[____] [____] []

295:[[[[]([])]]][[[]]]
 ____________
[  ________  ]
[ [  ____  ] ]
[ [ [    ] ] ]
[ [ [ [] ] ] ]  ________
[ [ [    ] ] ] [  ____  ]
[ [ [ [] ] ] ] [ [    ] ]
[ [ [____] ] ] [ [ [] ] ]
[ [________] ] [ [____] ]
[____________] [________]

296:[[[]][]([])][]([[]])
 ___________   ____
[  ____     ] [    ]
[ [    ] [] ] [ [] ]
[ [ [] ]    ] [____]
[ [____] [] ]
[___________] []

297:[[[[]]]][[]]([[]])
 ____________   ____
[  ________  ] [    ]
[ [  ____  ] ] [ [] ]
[ [ [    ] ] ] [____]
[ [ [ [] ] ] ]  ____
[ [ [____] ] ] [    ]
[ [________] ] [ [] ]
[____________] [____]

298:[[[]([])][[[]]]][]
 ___________________
[  ____   ________  ]
[ [    ] [  ____  ] ]
[ [ [] ] [ [    ] ] ]
[ [    ] [ [ [] ] ] ]
[ [ [] ] [ [____] ] ]
[ [____] [________] ]
[___________________] []

299:[[[]]([])][[[]][]]
 ________
[        ]
[  []    ]  ___________
[  ____  ] [  ____     ]
[ [    ] ] [ [    ]    ]
[ [ [] ] ] [ [ [] ]    ]
[ [____] ] [ [____] [] ]
[________] [___________]

300:[[[]]]([])[[]][]([])

[]
 ________
[  ____  ]
[ [    ] ]  ____
[ [ [] ] ] [    ] []
[ [____] ] [ [] ]
[________] [____] []</pre>
<p>One of the IP addresses of this blog: 72.233.2.56:</p>
<pre style="font-size:33%;line-height:95%;"> ______________________   ____________
[                      ] [  ________  ]
[ []                   ] [ [  ____  ] ]                ____________
[  ________            ] [ [ [    ] ] ]               [  ________  ]
[ [  ____  ]           ] [ [ [ [] ] ] ]  ___________  [ [  ____  ] ]  ____          ____
[ [ [    ] ]  ____     ] [ [ [    ] ] ] [  ____     ] [ [ [    ] ] ] [    ]        [    ]
[ [ [ [] ] ] [    ]    ] [ [ [ [] ] ] ] [ [    ]    ] [ [ [ [] ] ] ] [ [] ]  ____  [ [] ]
[ [ [____] ] [ [] ]    ] [ [ [____] ] ] [ [ [] ]    ] [ [ [____] ] ] [    ] [    ] [____]
[ [________] [____] [] ] [ [________] ] [ [____] [] ] [ [________] ] [ [] ] [ [] ]
[______________________] [____________] [___________] [____________] [____] [____] []</pre>
<p>Explanation: The IP 72.233.2.56 = 1223230008</p>
<p>1223230008 = 863 * 59 * 13 * 11 * 7 * 3 * 2^3</p>
<p>863 is the 150th prime. 150 = 5^2 * 3 * 2</p>
<p>59 is the 17th prime. 17 is the 7th prime.</p>
<p>13 is the 6th prime.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=4&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/04/16/boxy-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
		<item>
		<title>Basic Primes in Scala</title>
		<link>http://datacute.wordpress.com/2008/04/16/basic-primes-in-scala/</link>
		<comments>http://datacute.wordpress.com/2008/04/16/basic-primes-in-scala/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 12:17:53 +0000</pubDate>
		<dc:creator>Stephen Denne</dc:creator>
				<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://datacute.wordpress.com/?p=3</guid>
		<description><![CDATA[I&#8217;ve started learning Scala. One way I learn is by reading and experimenting, so I looked for a simple program I could write in the right problem space to make use of language features expressed more succinctly in Scala than in Java. Desired Application I chose to implement a weird idea that I had a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=3&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve started learning <a href="http://www.scala-lang.org/" target="_blank">Scala</a>. One way I learn is by reading and experimenting, so I looked for a simple program I could write in the right problem space to make use of language features expressed more succinctly in Scala than in Java. </p>
<p><span id="more-3"></span>
</p>
<h3>Desired Application</h3>
<p>I chose to implement a weird idea that I had a couple of years ago: Instead of representing natural numbers in base 10, or any other fixed base, record the prime factorisation. Instead of recording how many 1s, 10s, 100s, 1000s, etc. to sum, you can record how many 2s, 3s, 5s, 7s, 11s, 13s, etc. to multiply. (With a special code for 1.) Each prime number is indexed, and referred to by its index, such that, for example the number 288 (base 10) = 3^2 x 2^5, which is 3 (the second prime) to the power of 2 (the first prime), multiplied by 2 (the first prime) to the power of 5 (the third prime). The powers are also converted into their representation within this same system.</p>
<p>Using [x] to refer to the x&#8217;th prime, we get 288 (base 10)</p>
<pre>= [2] ^ [1] x [1] ^ [3]
= [[1]] ^ [1] x [1] ^ [[2]]
= [[1]] ^ [1] x [1] ^ [[[1]]]</pre>
<p>Everything reduces to [1], which I then replace with []. Multiplication signs can be removed, and power signs can be replaced with parenthesis to give a cryptic representation: 288 = [[]]([])[]([[[]]])</p>
<p>A cleaner representation may be to replace 1, with (), meaning &#8220;to the power of zero&#8221;, but that is not what I did for this silly example.</p>
<p>That covers the basic idea for the program: conversion from simple base 10 numbers into these cryptic character sequences representing the prime factorisation.</p>
<h3>Generating A Sequence Of Primes</h3>
<p>To start with I looked for a way to calculate primes in Scala. The docs on <a href="http://www.scala-lang.org/docu/files/api/scala/Stream.html" target="_blank">scala.Stream</a> includes a simple definition of the <a href="http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes" target="_blank">Sieve of Eratosthenes</a>. I started with something similar, which I found on <a href="http://www.scala-kurz.org/show/15" target="_blank">Scala Kurz</a>:</p>
<pre><span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">sieve</span>(<span style="color:#1b1bd7;">s</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]): <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] =
<span style="color:brown;">  Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">sieve</span>(<span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">tail filter </span>(_ <span style="color:#1e90ff;">% </span><span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">head != </span>0)))
<span style="color:#7f7f7f;">val </span><span style="color:#1b1bd7;">primes </span>= <span style="color:#1e90ff;">sieve</span>(<span style="color:brown;">Stream</span>.<span style="color:#1e90ff;">from</span>(2))
</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>This simple algorithm is quite easy to understand, but unfortunately is pretty useless, as it is so resource intensive that without changing any JVM runtime parameters, it can only calculate up to the 1641st prime (or the 3715th prime if using the scala runtime, which starts the jvm with a larger heap) before overflowing the stack.</p>
<h3>Generating A Sequence Of Primes Efficiently</h3>
<p>The <a href="http://en.literateprograms.org/LiteratePrograms:Welcome" target="_blank">Literate Programs site</a> includes the same implementation in its <a href="http://en.literateprograms.org/Sieve_of_Eratosthenes_%28Scala%29" target="_blank">Sieve of Eratosthenes in Scala</a> page, but the <a href="http://en.literateprograms.org/Sieve_of_Eratosthenes_%28Haskell%29" target="_blank">Sieve of Eratosthenes in Haskell</a> includes a more efficient functional implementation that I thought I&#8217;d convert to Scala (I don&#8217;t know Haskell, but the algorithm is explained well).</p>
<p>The most difficult part of the conversion was trying to decipher what foldr1 was supposed to do. I incorrectly assumed it was the same as Stream.foldRight, which I butchered till I arrived at something that seemed to work (The definition of foldr1 below is probably <strong>not</strong> equivalent to Haskell&#8217;s.):</p>
<pre><span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">merge</span>(<span style="color:#1b1bd7;">xs</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] , <span style="color:#1b1bd7;">ys</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]): <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] = {
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head &lt; </span><span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">head</span>)
    <span style="color:#7f7f7f;">return </span><span style="color:brown;">Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">merge</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">tail</span>, <span style="color:#1b1bd7;">ys</span>))
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head == </span><span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">head</span>)
    <span style="color:#7f7f7f;">return </span><span style="color:brown;">Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">merge</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">tail</span>, <span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">tail</span>))
  <span style="color:#7f7f7f;">return </span><span style="color:brown;">Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">merge</span>(<span style="color:#1b1bd7;">xs</span>, <span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">tail</span>))
}
<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">diff</span>(<span style="color:#1b1bd7;">xs</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>], <span style="color:#1b1bd7;">ys</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]): <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] = {
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head &lt; </span><span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">head</span>)
    <span style="color:#7f7f7f;">return </span><span style="color:brown;">Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">diff</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">tail</span>, <span style="color:#1b1bd7;">ys</span>))
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head == </span><span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">head</span>) <span style="color:#7f7f7f;">return </span><span style="color:#1e90ff;">diff</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">tail</span>, <span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">tail</span>)
  <span style="color:#7f7f7f;">return </span><span style="color:#1e90ff;">diff</span>(<span style="color:#1b1bd7;">xs</span>, <span style="color:#1b1bd7;">ys</span>.<span style="color:#1e90ff;">tail</span>)
}
<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">f</span>(<span style="color:#1b1bd7;">xs</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>], <span style="color:#1b1bd7;">ys</span>: =&gt; <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]) =
  <span style="color:brown;">Stream</span>.<span style="color:brown;">cons</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">merge</span>(<span style="color:#1b1bd7;">xs</span>.<span style="color:#1e90ff;">tail</span>, <span style="color:#1b1bd7;">ys</span>))
<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">g</span>(<span style="color:#1b1bd7;">p</span>: <span style="color:brown;">Int</span>) = <span style="color:brown;">Stream</span>.<span style="color:#1e90ff;">from</span>(<span style="color:#1b1bd7;">p</span><span style="color:#1e90ff;">*</span><span style="color:#1b1bd7;">p</span>,<span style="color:#1b1bd7;">p</span><span style="color:#1e90ff;">*</span>2)
<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">foldr1</span>(<span style="color:#1b1bd7;">f</span>: (<span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>], =&gt; <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]) =&gt; <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>])
  (<span style="color:#1b1bd7;">s</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>]]): <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] =
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">isEmpty</span>) <span style="color:brown;">Stream</span>.<span style="color:#1e90ff;">empty
  </span><span style="color:#7f7f7f;">else </span><span style="color:#1b1bd7;">f</span>(<span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1e90ff;">foldr1</span>(<span style="color:#1b1bd7;">f</span>)(<span style="color:#1b1bd7;">s</span>.<span style="color:#1e90ff;">tail</span>))
<span style="color:#7f7f7f;">val </span><span style="color:#1b1bd7;">primes</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>] =
  <span style="color:brown;">Stream</span>.<span style="color:#1e90ff;">fromIterator</span>((2<span style="color:#1e90ff;">::</span>3<span style="color:#1e90ff;">::</span>5<span style="color:#1e90ff;">::</span><span style="color:brown;">Nil</span>).<span style="color:#1e90ff;">elements</span>).<span style="color:#1e90ff;">append</span>(
      <span style="color:#1e90ff;">diff</span>(<span style="color:brown;">Stream</span>.<span style="color:#1e90ff;">from</span>(7,2), <span style="color:#1e90ff;">nonprimes</span>))
<span style="color:#7f7f7f;">val </span><span style="color:#1b1bd7;">nonprimes </span>= <span style="color:#1e90ff;">foldr1</span>(<span style="color:#1e90ff;">f</span>)(<span style="color:#1e90ff;">primes</span>.<span style="color:#1e90ff;">tail map g</span>)</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Now I can calculate up to the 18707th prime, an order of magnitude more that the simple algorithm, in an order of magnitude more lines of code.</p>
<p>Comments in Jorge Ortiz post <a href="http://scala-blogs.org/2007/12/project-euler-fun-in-scala.html" target="_blank">Fun with Project Euler and Scala</a> also mention the poor resource utilisation of the two-line sieve, and code is supplied for providing a stream of primes using java&#8217;s BigInteger.nextProbablePrime(). I&#8217;ll leave that for now though, and get back on track&#8230;</p>
<h3>Determining Prime Factorisation</h3>
<p>Next I needed indexed prime factors:</p>
<pre><span style="color:#7f7f7f;">// Prime Factor Tuple: Prime, Power, Index
</span><span style="color:#7f7f7f;">type </span><span style="color:#8b6914;">Factors </span>= <span style="color:brown;">List</span>[(<span style="color:brown;">Int</span>, <span style="color:brown;">Int</span>, <span style="color:brown;">Int</span>)];
<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">primeFactorsRecurse</span>(<span style="color:#1b1bd7;">i</span>: <span style="color:brown;">Int</span>, <span style="color:#1b1bd7;">factors</span>: <span style="color:#8b6914;">Factors</span>,
    <span style="color:#1b1bd7;">morePrimes</span>: <span style="color:brown;">Stream</span>[<span style="color:brown;">Int</span>], <span style="color:#1b1bd7;">index</span>: <span style="color:brown;">Int</span>): <span style="color:#8b6914;">Factors </span>= {
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">== </span>1) <span style="color:#7f7f7f;">return </span><span style="color:#1b1bd7;">factors</span>;
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">% </span><span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head == </span>0) {
    <span style="color:#7f7f7f;">if </span>((<span style="color:#1b1bd7;">factors </span><span style="color:#1e90ff;">!= </span><span style="color:brown;">Nil</span>) <span style="color:#1e90ff;">&amp;&amp; </span>(<span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head == </span><span style="color:#1b1bd7;">factors</span>.<span style="color:#1e90ff;">head</span>.<span style="color:#1e90ff;">_1</span>)) {
      <span style="color:#7f7f7f;">return </span><span style="color:#1e90ff;">primeFactorsRecurse</span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">/ </span><span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head</span>,
          (<span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head</span>, <span style="color:#1b1bd7;">factors</span>.<span style="color:#1e90ff;">head</span>.<span style="color:#1e90ff;">_2 + </span>1, <span style="color:#1b1bd7;">index</span>) <span style="color:#1e90ff;">::
          </span><span style="color:#1b1bd7;">factors</span>.<span style="color:#1e90ff;">tail</span>,
          <span style="color:#1b1bd7;">morePrimes</span>, <span style="color:#1b1bd7;">index</span>);
    } <span style="color:#7f7f7f;">else </span>{
      <span style="color:#7f7f7f;">return </span><span style="color:#1e90ff;">primeFactorsRecurse</span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">/ </span><span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head</span>,
          (<span style="color:#1b1bd7;">morePrimes</span>.<span style="color:#1e90ff;">head</span>, 1, <span style="color:#1b1bd7;">index</span>) <span style="color:#1e90ff;">:: </span><span style="color:#1b1bd7;">factors</span>,
          <span style="color:#1b1bd7;">morePrimes</span>, <span style="color:#1b1bd7;">index</span>);
    }
  }
  <span style="color:#7f7f7f;">return </span><span style="color:#1e90ff;">primeFactorsRecurse</span>(
      <span style="color:#1b1bd7;">i</span>, <span style="color:#1b1bd7;">factors</span>, <span style="color:#1b1bd7;">morePrimes </span><span style="color:#1e90ff;">drop </span>1, <span style="color:#1b1bd7;">index </span><span style="color:#1e90ff;">+ </span>1);
}

<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">primeFactors</span>(<span style="color:#1b1bd7;">i</span>: <span style="color:brown;">Int</span>): <span style="color:#8b6914;">Factors </span>= {
  <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">== </span>1) <span style="color:#7f7f7f;">return </span>(1,1,0) <span style="color:#1e90ff;">:: </span><span style="color:brown;">Nil</span>;
  <span style="color:#1e90ff;">primeFactorsRecurse</span>(<span style="color:#1b1bd7;">i</span>, <span style="color:brown;">Nil</span>, <span style="color:#1e90ff;">primes</span>, 1);
}</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<h3>Printing The Numbers</h3>
<p>All that is needed now is the code to print the numbers using the unusual representation described above:</p>
<pre><span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#1b1bd7;">factors</span>: <span style="color:#8b6914;">Factors</span>): <span style="color:brown;">Unit </span>= {
  <span style="color:#1b1bd7;">factors </span><span style="color:#7f7f7f;">match</span>{
    <span style="color:#7f7f7f;">case </span>(<span style="color:#1b1bd7;">prime</span>: <span style="color:brown;">Int</span>, <span style="color:#1b1bd7;">power</span>: <span style="color:brown;">Int</span>, <span style="color:#1b1bd7;">index</span>: <span style="color:brown;">Int</span>) <span style="color:brown;">:: </span><span style="color:#1b1bd7;">morefactors </span>=&gt;  {
      <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">index </span><span style="color:#1e90ff;">&gt; </span>0) <span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#7f7f7f;">"["</span>, <span style="color:#1b1bd7;">index</span>, <span style="color:#7f7f7f;">"]"</span>)
      <span style="color:#7f7f7f;">if </span>(<span style="color:#1b1bd7;">power </span><span style="color:#1e90ff;">&gt; </span>1) <span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#7f7f7f;">"("</span>, <span style="color:#1b1bd7;">power</span>, <span style="color:#7f7f7f;">")"</span>)
      <span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#1b1bd7;">morefactors</span>)
    }
    <span style="color:#7f7f7f;">case </span><span style="color:brown;">Nil </span>=&gt; ();
  }
}

<span style="color:#7f7f7f;">def </span><span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#1b1bd7;">pre</span>: <span style="color:brown;">String</span>, <span style="color:#1b1bd7;">i</span>: <span style="color:brown;">Int</span>, <span style="color:#1b1bd7;">post</span>: <span style="color:brown;">String</span>): <span style="color:brown;">Unit </span>= {
  <span style="color:#1e90ff;">print</span>(<span style="color:#1b1bd7;">pre</span>)
  <span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#1e90ff;">primeFactors</span>(<span style="color:#1b1bd7;">i</span>))
  <span style="color:#1e90ff;">print</span>(<span style="color:#1b1bd7;">post</span>)
}

(1 <span style="color:#1e90ff;">to </span>300) <span style="color:#1e90ff;">foreach </span>{<span style="color:#1b1bd7;">i</span>: <span style="color:brown;">Int </span>=&gt; <span style="color:#1e90ff;">printPrimeFactors</span>(<span style="color:#1b1bd7;">i </span><span style="color:#1e90ff;">+ </span><span style="color:#7f7f7f;">":"</span>,<span style="color:#1b1bd7;">i</span>,<span style="color:#7f7f7f;">"\n"</span>)}</pre>
</p>
<h3>Summary</h3>
<p>I was able to create an application in Scala to do what I wanted, while making use of a number of Scala language features.</p>
<p>I&#8217;ll welcome corrections, and comments regarding the Scala code, such as how I can create a infix Stream.cons operator to make my code less verbose, or ways to automatically switch to BigInts if the range of Int is surpassed.</p>
<p>I&#8217;d also be extremely interested in anyone can think of a use for this representation of natural numbers. The same ideas can be converted into graphical symbols, e.g. using differently sized concentric circles instead of [[[]]], or tracing a path to give a particular &#8220;primal squiggle&#8221; that uniquely represents a number, (such as an IP address). The order of factors doesn&#8217;t matter, so that provides scope to position graphical representations of them in artistically pleasing arrangements.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/datacute.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/datacute.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/datacute.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/datacute.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/datacute.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=datacute.wordpress.com&amp;blog=1760304&amp;post=3&amp;subd=datacute&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://datacute.wordpress.com/2008/04/16/basic-primes-in-scala/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2b3217a892341e28d299627a00030534?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">spdenne</media:title>
		</media:content>
	</item>
	</channel>
</rss>
