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

<channel>
	<title>Beauty of Code &#187; Programming</title>
	<atom:link href="http://beauty-of-code.de/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://beauty-of-code.de</link>
	<description>About code and visualisation</description>
	<lastBuildDate>Thu, 29 Jul 2010 13:48:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Reanimating Hypergraph</title>
		<link>http://beauty-of-code.de/2010/07/reanimating-hypergraph/</link>
		<comments>http://beauty-of-code.de/2010/07/reanimating-hypergraph/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 09:48:24 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hypergraph]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=160</guid>
		<description><![CDATA[After a break of several years, I decided to continue the Hypergraph project. For  those of you who don’t know Hypergraph: this is an open source Java  framework which provides ways to model hyperbolic geometry and  visualises graphs and trees using hyperbolic geometry. There has been  some research on hyperbolic trees [...]]]></description>
			<content:encoded><![CDATA[<p>After a break of several years, I decided to continue the <a href="http://hypergraph.sourceforge.net">Hypergraph </a>project. For  those of you who don’t know Hypergraph: this is an open source Java  framework which provides ways to model hyperbolic geometry and  visualises graphs and trees using hyperbolic geometry. There has been  some research on hyperbolic trees which shows that especially  hierarchical data can be view very well using hyperbolic trees.</p>
<p>Every few weeks I received a mail asking for the current status of  the project, whether it’s completely dead or whether certain  enhancements can be made. There were also various (legitimate)  complaints about the missing documentation of the project.</p>
<p>Hence I thought I should continue to work on the project at least if  time allows it. Here I would like to give an overview about the next  development steps and the reasons for this. I’m afraid, I can’t give a  time estimation as I’m not working on this project on a regular basis.</p>
<p>Well, the next steps will be:</p>
<ol>
<li>Finish the refactoring to      become independent of the UI (support  at least AWT/Sing and SWT)</li>
<li>Get rid of the graph data      structure and algorithms; replace it  by JgraphT</li>
<li>Tidy up the existing graph      layout algorithms</li>
<li>Tidy up the example      applications and add new examples</li>
<li>Enhance the Javadoc</li>
<li>Relaunch the website, including      a better documentation</li>
</ol>
<p>As you can see, I start with the parts which are more fun to me and  end up with the (usually boring, but necessary) documentation.</p>
<p><strong>Independence</strong><strong> of the UI framework</strong></p>
<p>The existing Hypergraph code consists of three parts: packages  related to the graph structure, a package for the hyperbolic geometry  and a package for the visualisation of the hyperbolic graphs and  hyperbolic trees in a JPanel. At first sight, this sounds like a  reasonable architecture, but if you look at the code in detail, you will  find that this is not the case, here some examples:</p>
<ul>
<li>The colour attribute for edges and vertices are stored using  java.awt.Colour. If you use this graph in frameworks which don’t use  java.awt.Colour, this causes a problem.</li>
<li>The projector which is responsible for projecting the hyperbolic  plane to the screen coordinates depends on JComponent</li>
<li>The animator which is responsible for smoothly translating the  hyperbolic plane uses javax.swing.Timer.</li>
</ul>
<p>If the code shall be used by different UI frameworks, these  dependencies have to be resolved, which is the first aim. Large parts  are already done and committed to the SWT branch, but there is still  something to do.</p>
<p><strong>Replacement of the Graph API by JGraphT</strong></p>
<p>When I started in 2002/2003, I decided to write my own graph API. By  now, there are some established projects written in Java which offer the  functionality I need and I decided to use <a href="http://jgrapht.org">JGraphT</a>.</p>
<p>The advantage is that I don’t need to worry about the (correct)  implementation of any algorithms or data structure &#8211; there is no need to  reinvent the wheel.</p>
<p>There are disadvantes though: I have to rewrite any code that depend  on the existing graph data structure, which is quite a lot by the nature  of the project. Also there doesn’t seem to be any reader for GraphML or  GraphXML files, so need to implement them.</p>
<p><strong>Tidying up the layout algorithms</strong></p>
<p>The most striking issue with the hyperbolic layout algorithms is the  poor quality of the code. I have to confess that I can’t read the code  at all…</p>
<p>But there are some other deficiencies: the layout algorithms are  graph layout algorithms. Well, that sounds tautologic, but for example  the force directed layout is actually a generic multi dimensional  scaling algorithm which could also be applied to other data than graphs.  It will be interesting to see whether hyperbolic geometry can also be  used for other visualisation besides hyperbolic trees and graphs.</p>
<p>This will happen more or less at the same time as the introduction of  JGraphT as this is related.</p>
<p><strong>Tidying up the example applications</strong></p>
<p>Similar to the layout algorithms, the code quality of the  applications is quite poor – the programs are a mixture of examples and  proof of concept. Even the main applet to show hyperbolic trees should  be tidied up.</p>
<p>I haven’t thought yet about which examples and which actual  applications I should include in the distribution. If you have any  proposals or if you would like to have an example for a specific concept  in Hypergraph, please add a comment.</p>
<p><strong>Enhancement of  the Javadoc and relaunching the website</strong></p>
<p>The need to enhance the Javadoc should be obvious to anybody who has  worked with the code. The same applies to the website: it’s not complete  at all.</p>
<p>Currently, it’s difficult or at least not comfortable to add new  content to the website due to the way the html files are generated and  deployed.</p>
<p>As I have also spent some time working with CouchDB, I might decide  to use CouchDB as a storage and web server and create some mixture of  blog and wiki for the new website.</p>
<p><strong>Conclusion</strong></p>
<p>As you can see, there is a lot to do and I hope to provide a new  release soon which covers at least the first two issues. I will also try  to write about how the issues are resolved, i.e. describe the new  architecture of Hypergraph.</p>
<p>As a last remark, let me mention that I’m not very glad about the  project’s name Hypergraph. When I created the project, I thought this is  a nice combination of hyperbolic geometry and graphs. However, I  completely ignored that hypergraph is actually a fixed notion in graph  theory which can lead to confusion. I wonder whether there is some other  name which hints at the main focus of the project: data visualisation  using hyperbolic geometry. If you have any ideas, please add a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2010/07/reanimating-hypergraph/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Haynes Catalog live</title>
		<link>http://beauty-of-code.de/2009/07/haynes-catalog-live/</link>
		<comments>http://beauty-of-code.de/2009/07/haynes-catalog-live/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 19:43:43 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Haynes]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=141</guid>
		<description><![CDATA[I&#8217;m glad to announce that the Haynes Catalog went live yesterday. The Haynes Catalog is an online project which &#8220;presents an interactive and continuously updated database containing music for and with oboe up to 1800&#8220;. A friend of mine, Peter Wuttke, continually collects information and uses the online catalog to make this available to the public.
The application is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m glad to announce that the <a href="http://haynes-catalog.net">Haynes Catalog</a> went live yesterday. The Haynes Catalog is an online project which &#8220;<em>presents an interactive and continuously updated database containing music for and with oboe up to 1800</em>&#8220;. A friend of mine, <a href="http://haynes-catalog.net/info/about_peter">Peter Wuttke</a>, continually collects information and uses the online catalog to make this available to the public.</p>
<p>The application is using Ruby on Rails with a Mysql database in the background. Apart of the public part of the application, there is an admin interface which allows Peter to update the data. Since I worked on this project only sporadically in my spare time, two challenges proved to be more complicated than expected:</p>
<ol>
<li>Versioning of changes:<br />
We tried to make changes of the data transparent to the user. It should be visible to the user, when information has been changed, for example when a composition has been published, or other data is corrected. Hence there is some change history.<br />
However, not all changes should be mentioned &#8211; simple corrections of typos etc. should be ignored.<br />
Finally, the versions must span several tables as there are a lot one-to-many or many-to-many relations.</li>
<li>Synchronisation:<br />
Most of the research is done offline, for example in libraries or when travelling. Therefore there exist two installations, both being &#8220;productive&#8221;: the official homepage plus an offline installation which is used during the research.</li>
</ol>
<p>Both problems can be solved, but there is no &#8220;out-of-the box&#8221; solution. There will be some detail about how to solve these two issues in a Rails application in following posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2009/07/haynes-catalog-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Redesign of Beauty of Code</title>
		<link>http://beauty-of-code.de/2009/06/redesign-of-beauty-of-code/</link>
		<comments>http://beauty-of-code.de/2009/06/redesign-of-beauty-of-code/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 18:21:36 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Timeline]]></category>
		<category><![CDATA[Visualization]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=116</guid>
		<description><![CDATA[In the last weeks I completely changed the design of this site. It became much lighter and I removed some plugins which I didn&#8217;t want to use anymore. In particular, I removed the simile timeline on the left.
In the previous design, I used the WP Simile Timeline plugin to show the timeline of the blog entries. [...]]]></description>
			<content:encoded><![CDATA[<p>In the last weeks I completely changed the design of this site. It became much lighter and I removed some plugins which I didn&#8217;t want to use anymore. In particular, I removed the simile timeline on the left.</p>
<p>In the previous design, I used the <a href="http://wordpress.org/extend/plugins/wp-simile-timeline/">WP Simile Timeline plugin</a> to show the timeline of the blog entries. This was a vertical timeline located in the left sidebar. The problem was that vertical timelines are pretty complicated to design and the simile timeline doesn&#8217;t really support a vertical layout. Therefore I chose to change to a horizontal blog timeline as part of the redesign. At the same time I realized that the timeline doesn&#8217;t fit to the overall design.</p>
<p>Hence I wrote my own timeline implementation using jQuery and embedded it in the new layout. Each small vertical tick in the header corresponds to a blog entry. If you hover over it, the link to the blog entry is shown.</p>
<p>Currently there are only few features:</p>
<ol>
<li>RSS feed: the timeline implementation reads the RSS feed of the site an creates the div elements for the timeline.</li>
<li>Custom creation of events:  create a div and call a simple javascript method to add an event.</li>
<li>Design completely using CSS: it is very difficult to change the theme of the simile timeline. The timeline above can be adjusted using very simple CSS.</li>
</ol>
<p>But of course, it still can (and needs) to be enhanced.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2009/06/redesign-of-beauty-of-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cumulus plugin for Wordpress</title>
		<link>http://beauty-of-code.de/2009/06/cumulus-plugin-for-wordpress/</link>
		<comments>http://beauty-of-code.de/2009/06/cumulus-plugin-for-wordpress/#comments</comments>
		<pubDate>Wed, 17 Jun 2009 22:19:56 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Visualization]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=102</guid>
		<description><![CDATA[In the context of my Hypergraph project, I have been asked whether Hypergraph can be used to show the tags of Wordpress blogs.
To be honest, I don&#8217;t think that this would be a good idea. On this page I use the Cumulus plugin by Roy Tanck. This plugin does a good job in visualizing the [...]]]></description>
			<content:encoded><![CDATA[<p>In the context of my <a href="http://hypergraph.sourceforge.net">Hypergraph</a> project, I have been <a href="http://sourceforge.net/tracker/?func=detail&amp;atid=543676&amp;aid=2803371&amp;group_id=75356">asked</a> whether Hypergraph can be used to show the tags of Wordpress blogs.</p>
<p>To be honest, I don&#8217;t think that this would be a good idea. On this page I use the <a href="http://wordpress.org/extend/plugins/wp-cumulus/">Cumulus plugin</a> by Roy Tanck. This plugin does a good job in visualizing the tags in your blog by distributing the tags on a 3D sphere. It&#8217;s easy to use, easy to understand &#8211; so if you are looking for some appealing visualisation of your tags, use this plugin and you&#8217;re done.</p>
<p>But why don&#8217;t I write a wordpress plugin for Hypergraph? First of all I currently don&#8217;t have the time <img src='http://beauty-of-code.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> . But apart of that, I don&#8217;t think it&#8217;s fit for purpose. Hypergraph, like other tools that show trees/graphs using hyperbolic geometry, is strong when there is some exponentially growing graph structure in the background. For example the organisational structure of a company or a class hierarchy are suitable.</p>
<p>However,  this is not the case for blogs: tags are used to loosely group blog entries which are somehow related, but even if we enforce a graph structure based on tags (which I don&#8217;t really propose), it won&#8217;t work. Of course one could link all entries with the same tag(s). Of course I haven&#8217;t conducted something like a field study to analyse a significant amount of blogs in the wild, but I assume that this will just create a lot of clutter, but won&#8217;t give additional meaning. Plugins like the mentioned Cumulus plugin circumvent this problem: they show the tags and not the articles, hence reducing the number of entities to show. They also don&#8217;t link the tags &#8211; even thought this would be some interesting challenge.</p>
<p>This leaves us with two open questions: Is it possible to cluster tags such that some similarity of tags can be established? If this can be done, would this give benefit to the visitor of a blog or another site?</p>
<p>Ideas and comments are of course most welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2009/06/cumulus-plugin-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using checkstyle with bitten</title>
		<link>http://beauty-of-code.de/2008/11/using-checkstyle-with-bitten/</link>
		<comments>http://beauty-of-code.de/2008/11/using-checkstyle-with-bitten/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 22:53:35 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=29</guid>
		<description><![CDATA[Bitten is a trac plugin for continuous integration which I use for the antdiff project and it does a good job in getting the daily builds organized. One nice feature is the summary for unit tests and code coverage tools (I use corbertura). But what I was missing was a similar summary for my checkstyle [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bitten.edgewall.org/">Bitten</a> is a trac plugin for continuous integration which I use for the <a href="http://antdiff.beauty-of-code.de/">antdiff project</a> and it does a good job in getting the daily builds organized. One nice feature is the summary for unit tests and code coverage tools (I use corbertura). But what I was missing was a similar summary for my checkstyle reports.</p>
<p>But thanks to XSLT, there is a simple solution: Bitten is able to include test and coverage reports from xml files. And since checkstyle generates a xml file for the results, it was straight-forward to translate the checkstyle xml file to a xml file for bitten. The only problem is that bitten only knows the two mentioned types of reports, so I decided to use the test report. </p>
<p>And this is the (extremely simple) stylesheet:</p>
<pre class="syntax-highlight:xslt">
&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;1.0&quot;&gt;

  &lt;xsl:template match=&quot;file&quot;&gt;
    &lt;xsl:choose&gt;
      &lt;xsl:when test=&quot;count(error) = 0&quot;&gt;
        &lt;test status=&quot;success&quot; fixture=&quot;{@name}&quot; name=&quot;No checkstyle errors&quot; file=&quot;{@name}&quot; /&gt;
      &lt;/xsl:when&gt;
      &lt;xsl:otherwise&gt;
        &lt;xsl:for-each select=&quot;error&quot;&gt;
          &lt;test status=&quot;error&quot; fixture=&quot;{../@name}&quot; name=&quot;{@message}&quot; file=&quot;{../@name}&quot; /&gt;
        &lt;/xsl:for-each&gt;
      &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
  &lt;/xsl:template&gt;

  &lt;xsl:template match=&quot;checkstyle&quot;&gt;
    &lt;report category=&quot;test&quot;&gt;
      &lt;xsl:apply-templates/&gt;
    &lt;/report&gt;
  &lt;/xsl:template&gt;   

&lt;/xsl:stylesheet&gt;
</pre>
<p>Translating the checkstyle xml report using this stylesheet allows you to treat checkstyle results in the same way as unit test failures.</p>
<p>But there is one slight problem: the file names in the checkstyle xml are absolute file names. Hence also the file names in the bitten build summary are absolute. In my setup this means having something like &#8220;/tmp/bittenFpQXrh/build_Trunk_22&#8243; in front of the name, which doesn&#8217;t look good and it also breaks the link to the source code. The simple solution was to remove the path name from the checkstyle report using the following ant task:</p>
<blockquote><p><span>&lt;replace</span><span> </span><span>file=</span>&#8220;${dir.reports}/checkstyle_report.xml&#8221;<span> </span><span>token=</span>&#8220;${basedir}&#8221;<span> </span><span>value=</span>&#8220;&#8221;<span>/&gt;</span></p></blockquote>
<p>Maybe it would be nice not to link the checkstyle results to the source code, but rather to the html reports which give more information about the details of the problem.</p>
<p>Please see on of the <a href="http://antdiff.beauty-of-code.de/build/Trunk/31">antdiff build status pages</a> as an example (click on &#8220;Test results&#8221; in the checkstyle section).</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2008/11/using-checkstyle-with-bitten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ideas for analysing legacy code</title>
		<link>http://beauty-of-code.de/2008/05/ideas-for-analysing-legacy-code/</link>
		<comments>http://beauty-of-code.de/2008/05/ideas-for-analysing-legacy-code/#comments</comments>
		<pubDate>Sat, 31 May 2008 09:13:57 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Visualization]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.beauty-of-code.de/?p=10</guid>
		<description><![CDATA[Basildon Coder wrote about the P.G.Wodehouse method of Refactoring, which reminded me of a graphic I have seen at the Museum of Modern Art in &#8216;Design and the elastic mind&#8217;: Code Profiles by W. Bradford Pailey. A demo how the graphic evolved can be seen on the site of the Whitney Museum.
The basic idea is [...]]]></description>
			<content:encoded><![CDATA[<p>Basildon Coder wrote about the <a href="http://basildoncoder.com/blog/2008/03/21/the-pg-wodehouse-method-of-refactoring/">P.G.Wodehouse method of Refactoring</a>, which reminded me of a graphic I have seen at the Museum of Modern Art in &#8216;Design and the elastic mind&#8217;: <a href="http://www.moma.org/exhibitions/2008/elasticmind/#/47/">Code Profiles</a> by W. Bradford Pailey. A demo how the graphic evolved can be seen on the site of the <a href="http://artport.whitney.org/commissions/codedoc/Paley/CodeProfiles_800x600.htm">Whitney Museum</a>.</p>
<p>The basic idea is to have a program on one single page / in one single graphic, which shows the overall structure and density of the program part you are looking at. Bradford Pailey adds an overlay that shows the actual execution path on top of the code.</p>
<p>I wonder whether this idea, which is currently art rather than a programming tool,  can actually be implemented as part of an IDE plugin (I&#8217;m thinking of Eclipse as I&#8217;m working with Eclipse 99% of my time). </p>
<p>The code is of course already available in any IDE and profiling data could be obtained from the <a href="http://www.eclipse.org/tptp/">Eclipse Test and Performance Platform</a> or other profiling tools.</p>
<p>However, it&#8217;s not yet clear to me how the interaction between the different classes and packages can be covered. The graphic by Bradford Pailey shows a program that consists of one file only &#8211; at least that&#8217;s what it looks like.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2008/05/ideas-for-analysing-legacy-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
