<?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</title>
	<atom:link href="http://beauty-of-code.de/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>Complex Joins in CouchDB</title>
		<link>http://beauty-of-code.de/2010/07/complex-joins-in-couchdb/</link>
		<comments>http://beauty-of-code.de/2010/07/complex-joins-in-couchdb/#comments</comments>
		<pubDate>Thu, 29 Jul 2010 13:46:09 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CouchDB]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=194</guid>
		<description><![CDATA[By nature of all so-called „No-SQL“ databases, there is no query language which offers the same expressiveness as SQL. In particular, there is no notion like “joins”. In most cases, this is not an issue since the more flexible structure of a document makes it unnecessary to distribute information to different tables, i.e. there is [...]]]></description>
			<content:encoded><![CDATA[<p>By nature of all so-called „No-SQL“ databases, there is no query language which offers the same expressiveness as SQL. In particular, there is no notion like “joins”. In most cases, this is not an issue since the more flexible structure of a document makes it unnecessary to distribute information to different tables, i.e. there is simply nothing to join.</p>
<p>However, if you need to do something similar to joins, there is a solution: view collations. The original idea has already been described <a href="http://www.cmlenz.net/archives/2007/10/couchdb-joins">by Christopher Lenz back in 2007</a>. With CouchDB version 0.11, the <a href="http://blog.couch.io/post/446015664/whats-new-in-apache-couchdb-0-11-part-two-views">include_docs parameter improves this approach</a>.</p>
<p>Combining view collation with appropriate list functions provides an easy way to combine several documents into one complex JSON document which can be queried.</p>
<p>Let’s look at an example of a many-to-many relationship based on the data model I use for the Haynes catalog. A “work” represents a piece of music which has been written by one or more “composers”. Needless to say, a composer may have written several works. Users can add comments to works. For various reasons I would like to keep these three types of documents normalized, i.e. works, composers and comments are stored in different components.</p>
<p>In a CouchApp, I would like to render a work including composer information and the comments. Since the result should be search-engine friendly, I would like to avoid javascript to load the data asynchronously.</p>
<p>Ideally, I would like to have an enhanced work document which includes an array of composers and comments.</p>
<p>To see how this can be done, let’s look at an example:</p>
<pre>{_id: “work_1”, type: ”work”, title: “Title of work 1”, composer_ids: [“composer_1”, “composer_2”] }
{_id: “composer_1”, type: ”composer”, name: “Name of composer 1” }
{_id: “composer_2”, type: ”composer”, name: “Name of composer 2” }
{_id: “comment_1”, type: “comment”, text: “Comment for work 1”, work_id: “work_1” }
{_id: “comment_2”, type: “comment”, text: “Another comment for work 2”, work_id: “work_1” }</pre>
<p>As you can see, there is one work written by two composers and having two comments.</p>
<p>I would like to create the following document which could be used in my template to render html:</p>
<pre>{_id: “work_1”, type: ”work”, title: “Title of work 1”,
    composers: [
        {_id: “composer_1”, type: ”composer”, name: “Name of composer 1” },
        {_id: “composer_2”, type: ”composer”, name: “Name of composer 2” }],
    comments: [
        {_id: “comment_1”, type: “comment”, text: “Comment for work 1”, work_id: “work_1”},
        {_id: “comment_2”, type: “comment”, text: “Another comment for work 2”, work_id: “work_1”}]
}</pre>
<p>Wouldn’t it be great if I could use this document in may template and simply write &lt;%= work.composers[0].name %&gt; instead of ajax calls?</p>
<p>Combining the known techniques from above with a list function, gives you exactly this possibility. Let’s start with the map function for the view called “works”:</p>
<pre>function (doc) {
	if (doc.type == "work") {
		emit([doc._id], {_id:doc._id});
		for (var ix in doc.composer_ids) {
			emit([id, "composers", ix], {_id: doc.composer_ids[ix]});
		}
	}
	if (doc.type == "comment") {
		emit([doc.work_id, "comments", doc._id], {_id: doc._id});
	}
}</pre>
<p>There is no reduce function for this view. Actually there is an approach to use <a href="http://chrischandler.name/couchdb/view-collation-for-join-like-behavior-in-couchdb/">reduce functions to merge the documents into one document</a><a href="http://chrischandler.name/couchdb/view-collation-for-join-like-behavior-in-couchdb/"></a>, but as you can see in the comments to this article this is not advised for larger data sets.</p>
<p>Instead, we use a list function, let’s call it “join”:</p>
<pre>function(head, req) {
    provides("json", function() {
        var data = [];
        var dataItem = {};
        var row, key;
        while (row = getRow()) {
            if (row.key.length == 1) {
                if (dataItem._id &amp;&amp; dataItem._id != row.value._id) {
                    data.push(dataItem);
                }
                dataItem = row.doc;
            } else {
                object = dataItem;
                for (var i = 1; i &lt; row.key.length - 1; i++) {
                    if (!(row.key[i] in object))
                        object[row.key[i]] = [];
                    object = object[row.key[i]];
                }
                object[row.key[row.key.length - 1]] = row.doc;
            }
        }
        data.push(dataItem);
        return toJSON(data);
    });
}</pre>
<p>Before we go into detail what happens in this method, let’s look at the result of the query http://localhost:5984/db_name/_design/design_name/_list/join/works?include_docs=true&amp;startkey=[“work_1”]&amp;endkey=[“work_1”,{}]:</p>
<pre>
[{_id: “work_1”, type: ”work”, title: “Title of work 1”,
    composers: [
        {_id: “composer_1”, type: ”composer”, name: “Name of composer 1” },
        {_id: “composer_2”, type: ”composer”, name: “Name of composer 2” }],
    comments: [
        {_id: “comment_1”, type: “comment”, text: “Comment for work 1”, work_id: “work_1”},
        {_id: “comment_2”, type: “comment”, text: “Another comment for work 2”, work_id: “work_1”}]
}]
</pre>
<p>The result is an array of the enhanced work documents. In a real example, the “data” array or rather only the first element would be used in a template to provide html instead of json, but you get the idea.</p>
<p>Now let’s have a closer look at what happens in the list function. If the key is an array with only one element (row.key.length == 1), we store the corresponding document. If we encounter a new one, we push the old one as this is obviously completely processed.</p>
<p>If the key has more than 1 element, the additional elements contain the property names of the final document which should contain the document. For example the key [“work_1”, “composers”, 0] means that work[“composers”][0] (=work.composer[0]) should contain the document for this key. The for loop makes sure that the properties exist (if not, they are initialised as []). Finally the document can be stored in the property.</p>
<p>As a result, you can create arbitrarily complex compound objects joining several separate documents. As you will typically join only a relative small number of documents, the list function performs well.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2010/07/complex-joins-in-couchdb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proposal for graph readers in JGraphT</title>
		<link>http://beauty-of-code.de/2010/07/proposal-for-graph-readers-in-jgrapht/</link>
		<comments>http://beauty-of-code.de/2010/07/proposal-for-graph-readers-in-jgrapht/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 12:07:47 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Hypergraph]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[JGraphT]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=169</guid>
		<description><![CDATA[One part of my development on Hypergraph which I recently started again after a long break is to replace my own graph implementation with JGraphT. JGrapht is a nice framework to create graph structures in Java and it offers various algorithms to process graphs. For the hyperbolic graph visualisation I do with Hypergraph, this is [...]]]></description>
			<content:encoded><![CDATA[<p>One part of my development on <a href="http://hypergraph.sourceforge.net">Hypergraph</a> which I recently <a href="2010/07/reanimating-hypergraph">started again</a> after a long break is to replace my own graph implementation with <a href="http://jgrapht.org">JGraphT</a>. JGrapht is a nice framework to create graph structures in Java and it offers various algorithms to process graphs. For the hyperbolic graph visualisation I do with Hypergraph, this is a very good alternative to my self-written “graph library”. It also includes the possibility to serialise graphs using for example the GraphViz dot format or the GraphML XML format. However, it doesn’t offer any possibility to read these graph formats.</p>
<p>The following is a proposal how to create readers for JGraphT. Please feel free to leave a comment, an additional proposal etc.</p>
<p><strong>The GraphReader interface</strong></p>
<p>The parsing of a file and the creation of the graph should be done by a instances of a common GraphReader interface. This interface could be:</p>
<pre>public interface GraphReader&lt;V, E&gt; {
    public void setComponentAttributeProvider(ComponentAttributeProvider&lt;?&gt; attributeProvider);

    public Graph&lt;V, E&gt; read(String filename,
        VertexFactory&lt;V&gt; vertexFactory, EdgeFactory&lt;V, E&gt; edgeFactory);

    public Graph&lt;V, E&gt; read(InputStream inputStream,
        VertexFactory&lt;V&gt; vertexFactory, EdgeFactory&lt;V, E&gt; edgeFactory);

    public Graph&lt;V, E&gt; read(URL url,
        VertexFactory&lt;V&gt; vertexFactory, EdgeFactory&lt;V, E&gt; edgeFactory);

}</pre>
<p>The ComponentAttributeProvider can be provided before creating the graph; in this case, attributes like weight, color or other information provided in the file will be stored in the ComponentAttributeProvider. This is not mandatory – if not available, the attributes are simply ignored. For a discussion about storing the attributes, see below.</p>
<p>The read methods return a Graph instance; the actual type of the graph depends on the data in the file. For example the graph format can define a graph as directed/undirected (for example “digraph” in the dot format); the created graph may hence be a DirectedGraph or an UndirectedGraph.</p>
<p><strong>Questions</strong>:</p>
<ol>
<li>Which read methods should be implemented? Are the three methods I mentioned above enough?</li>
<li>Which parameters should the read methods have? Shold we offer read methods without an EdgeFactory, which default to ClassBasedEdgeFactory?</li>
<li>How should exceptions (IOException etc) be handled? This includes parsing errors (wrong format).</li>
</ol>
<p><strong>Generic Reader</strong></p>
<p>There should be a generic class which hides the complexity of choosing the correct parser. When this generic reader is used, the only information passed to the reader might be a file name or even only an input stream. The reader should derive information about the format by analysing for example the file name, the mime type or the format of the actual data, based on some heuristics.</p>
<p>Some example for heuristics:</p>
<ol>
<li>if the file name is given and ends with “.xml” or “.dot” =&gt; the file is an xml or dot file and the corresponding reader is used</li>
<li>if the mime type is available, use xml reader for the xml mime type</li>
<li>if the first bytes “look like” a dot file (i.e. the file starts according to the dot grammar [strict] (graph | digraph) ), use the dot reader</li>
</ol>
<p>Example how to use such a generic reader:</p>
<pre>    GraphReader&lt;V, E&gt; reader = new GenericReader&lt;V, E&gt;();
    ComponentAttributeProvider attributeProvider = new DefaultComponentAttributeProvider();
    reader.setAttributeProvider(attributeProvider);
    Graph&lt;V, E&gt; graph = reader.read(“some_file.dot”, vertexFactory);</pre>
<p>In this case, the read(..) methods would assume that the file has the dot format because of the file name. It would instantiate a corresponding reader (say DOTReader) and delegate the actual parsing to this reader.</p>
<p><strong>Storing attributes on vertices and edges</strong></p>
<p>Most graph formats include attributes for vertices and edges, for example a weight or color information. There must be a way to store these attributes either on the graph elements (i.e. vertices or edges) themselves or by maintaining a map for each element which stores the attribute keys and corresponding values. I prefer the second approach for two reasons:</p>
<ol>
<li>There exists already a ComponentAttributeProvider which has been introduced to support attributes when dot files are created.</li>
<li>Storing the attributes on the elements would imply that the elements implement some interface, probably an interface which defines something like “Object getAttribute(String key)”. This would contradict the philosophy of JgraphT since the JgraphT code makes no assumption on the vertices and edges at all.</li>
</ol>
<p>Hence the readers should store any attributes using ComponentAttributeProvider (probably in a slightly enhanced version) and should make no assumptions on the elements. Even then, there are different ways to work with the attributes:</p>
<dl>
<dt>Variant 1:</dt>
<dd>The vertex and edge classes don’t know about the attributes; to access the attributes, the program has to access the ComponentAttributeProvider.</dd>
<dt>Variant 2:</dt>
<dd>The elements are instances of a special class which “knows” about the attribute provider. The vertex/edge class has accessors to for example a label (i.e. public String getLabel()) and the implementation of this method delegates to the attribute provider. In particular, the elements don’t store the actual attribute values.</dd>
<dt>Variant 3:</dt>
<dd>The elements store the actual attribute values and offer appropriate accessors. The attribute provider knows the type of the element and when getAttributes() is called, the attribute provider creates a map and initialises it with the attributes read from the vertex.</dd>
</dl>
<p>Both variant 2 and 3 assume that there is a special vertex or edge class; this is possible because the Reader accepts a VertexFactory and EdgeFactory.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2010/07/proposal-for-graph-readers-in-jgrapht/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<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>Setting Debug level in CouchDB</title>
		<link>http://beauty-of-code.de/2009/11/setting-debug-level-in-couchdb/</link>
		<comments>http://beauty-of-code.de/2009/11/setting-debug-level-in-couchdb/#comments</comments>
		<pubDate>Sun, 01 Nov 2009 23:01:09 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[CouchDB]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=145</guid>
		<description><![CDATA[I have experimented with CouchDB in the last days and wanted to switch on the debug level. I thought this could be done when starting the couchdb server, but this wouldn&#8217;t work.
The solution was simply to set the level in the ini file (e.g. /usr/local/etc/couchdb/local.ini):
[log]
level = debug
This may be useful from time to time.
]]></description>
			<content:encoded><![CDATA[<p>I have experimented with CouchDB in the last days and wanted to switch on the debug level. I thought this could be done when starting the couchdb server, but this wouldn&#8217;t work.</p>
<p>The solution was simply to set the level in the ini file (e.g. /usr/local/etc/couchdb/local.ini):</p>
<pre>[log]
level = debug</pre>
<p>This may be useful from time to time.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2009/11/setting-debug-level-in-couchdb/feed/</wfw:commentRss>
		<slash:comments>0</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>Event tracking available in Google Analytics</title>
		<link>http://beauty-of-code.de/2009/06/event-tracking-available-in-google-analytics/</link>
		<comments>http://beauty-of-code.de/2009/06/event-tracking-available-in-google-analytics/#comments</comments>
		<pubDate>Tue, 16 Jun 2009 17:31:18 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[Google Analytics]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=86</guid>
		<description><![CDATA[In a recent entry on the Google Analytics blog, Nick Mihailovski published that GA now offers event tracking. After doing some setup like adding categories to your GA account, this works by simply calling the Javascript function _trackEvent:
trackEvent(category, action, optional_label, optional_value)
Since this can be called in any context, it allows you track something standard as [...]]]></description>
			<content:encoded><![CDATA[<p>In a recent entry on the Google Analytics blog, Nick Mihailovski published that GA now offers <a href="http://analytics.blogspot.com/2009/06/event-tracking-now-available-in-all.html">event tracking</a>. After doing some setup like adding categories to your GA account, this works by simply calling the Javascript function _trackEvent:</p>
<p><code>trackEvent(category, action, optional_label, optional_value)</code></p>
<p>Since this can be called in any context, it allows you track something standard as downloads, but for example also whether your fancy drop down menu is actually used.</p>
<p>For details about this, see the <a href="http://code.google.com/intl/de-DE/apis/analytics/docs/tracking/eventTrackerGuide.html">documentation on google code</a> or a <a href="http://www.epikone.com/blog/2007/10/16/event-tracking-pt-1-overview-data-model/">tutorial</a>. Actually the mentioned tutorial is from 2007 &#8211; at this time the functionality wasn&#8217;t available to all accounts. It should still be valid though.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2009/06/event-tracking-available-in-google-analytics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Analytics API coming soon?</title>
		<link>http://beauty-of-code.de/2008/11/google-analytics-api-coming-soon/</link>
		<comments>http://beauty-of-code.de/2008/11/google-analytics-api-coming-soon/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 23:47:26 +0000</pubDate>
		<dc:creator>Jens</dc:creator>
				<category><![CDATA[Visualization]]></category>
		<category><![CDATA[Google Analytics]]></category>

		<guid isPermaLink="false">http://beauty-of-code.de/?p=43</guid>
		<description><![CDATA[Google announced on their blog that a data export API is currently in private beta. Hopefully it will be public soon. This will boost a lot of new applications which will help to analyse the GA data.
To get an impression what can be done with an API, look at Nicolas Lierman&#8217;s pictures showing the traffic on his [...]]]></description>
			<content:encoded><![CDATA[<p>Google <a href="http://analytics.blogspot.com/2008/10/more-enterprise-class-features-added-to.html">announced</a> on their blog that a data export API is currently in private beta. Hopefully it will be public soon. This will boost a lot of new applications which will help to analyse the GA data.</p>
<p>To get an impression what can be done with an API, look at Nicolas Lierman&#8217;s <a href="http://www.aboutnico.be/wp-trackback.php?p=3">pictures</a> showing the traffic on his site. I can imagine that based on the new API, more and especially interactive visualisation like this will occur.</p>
]]></content:encoded>
			<wfw:commentRss>http://beauty-of-code.de/2008/11/google-analytics-api-coming-soon/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>
	</channel>
</rss>
