<?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>Narnio</title>
	<atom:link href="http://www.narnio.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.narnio.com</link>
	<description>A day in the life of a software engineer</description>
	<lastBuildDate>Sat, 28 Aug 2010 16:18:37 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>The HTC Desire indepth</title>
		<link>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/</link>
		<comments>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/#comments</comments>
		<pubDate>Sat, 28 Aug 2010 16:18:37 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[HTC Desire]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=432</guid>
		<description><![CDATA[In a previous post I said I recently got a new phone, the HTC Desire. But since I only had it very briefly I felt it wasn&#8217;t the time yet to write about the phone itself. Well know I&#8217;ve been playing with it for more then a week so it&#8217;s time to write some small [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.narnio.com/wp-content/uploads/2010/08/htc-desire-vodafone.jpg"><img style="margin-left: 4px; margin-bottom: 2px; border: 1px dashed #000000; float: right;" title="HTC Desire" src="http://www.narnio.com/wp-content/uploads/2010/08/htc-desire-vodafone-e1283010973305.jpg" alt="" width="282" height="478" /></a>In a previous post I said I recently got a new phone, the HTC Desire. But since I only had it very briefly I felt it wasn&#8217;t the time yet to write about the phone itself. Well know I&#8217;ve been playing with it for more then a week so it&#8217;s time to write some small article about it.</p>
<p>So I&#8217;ve been using HTC phones for several years now and so far I&#8217;ve liked every single phone I&#8217;ve had. But the Desire was my switch from Windows Mobile to the Android platform, and I was very worried about the switch to say the least.</p>
<h2>First impression of the Desire</h2>
<p>After switching on the phone for the first time I went through the setup procedure, which is as simple as 1, 2, 3. So thank god for that, it&#8217;s a huge step up from Windows Mobile 5.</p>
<p>I have to give HTC one thing, the phone response very well to any time you touch the screen. It&#8217;s probably the capacitive screen, but its a whole lot better then what I was used to.  Just after first boot you will probably play around a little with the widgets that are included.</p>
<p>As the Sense interface gives you 7 different tabs that you can put widgets on it will take you some time to configure it to your likings. Which is as much a blessing as a curse, especially in when you are just using the phone for the first time. Luckily the phone comes with several presets for the Sense interface.</p>
<p>My biggest concern was migrating all my data from Windows Mobile to the Android platform. And unfortunately my worries where right. So Google step up to the plate and make migrating from different phone platforms easier. It&#8217;s impossible to migrate text messages or call history without doing a lot of manual work.</p>
<h2>The good the bad and the ugly</h2>
<p>So what&#8217;s up with this phone. Is it a good thing to buy or good gift to get <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> . Well it sorta depends on what you are expecting. If you want a phone that gives you a lot of access to your social networks, then yeah it might be something for you. If you want something that just enables you to call and send text message, then please don&#8217;t waste your money on the Desire.  It&#8217;ll do the job but at a high price.</p>
<p>Having said that here are some of the pro&#8217;s and con&#8217;s of the phone:</p>
<table width="100%">
<thead>
<tr>
<td style="text-align: left;"><strong>Pro&#8217;s</strong></td>
<td style="text-align: left;"><strong>Con&#8217;s</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="50%" valign="top">
<ul>
<li>Very responsive to touch</li>
<li>Well thought out interface</li>
<li>Good build quality</li>
<li>Tons of applications available for Android</li>
<li>Automatic updating over the air</li>
</ul>
</td>
<td width="50%" valign="top">
<ul>
<li>Seems to loose 3G connection randomly, and won&#8217;t reconnect automatically</li>
<li>Very, very expensive at 400+ bucks</li>
<li>Crappy FriendStream widget of HTC</li>
</ul>
</td>
</tr>
</tbody>
</table>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/08/28/the-htc-desire-indepth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Leaving LinkedIn</title>
		<link>http://www.narnio.com/2010/08/20/leaving-linkedin/</link>
		<comments>http://www.narnio.com/2010/08/20/leaving-linkedin/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 20:07:37 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=427</guid>
		<description><![CDATA[Ok so I don&#8217;t know who the was the genious that introduces the captcha on the LinkedIn website, but it makes the damn website completely useless. Every time you login you need to enter an unreadable, completely useless captcha. See the screenshot below for what I mean.
Now I know I&#8217;m not an expert on the [...]]]></description>
			<content:encoded><![CDATA[<p>Ok so I don&#8217;t know who the was the genious that introduces the captcha on the LinkedIn website, but it makes the damn website completely useless. Every time you login you need to enter an unreadable, completely useless captcha. See the screenshot below for what I mean.</p>
<div id="attachment_428" class="wp-caption aligncenter" style="width: 354px"><a href="http://www.narnio.com/wp-content/uploads/2010/08/LinkedIn-Captcha.jpg"><img class="size-medium wp-image-428 " title="LinkedIn-Captcha" src="http://www.narnio.com/wp-content/uploads/2010/08/LinkedIn-Captcha-300x170.jpg" alt="" width="344" height="199" /></a><p class="wp-caption-text">Screenshot of Captcha</p></div>
<p>Now I know I&#8217;m not an expert on the usability side of things, but why do you need to enter a captcha code <strong>after correctly entering both your username and the password</strong>. This sersiously makes me wonder if it would not be better to erase my LinkedIn account. Unfortunately that would require me to login, now if I were only able to read the damn image.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/08/20/leaving-linkedin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New fancy toy, the HTC Desire</title>
		<link>http://www.narnio.com/2010/08/14/new-fancy-toy-the-htc-desire/</link>
		<comments>http://www.narnio.com/2010/08/14/new-fancy-toy-the-htc-desire/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 12:56:40 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Gadgets]]></category>
		<category><![CDATA[HTC]]></category>
		<category><![CDATA[Motorola]]></category>
		<category><![CDATA[phone]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=416</guid>
		<description><![CDATA[So I got my new HTC Desire in today after renewing my phone service. I renewed with this free phone even after being warned that it could take up to 5 weeks for the delivery. Guess I&#8217;m one of the lucky receiving it within a week. Anyhow I will write something about the new phone [...]]]></description>
			<content:encoded><![CDATA[<p>So I got my new HTC Desire in today after renewing my phone service. I renewed with this free phone even after being warned that it could take up to 5 weeks for the delivery. Guess I&#8217;m one of the lucky receiving it within a week. Anyhow I will write something about the new phone in a few days time, but I thought it might be fun to go over my phone history so far <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .<br />
<span id="more-416"></span><br />
Over the last 10 years or so I&#8217;ve had a lot of phones below are the listed from oldest to newest. Forgive me if I don&#8217;t know the exact date of purchase any more, but it&#8217;s been a long time for some of them.</p>
<div style="float: left; text-align: center; border: 1px gray solid; margin-left: 5px; width: 150px;"><img src="http://www.narnio.com/wp-content/uploads/2010/08/Motorola-Flip-Phone-150x150.gif" alt="" width="150" height="150" /><br />
Motorola 1995</div>
<div style="float: left; text-align: center; border: 1px gray solid; width: 150px; margin-left: 5px;"><img src="http://www.narnio.com/wp-content/uploads/2010/08/nokia_6681_phone.jpg" alt="" width="150" height="150" /><br />
Nokia 6681 (2005)</div>
<div style="float: left; text-align: center; border: 1px gray solid; margin-left: 5px; width: 150px;"><a style="border: none;" href="http://en.wikipedia.org/wiki/Motorola_PEBL" target="_blank"><img src="http://www.narnio.com/wp-content/uploads/2010/08/motorola-pebl-closed-front-150x150.jpg" alt="" width="150" height="150" /></a><br />
Motorola Peble (2006)</div>
<div style="clear: both; padding-top: 5px; text-align: center;">
<div style="float: left; text-align: center; border: 1px gray solid; margin-left: 5px; width: 150px;"><a style="border: none;" href="http://www.htc.com/www/Product.aspx?id=392" target="_blank"><img src="http://www.narnio.com/wp-content/uploads/2010/08/htc-p3300-150x150.jpg" alt="" width="150" height="150" /></a><br />
HTC P3300 (2007)</div>
<div style="float: left; text-align: center; border: 1px gray solid; margin-left: 5px; width: 150px;"><a style="border: none;" href="http://www.sonyericsson.com/cws/products/mobilephones/overview/c902" target="_blank"><img src="http://www.narnio.com/wp-content/uploads/2010/08/sony-ericsson-c902-mobile-phone-150x150.jpg" alt="" width="150" height="150" /></a><br />
Sony Ericson C902 (2009)</div>
<div style="float: left; text-align: center; border: 1px gray solid; margin-left: 5px; width: 150px;"><a style="border: none;" href="http://www.htc.com/www/product/touchdiamond2/overview.html" target="_blank"><img src="http://www.narnio.com/wp-content/uploads/2010/08/htc-touch-diamond2-2-150x150.jpg" alt="" width="150" height="150" /></a><br />
HTC Touch Diamond 2 (2009)</div>
</div>
<div style="clear: both;">As you can see the list is pretty huge. Truth be told I never actually used the Pebl or the Sony Ericson phones, but got them free when renewing my phone service. Oh and as a side note I still have all the phones except for the really old motorola and the HTC P3300 (which I gave away).</div>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/08/14/new-fancy-toy-the-htc-desire/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MSAccess and a really weird behaviour with distinct</title>
		<link>http://www.narnio.com/2010/06/25/msaccess-and-a-really-weird-behaviour-with-distinct/</link>
		<comments>http://www.narnio.com/2010/06/25/msaccess-and-a-really-weird-behaviour-with-distinct/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 06:56:54 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[MS Access]]></category>

		<guid isPermaLink="false">http://www.narnio.com/2010/06/25/msaccess-and-a-really-weird-behaviour-with-distinct/</guid>
		<description><![CDATA[Recently I started working with MS Access databases, I know not the best choice. I ran into a really weird problem with the database, which I didn&#8217;t expect.
I have a relativly simple select query which contains a distinct. Something like &#8220;select distinct id, content from table&#8221;. Nothing fancy so you&#8217;d expect the content of the [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I started working with MS Access databases, I know not the best choice. I ran into a really weird problem with the database, which I didn&#8217;t expect.</p>
<p>I have a relativly simple select query which contains a distinct. Something like &#8220;select distinct id, content from table&#8221;. Nothing fancy so you&#8217;d expect the content of the table excluding all duplicates.</p>
<p>But this is also where the weirdness begins with MS Access. I was using this type of query to select data for my search engine. But some data wasn&#8217;t included for some reason.</p>
<p>After a lot of debugging my queries and code it turned out that MS Access ODBC was only returning the first 255 characters of a MEMO field. So I thought the driver was to blame, until I ran the same query in MS Access itself. As it turns out Access was the one truncating MEMO fields to VARCHAR(255) fields when using a DISTINCT in a query.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/06/25/msaccess-and-a-really-weird-behaviour-with-distinct/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Controlling Tomcat using Ant scripting</title>
		<link>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/</link>
		<comments>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/#comments</comments>
		<pubDate>Wed, 26 May 2010 16:31:34 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Webdevelopment]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=404</guid>
		<description><![CDATA[As a Java webdeveloper you are faced with a lot of different aspects of development. One is testing and debugging code, to do this you need an application server like Tomcat. One of the issues I recently encountered was the need to control various Tomcat instances with a single Ant build script. Below are some [...]]]></description>
			<content:encoded><![CDATA[<p>As a Java webdeveloper you are faced with a lot of different aspects of development. One is testing and debugging code, to do this you need an application server like Tomcat. One of the issues I recently encountered was the need to control various <a href="http://tomcat.apache.org" target="_blank" title="Tomcat Homepage">Tomcat</a> instances with a single <a href="http://ant.apache.org" target="_blank" title="Ant homepage">Ant</a> build script. Below are some of the solutions I&#8217;ve used to manipulate Tomcat.</p>
<p><b>Note:</b> some parts of this script rely on the <a href="http://ant-contrib.sourceforge.net/" target="_blank" title="Ant Contrib home page">ant-contrib</a> library. Download this library and include it in the tomcat.xml with the following code:</p>
<pre class="brush: xml">
&lt;taskdef resource=&quot;net/sf/antcontrib/antcontrib.properties&quot;&gt;
 &lt;classpath&gt;
  &lt;pathelement location=&quot;./ant-contrib-1.0b3.jar&quot;/&gt;
 &lt;/classpath&gt;
&lt;/taskdef&gt;
</pre>
<h2>Starting tomcat</h2>
<p>Though starting tomcat may seem easy. You could just use the development IDE (like Netbeans) to start and stop Tomcat, but what this lacks is the ability to control several instances with easy shortcuts. So I defined the following Ant <a href="http://ant.apache.org/manual/CoreTasks/macrodef.html" target="_blank" title="Macrodef Documentation">macrodef</a> in a file called tomcat.xml:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-start&quot;&gt;
 &lt;sequential&gt;
   &lt;trycatch&gt;
    &lt;try&gt;
      &lt;if&gt;
       &lt;not&gt;&lt;http url=&quot;http://localhost&quot;/&gt;&lt;/not&gt;
       &lt;then&gt;
         &lt;java classname=&quot;org.apache.catalina.startup.Bootstrap&quot;
             fork=&quot;yes&quot;
             dir=&quot;${tomcat.dir}&quot;
             spawn=&quot;true&quot;
             jvm=&quot;${tomcat.java.home}/bin/java&quot;&gt;
          &lt;jvmarg value=&quot;-Dcatalina.home=${tomcat.dir}&quot;/&gt;
          &lt;jvmarg value=&quot;-Dcatalina.base=${tomcat.dir}&quot;/&gt;
          &lt;jvmarg value=&quot;-Djava.io.tmpdir=${tomcat.dir}/temp&quot;/&gt;
          &lt;jvmarg value=&quot;-Djava.endorsed.dirs=${tomcat.dir}/common/endorsed&quot;/&gt;
          &lt;jvmarg value=&quot;-Xdebug&quot;/&gt;
          &lt;jvmarg value=&quot;-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n&quot;/&gt;
          &lt;classpath&gt;
           &lt;pathelement location=&quot;${tomcat.java.home}/lib/tools.jar&quot;/&gt;
           &lt;pathelement location=&quot;${tomcat.dir}/bin/bootstrap.jar&quot;/&gt;
          &lt;/classpath&gt;

          &lt;arg line=&quot;start&quot; /&gt;
         &lt;/java&gt;

         &lt;waitfor maxwait=&quot;10&quot; maxwaitunit=&quot;second&quot; checkevery=&quot;5000&quot;&gt;
          &lt;http url=&quot;http://localhost&quot;/&gt;
         &lt;/waitfor&gt;
         &lt;echo message=&quot;Tomcat started&quot;/&gt;
       &lt;/then&gt;
       &lt;else&gt;
        &lt;echo message=&quot;Tomcat already started...&quot; /&gt;
       &lt;/else&gt;
     &lt;/if&gt;
    &lt;/try&gt;
    &lt;catch&gt;
     &lt;echo message=&quot;Unable to start tomcat&quot;/&gt;
    &lt;/catch&gt;
  &lt;/trycatch&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This macro is really easy. First it starts of by checking if tomcat is not already running (well actually it just checks to see if there is something running on port 80). If nothing is running then tomcat is started using the java defined by the <a href="http://ant.apache.org/manual/CoreTasks/property.html" title="Property Task documentation" target="_blank">ant property</a> <i>tomcat.java.home</i>. This macro also depends on some other properties that are set by a different macro, which will be a bit further on in the post. Tomcat is started by using the Bootloader class provided by the server, to make sure it loads correctly the <strong>classpath</strong> is set.</p>
<p>The last step in the macro is to wait for tomcat to start, this has to be done since we start tomcat in a seperate java instance (the <i>spawn</i> option).</p>
<h2>Stopping Tomat</h2>
<p>Off course you also want to be able to stop tomcat to load some new data, or an entire web-app. I use the following macro to stop Tomcat:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-stop&quot;&gt;
 &lt;sequential&gt;
  &lt;trycatch&gt;
   &lt;try&gt;
    &lt;java classname=&quot;org.apache.catalina.startup.Bootstrap&quot;
         fork=&quot;yes&quot;
         dir=&quot;${tomcat.dir}&quot;
         spawn=&quot;true&quot;
         jvm=&quot;${java.home}/bin/java&quot;&gt;
     &lt;jvmarg value=&quot;-Dcatalina.home=${tomcat.dir}&quot;/&gt;
     &lt;jvmarg value=&quot;-Dcatalina.base=${tomcat.dir}&quot;/&gt;
     &lt;jvmarg value=&quot;-Djava.io.tmpdir=${tomcat.dir}/temp&quot;/&gt;
     &lt;classpath&gt;
      &lt;pathelement location=&quot;${tomcat.java.home}/lib/tools.jar&quot;/&gt;
      &lt;pathelement location=&quot;${tomcat.dir}/bin/bootstrap.jar&quot;/&gt;
     &lt;/classpath&gt;

     &lt;arg line=&quot;stop&quot; /&gt;
    &lt;/java&gt;

    &lt;kill-java name=&quot;Bootstrap&quot; /&gt;
    &lt;echo message=&quot;Tomcat stopped&quot; /&gt;
   &lt;/try&gt;
   &lt;catch&gt;
    &lt;echo message=&quot;Unable to stop tomcat forcing shutdown.....&quot;/&gt;
    &lt;kill-java name=&quot;Bootstrap&quot; /&gt;
   &lt;/catch&gt;
  &lt;/trycatch&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>Just like with the starting of Tomcat I use the provided Bootloader class to instruct tomcat to stop. Again I use the java that is set in <i>tomcat.java.home</i> as well as some other properties loaded by another macro. Since Tomcat sometimes fails to stop gracefully (due to poorly designed webapps) you also have to kill the Java process of Tomcat. This is done with the call to <b>kill-java</b>.</p>
<h2>Killing any java process</h2>
<p>As you saw in the <b>tomcat-stop</b> macro I used a macro called <i>kill-java</i> to make sure that Tomcat is really killed and no longer running in the background. The macro is as follows:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;kill-java&quot;
          description=&quot;Forcefully stop tomcat....&quot;&gt;
 &lt;attribute name=&quot;name&quot;/&gt;
 &lt;sequential&gt;
  &lt;!-- Execute the jps and check for any Java process with the provided @{name} attribute --&gt;
  &lt;exec executable=&quot;${tomcat.java.home}/bin/jps&quot; output=&quot;pid.out.file&quot; /&gt;
  &lt;!-- Load in the name / pid file and strip all information except the PID --&gt;
  &lt;loadfile srcfile=&quot;pid.out.file&quot; property=&quot;pid.out&quot;&gt;
   &lt;filterchain&gt;
     &lt;linecontains&gt;
      &lt;contains value=&quot;@{name}&quot;/&gt;
     &lt;/linecontains&gt;
    &lt;tokenfilter&gt;
    &lt;deletecharacters chars=&quot;@{name}&quot;/&gt;
    &lt;trim/&gt;
    &lt;ignoreblank/&gt;
    &lt;/tokenfilter&gt;
    &lt;striplinebreaks/&gt;
   &lt;/filterchain&gt;
  &lt;/loadfile&gt;
  &lt;echo message=&quot;Killing java process with pid ${pid.out}&quot;/&gt;
  &lt;!-- Kill the process, warning this only Works on Windows --&gt;
  &lt;exec spawn=&quot;true&quot; executable=&quot;taskkill&quot;&gt;
   &lt;arg line=&quot;/PID ${pid.out}&quot; /&gt;
   &lt;arg line=&quot;/F&quot; /&gt;
  &lt;/exec&gt;
  &lt;delete file=&quot;pid.out.file&quot; /&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This macro is really simple and relies on the jps application provided by Java. This application returns a list of all running processes with name and process id (PID). All we need to do is get the line containing the process name provided and strip everything except the PID.</p>
<p><b>Please note:</b> the task killing the proces is designed for Windows, you could change this with kill in Linux.</p>
<h2>Rounding it up</h2>
<p>Though you now have all you need to manipulate tomcat there is one last macro that we are tegenkant upon. That is the initializer of the various Tomcat properties. I use the following macro:</p>
<pre class="brush: xml">
&lt;macrodef name=&quot;tomcat-init&quot;&gt;
 &lt;attribute name=&quot;from&quot;/&gt;
 &lt;sequential&gt;
  &lt;property name=&quot;tomcat.dir&quot; value=&quot;${tomcat.@{from}.dir}&quot;/&gt;
  &lt;property name=&quot;tomcat.server&quot; value=&quot;${tomcat.@{from}.server}&quot;/&gt;
  &lt;property name=&quot;tomcat.port&quot; value=&quot;${tomcat.@{from}.port}&quot; /&gt;
  &lt;property name=&quot;j2ee.server.type&quot; value=&quot;${tomcat.server}&quot; /&gt;
  &lt;taskdef name=&quot;webapp-stop&quot;
          classname=&quot;org.apache.catalina.ant.StopTask&quot;
          classpath=&quot;${tomcat.dir}/server/lib/catalina-ant.jar&quot;/&gt;
  &lt;taskdef name=&quot;webapp-start&quot;
           classname=&quot;org.apache.catalina.ant.StartTask&quot;
           classpath=&quot;${tomcat.dir}/server/lib/catalina-ant.jar&quot;/&gt;
 &lt;/sequential&gt;
&lt;/macrodef&gt;
</pre>
<p>This little macro will initialize tomcat for a specific environment (for exemple DEV). Of course none of this works without the loading of some preset properties in a property file <i>tomcat.properties</i>. Which contains the following data:</p>
<pre class="brush: php">
tomcat.java.home=C:/jdk1.5.0_22_32b

tomcat.DEV.dir=d:/jakarta/tomcat5.0
tomcat.DEV.server=tomcat55-DEV
tomcat.DEV.port=8000

tomcat.MAIN.dir=d:/jakarta/tomcat5.0-MAIN
tomcat.MAIN.server=tomcat55-MAIN
tomcat.MAIN.port=8000
</pre>
<p>To load the property file just include the following instruction in the build script:</p>
<pre class="brush: xml">
&lt;property file=&quot;./tomcat.properties&quot; /&gt;
</pre>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/05/26/controlling-tomcat-using-ant-scripting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is to static in programming</title>
		<link>http://www.narnio.com/2010/04/25/what-is-to-static-in-programming/</link>
		<comments>http://www.narnio.com/2010/04/25/what-is-to-static-in-programming/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 12:59:53 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[coding practice]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=400</guid>
		<description><![CDATA[As I recently started a new job I also had to dive into a completely different culture. Programming and code style wise that is. One of the things I came accross was the choice to always use static members. But is this desirable in programming and good conventions.
Personally I think static members should be reserved [...]]]></description>
			<content:encoded><![CDATA[<p>As I recently started a new job I also had to dive into a completely different culture. Programming and code style wise that is. One of the things I came accross was the choice to always use static members. But is this desirable in programming and good conventions.</p>
<p>Personally I think static members should be reserved for helper classes and singleton instances. But why?</p>
<p>One of the main reasons for reserving it for helper classes is simple. A lot of 3rd gen programming languages don&#8217;t allow functional programming, hence you need to create a class to support generic functions. In a way you are just trying to store some simple functions in a namespace (C++/.net) or package (Java), but this is not supported. I believe this is fine when <strong>all</strong> members are static.</p>
<p>A second reason for a static member is to support singleton, or factory model classes. In these situations it is desirable to have one single access point to get an instance of a class. But <strong>no</strong> other methods should be static.</p>
<p>If you are thinking about making a member static then ask yourself the following question: &#8220;Why does this need to be static?&#8221;. And the following answers aren&#8217;t good once:</p>
<ul>
<li>It&#8217;s easier cause I don&#8217;t have to use a getInstance() all the time</li>
<li>Cause I can (would you be one of the few still using goto statements)</li>
</ul>
<p>So try and be careful when using static members. And as always just keep thinking when programming and designing code.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2010/04/25/what-is-to-static-in-programming/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Memory issues finally solved</title>
		<link>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/</link>
		<comments>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 11:13:11 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[dovecot]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=394</guid>
		<description><![CDATA[As I posted before in &#8216;Mysterious problems with my VPS&#8217;, I recently got an increasingly unstable VPS system hosting a lot of my and my customers sites. After a lot of digging I initially presumed that Dovecot (the mail server) was responsible for the issues, as you can read in &#8216;Dovecot causing memory issues&#8217;.
Last week [...]]]></description>
			<content:encoded><![CDATA[<p>As I posted before in <a title="View the post" href="http://www.narnio.com/2009/10/15/mysterious-problems-with-my-vps/">&#8216;Mysterious problems with my VPS&#8217;</a>, I recently got an increasingly unstable VPS system hosting a lot of my and my customers sites. After a lot of digging I initially presumed that Dovecot (the mail server) was responsible for the issues, as you can read in <a title="View the post" href="http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/">&#8216;Dovecot causing memory issues&#8217;</a>.</p>
<p>Last week I did a lot of debugging on the Debian server to try and find out what was the issue. And initially it was Dovecots memory usage. After disabling this tool for a couple of days the server was still running fine. However the day after I posted the article on Dovecot the server crashed again. So I had to restart my investigation.</p>
<p>First off I had to had to get a better memory management tool, so I installed <em>Htop</em> on the server <em>(apt-get htop</em>)<em>. </em>This shows the current memory usage of each running application. After installing this I enabled all services and applications again and started running stress tests. And though Dovecot was causing some peeks in memory usage it did not keep the high memory usage after the requests where done.</p>
<p>As it turns out for some reason Apache 2.2 was using a lot of memory during peak loads. But even more frustrating it didn&#8217;t seem to release any memory any more. Which was causing issues for services that only spawn when they are being accessed like Dovecot and Postfix, which explained why both of these services crashed when the server halted.</p>
<p>After tweaking the maximum amount of servers Apache is allowed to start and the maximum amount of client threads to handle the memory usage dropped dramatically. And I am very happy to report that the server has been running again for more then a week, without any glitches.</p>
<p>Still it doesn&#8217;t explain why all of this only happened after updating my server with the latest versions and patches. But I&#8217;m glad it&#8217;s solved for now.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/10/24/memory-issues-finally-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dovecot causing memory issues?</title>
		<link>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/</link>
		<comments>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/#comments</comments>
		<pubDate>Sun, 18 Oct 2009 18:19:49 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dovecot]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=392</guid>
		<description><![CDATA[In my previous post I mentioned that I had and still am having some serious issues with the stability of the VPS I&#8217;m running all of my websites on. Though I&#8217;m still a long way away from solving the issue, I have figured out that it is very likely caused by an upgrade of Dovecot.
Why [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post I mentioned that I had and still am having some serious issues with the stability of the VPS I&#8217;m running all of my websites on. Though I&#8217;m still a long way away from solving the issue, I have figured out that it is very likely caused by an upgrade of Dovecot.</p>
<p>Why I believe that dovecot is slowely over time eating up memory, well after I disabled it the VPS continued running without any issues. I already knew Apache 2, subversion and MySQL weren&#8217;t causing it. So I only had postfix and dovecot left to test.</p>
<p>What is truly amazing is that the website for Dovecot indicates it is low in memory consumption, hence it has no settings to limit the amount of memory allocated for Dovecot. So I still need to figure that part out, or alternatively change to a different IMAP server.</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/10/18/dovecot-causing-memory-issues/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mysterious problems with my VPS</title>
		<link>http://www.narnio.com/2009/10/15/mysterious-problems-with-my-vps/</link>
		<comments>http://www.narnio.com/2009/10/15/mysterious-problems-with-my-vps/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 16:32:01 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General Rant]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=390</guid>
		<description><![CDATA[I&#8217;ve heard a lot of people always say that you can&#8217;t crash/hang or break linux easily. Well then I guess I&#8217;m one of the lucky bastards that gets it done. Since a few days the VPS system I&#8217;m operating keeps hanging itself up.
Now off course it is not the fault of Linux  , but [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard a lot of people always say that you can&#8217;t <strong>crash/hang or break linux</strong> easily. Well then I guess I&#8217;m one of the lucky bastards that gets it done. Since a few days the VPS system I&#8217;m operating keeps hanging itself up.</p>
<p>Now off course it is not the fault of Linux <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> , but with my very lacking skill. I recently did an <em>apt-get upgrade</em> command on the VPS. To my suprise it started updating with Lenny packages, whilst I could have sworn I have Etch installed. Mystery on its own, but worse yet the server now keeps hanging and breaking.</p>
<p>I figured it was a memory issue at first cause some weird service was installed that was eating it alive. So I de-installed that and it ran fine for a few days. But allas, after 3 days of running the VPS hangs itself up again. When I say hangs-up I mean that I cannot connect using SSH, the mailserver goes down. MySQL and Apache keep running though, as does postfix. So I&#8217;m still guessing it is memory, but I have no idea why my configuration is no longer working after running an <em>apt-get upgrade</em> command. Something is really wrong <img src='http://www.narnio.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> .</p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/10/15/mysterious-problems-with-my-vps/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>First Look On Windows 7</title>
		<link>http://www.narnio.com/2009/09/05/first-look-on-windows-7/</link>
		<comments>http://www.narnio.com/2009/09/05/first-look-on-windows-7/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 10:40:03 +0000</pubDate>
		<dc:creator>Jongerius</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[General Rant]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[OS]]></category>
		<category><![CDATA[Vista]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.narnio.com/?p=380</guid>
		<description><![CDATA[I recently had the option to test Windows 7 the Release Candidate. So I thought it would be good to write a short post on my first thoughts on this latest version of Windows. Don&#8217;t expect a lengthy review in this article, I may write on later on though.
After downloading and burning the image I [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the option to test Windows 7 the Release Candidate. So I thought it would be good to write a short post on my first thoughts on this latest version of Windows. Don&#8217;t expect a lengthy review in this article, I may write on later on though.</p>
<p>After downloading and burning the image I got from Microsoft I quickly tried to install it on my HP TouchSmart PC. Why did I choose this computer rather then my laptop or mediacenter. Well I was honestly expecting a lot of trouble and my TouchSmart has a recovery disk to quickly revert to Windows Vista <img src='http://www.narnio.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> .</p>
<h2>First look at the Windows 7</h2>
<p>The installation of windows was damn easy, I guess when you compare the installation it is very similar to Windows Vista. A graphical interface is loaded that will help you trough the various steps needed  to install Windows 7. So far so good, though it does take quite long to install. But then again who is expecting anything else from a bloated OS, which I still believe Windows is. After the installation most things on my computer are recognized and work fine. Why I say most things, well unfortunately none of the <em>special</em> buttons of my computer are working. So I can&#8217;t control the sound, media or the brightness of the screen. Which sucks, but then again I don&#8217;t think I can blame Microsoft for that. As HP does not have any support what so ever for Windows 7.</p>
<p>One cool thing I really liked is that after installing a multi touch driver my HP was able to recognize 2 pressure points on the screen at the same time. Which makes for some cool features that work. I really liked it, but keep in mind it is just some eye candy and won&#8217;t help you in the every day things you do on the computer <img src='http://www.narnio.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> .</p>
<h2>Some new neat features</h2>
<p>Some might have already heard about some of the new features included in Windows 7. Well I will try and summarize a few that I find useful and some of which I have serious doubts that they are any added value what so ever.</p>
<p><strong>More decent window grouping</strong><br />
Anyone who has used Windows XP or Vista knows about the feature that windows starts grouping similar windows when there are a lot of them open. Well in windows 7 this feature got extended. Now it groups the windows no matter how many are open. This on its own is not that bad. Because like in Windows Vista you get a small preview of the window when you hover over it. A new feature in this is that when you stay over a window for a longer period of time the window will be displayed on the screen and all other windows &#8216;disappear&#8217; to the background.</p>
<p>Though this is a pretty stable and nice feature I strongly dislike Windows for doing this same thing for every single tab in Internet Explorer. Which is pretty annoying to people like me who have several tabs open, as well as several instances of Internet Explorer. This causes it to become a bit crowded down in that small preview window.</p>
<p><strong>Better quicklaunch features<br />
</strong>One of the older features in windows is the quicklaunch bar in the taskbar. This allows you to quickly start up any program you pinned to it. Well Windows 7 is no stranger to this. It features this prominently and slightly changed. The icons are a lot bigger then before, and like before you can pin any application to the taskbar. One new thing is that if you click on an icon and drag up a quicklaunch window appears with the most used actions, or in case of the explorer the most opened folders.</p>
<h2>Speed compared to Vista</h2>
<p>A lot of people are comparing Windows 7 with Vista, which I guess is not that strange since they look very similar. One huge improvement is that Windows 7 appears to be a bit quicker and slimmer then Vista. I have not done extensive tests speed wise, but it looks like it boots up a bit quicker and closes quicker. As well as loading of applications this also appears to be slightly faster.</p>
<p>The eye-candy included in Windows 7 is a bit sluggish tough. It&#8217;s just that bit lagging behind on commands giving. Like dragging of applications seems to bit just a bit slow. It might have todo with my HP TouchSmart, but Vista runs on it beautifully so I would expect Windows 7 to do the same.</p>
<h2>Some related video&#8217;s</h2>
<p>Like all of you I like vid&#8217;s, so I added some nice reviews and feature video&#8217;s below. Enjoy them and until next time&#8230;</p>
<p><span class="youtube">
<object width="480" height="360">
<param name="movie" value="http://www.youtube.com/v/6Jsx-gf-z2U&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;hd=1" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/6Jsx-gf-z2U&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" width="480" height="360"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=6Jsx-gf-z2U&fmt=18"><img src="http://img.youtube.com/vi/6Jsx-gf-z2U/default.jpg" width="130" height="97" border=0></a></p></p>
<p><span class="youtube">
<object width="480" height="360">
<param name="movie" value="http://www.youtube.com/v/Wt9rnSWM25U&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;hd=1" />
<param name="allowFullScreen" value="true" />
<embed wmode="transparent" src="http://www.youtube.com/v/Wt9rnSWM25U&amp;rel=1&amp;color1=d6d6d6&amp;color2=f0f0f0&amp;border=0&amp;fs=1&amp;hl=en&amp;autoplay=0&amp;showinfo=0&amp;iv_load_policy=3&amp;showsearch=0&amp;hd=1" type="application/x-shockwave-flash" allowfullscreen="true" width="480" height="360"></embed>
<param name="wmode" value="transparent" />
</object>
</span><p><a href="http://www.youtube.com/watch?v=Wt9rnSWM25U&fmt=18"><img src="http://img.youtube.com/vi/Wt9rnSWM25U/default.jpg" width="130" height="97" border=0></a></p></p>
<hr/>Copyright &copy; 2010 <strong><a href="http://www.narnio.com">Narnio</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@jong-soft.com so we can take legal action immediately.]]></content:encoded>
			<wfw:commentRss>http://www.narnio.com/2009/09/05/first-look-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
