<?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>erlendaakre.com &#187; trekwar</title>
	<atom:link href="http://www.erlendaakre.com/tag/trekwar/feed" rel="self" type="application/rss+xml" />
	<link>http://www.erlendaakre.com</link>
	<description>Erlend Aakre's blog</description>
	<lastBuildDate>Wed, 18 Jan 2012 12:56:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Pentecost programming</title>
		<link>http://www.erlendaakre.com/pentecost-programming.html</link>
		<comments>http://www.erlendaakre.com/pentecost-programming.html#comments</comments>
		<pubDate>Mon, 13 Jun 2011 20:05:36 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[klingon]]></category>
		<category><![CDATA[multiplayer]]></category>
		<category><![CDATA[startrek game]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=1526</guid>
		<description><![CDATA[For some reason almost everyone in Norway have the day of on &#8220;Pentecost Monday&#8221;. Not that I&#8217;m complaining, I slept until noon, got up to watch Doctor Who and Game of Thrones, but also managed to get lots of work done on my Startrek Game. The game is almost ready for a little pre-alpha test [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason almost everyone in Norway have the day of on &#8220;Pentecost Monday&#8221;. Not that I&#8217;m complaining, I slept until noon, got up to watch Doctor Who and Game of Thrones, but also managed to get lots of work done on <a title="Trekwar" href="http://www.trekwar.org">my Startrek Game</a>.</p>
<p>The game is almost ready for a little pre-alpha test which I&#8217;ve got about 15 volunteers ready for. Today I completed the final feature that will be implemented before this test, and maybe the most important feature of them all.</p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2011/06/trekwar_ship_combat.jpg"><img class="alignnone size-medium wp-image-1527" title="trekwar_ship_combat" src="http://www.erlendaakre.com/wp-content/uploads/2011/06/trekwar_ship_combat-300x204.jpg" alt="Trekwar Ship Combat" width="300" height="204" /></a></p>
<p>It was nice to see those stupid fleets that have been moving around my screen finally do something violent. My technologically superior (I cheat) scoutship blew that poor Klingon while taking almost no damage.</p>
<p>Implementing the combat between spaceships took about 5-6 hours of work today (lots of rules for selecting which ships to fight, calculate if they hit, calculate damage, etc..), so now I can start working on the testing scenario that all the testers will be playing through before the big multiplayer test starts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/pentecost-programming.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Toodledo API (simple java version)</title>
		<link>http://www.erlendaakre.com/toodledo-api-simple-java-version.html</link>
		<comments>http://www.erlendaakre.com/toodledo-api-simple-java-version.html#comments</comments>
		<pubDate>Sun, 05 Jun 2011 13:15:09 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[documentbuilderfactory]]></category>
		<category><![CDATA[dom document]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[inputstreamreader]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java implementation]]></category>
		<category><![CDATA[java object]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[star trek]]></category>
		<category><![CDATA[star trek game]]></category>
		<category><![CDATA[Toodledo]]></category>
		<category><![CDATA[Toodledo api]]></category>
		<category><![CDATA[trekwar]]></category>
		<category><![CDATA[w3c dom]]></category>
		<category><![CDATA[wiki]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=1449</guid>
		<description><![CDATA[Wanted to get a list of all the bugs for my Star Trek game, that I have registered at Toodledo and have them listed on the Trekwar wiki. Toodledo offers a nicely done API, but there was no java implementation, there were a couple of unofficial ones, but I decided to write my own very [...]]]></description>
			<content:encoded><![CDATA[<p>Wanted to get a list of all the bugs for my <a title="Trekwar" href="http://www.trekwar.org/">Star Trek game</a>, that I have registered at <a title="Toodledo" href="http://www.toodledo.com">Toodledo </a>and have them listed on the Trekwar <a title="Trekwar bugs" href="http://www.trekwar.org/Wiki.jsp?page=Bugs">wiki</a>.</p>
<p>Toodledo offers a nicely done API, but there was no java implementation, there were a couple of unofficial ones, but I decided to write my own very simple basic program for connecting to Toodledo and getting all the tasks as XML, and parsing them into a simple Java object. So if you&#8217;re doing something similar, this program might be a nice place to start. To keep it as short as possible, comments and exception handling is pretty much not there <img src='http://www.erlendaakre.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>download the file: <a href="http://www.erlendaakre.com/wp-content/uploads/2011/06/Toodledoo2html.txt">Toodledo2html.java</a></p>
<div id="wpshdo_1" class="wp-synhighlighter-outer"><div id="wpshdt_1" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_1"></a><a id="wpshat_1" class="wp-synhighlighter-title" href="#codesyntax_1"  onClick="javascript:wpsh_toggleBlock(1)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_1" onClick="javascript:wpsh_code(1)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_1" onClick="javascript:wpsh_print(1)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_1" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">import</span> <span class="co2">java.io.BufferedReader</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.io.IOException</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.io.InputStreamReader</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.io.StringReader</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.net.MalformedURLException</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.net.URL</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.net.URLConnection</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.security.MessageDigest</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.security.NoSuchAlgorithmException</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.util.ArrayList</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.util.logging.Level</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">java.util.logging.Logger</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">javax.xml.parsers.DocumentBuilder</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">javax.xml.parsers.DocumentBuilderFactory</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">javax.xml.parsers.ParserConfigurationException</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.w3c.dom.Document</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.w3c.dom.Element</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.w3c.dom.NodeList</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.xml.sax.InputSource</span><span class="sy0">;</span>
<span class="kw1">import</span> <span class="co2">org.xml.sax.SAXException</span><span class="sy0">;</span>
&nbsp;
<span class="kw1">class</span> Task <span class="br0">&#123;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> id<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> title<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> modified<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> completed<span class="sy0">;</span>
&nbsp;
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> folder<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> context<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> tag<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> status<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> priority<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> length<span class="sy0">;</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> note<span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw1">public</span> <span class="kw1">class</span> Toodledoo2html <span class="br0">&#123;</span>
    <span class="co1">// TODO you must get the 4 values below from Toodledo</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> appID <span class="sy0">=</span> <span class="st0">&quot;x&quot;</span><span class="sy0">;</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> userID <span class="sy0">=</span> <span class="st0">&quot;x&quot;</span><span class="sy0">;</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> userPW <span class="sy0">=</span> <span class="st0">&quot;x&quot;</span><span class="sy0">;</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> applicationToken <span class="sy0">=</span> <span class="st0">&quot;x&quot;</span><span class="sy0">;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> fields <span class="sy0">=</span> <span class="st0">&quot;folder,context,tag,status,priority,length,note&quot;</span><span class="sy0">;</span> <span class="co1">// get these fields when downloading tasks</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> sessionToken<span class="sy0">;</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> key<span class="sy0">;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> toodledoTokenURL <span class="sy0">=</span> <span class="st0">&quot;https://api.toodledo.com/2/account/token.php&quot;</span><span class="sy0">;</span>
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> toodledoGetTaskURL <span class="sy0">=</span> <span class="st0">&quot;https://api.toodledo.com/2/tasks/get.php&quot;</span><span class="sy0">;</span>
&nbsp;
    <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw4">void</span> main<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a><span class="br0">&#91;</span><span class="br0">&#93;</span> args<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        sessionToken <span class="sy0">=</span> getSessionToken<span class="br0">&#40;</span>md5<span class="br0">&#40;</span>userID<span class="sy0">+</span>applicationToken<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        key <span class="sy0">=</span> md5<span class="br0">&#40;</span>md5<span class="br0">&#40;</span>userPW<span class="br0">&#41;</span><span class="sy0">+</span>applicationToken<span class="sy0">+</span>sessionToken<span class="br0">&#41;</span><span class="sy0">;</span>
        ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span> tasks <span class="sy0">=</span> getTasks<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="co1">// do whatever to tasks</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span> getTasks<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">try</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> data <span class="sy0">=</span> <span class="st0">&quot;?key=&quot;</span> <span class="sy0">+</span> key <span class="sy0">+</span> <span class="st0">&quot;;fields=&quot;</span> <span class="sy0">+</span> fields <span class="sy0">+</span> <span class="st0">&quot;;f=xml&quot;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;Getting tasks: &quot;</span> <span class="sy0">+</span> toodledoGetTaskURL <span class="sy0">+</span> data<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurl+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URL</span></a> url <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurl+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URL</span></a><span class="br0">&#40;</span>toodledoGetTaskURL <span class="sy0">+</span> data<span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurlconnection+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URLConnection</span></a> connection <span class="sy0">=</span> url.<span class="me1">openConnection</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            connection.<span class="me1">setDoOutput</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abufferedreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BufferedReader</span></a> in <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abufferedreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BufferedReader</span></a><span class="br0">&#40;</span><span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstreamreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStreamReader</span></a><span class="br0">&#40;</span>connection.<span class="me1">getInputStream</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            StringBuilder xml <span class="sy0">=</span> <span class="kw1">new</span> StringBuilder<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> line <span class="sy0">=</span> in.<span class="me1">readLine</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">while</span><span class="br0">&#40;</span> line <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>line<span class="br0">&#41;</span><span class="sy0">;</span>
                xml.<span class="me1">append</span><span class="br0">&#40;</span>line<span class="br0">&#41;</span><span class="sy0">;</span>
                line <span class="sy0">=</span> in.<span class="me1">readLine</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="br0">&#125;</span>
            in.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span> tasks <span class="sy0">=</span> xmlToTasks<span class="br0">&#40;</span>xml.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <span class="kw1">for</span><span class="br0">&#40;</span>Task t <span class="sy0">:</span> tasks<span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>t.<span class="me1">id</span> <span class="sy0">+</span> <span class="st0">&quot; &quot;</span> <span class="sy0">+</span> t.<span class="me1">title</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="br0">&#125;</span>
            <span class="kw1">return</span> tasks<span class="sy0">;</span>
&nbsp;
        <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Amalformedurlexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">MalformedURLException</span></a> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>ex<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">IOException</span></a> ioe<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>ioe<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">return</span> <span class="kw2">null</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span> xmlToTasks<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> xml<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span> taskList <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>Task<span class="sy0">&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
        <span class="kw1">try</span> <span class="br0">&#123;</span>
            DocumentBuilderFactory dbf <span class="sy0">=</span> DocumentBuilderFactory.<span class="me1">newInstance</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            DocumentBuilder db <span class="sy0">=</span> dbf.<span class="me1">newDocumentBuilder</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adocument+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Document</span></a> doc <span class="sy0">=</span> db.<span class="me1">parse</span><span class="br0">&#40;</span><span class="kw1">new</span> InputSource<span class="br0">&#40;</span><span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astringreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">StringReader</span></a><span class="br0">&#40;</span>xml<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a> root <span class="sy0">=</span> doc.<span class="me1">getDocumentElement</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            NodeList tasks <span class="sy0">=</span> root.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span><span class="st0">&quot;task&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> tasks.<span class="me1">getLength</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a> task <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a><span class="br0">&#41;</span> tasks.<span class="me1">item</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
                Task t <span class="sy0">=</span> <span class="kw1">new</span> Task<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">id</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;id&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">title</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;title&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">modified</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;modified&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">completed</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;completed&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
                t.<span class="me1">folder</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;folder&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">context</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;context&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">tag</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;tag&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">status</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;status&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">priority</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;priority&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">length</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;length&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                t.<span class="me1">note</span> <span class="sy0">=</span> getDomTextValue<span class="br0">&#40;</span>task, <span class="st0">&quot;note&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                taskList.<span class="me1">add</span><span class="br0">&#40;</span>t<span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="br0">&#125;</span>
&nbsp;
        <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span>ParserConfigurationException ex<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            Logger.<span class="me1">getLogger</span><span class="br0">&#40;</span>Toodledoo2html.<span class="kw1">class</span>.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>.<span class="me1">log</span><span class="br0">&#40;</span>Level.<span class="me1">SEVERE</span>, <span class="kw2">null</span>, ex<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">catch</span><span class="br0">&#40;</span>SAXException se<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
        <span class="br0">&#125;</span>
        <span class="kw1">catch</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">IOException</span></a> ioe<span class="br0">&#41;</span> <span class="br0">&#123;</span>
&nbsp;
        <span class="br0">&#125;</span>
&nbsp;
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;xmlToTasks got &quot;</span> <span class="sy0">+</span> taskList.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">+</span> <span class="st0">&quot; tasks&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">return</span> taskList<span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getSessionToken<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> signature<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">try</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> data <span class="sy0">=</span> <span class="st0">&quot;?userid=&quot;</span> <span class="sy0">+</span> userID <span class="sy0">+</span> <span class="st0">&quot;;appid=&quot;</span> <span class="sy0">+</span> appID <span class="sy0">+</span> <span class="st0">&quot;;sig=&quot;</span> <span class="sy0">+</span> signature <span class="sy0">+</span> <span class="st0">&quot;;f=xml&quot;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;Getting session token: &quot;</span> <span class="sy0">+</span> toodledoTokenURL<span class="sy0">+</span>data<span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurl+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URL</span></a> url <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurl+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URL</span></a><span class="br0">&#40;</span>toodledoTokenURL <span class="sy0">+</span> data<span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aurlconnection+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">URLConnection</span></a> connection <span class="sy0">=</span> url.<span class="me1">openConnection</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            connection.<span class="me1">setDoOutput</span><span class="br0">&#40;</span><span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abufferedreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BufferedReader</span></a> in <span class="sy0">=</span> <span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Abufferedreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">BufferedReader</span></a><span class="br0">&#40;</span><span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainputstreamreader+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">InputStreamReader</span></a><span class="br0">&#40;</span>connection.<span class="me1">getInputStream</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> xml <span class="sy0">=</span> in.<span class="me1">readLine</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            in.<span class="me1">close</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> token <span class="sy0">=</span> xml.<span class="me1">substring</span><span class="br0">&#40;</span>xml.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;token&gt;&quot;</span><span class="br0">&#41;</span><span class="sy0">+</span><span class="nu0">7</span>, xml.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&quot;&lt;/token&gt;&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">return</span> token<span class="sy0">;</span>
        <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Amalformedurlexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">MalformedURLException</span></a> ex<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>ex<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">catch</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aioexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">IOException</span></a> ioe<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>ioe<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">return</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> md5<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> input<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">try</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Amessagedigest+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">MessageDigest</span></a> md <span class="sy0">=</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Amessagedigest+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">MessageDigest</span></a>.<span class="me1">getInstance</span><span class="br0">&#40;</span><span class="st0">&quot;MD5&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            md.<span class="me1">update</span><span class="br0">&#40;</span>input.<span class="me1">getBytes</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
            <span class="kw4">byte</span> byteData<span class="br0">&#91;</span><span class="br0">&#93;</span> <span class="sy0">=</span> md.<span class="me1">digest</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            StringBuilder sb <span class="sy0">=</span> <span class="kw1">new</span> StringBuilder<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">for</span> <span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> byteData.<span class="me1">length</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                sb.<span class="me1">append</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Integer</span></a>.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#40;</span>byteData<span class="br0">&#91;</span>i<span class="br0">&#93;</span> <span class="sy0">&amp;</span> 0xff<span class="br0">&#41;</span> <span class="sy0">+</span> 0x100, 16<span class="br0">&#41;</span>.<span class="me1">substring</span><span class="br0">&#40;</span>1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="br0">&#125;</span>
            <span class="kw1">return</span> sb.<span class="me1">toString</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span> <span class="kw1">catch</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anosuchalgorithmexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">NoSuchAlgorithmException</span></a> nse<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">err</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;ERROR. MD5 ALGORITHM NOT FOUND&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">return</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">public</span> <span class="kw1">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> getDomTextValue<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a> element, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">String</span></a> tag<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span>element <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
            NodeList nl <span class="sy0">=</span> element.<span class="me1">getElementsByTagName</span><span class="br0">&#40;</span>tag<span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="kw1">if</span> <span class="br0">&#40;</span>nl <span class="sy0">!=</span> <span class="kw2">null</span> <span class="sy0">&amp;&amp;</span> nl.<span class="me1">getLength</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">&gt;</span> 0<span class="br0">&#41;</span> <span class="br0">&#123;</span>
                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a> el <span class="sy0">=</span> <span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aelement+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Element</span></a><span class="br0">&#41;</span> nl.<span class="me1">item</span><span class="br0">&#40;</span>0<span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="kw1">if</span><span class="br0">&#40;</span>el <span class="sy0">!=</span> <span class="kw2">null</span> <span class="sy0">&amp;&amp;</span> el.<span class="me1">getFirstChild</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="sy0">!=</span> <span class="kw2">null</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
                    <span class="kw1">return</span> el.<span class="me1">getFirstChild</span><span class="br0">&#40;</span><span class="br0">&#41;</span>.<span class="me1">getNodeValue</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
                <span class="br0">&#125;</span>
            <span class="br0">&#125;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">return</span> <span class="st0">&quot;&quot;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
<p><strong>Note:</strong> This program was made to run once per hour.. running this program many times in a row will cause Toodledo to ban you for about 1 hour. When that happens there will be a IndexOutOfBoundsException -7 from the method that gets the session token. This can be fixed by saving the token you get between requests, and not asking for a new one each time (which is what causes the short ban).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/toodledo-api-simple-java-version.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Scrum tool (Jira vs Toodledo)</title>
		<link>http://www.erlendaakre.com/scrum-tool-jira-vs-toodledo.html</link>
		<comments>http://www.erlendaakre.com/scrum-tool-jira-vs-toodledo.html#comments</comments>
		<pubDate>Tue, 05 Oct 2010 18:30:13 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Abstractspoon]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[great software]]></category>
		<category><![CDATA[Jira]]></category>
		<category><![CDATA[milestone]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[planning]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[scrum]]></category>
		<category><![CDATA[scrum development]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[task]]></category>
		<category><![CDATA[task list]]></category>
		<category><![CDATA[todolist]]></category>
		<category><![CDATA[Toodledo]]></category>
		<category><![CDATA[track]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=1083</guid>
		<description><![CDATA[Up until recently I&#8217;ve been using ToDoList (read my previous post about it) to keep track of all tasks that needs to be done for the Trekwar project. Don&#8217;t get me wrong, ToDoList is very nice, except there are a few drawbacks that made me go look for a replacement. It&#8217;s Windows only, so using [...]]]></description>
			<content:encoded><![CDATA[<p>Up until recently I&#8217;ve been using <a title="ToDoList by Abstractspoon" href="http://www.abstractspoon.com/tdl_resources.html">ToDoList</a> (read my <a title="ToDoList" href="http://www.erlendaakre.com/todolist.html">previous post</a> about it) to keep track of all tasks that needs to be done for the Trekwar project.</p>
<p>Don&#8217;t get me wrong, ToDoList is very nice, except there are a few drawbacks that made me go look for a replacement.</p>
<ul>
<li>It&#8217;s Windows only, so using it from linux would be cumbersome</li>
<li>It&#8217;s not online, so I have to sync the file between different computers</li>
<li>It&#8217;s hard to share the list, or make it public (there is html report, but the output is not very nice, and you&#8217;ll have to generate the file + upload it) which is a hassle.</li>
<li>It&#8217;s hard to use this to get a good view of what is needed for a specific release (like to view every task that is needed for alpha, beta or release)</li>
</ul>
<p><strong>JIRA<br />
</strong>I&#8217;ve used <a title="JIRA" href="http://www.atlassian.com/software/jira/">JIRA</a> a bit at my real job, and it&#8217;s pretty good. It&#8217;s online, and I installed it on my server to give it a try. I quickly had to abandon that idea seeing that JIRA is extremely bloated.. It uses like 600 MB of ram just starting up, no idea what it uses the memory for, it&#8217;s not doing anything remotely fancy that would require that amount of memory.</p>
<p>So I decided to run it from my desktop computer, now I get the same problems as with ToDoList with having to sync files between computers, and difficulty making the task list public. Also the interface itself is pretty bloated and slow, even tough it has pretty nice views for planning and when doing the tasks.</p>
<p><strong>Toodledo</strong><br />
In trying once more to find the perfect tool for managing the tasks of my scrum like development, I tried out <a title="Toodledo" href="http://www.toodledo.com">Toodledo</a>. I found out about it because <a title="Minecraft" href="http://www.minecraft.net/">minecraft</a> (awesome game BTW) also uses Toodledo as a public task list. Which is good as it lets people following projects get a sense of how much work/time is needed until the next milestone.</p>
<p>Toodledo is a online to do list, and it works very nicely for scrum development. It&#8217;s quick and easy without all the bloat of JIRA and gives you pretty much the same information.</p>
<p>It&#8217;s very easy to add tasks (subtasks require a pro account which is 15$ per year, well worth the money), and you can create context&#8217;s like &#8220;alpha&#8221;, &#8220;beta&#8221;, &#8220;release&#8221;, etc.. and add folders/tags which can be anything. There are lots of different views, I mostly use the main view which has all the tasks grouped by context and sorted by priority. There is also a view for seeing all the tasks in a particular context (like alpha) and the estimated time for all the tasks. (currently 94 hours of work needed before Trekwar can go into alpha).</p>
<p>My only problem with Toodledo is that subtasks don&#8217;t show up in the public view, but it should be implemented shortly. Another great thing about Toodledo is the forum, which is frequently visited by the staff/developers.</p>
<p>So if you&#8217;re looking for a good way to organize your project, I can definitely recommend Toodledo, and you can try it for free at their website.</p>
<p>For an example you can look at the <a title="Trekwar Todo list" href="http://www.toodledo.com/views/public.php?s=9;h=0;f=0;id=td4ca2f960d2cd4">Trekwar Todo list</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/scrum-tool-jira-vs-toodledo.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trekwar Fog Of War</title>
		<link>http://www.erlendaakre.com/trekwar-fog-of-war.html</link>
		<comments>http://www.erlendaakre.com/trekwar-fog-of-war.html#comments</comments>
		<pubDate>Sat, 02 Oct 2010 23:30:58 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[comicon]]></category>
		<category><![CDATA[fog of war]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[new job]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[sensor system]]></category>
		<category><![CDATA[star trek]]></category>
		<category><![CDATA[star trek game]]></category>
		<category><![CDATA[Toodledo]]></category>
		<category><![CDATA[Trek]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=1080</guid>
		<description><![CDATA[It&#8217;s been too long since I got any programming done on my Star Trek game Trekwar, but today I managed to implement animation support on the main map, as well as get the sensor system and fog of war working (still needs a bit of tweaking): I&#8217;ve gotten a new job, and been working on [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been too long since I got any programming done on my Star Trek game <a title="Trekwar" href="http://www.trekwar.org">Trekwar</a>, but today I managed to implement animation support on the main map, as well as get the sensor system and fog of war working (still needs a bit of tweaking):</p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/10/trekwar_fog_og_war.jpg"><img class="alignnone size-medium wp-image-1081" title="trekwar_fog_og_war" src="http://www.erlendaakre.com/wp-content/uploads/2010/10/trekwar_fog_og_war-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>I&#8217;ve gotten a new job, and been working on another paying project as well (Comicon does not pay for itself you know). But this other project is almost done, and then I should be able to get back to doing regular Trekwar updates.</p>
<p>I&#8217;ve also switched over to <a title="Toodledo" href="http://www.toodledo.com">Toodledo</a> for maintaining the <a title="Trekwar todo list" href="http://www.toodledo.com/views/public.php?s=9;h=0;f=0;id=td4ca2f960d2cd4">list of features to be implemented</a>, so hopefully you can see the issues under &#8220;0.4.0 (Alpha)&#8221; shrinking over the next few months <img src='http://www.erlendaakre.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/trekwar-fog-of-war.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oups</title>
		<link>http://www.erlendaakre.com/oups.html</link>
		<comments>http://www.erlendaakre.com/oups.html#comments</comments>
		<pubDate>Sun, 14 Mar 2010 23:25:10 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Collections]]></category>
		<category><![CDATA[core classes]]></category>
		<category><![CDATA[documention]]></category>
		<category><![CDATA[equals]]></category>
		<category><![CDATA[equals method]]></category>
		<category><![CDATA[example]]></category>
		<category><![CDATA[faction]]></category>
		<category><![CDATA[generics]]></category>
		<category><![CDATA[getName]]></category>
		<category><![CDATA[instanceof]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[java collections]]></category>
		<category><![CDATA[java generics]]></category>
		<category><![CDATA[method]]></category>
		<category><![CDATA[Object]]></category>
		<category><![CDATA[star systems]]></category>
		<category><![CDATA[structure]]></category>
		<category><![CDATA[Trek]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=926</guid>
		<description><![CDATA[While cleaning up in the core classes of Trekwar yesterday (documenting functions, formatting/structuring code, minor improvements) I also saw lots of equals(Object o) methods. And in my infinite wisdom I decided to use generics since it is used pretty extensively throughout the code anyway, so I changed basically all the equals methods. example: was changed [...]]]></description>
			<content:encoded><![CDATA[<p>While cleaning up in the core classes of Trekwar yesterday (documenting functions, formatting/structuring code, minor improvements) I also saw lots of equals(Object o) methods. And in my infinite wisdom I decided to use generics since it is used pretty extensively throughout the code anyway, so I changed basically all the equals methods.</p>
<p>example:</p>
<div id="wpshdo_2" class="wp-synhighlighter-outer"><div id="wpshdt_2" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_2"></a><a id="wpshat_2" class="wp-synhighlighter-title" href="#codesyntax_2"  onClick="javascript:wpsh_toggleBlock(2)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_2" onClick="javascript:wpsh_code(2)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_2" onClick="javascript:wpsh_print(2)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_2" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">public</span> <span class="kw4">boolean</span> equals<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> o<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span><span class="br0">&#40;</span>o <span class="kw1">instanceof</span> Structure<span class="br0">&#41;</span>
            <span class="kw1">return</span> equals<span class="br0">&#40;</span><span class="br0">&#40;</span>Structure<span class="br0">&#41;</span>o<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span>
    <span class="br0">&#125;</span></pre></div></div>
<p>was changed to:</p>
<div id="wpshdo_3" class="wp-synhighlighter-outer"><div id="wpshdt_3" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_3"></a><a id="wpshat_3" class="wp-synhighlighter-title" href="#codesyntax_3"  onClick="javascript:wpsh_toggleBlock(3)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_3" onClick="javascript:wpsh_code(3)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_3" onClick="javascript:wpsh_print(3)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_3" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">public</span> <span class="kw4">boolean</span> equals<span class="br0">&#40;</span>Structure s2<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">return</span> name.<span class="me1">equals</span><span class="br0">&#40;</span>s2.<span class="me1">getName</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span></pre></div></div>
<p>Now this is not a problem when writing code, as you pretty much always compare objects of the same type. However, the code also uses the Java Collections contains() method a few places, and it always uses the equals(Object) version. So when my classes no longer provided this method, the default one inherited from java.lang.Object was used instead. This caused a strange array of bugs to appear (star systems on the map not shown with faction color/icon except for the Cardassians for some strange reason, users not having any technologies, unable to build any structures, generally erratic behavior, etc..). Luckily I discovered the cause pretty quickly and only wasted about an hour or so on this <img src='http://www.erlendaakre.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I guess the lesson is that objects that needs to be compared, directly or indirectly by contains() or other methods, should always define an equals(Object) method that just passes the call along to the equals method written with generics.</p>
<div id="wpshdo_4" class="wp-synhighlighter-outer"><div id="wpshdt_4" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_4"></a><a id="wpshat_4" class="wp-synhighlighter-title" href="#codesyntax_4"  onClick="javascript:wpsh_toggleBlock(4)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_4" onClick="javascript:wpsh_code(4)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_4" onClick="javascript:wpsh_print(4)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_4" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">public</span> <span class="kw4">boolean</span> equals<span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">Object</span></a> o<span class="br0">&#41;</span> <span class="br0">&#123;</span>
        <span class="kw1">if</span><span class="br0">&#40;</span>o <span class="kw1">instanceof</span> Structure<span class="br0">&#41;</span> <span class="br0">&#123;</span>
            <span class="kw1">return</span> equals<span class="br0">&#40;</span><span class="br0">&#40;</span>Structure<span class="br0">&#41;</span>o<span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw1">return</span> <span class="kw2">false</span><span class="sy0">;</span>
    <span class="br0">&#125;</span></pre></div></div>
<p>And perhaps that you should not mess around with your code for hours on end without stopping to test if you broke it once in a while <img src='http://www.erlendaakre.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/oups.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trekwar cargo system</title>
		<link>http://www.erlendaakre.com/trekwar-cargo-system.html</link>
		<comments>http://www.erlendaakre.com/trekwar-cargo-system.html#comments</comments>
		<pubDate>Sun, 07 Mar 2010 21:43:44 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[cargo]]></category>
		<category><![CDATA[cargo system]]></category>
		<category><![CDATA[cargo transfer]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[deuterium]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ore]]></category>
		<category><![CDATA[resource]]></category>
		<category><![CDATA[ship]]></category>
		<category><![CDATA[star trek]]></category>
		<category><![CDATA[starship]]></category>
		<category><![CDATA[starsystem]]></category>
		<category><![CDATA[starsystems]]></category>
		<category><![CDATA[strategy]]></category>
		<category><![CDATA[the da vinci code]]></category>
		<category><![CDATA[trekwar]]></category>
		<category><![CDATA[ui]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=903</guid>
		<description><![CDATA[Today I mostly finished the Trekwar Cargo system, so now it&#8217;s possible to collect resources and bring them back to your starsystems. Also included 4 images from the design and implementation of the UI: Read full devblog post at trekwar.org]]></description>
			<content:encoded><![CDATA[<p>Today I mostly finished the Trekwar Cargo system, so now it&#8217;s possible to collect resources and bring them back to your starsystems.</p>
<p>Also included 4 images from the design and implementation of the UI:</p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_1.jpg"><img class="alignnone size-full wp-image-904" title="making_gui_1" src="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_1.jpg" alt="" width="400" height="267" /></a></p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_2.png"><img class="alignnone size-full wp-image-905" title="making_gui_2" src="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_2.png" alt="" width="362" height="192" /></a></p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_3.jpg"><img class="alignnone size-full wp-image-906" title="making_gui_3" src="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_3.jpg" alt="" width="350" height="212" /></a></p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_4.jpg"><img class="alignnone size-full wp-image-907" title="making_gui_4" src="http://www.erlendaakre.com/wp-content/uploads/2010/03/making_gui_4.jpg" alt="" width="350" height="212" /></a></p>
<p>Read <a title="Trekwar Cargo System" href="http://www.trekwar.org/Wiki.jsp?page=Devblog-07032010">full devblog post</a> at <a title="Trekwar.org" href="http://www.trekwar.org">trekwar.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/trekwar-cargo-system.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trekwar sensor system</title>
		<link>http://www.erlendaakre.com/trekwar-sensor-system.html</link>
		<comments>http://www.erlendaakre.com/trekwar-sensor-system.html#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:07:50 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[fleet]]></category>
		<category><![CDATA[fog of war]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[map]]></category>
		<category><![CDATA[prototype]]></category>
		<category><![CDATA[sensor system]]></category>
		<category><![CDATA[sensors]]></category>
		<category><![CDATA[star trek]]></category>
		<category><![CDATA[Trek]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=884</guid>
		<description><![CDATA[I haven&#8217;t had much time working on Trekwar lately, but I&#8217;ve recently made a prototype of the sensor system: I&#8217;ll have to add this, as well as fog of war when I&#8217;m done with the fleet management tools which are almost ready. &#62; Read the whole devblog post @ trekwar.org]]></description>
			<content:encoded><![CDATA[<p>I haven&#8217;t had much time working on Trekwar lately, but I&#8217;ve recently made a prototype of the sensor system:</p>
<p><a href="http://www.erlendaakre.com/wp-content/uploads/2010/02/sensor2.jpg"><img class="alignnone size-full wp-image-885" title="sensor2" src="http://www.erlendaakre.com/wp-content/uploads/2010/02/sensor2.jpg" alt="" width="321" height="296" /></a></p>
<p>I&#8217;ll have to add this, as well as fog of war when I&#8217;m done with the fleet management tools which are almost ready.</p>
<p>&gt; <a title="Trekwar Sensor System" href="http://www.trekwar.org/Wiki.jsp?page=Devblog-18022010">Read the whole devblog post @ trekwar.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/trekwar-sensor-system.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Resetting password in JSPWiki</title>
		<link>http://www.erlendaakre.com/resetting-password-in-jspwiki.html</link>
		<comments>http://www.erlendaakre.com/resetting-password-in-jspwiki.html#comments</comments>
		<pubDate>Thu, 22 Oct 2009 21:20:45 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[encrypted password]]></category>
		<category><![CDATA[jsp]]></category>
		<category><![CDATA[jspwiki]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[reset]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[ssha]]></category>
		<category><![CDATA[trekwar]]></category>
		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=758</guid>
		<description><![CDATA[The Trekwar Wiki runs on JSPWiki 2.8.1 (which is pretty awesome BTW). I just reinstalled my OS and had lost the password, and the Wiki is not set up to use email, so I could not reset it by web. So I had to find a way to do it by console, and a google [...]]]></description>
			<content:encoded><![CDATA[<p>The <a title="Trekwar Wiki" href="http://www.trekwar.org/wiki/">Trekwar Wiki</a> runs on <a title="JSPWiki" href="http://www.jspwiki.org/">JSPWiki</a> 2.8.1 (which is pretty awesome BTW).</p>
<p>I just reinstalled my OS and had lost the password, and the Wiki is not set up to use email, so I could not reset it by web.</p>
<p>So I had to find a way to do it by console, and a google search did not provide a complete solution, so here it is:</p>
<ol>
<li>Log into the server where the Wiki is hosted</li>
<li>generate your new password (the password in this example is &#8220;password&#8221; and it&#8217;s hash is the green text below, you can use this if you want)<br />
<em>echo -n password | sha1sum</em></li>
<li>The command above gives you a &#8220;encrypted&#8221; password: <span style="color: #339966;">5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8</span></li>
<li><span style="color: #339966;"><span style="color: #000000;">The user database in JSPWiki is a xml file that resides in the WEB-APP directory and is called userdatabase.xml</span></span></li>
<li><span style="color: #339966;"><span style="color: #000000;">This file has a simple format, each user has a &lt;user&gt; tag. So just find the user you want to reset the password for</span></span></li>
<li><span style="color: #339966;"><span style="color: #000000;">The user tag has a password filed that looks something like this:<br />
<div id="wpshdo_5" class="wp-synhighlighter-outer"><div id="wpshdt_5" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_5"></a><a id="wpshat_5" class="wp-synhighlighter-title" href="#codesyntax_5"  onClick="javascript:wpsh_toggleBlock(5)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_5" onClick="javascript:wpsh_code(5)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_5" onClick="javascript:wpsh_print(5)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_5" class="wp-synhighlighter-inner" style="display: block;"><pre class="xml" style="font-family:monospace;">password=&quot;{SSHA}XXXXXXXXXXXXXXXXXXXXXXXXX&quot;</pre></div></div><br />
Change this to: (remember to use your own password hash if you made one, or use the green one above):<br />
</span></span><span style="color: #339966;"><span style="color: #000000;"><div id="wpshdo_6" class="wp-synhighlighter-outer"><div id="wpshdt_6" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_6"></a><a id="wpshat_6" class="wp-synhighlighter-title" href="#codesyntax_6"  onClick="javascript:wpsh_toggleBlock(6)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_6" onClick="javascript:wpsh_code(6)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_6" onClick="javascript:wpsh_print(6)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_6" class="wp-synhighlighter-inner" style="display: block;"><pre class="xml" style="font-family:monospace;">password=&quot;{SHA}YYYYYYYYYYYYYYYYYYYYYYYYYY&quot;</pre></div></div></span></span></li>
<li><span style="color: #339966;"><span style="color: #000000;">NOTE: changing from SSHA to SHA</span></span></li>
<li><span style="color: #339966;"><span style="color: #000000;">Log in with your new password (or &#8220;password&#8221; if you used the green hash above)</span></span></li>
<li><span style="color: #339966;"><span style="color: #000000;">Change your password!<br />
</span></span></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/resetting-password-in-jspwiki.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using WeakReference to confirm/find memory leaks in Java</title>
		<link>http://www.erlendaakre.com/using-weakreference-to-confirmfind-memory-leaks-in-java.html</link>
		<comments>http://www.erlendaakre.com/using-weakreference-to-confirmfind-memory-leaks-in-java.html#comments</comments>
		<pubDate>Fri, 04 Sep 2009 15:40:08 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[galaxy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[memory leak]]></category>
		<category><![CDATA[program]]></category>
		<category><![CDATA[trekwar]]></category>
		<category><![CDATA[visualvm]]></category>
		<category><![CDATA[weak reference]]></category>
		<category><![CDATA[weakreference]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=733</guid>
		<description><![CDATA[I recently had a memory leak in my Trekwar game, and to find it (or at least confirm it&#8217;s there) I used the WeakReference object in Java.. This is how I proceeded in locating the memory leak, this method could easily be adapted to other programs. Trekwar is turn based, so each turn the client [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had a memory leak in my Trekwar game, and to find it (or at least confirm it&#8217;s there) I used the WeakReference object in Java..</p>
<p>This is how I proceeded in locating the memory leak, this method could easily be adapted to other programs.</p>
<p>Trekwar is turn based, so each turn the client downloads a Galaxy object from the server. There are many references to this objects inside action listeners, threads, etc..</p>
<p><strong>WeakReference</strong><br />
To make a long story short, a weak reference is like a normal reference, except it will not prevent the object it points to from being garbage collected.</p>
<p>This means that is you  have a normal and a weak reference to object A, the weak reference will be null if you remove the &#8220;hard&#8221; reference.</p>
<p><strong>1) </strong>In the client main executable (the class that holds the method that updates the map from the server). Import, declare and make a list of weak references</p>
<div id="wpshdo_7" class="wp-synhighlighter-outer"><div id="wpshdt_7" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_7"></a><a id="wpshat_7" class="wp-synhighlighter-title" href="#codesyntax_7"  onClick="javascript:wpsh_toggleBlock(7)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_7" onClick="javascript:wpsh_code(7)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_7" onClick="javascript:wpsh_print(7)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_7" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;"><span class="kw1">import</span> <span class="co2">java.lang.ref.WeakReference</span><span class="sy0">;</span>
<span class="kw1">private</span> ArrayList<span class="sy0">&lt;</span>WeakReference<span class="sy0">&lt;</span>Galaxy<span class="sy0">&gt;&gt;</span> weakRefs<span class="sy0">;</span>
&nbsp;
weakRefs <span class="sy0">=</span> <span class="kw1">new</span> ArrayList<span class="sy0">&lt;</span>WeakReference<span class="sy0">&lt;</span>Galaxy<span class="sy0">&gt;&gt;</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div>
<p><strong>2)</strong> Find the place in your program where a new object is being added, in my place this is the localGalaxy object. Create a weak reference to this object, and list all your weak references.</p>
<div id="wpshdo_8" class="wp-synhighlighter-outer"><div id="wpshdt_8" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_8"></a><a id="wpshat_8" class="wp-synhighlighter-title" href="#codesyntax_8"  onClick="javascript:wpsh_toggleBlock(8)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_8" onClick="javascript:wpsh_code(8)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_8" onClick="javascript:wpsh_print(8)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_8" class="wp-synhighlighter-inner" style="display: block;"><pre class="java" style="font-family:monospace;">localGalaxy <span class="sy0">=</span> <span class="br0">&#40;</span>Galaxy<span class="br0">&#41;</span> objStream.<span class="me1">readObject</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
weakRefs.<span class="me1">add</span><span class="br0">&#40;</span><span class="kw1">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aweakreference+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">WeakReference</span></a><span class="br0">&#40;</span>localGalaxy<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">for</span><span class="br0">&#40;</span><span class="kw4">int</span> i <span class="sy0">=</span> <span class="nu0">0</span><span class="sy0">;</span> i <span class="sy0">&lt;</span> weakRefs.<span class="me1">size</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> i<span class="sy0">++</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">print</span><span class="br0">&#40;</span><span class="st0">&quot;ref # &quot;</span> <span class="sy0">+</span> i <span class="sy0">+</span> <span class="st0">&quot; = &quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">try</span> <span class="br0">&#123;</span>
Galaxy testG <span class="sy0">=</span> <span class="br0">&#40;</span>Galaxy<span class="br0">&#41;</span>weakRefs.<span class="me1">get</span><span class="br0">&#40;</span>i<span class="br0">&#41;</span>.<span class="me1">get</span><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span>testG <span class="sy0">+</span> <span class="st0">&quot;, tick = &quot;</span> <span class="sy0">+</span> testG.<span class="me1">currentTick</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="kw1">catch</span><span class="br0">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Anullpointerexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">NullPointerException</span></a> npe<span class="br0">&#41;</span> <span class="br0">&#123;</span>
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Asystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span class="kw3">System</span></a>.<span class="me1">out</span>.<span class="me1">println</span><span class="br0">&#40;</span><span class="st0">&quot;null&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div>
<p>And you&#8217;re done!</p>
<p>Now when you run the program, you should see something like this each time the method is called</p>
<div id="wpshdo_9" class="wp-synhighlighter-outer"><div id="wpshdt_9" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_9"></a><a id="wpshat_9" class="wp-synhighlighter-title" href="#codesyntax_9"  onClick="javascript:wpsh_toggleBlock(9)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_9" onClick="javascript:wpsh_code(9)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_9" onClick="javascript:wpsh_print(9)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_9" class="wp-synhighlighter-inner" style="display: block;"><pre class="text" style="font-family:monospace;">ref # 0 = org.aakretech.trekwar2.common.Galaxy@11ed166, tick = 37
ref # 1 = org.aakretech.trekwar2.common.Galaxy@9801f4, tick = 37
ref # 2 = org.aakretech.trekwar2.common.Galaxy@1c5d81c, tick = 38
ref # 3 = org.aakretech.trekwar2.common.Galaxy@101f8f4, tick = 39
ref # 4 = org.aakretech.trekwar2.common.Galaxy@1ed1e7e, tick = 40
ref # 5 = org.aakretech.trekwar2.common.Galaxy@e0a7ea, tick = 41</pre></div></div>
<p>Unless you want to wait until your GC decides it&#8217;s time to go, use a tool like <a title="Visual VM" href="http://www.erlendaakre.com/2008/313/visualvm-nifty-java-tool.html">VisualVM</a> to force the Garbage Collector to run.</p>
<p>After the GC has run, the output should look like this:</p>
<div id="wpshdo_10" class="wp-synhighlighter-outer"><div id="wpshdt_10" class="wp-synhighlighter-expanded"><table border="0" width="100%"><tr><td align="left" width="80%"><a name="#codesyntax_10"></a><a id="wpshat_10" class="wp-synhighlighter-title" href="#codesyntax_10"  onClick="javascript:wpsh_toggleBlock(10)" title="Click to show/hide code block">Code block</a></td><td align="right"><a href="#codesyntax_10" onClick="javascript:wpsh_code(10)" title="Show code only"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/code.png" /></a>&nbsp;<a href="#codesyntax_10" onClick="javascript:wpsh_print(10)" title="Print code"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/printer.png" /></a>&nbsp;<a href="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/About.html" target="_blank" title="Show plugin information"><img border="0" style="border: 0 none" src="http://www.erlendaakre.com/wp-content/plugins/wp-synhighlight/themes/default/images/info.gif" /></a>&nbsp;</td></tr></table></div><div id="wpshdi_10" class="wp-synhighlighter-inner" style="display: block;"><pre class="text" style="font-family:monospace;">ref # 0 = null
ref # 1 = null
ref # 2 = null
ref # 3 = null
ref # 4 = null
ref # 5 = null
ref # 6 = org.aakretech.trekwar2.common.Galaxy@2b3c91, tick = 42</pre></div></div>
<p>Now, this means that the object IS being garbage collected, and there is no memory leak.. If you run this and the object you are monitoring (in this example the localGalaxy object) is not GC&#8217;ed because of stray references, you can tell because none of the references will point to null.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/using-weakreference-to-confirmfind-memory-leaks-in-java.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaEaster</title>
		<link>http://www.erlendaakre.com/javaeaster.html</link>
		<comments>http://www.erlendaakre.com/javaeaster.html#comments</comments>
		<pubDate>Fri, 10 Apr 2009 15:34:40 +0000</pubDate>
		<dc:creator>Erlend Aakre</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Chat]]></category>
		<category><![CDATA[Colonization]]></category>
		<category><![CDATA[easter]]></category>
		<category><![CDATA[faction]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ship]]></category>
		<category><![CDATA[shipdesigner]]></category>
		<category><![CDATA[starsystem]]></category>
		<category><![CDATA[trekwar]]></category>

		<guid isPermaLink="false">http://www.erlendaakre.com/?p=634</guid>
		<description><![CDATA[Easter is almost over, and I used most of the time to complete the Trekwar shipdesigner, and set up lots of hulls for it.. I also created a chat system for the game. ShipDesigner: Faction Hulls: x Chat: I was planning to implement the ship actions, like colonization and ship combat this easter. But I [...]]]></description>
			<content:encoded><![CDATA[<p>Easter is almost over, and I used most of the time to complete the <a title="Trekwar game" href="http://www.trekwar.org">Trekwar </a>shipdesigner, and set up lots of hulls for it.. I also created a chat system for the game.</p>
<p>ShipDesigner:<br />
<a href="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_shipdesigner_boomship.png"><img class="alignnone size-medium wp-image-636" title="trekwar_shipdesigner_boomship" src="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_shipdesigner_boomship-300x191.png" alt="trekwar_shipdesigner_boomship" width="300" height="191" /></a></p>
<p>Faction Hulls:<br />
x<a href="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_hulls_easter09.png"><img class="alignnone size-medium wp-image-637" title="trekwar_hulls_easter09" src="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_hulls_easter09-300x236.png" alt="trekwar_hulls_easter09" width="300" height="236" /></a></p>
<p>Chat:<a href="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_chat.png"><br />
<img class="alignnone size-medium wp-image-635" title="trekwar_chat" src="http://www.erlendaakre.com/wp-content/uploads/2009/04/trekwar_chat-300x249.png" alt="trekwar_chat" width="300" height="249" /></a></p>
<p>I was planning to implement the ship actions, like colonization and ship combat this easter. But I think I&#8217;ll work on the Starsystem management system instead, as I redesigned it heavily this easter.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.erlendaakre.com/javaeaster.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

