<?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>Tales of the ordinary &#187; Programming</title>
	<atom:link href="http://piskeris.dk/blog/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://piskeris.dk/blog</link>
	<description>Emotions, books, outlooks on life....and maybe a few helpful tips</description>
	<lastBuildDate>Tue, 29 Dec 2009 22:03:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Invalid duplicate class definition in Groovy</title>
		<link>http://piskeris.dk/blog/2009/07/13/invalid-duplicate-class-definition-in-groovy/</link>
		<comments>http://piskeris.dk/blog/2009/07/13/invalid-duplicate-class-definition-in-groovy/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 20:42:38 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://piskeris.dk/blog/?p=85</guid>
		<description><![CDATA[Just a quick one. I&#8217;ve just started poking around with Groovy and from time to time I&#8217;d get an error saying&#8230;and I quote:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
/.../Error.groovy: 1: Invalid duplicate class definition of class Error :


An example might come handy:
I create a new file called Error.groovy, containing this:

class Error{
	def fail(){
		println 'hello'
	}
}

Error error = new Error()
error.fail()

When trying to [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick one. I&#8217;ve just started poking around with Groovy and from time to time I&#8217;d get an error saying&#8230;and I quote:</p>
<pre>
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
/.../Error.groovy: 1: Invalid duplicate class definition of class Error :
</pre>
<p><span id="more-85"></span><br />
An example might come handy:<br />
I create a new file called Error.groovy, containing this:</p>
<pre>
class Error{
	def fail(){
		println 'hello'
	}
}

Error error = new Error()
error.fail()
</pre>
<p>When trying to run this, instead of a line saying hello, you&#8217;ll receive this heartwarming message:</p>
<pre>
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
/.../Error.groovy: 1: Invalid duplicate class definition of class Error :
The source /.../Error.groovy contains at least two defintions of the
class Error.
One of the classes is a explicit generated class using the class statement,
the other is a class generated from the script body based on the file name.
Solutions are to change the file name or to change the class name.
 @ line 1, column 1.
   class Error{
   ^

1 error
</pre>
<p>After some general wondering I found <a href="http://bayesianconspiracy.blogspot.com/2009/03/invalid-duplicate-class-definition.html">this blog post</a> explaining very nicely what the problem is.</p>
<p>If you&#8217;re busy I&#8217;ll tell you what the problem is, so you don&#8217;t have to click the link, just remember, this is not something that I discovered, all credit goes to the original blog poster. </p>
<p>OK, the problem is that I try to create a new instance of the Error class outside of any classes. Groovy will treat this as a script. Behind the scenes Groovy will create a class to store the script code in. This class will be named like the file in which it is used. In my case the file is called Error.groovy, so Groovy will try to create a new class called Error&#8230;..however, this class allready exists in the file and so Groovy get&#8217;s all moody and refuses any further cooperation. </p>
<p>The solution in my case would be to either:</p>
<ol>
<li>Create a public static void main method in my Error class and call the Error code from there</li>
<li>Rename my class to something other than Error</li>
</ol>
<p>Either way, it&#8217;ll work.<br />
Hope this is of any usage to you.</p>
]]></content:encoded>
			<wfw:commentRss>http://piskeris.dk/blog/2009/07/13/invalid-duplicate-class-definition-in-groovy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Language of the year</title>
		<link>http://piskeris.dk/blog/2009/07/03/language-of-the-year/</link>
		<comments>http://piskeris.dk/blog/2009/07/03/language-of-the-year/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 08:34:38 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Groovy]]></category>

		<guid isPermaLink="false">http://piskeris.dk/blog/?p=70</guid>
		<description><![CDATA[The pragmatic programmer say it, and last year I heard a talk by Jared Richardson who also said it: Learn a new programming language every year. Since I&#8217;m always keen on learning something new I thought &#8220;why not?&#8221;. The only problem is: Which language to choose?

This post lists some of the candidates with pros and [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://www.pragprog.com/titles/tpp/the-pragmatic-programmer">pragmatic programmer</a> say it, and last year I heard a talk by Jared Richardson who also said it: Learn a new programming language every year. Since I&#8217;m always keen on learning something new I thought &#8220;why not?&#8221;. The only problem is: Which language to choose?<br />
<span id="more-70"></span><br />
This post lists some of the candidates with pros and cons, and hopefully, when finished writing this, I&#8217;ll know which language to start looking at. But without further ado, let&#8217;s have a look at contester number one.</p>
<h2>Ruby</h2>
<p>Ruby has been around for quite some time, but as far as I can tell, it wasn&#8217;t until the release of Ruby on Rails that Ruby really took of.<br />
Reasons to learn Ruby:</p>
<ol>
<li>It&#8217;s used for Ruby on Rails which I&#8217;ve been foolin&#8217; around with, but sometimes without knowing exactly what I did. For instance, why did I had to type what I just typed like that</li>
<li>It&#8217;s 100% OO</li>
<li>It can be used for scripting, something I&#8217;d like to look more into as I think it could help me automate things and thereby make everyday tasks easier</li>
</ol>
<h2>JavaScript</h2>
<p>Now, there are some people out there, especially &#8220;real&#8221; programmers who don&#8217;t like JavaScript and I think that this is a shame, because JavaScript is really a great language, it just got at stupid name, meaning that people think that JavaScript == Java&#8230;.which it certainly isn&#8217;t!<br />
I know a bit of JavaScript (who doesn&#8217;t?), but when we start talking </p>
<ul>
<li>Closures</li>
<li>OO in JavaScript</li>
<li>Anonymous functions</li>
<li>&#8230;and so on</li>
</ul>
<p>I&#8217;m nowhere near safe ground. Therefore advanced JavaScript would be great to learn. I&#8217;m really looking forward to <a href="http://jsninja.com/">this book</a> by John Resig. </p>
<h2>Clojure</h2>
<p>To tell you the truth, I don&#8217;t know that much about Clojure. People say functional programming and Lisp and that is enough to wake my attention.</p>
<h2>Groovy</h2>
<p>Groovy is, and I quote: &#8220;a flexible, highly productive, agile, dynamic language that runs on the rich framework of the Java platform&#8221;&#8230;.wow eh!<br />
Reasons to learn Groovy</p>
<ol>
<li>Groovy is close to Java, meaning that the learning curve is not so steep.</li>
<li>It is possible to use Groovy for scripting</li>
<li>As with Ruby on Rails, there exists Grails, a web framework based on Groovy. This means that one could create web applications in Java land, but with the ease of Ruby on Rails (at least that&#8217;s what I think)</li>
</ol>
<h2>And the winner is&#8230;</h2>
<p>I think I&#8217;m gonna go with Groovy for now. It sounds really cool and easy to get a hang of.<br />
Furthermore afterwords one could go on to learn Grails and experiment with web applications in Java without using JSF, just to try something else than what I spend my entire day doing <img src='http://piskeris.dk/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://piskeris.dk/blog/2009/07/03/language-of-the-year/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>How to install Subversion to a DS207+</title>
		<link>http://piskeris.dk/blog/2009/02/26/how-to-install-subversion-to-a-ds207/</link>
		<comments>http://piskeris.dk/blog/2009/02/26/how-to-install-subversion-to-a-ds207/#comments</comments>
		<pubDate>Thu, 26 Feb 2009 20:23:55 +0000</pubDate>
		<dc:creator>peter</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech Tip]]></category>
		<category><![CDATA[NAS Server]]></category>

		<guid isPermaLink="false">http://piskeris.dk/blog/?p=34</guid>
		<description><![CDATA[After the success with getting TimeMachine to back up to our NAS server I was eager to see if the NAS server could be used for something else, say a Subversion server for instance.

Turns out I was not the only one with that idea. It was even described on Synologys own wiki. Therefore, all you [...]]]></description>
			<content:encoded><![CDATA[<p>After the success with <a href="http://piskeris.dk/blog/2009/01/11/how-to-get-time-machine-to-back-up-to-a-ds207/">getting TimeMachine to back up to our NAS server</a> I was eager to see if the NAS server could be used for something else, say a <a href="http://subversion.tigris.org/">Subversion</a> server for instance.<br />
<span id="more-34"></span><br />
Turns out I was not the only one with that idea. It was even described on Synologys own <a href="http://www.synology.com/wiki/index.php/Home">wiki</a>. Therefore, all you need to do to get Subversion running on your DS207+ is follow the simple steps described on <a href="http://www.synology.com/wiki/index.php/Step-by-step_guide_to_installing_Subversion">Synologys wiki</a>. Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://piskeris.dk/blog/2009/02/26/how-to-install-subversion-to-a-ds207/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

