<?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>creatified.com &#187; Java</title>
	<atom:link href="http://creatified.com/blog/tag/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://creatified.com/blog</link>
	<description>code creative.</description>
	<lastBuildDate>Fri, 05 Mar 2010 15:42:58 +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>J2ME/MIDP: The hard parts (1)</title>
		<link>http://creatified.com/blog/2009/09/j2me-midp-the-hard-parts-1/</link>
		<comments>http://creatified.com/blog/2009/09/j2me-midp-the-hard-parts-1/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 16:33:41 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[J2ME]]></category>
		<category><![CDATA[MIDP]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=265</guid>
		<description><![CDATA[This is going to be a series of articles about things that don&#8217;t go smooth when moving from J2SE to developing for J2ME in my case especially MIDP. It&#8217;s not intended to blame the guys behind J2ME and the MIDP APIs for what they&#8217;ve done &#8211; instead it&#8217;s intended to be a collection of common [...]]]></description>
			<content:encoded><![CDATA[<p>This is going to be a series of articles about things that don&#8217;t go smooth when moving from J2SE to developing for J2ME in my case especially MIDP. It&#8217;s not intended to blame the guys behind J2ME and the MIDP APIs for what they&#8217;ve done &#8211; instead it&#8217;s intended to be a collection of common problems or traps developers used to J2SE could fall in.</p>
<p>First up: Simple often-used utility functions:</p>
<p><strong>static boolean Boolean.parseBoolean(String s) missing</strong></p>
<p>The lack of this method is really annoying once you have to cope with reading in configuration values. Many of them will be in boolean-like format but you will have no method to parse them into booleans.</p>
<p>A very simple re-write of this method could look like that:</p>
<blockquote><p>public static boolean parseBoolean(String s) {<br />
return s.equalsIgnoreCase(&#8220;true&#8221;) || s.equalsIgnoreCase(&#8220;yes&#8221;);<br />
}</p></blockquote>
<p>Since it could be so easy to write this function (and Integer.parseInt() still exists which seems more complex to me) I don&#8217;t understand why it has not been included.</p>
<p><strong>String[] String.split() missing</strong></p>
<p>Every now and then one will have to parse some input &#8211; and this is where split() comes in handy. Would have come. Luckily String.indexOf() exists which allows for the following re-implementation of String.split():</p>
<blockquote><p>public static String[] split(String source, String separator) {<br />
Vector nodes = new Vector();</p>
<p>int index = source.indexOf(separator);<br />
while(index &gt;= 0) {<br />
nodes.addElement(source.substring(0, index));<br />
source = source.substring(index + separator.length());<br />
index = source.indexOf(separator);<br />
}<br />
nodes.addElement(source);</p>
<p>String[] result = new String[nodes.size()];<br />
if(nodes.size() &gt; 0) {<br />
for(int i = 0; i &lt; nodes.size(); i++) {<br />
result[i] = (String)nodes.elementAt(i);<br />
}<br />
}</p>
<p>return result;<br />
}</p></blockquote>
<p>All in all this might not sound too bad since both &#8220;re-implementations&#8221; were pretty easy to write. But: Since Boolean and String are declared abstract you can&#8217;t subclass and by that extend those. So you will have to declare a &#8220;tool&#8221;-class for them &#8211; not the most elegant way in my opinion.</p>
<p>So these are methods I think many developers will use very regularly but J2ME/MIDP doesn&#8217;t provide them.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/09/j2me-midp-the-hard-parts-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Team. New Challenges.</title>
		<link>http://creatified.com/blog/2009/09/new-team-new-challenges/</link>
		<comments>http://creatified.com/blog/2009/09/new-team-new-challenges/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:19:15 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[common]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Blackberry]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[mobile]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=255</guid>
		<description><![CDATA[In early September I started working in a new team. The main reason for this step was change itself. Since I&#8217;m still in training it&#8217;s always great to see something different and new. This helps me complete my picture of software development and also takes me to another company with business processes slightly different from [...]]]></description>
			<content:encoded><![CDATA[<p>In early September I started working in a new team. The main reason for this step was change itself. Since I&#8217;m still in training it&#8217;s always great to see something different and new. This helps me complete my picture of software development and also takes me to another company with business processes slightly different from those I&#8217;m used to.</p>
<p>I&#8217;m still a software developer. But the kind of software I&#8217;m developing has changed and so have my experiences and learnings. Of course they did not change completely &#8211; but they changed focus. For the last year I&#8217;ve mostly been developing server side applications combined with HTML/CSS/JavaScript. Although I would not see them as very large they were certainly more complex and more demanding on hardware than what I&#8217;m developing now. That thing which I&#8217;m entirely new to is development for mobile. This basically means developing for devices like the iPhone, Blackberry or Android. For me, this is a great opportunity. It&#8217;s helping me a lot to fine-tune my programming skills. Here are some examples of things I had already expected and some things I just experienced:</p>
<ul>
<li>memory and processing power is so limited compared to desktop or even server environments (iPhone 3G: ~400MHz, 128MB of RAM, no swap! &#8211; Desktop: multi-core 1-2GHz, GB&#8217;s of RAM)</li>
<li>(only for the iPhone) memory management can be a tricky if you&#8217;ve always been developing in a garbage collected environment like the Java platform</li>
<li>SDKs like the iPhone SDK or Android SDK rely heavily on software design patterns. A developer using those SDks is at a loss if he&#8217;s does not only understand those but is also able to extend and re-use them</li>
</ul>
<p>There are many things that come with this change for developers. First: one must be very careful with creating objects. Very careful! Even if you&#8217;re on platforms like Android or Blackberry which feature Java and by thus automatic Garbage Collection! Every object counts.</p>
<p>Those limitations and the way you deal with them really help developers get more experienced. By that it&#8217;s a great deal for both the company and me.</p>
<p>I&#8217;m looking forward to what comes next &#8211; and rest assured I will keep you updated about any further developments.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/09/new-team-new-challenges/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SpringSource: A Groovier Eclipse experience</title>
		<link>http://creatified.com/blog/2009/08/springsource-a-groovier-eclipse-experience/</link>
		<comments>http://creatified.com/blog/2009/08/springsource-a-groovier-eclipse-experience/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 17:48:10 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=249</guid>
		<description><![CDATA[For a very long time developing Grails applications in Eclipse using the Groovy-Eclipse-Plugin was everything but enjoyable for me. Matthias Käppler summed it up best when he wrote:
Grails and Eclipse: Not So Groovy
In fact I struggled to get the Groovy-Eclipse-Plugin installed those days, and after finally having done that I found out that developing Grails [...]]]></description>
			<content:encoded><![CDATA[<p>For a very long time developing Grails applications in Eclipse using the Groovy-Eclipse-Plugin was everything but enjoyable for me. <a href="http://brainflush.wordpress.com/2008/05/03/grails-and-eclipse-not-so-groovy/">Matthias Käppler</a> summed it up best when he wrote:</p>
<blockquote><p>Grails and Eclipse: Not So Groovy</p></blockquote>
<p>In fact I struggled to get the Groovy-Eclipse-Plugin installed those days, and after finally having done that I found out that developing Grails applications in Eclipse was really painful for me.</p>
<p>But now with the <a href="http://blog.springsource.com/2009/07/30/a-groovier-eclipse-experience/">first pre-M1 release</a> of the next version of the Groovy-Eclipse plugin many things are better than ever. I finally got around using Grails and Eclipse for some of my projects at work but on the Mac at home I still prefer the combination of TextMate and Console.app. I&#8217;m looking forward to the final release which should improve UI performance in Eclipse, especially when using Code Assist.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/08/springsource-a-groovier-eclipse-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Jacqueline &#8211; parallelized.</title>
		<link>http://creatified.com/blog/2009/07/jacqueline-parallelized/</link>
		<comments>http://creatified.com/blog/2009/07/jacqueline-parallelized/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 10:02:13 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[Jacqueline]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=241</guid>
		<description><![CDATA[Jacqueline now features a development branch containing the latest changes to check multiple documents in a parallel fashion.
My first performance tests show that this boosts overall performance when checking large amounts of CSS selectors on multiple HTML documents. The next big step will be trunk-integration of this feature.
In the meantime check the dev-branch at http://code.google.com/p/jacqueline/source/browse/#svn/branches/threaded
]]></description>
			<content:encoded><![CDATA[<p>Jacqueline now features a development branch containing the latest changes to check multiple documents in a parallel fashion.</p>
<p>My first performance tests show that this boosts overall performance when checking large amounts of CSS selectors on multiple HTML documents. The next big step will be trunk-integration of this feature.</p>
<p>In the meantime check the dev-branch at <a href="http://code.google.com/p/jacqueline/source/browse/#svn/branches/threaded" target="_blank">http://code.google.com/p/jacqueline/source/browse/#svn/branches/threaded</a></p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/07/jacqueline-parallelized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Galileo coming with Cocoa for OS X</title>
		<link>http://creatified.com/blog/2009/06/eclipse-galileo-coming-with-cocoa-for-os-x/</link>
		<comments>http://creatified.com/blog/2009/06/eclipse-galileo-coming-with-cocoa-for-os-x/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 13:45:55 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cocoa]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[osx]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/2009/06/eclipse-galileo-coming-with-cocoa-for-os-x/</guid>
		<description><![CDATA[For all the developers using a Mac and Eclipse &#8211; be sure to check out the new release of Eclipse &#8220;Galileo&#8221; which will be out tomorrow, and is now built using Cocoa! Say goodbye to Carbon&#8230;
Of course I&#8217;ll post my experiences here&#8230;
]]></description>
			<content:encoded><![CDATA[<p>For all the developers using a Mac and Eclipse &#8211; be sure to check out the new release of Eclipse &#8220;Galileo&#8221; which will be out tomorrow, and is now built using Cocoa! Say goodbye to Carbon&#8230;</p>
<p>Of course I&#8217;ll post my experiences here&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/06/eclipse-galileo-coming-with-cocoa-for-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing Jacqueline: unused CSS Selectors in Java</title>
		<link>http://creatified.com/blog/2009/06/introducing-jacqueline-unused-css-selectors-in-java/</link>
		<comments>http://creatified.com/blog/2009/06/introducing-jacqueline-unused-css-selectors-in-java/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 18:13:20 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[1&1]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[standards]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[DOM]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[Selectors API]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=225</guid>
		<description><![CDATA[Back in 2008 I wrote some articles about the proposed Selectors API for the DOM. Now, in 2009, it&#8217;s still &#8220;only&#8221; a working draft of the W3C. I&#8217;ve been exploring this topic for a long time, now I will finally have time to write about what I&#8217;ve been working on for several months.
Jacqueline is a [...]]]></description>
			<content:encoded><![CDATA[<p>Back in 2008 I wrote some articles about the <a href="http://www.w3.org/TR/selectors-api/" target="_blank">proposed Selectors API</a> for the DOM. Now, in 2009, it&#8217;s still &#8220;only&#8221; a working draft of the W3C. I&#8217;ve been exploring this topic for a long time, now I will finally have time to write about what I&#8217;ve been working on for several months.</p>
<p>Jacqueline is a library which will help you to find unused CSS Selectors in multiple HTML documents. This is a very important feature when you want to check a complete website: it will be almost certain that you have some CSS selectors used on page &#8220;A&#8221; but not on page &#8220;B&#8221; whereas &#8220;B&#8221; uses some CSS selectors which &#8220;A&#8221; doesn&#8217;t use.</p>
<p>Jacqueline is completely written in Java &#8211; this was necessary because we wanted to run it in our Java based infrastructure. This brings some other problems Jacqueline has to face: the DOM implementation in Java doesn&#8217;t feature the Selectors API. So I wrote a CSS-to-XPath engine &#8211; inspired by <a href="http://www.domassistant.com/" target="_blank">DOMAssistant.</a> What this basically does is: it transforms CSS2.1 selectors into XPath queries which can then be used for node tests (since XPath support is included in the JDK) on the DOM tree of the HTML document.</p>
<p>Because our documents are still using HTML 4.0 (due to several problems when switching to XHTML 1.0) I had to use <a href="http://jtidy.sourceforge.net/" target="_blank">JTidy</a> for building DOMs.</p>
<p>Jacqueline also uses <a href="http://xmlgraphics.apache.org/batik/" target="_blank">Apache Batik</a> to retrieve all the CSS rules and CSS selectors from a document &#8211; it was the only implementation of the <a href="http://www.w3.org/Style/CSS/SAC/" target="_blank">SAC (Simple API for CSS)</a> I got to run &#8211; and which had some special features. These include locator information of the found tokens for example.</p>
<p>At the moment Jacqueline only works single-threaded, but because this includes many cpu-intensive operations which could definitely be fastened by using the power of multiple cores I&#8217;m also dreaming of a multi-threaded version. Since most operations of Jacqueline could be executed in a parallel fashion this could bring a major speed-up.</p>
<p>The main thing of Jacqueline is that it&#8217;s one of the first pieces to the lately mentioned <a href="http://creatified.com/blog/2009/06/the-project-mess-tool/" target="_blank">Project Mess Tool</a>. We&#8217;ll be using the power of Jacqueline to detect unused CSS selectors in our web projects.</p>
<p>Finally, that stupid name: Jacqueline is named after <a href="http://simpsonspedia.net/index.php?title=Jacqueline_Bouvier" target="_blank">Jacqueline Bouvier</a> from my favorite TV show the Simpsons. See this poster in our office:</p>
<div id="attachment_229" class="wp-caption alignnone" style="width: 235px"><a href="http://creatified.com/blog/wp-uploads/2009/06/jacqueline.jpg"><img class="size-medium wp-image-229" title="jacqueline" src="http://creatified.com/blog/wp-uploads/2009/06/jacqueline-225x300.jpg" alt="Jacqueline - Poster" width="225" height="300" /></a><p class="wp-caption-text">Jacqueline - Poster</p></div>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/06/introducing-jacqueline-unused-css-selectors-in-java/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A few updates on GInstruments</title>
		<link>http://creatified.com/blog/2009/05/a-few-updates-on-ginstruments/</link>
		<comments>http://creatified.com/blog/2009/05/a-few-updates-on-ginstruments/#comments</comments>
		<pubDate>Wed, 27 May 2009 20:50:43 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=136</guid>
		<description><![CDATA[After some days off last week I&#8217;m on it again&#8230; GInstruments definitely on the way I&#8217;d like it to be.
First things first: Fortunately Hyperic had placed an exception-statement into its GPL-licensed SIGAR &#8211; which allows to include the SIGAR binaries in &#8211; for example &#8211; Apache-licensed works. For me that&#8217;s really good news, because this [...]]]></description>
			<content:encoded><![CDATA[<p>After some days off last week I&#8217;m on it again&#8230; GInstruments definitely on the way I&#8217;d like it to be.</p>
<p>First things first: Fortunately Hyperic had placed an exception-statement into its GPL-licensed SIGAR &#8211; which allows to include the SIGAR binaries in &#8211; for example &#8211; Apache-licensed works. For me that&#8217;s really good news, because this means GInstruments could also be used in productive environments which I think often would not be GPL-compliant.</p>
<p>Second: One of the basic things I always wanted to have seems really close now. At the moment GInstruments only displays your current system usage &#8211; not too useful, because most times you&#8217;d be interested in the usage over time, say for the past 30 seconds or so. So that&#8217;s one of the core features I&#8217;ll be implementing before releasing anything to the public &#8211; sorry for the delay, I&#8217;m very busy in other projects right now, too.</p>
<p>For the next few weeks I&#8217;ll also be testing on various kinds of systems (Windows, Linux, &#8230;) and of course testing on Google AppEngine whether they support all the necessary features.</p>
<p>And for a great user experience I&#8217;ll also be working very hard on a prototype of the UI.</p>
<p>Some things that will probably make it into the first public release include:</p>
<ul>
<li>logging system usage and events to a set of CSV-files (configurable in later versions)</li>
<li>usage graphs on the client-side using <a href="http://code.google.com/p/flot/" target="_blank">flot</a></li>
<li>more? yeah, sure!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/05/a-few-updates-on-ginstruments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>GInstruments &#8211; a new Grails plugin&#8230; soon!</title>
		<link>http://creatified.com/blog/2009/05/ginstruments/</link>
		<comments>http://creatified.com/blog/2009/05/ginstruments/#comments</comments>
		<pubDate>Sat, 23 May 2009 19:03:59 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[benchmark]]></category>
		<category><![CDATA[Free Software]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=123</guid>
		<description><![CDATA[As a developer I&#8217;m very often on the hunt for every last bit of performance &#8211; trying to optimize every single function of my program.
In the past weeks I&#8217;ve been thinking of, designing and developing on a new plugin for the growing framework Grails. It will be called GInstruments and it aims to provide some [...]]]></description>
			<content:encoded><![CDATA[<p>As a developer I&#8217;m very often on the hunt for every last bit of performance &#8211; trying to optimize every single function of my program.</p>
<p>In the past weeks I&#8217;ve been thinking of, designing and developing on a new plugin for the growing framework Grails. It will be called GInstruments and it aims to provide some useful clues for Grails developers who want to know how their application is performing.</p>
<p>The plugin uses Hyperic&#8217;s (<a href="http://www.hyperic.com/springsource/" target="_blank">now SpringSource</a>) <a href="http://support.hyperic.com/display/SIGAR/Home" target="_blank">SIGAR</a> (System Information Gatherer And Reporter) to report vital system information such as CPU usage or memory comsumption overall or for the current process.</p>
<p>The first release (0.1) is only going to be a snapshot of my first ideas, hence I&#8217;ll not release it to the official Grails plugin repositories. It will show you some information about your system like name, version, vendor or architecture, the current CPU and memory consumption. Especially for your current process (which will be the relevant information to know). Take a look at this:</p>
<div id="attachment_127" class="wp-caption alignnone" style="width: 408px"><a href="http://matiam.creatified.com/blog/wp-uploads/2009/05/ginstruments-01.png"><img class="size-full wp-image-127" title="First draft of GInstruments 0.1" src="http://matiam.creatified.com/blog/wp-uploads/2009/05/ginstruments-01.png" alt="First draf of GInstruments 0.1" width="398" height="302" /></a><p class="wp-caption-text">First draft of GInstruments 0.1</p></div>
<p>All these features are subject to change (I first wanted to know whether there could be a future for this). Possible features for the future may include</p>
<ul>
<li>logging of metrics (cpu, memory, swap, network, &#8230;)</li>
<li>tracking of Grails events (requests, &#8230;)</li>
<li>visualization of these two and more components over time to detect points of interest</li>
</ul>
<p>I&#8217;m open to all kinds feature requests but please bear in mind that I&#8217;m only doing this in my spare time, after work, school whatsoever ;-)</p>
<p>At last let me point you to a link (for the non-Apple-developers) to <a href="http://www.apple.com/macosx/developertools/instruments.html" target="_blank">how Apple&#8217;s Instruments-app looks like</a>. I think it has some other cool possibilities.</p>
<p>At the moment I&#8217;m also waiting for some response from the guys from Hyperic. I really want to license the plugin under the terms of the Apache License (the license Grails uses and many other plugins) &#8211; SIGAR is GPL-only at the moment.</p>
<p>Do you think this could be a useful plugin for the Grails infrastructure? What&#8217;s your opinion.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/05/ginstruments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grails &#8211; ImageTools-Plugin</title>
		<link>http://creatified.com/blog/2009/05/grails-imagetools-plugin/</link>
		<comments>http://creatified.com/blog/2009/05/grails-imagetools-plugin/#comments</comments>
		<pubDate>Fri, 08 May 2009 20:05:37 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[Grails]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[JAI]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JDK]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=103</guid>
		<description><![CDATA[There have already been some posts about the Grails Framework on my blog, so here&#8217;s one about the ImageTools plugin. This plugin leverages some functionality of the Java Advanced Imaging API (JAI) to make handling images a lot easier for Grails developers. However, some people seem to be complaining about poor image quality &#8211; I [...]]]></description>
			<content:encoded><![CDATA[<p>There have already been some posts about the <a href="http://www.grails.org">Grails Framework</a> on my blog, so here&#8217;s one about the <strong><a href="http://www.grails.org/ImageTools+plugin">ImageTools plugin</a>.</strong> This plugin leverages some functionality of the <a href="https://jai-imageio.dev.java.net/">Java Advanced Imaging API (JAI)</a> to make handling images a lot easier for Grails developers. However, some people <a href="http://javazquez.com/juan/category/grails/">seem to be complaining</a> about poor image quality &#8211; I guess they&#8217;re about the poor resizing-results when using the thumbnail functionality.</p>
<p>The default method for creating thumbnails is the following</p>
<blockquote>
<pre>def imageTool = new ImageTool()</pre>
<pre>imageTool.load("/path/to/image.jpg")</pre>
<pre>imageTool.thumbnail(640)</pre>
</blockquote>
<p>This will load the file, create a new ImageTool instance and make a thumbnail out of it, where the max width/height will be 640px. However the resizing quality is very bad because by default it uses nearest neighbor for interpolation. You will encounter this especially when you&#8217;re rendering small thumbnails out of large images.</p>
<h3>A possible solution</h3>
<p>Because there is no detailed documentation about the ImageTools plugin (actually I didn&#8217;t find any) one will have to inspect the source code to find something very cool: ImageTools also provides a method called &#8220;<strong>thumbnailSpecial</strong>&#8221; which can use other interpolation and rendering algorithms and you can use it instead of the basic &#8220;thumbail()&#8221;. It&#8217;s signature is as follows</p>
<blockquote>
<pre>thumbnailSpecial(float maxWidth,
                 float maxHeight,
                 int interPolationType,
                 int renderingType)</pre>
</blockquote>
<p>maxWidth and maxWidth are pretty self-explaining, just set them to the same values (for example 640) to achieve the same dimensions as above.</p>
<p>interPolationType is one of</p>
<p><strong>1</strong>: &#8220;bilinear interpolation&#8221; &#8211; which is at least better than nearest<br />
<strong>2</strong>: &#8220;bicubic interpolation&#8221; &#8211; which is even better and<br />
<strong>3</strong>: &#8220;bicubic2 interpolation&#8221; &#8211; which may even better</p>
<p>these are JAI names for them, don&#8217;t ask me about the details</p>
<p>renderingType is one of<br />
<strong>1</strong>: &#8220;scale&#8221; &#8211; the default function JAI uses<br />
<strong>2</strong>: &#8220;SubsampleAverage&#8221; &#8211; which will provide better results</p>
<p>Please keep in mind that all the &#8220;better results&#8221; require <strong>a lot more rendering time</strong> and are likely to consume more memory &#8211; but the results will be way smoother then.</p>
<p>So that may help some people out there which have experienced poor quality at this end.</p>
<p>For me there are only two further caveats when using ImageTools/JAI.</p>
<p>First: <strong>performance</strong> is very bad when using pure Java mode (which will be the default unless you provide a &#8220;native accelerator&#8221; for JAI). On my Mac this is no problem &#8211; as far as I know Apple provides a native accelerator in its own JDK on Mac OS X (and I never got messages like <a href="http://www.grails.org/ImageTools+plugin">detailed on the plugin page</a>) &#8211; yeah, using CoreGraphics/CoreImage, whatever&#8230; correct me if I&#8217;m wrong ;-) but I never got it to run on my production system (Ubuntu Server).</p>
<p>Second: JAI seems to have some other <strong>strange problems with JPEGs on Linux</strong> (I tried both OpenJDK and Sun&#8217;s JDK, always JAI in pure Java mode): some JPEGs will have inverted colors in the resulting thumbnail &#8211; couldn&#8217;t find out any details but I think something about the JPEG implementation is broken. This also affects saving JPEGs for me. It got strange exceptions when saving images as JPEGs causing that to fail &#8211; so I fell back to using PNGs &#8211; which is everything but cool in many cases :-(</p>
<p>As said these two problems only occurred on Linux (Ubuntu 9.04) &#8211; not on Mac OS X (couldn&#8217;t test on Windows) &#8211; but since most web apps I&#8217;m writing will be running on Linux some day this is a very annoying problem &#8211; and unfortunately I don&#8217;t see any progress on the ImageTools plugin or JAI. Anybody else got this kind of problem?</p>
<p>So I&#8217;m very tended to give something like good old <a href="http://www.imagemagick.org/">ImageMagick</a> a try &#8211; maybe using <a href="http://im4java.sourceforge.net/">im4java</a> or <a href="http://www.jmagick.org/index.html">JMagick</a> &#8211; or something else.</p>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/05/grails-imagetools-plugin/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Enterprise-Vorlesung</title>
		<link>http://creatified.com/blog/2009/04/enterprise-vorlesung/</link>
		<comments>http://creatified.com/blog/2009/04/enterprise-vorlesung/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 18:31:28 +0000</pubDate>
		<dc:creator>mat.i.am</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[study]]></category>
		<category><![CDATA[BA Mosbach]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[Grails]]></category>
		<category><![CDATA[Groovy]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[JBoss]]></category>

		<guid isPermaLink="false">http://creatified.com/blog/?p=93</guid>
		<description><![CDATA[In der Enterprise-Vorlesung lernten wir dieses Semester verschiedene Technologien kennen, die fÃ¼r die Entwicklung und den Einsatz von Unternehmens-Anwendungen wichtig sind.
Neben einem schriftlichen Test erarbeiteten wir in verschiedenen Gruppen unseres Kurses einzelne Module an einem &#8220;Downloadportal&#8221;. Dazu sollten wir unter Anderem den JBoss Portal Server einsetzen.
Aufgabe/Gruppe
Ich war gemeinsam mit meinen Kommilitonen Claudia FrÃ¶hlich, Katrin Plaumann [...]]]></description>
			<content:encoded><![CDATA[<p>In der <strong>Enterprise</strong>-Vorlesung lernten wir dieses Semester verschiedene Technologien kennen, die fÃ¼r die Entwicklung und den Einsatz von Unternehmens-Anwendungen wichtig sind.</p>
<p>Neben einem schriftlichen Test erarbeiteten wir in verschiedenen Gruppen unseres Kurses einzelne Module an einem <strong>&#8220;Downloadportal&#8221;</strong>. Dazu sollten wir unter Anderem den <a href="http://www.jboss.org/jbossportal/">JBoss Portal Server</a> einsetzen.</p>
<p><strong>Aufgabe/Gruppe</strong></p>
<p>Ich war gemeinsam mit meinen Kommilitonen Claudia FrÃ¶hlich, Katrin Plaumann und Lino StrÃ¼mann, in der Gruppe <strong>&#8220;Persistenz&#8221;</strong>. Unsere Aufgabe war es, mittels des ORM-Frameworks <a href="https://www.hibernate.org/">Hibernate</a> dafÃ¼r zu sorgen, dass jegliche Objekte aus dem Downloadportal transparent in einer relationalen Datenbank abgespeichert und aus dieser auch wieder ausgelesen werden konnten. Hibernate ist ein sog. objekt-relationaler-Mapper (kann also objektorientierte Strukturen in relationale Strukturen mappen) und hat sich auf diesem Gebiet als Quasi-Standard etabliert.</p>
<p>Dazu entwickelten wir eine Hilfsklasse, welche den anderen Gruppen nicht nur eine Hibernate-Session bereitstellte, sondern auch Methoden um verschiedene Objekte in die Datenbank schreiben zu kÃ¶nnen. ErgÃ¤nzt wurde dies durch einige &#8220;Finder&#8221;-Methoden die z.B. einen Benutzer anhand seines Nicknames finden konnte. Diese Klasse wurde allen anderen Gruppen zur VerfÃ¼gung gestellt.</p>
<p><strong>zur Entwicklungs-Umgebung</strong></p>
<ul>
<li>Da wir keine Testumgebung innerhalb des Portal Servers hatten, sicherten wir unsere Ergebnisse allein durch eine umfangreiche Test-Abdeckung durch JUnit ab</li>
<li>zur Versionskontrolle nutzten wir ein Subversion-Repository dass ich auf meinem privaten Server eingerichtet habe</li>
</ul>
<p><strong>Erfahrungen</strong></p>
<p>Ich hatte bisher schon Erfahrungen mit Hibernate gemacht &#8211; vor allem durch verschiedene Arbeiten mit <a href="http://grails.org/">Grails </a>das ebenfalls Hibernate einbindet. Allerdings war die &#8220;Low-Level-Arbeit&#8221; mit Hibernate eine andere Anforderung, ganz im Vergleich zu dem <a href="http://www.grails.org/GORM">&#8220;Luxus&#8221; den Grails dabei anbietet</a>. Dennoch kam ich damit sehr gut zurecht und konnte meinen Kommilitonen die bisher noch nicht damit gearbeitet hatten eine kurze EinfÃ¼hrung in das Thema geben.</p>
<p><strong>MÃ¶gliche Verbesserungen</strong></p>
<p>aus diversen GrÃ¼nden kamen wir erst in den letzten Wochen des Semesters dazu diese Anwendung zu entwickeln. Unser Teil wurde dabei relativ flott in weniger als einer knappen Woche fertig. Dabei wurde natÃ¼rlich einiges weggelassen, damit wir so schnell fertig wurden. Optimieren kÃ¶nnen hÃ¤tten wir zum Beispiel durch</p>
<ul>
<li>mehr Finder-Methoden fÃ¼r die Objekte anzubieten (wÃ¤re in Groovy dank Meta-Methoden sehr einfach, wie <a href="http://www.grails.org/DomainClass+Dynamic+Methods#findAllBy*">z.B. bei Grails</a>)</li>
<li><a href="http://logging.apache.org/log4j/">log4j</a> (miteingebunden) weiter nutzen um detaillierte Logs auszugeben</li>
<li>Aufbau des gesamten Projekts z.B. mit <a href="http://maven.apache.org/">Maven</a>, um AbhÃ¤ngigkeiten von Libraries transparent auflÃ¶sen zu kÃ¶nnen (hÃ¤tte leider wiederum eine EinfÃ¼hrung benÃ¶tigt, da Ant, Maven oder auch JUnit den meisten noch unbekannt waren)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://creatified.com/blog/2009/04/enterprise-vorlesung/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
