<?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>Armin Widegreen</title>
	<atom:link href="http://armin.widegreen.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://armin.widegreen.de</link>
	<description>Personal Homepage &#124; Projects</description>
	<lastBuildDate>Mon, 14 Nov 2011 23:04:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Bash script template with parameter evaluation</title>
		<link>http://armin.widegreen.de/2011/11/bash-script-template-with-parameter-evaluation/</link>
		<comments>http://armin.widegreen.de/2011/11/bash-script-template-with-parameter-evaluation/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 22:59:53 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=326</guid>
		<description><![CDATA[just a handy bash script template: #!/bin/bash scriptname=&#34;script_template&#34; ### functions function usage &#123; &#160; &#160; echo -e &#34;usage: $scriptname MANDATORY [OPTION]\n&#34; &#160; &#160; echo -e &#34;MANDATORY mandatory parameter:&#34; &#160; &#160; echo -e &#34; &#160;-m, &#160;--mandatory &#160;VAL &#160;The desc of the mandatory parameter\n&#34; &#160; &#160; echo -e &#34;OPTION optional parameter:\n&#34; &#160; &#160; echo -e &#34; &#160;-h, [...]


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>just a handy bash script template:</p>
<div class="codecolorer-container bash dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:700px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<br />
<span style="color: #007800;">scriptname</span>=<span style="color: #ff0000;">&quot;script_template&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;">### functions</span><br />
<span style="color: #000000; font-weight: bold;">function</span> usage<br />
<span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;usage: <span style="color: #007800;">$scriptname</span> MANDATORY [OPTION]<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;MANDATORY mandatory parameter:&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot; &nbsp;-m, &nbsp;--mandatory &nbsp;VAL &nbsp;The desc of the mandatory parameter<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;OPTION optional parameter:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot; &nbsp;-h, &nbsp;--help &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Prints this help&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot; &nbsp;-o1, --optional1 &nbsp; &nbsp; &nbsp; The optional1 parameter&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot; &nbsp;-o2, --optional2 VAL &nbsp; The optional2 parameter<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;EXAMPLE:&quot;</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot; &nbsp;<span style="color: #007800;">$scriptname</span> -m mandatory -o1 opt1&quot;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># more...</span><br />
<span style="color: #666666; font-style: italic;">#####</span><br />
<br />
<span style="color: #666666; font-style: italic;">### Main</span><br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> == <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Called with no parameter!&quot;</span><br />
&nbsp; &nbsp; usage<br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #007800;">mand</span>=<br />
<span style="color: #007800;">opt1</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #666666; font-style: italic;"># or use 1 and 0, with default 0</span><br />
<span style="color: #007800;">opt2</span>=<span style="color: #ff0000;">&quot;defaultValue&quot;</span><br />
<br />
<span style="color: #666666; font-style: italic;"># parameter while-loop</span><br />
<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<br />
<span style="color: #000000; font-weight: bold;">do</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #007800;">$1</span> <span style="color: #000000; font-weight: bold;">in</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-m</span> &nbsp;<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--mandatory</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">shift</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">mand</span>=<span style="color: #007800;">$1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-o1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--optional1</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;<span style="color: #007800;">opt1</span>=<span style="color: #ff0000;">&quot;true&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-o2</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--optional2</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">shift</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">opt2</span>=<span style="color: #007800;">$1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; &nbsp;<span style="color: #660033;">-h</span> &nbsp;<span style="color: #000000; font-weight: bold;">|</span> <span style="color: #660033;">--help</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; usage<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; usage<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;The parameter $1 is not allowed&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span> <span style="color: #666666; font-style: italic;"># error</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">;;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">esac</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">shift</span><br />
<span style="color: #000000; font-weight: bold;">done</span><br />
<br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$mand</span>&quot;</span> == <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;mandatroy parameter is missing&quot;</span><br />
&nbsp; &nbsp; usage<br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span> <span style="color: #666666; font-style: italic;"># error</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;params: <span style="color: #007800;">$mand</span>, <span style="color: #007800;">$opt1</span>, <span style="color: #007800;">$opt2</span>&quot;</span><br />
<span style="color: #666666; font-style: italic;">#####</span></div></div>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2011/11/bash-script-template-with-parameter-evaluation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Comparing JPQL, Criteria string-based and typesafe queries</title>
		<link>http://armin.widegreen.de/2010/05/comparing-jpql-criteria-string-based-and-typesafe-queries/</link>
		<comments>http://armin.widegreen.de/2010/05/comparing-jpql-criteria-string-based-and-typesafe-queries/#comments</comments>
		<pubDate>Fri, 07 May 2010 22:13:16 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Criteria API]]></category>
		<category><![CDATA[Entity Bean]]></category>
		<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[JPQL]]></category>
		<category><![CDATA[Query]]></category>
		<category><![CDATA[typesafe query]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=228</guid>
		<description><![CDATA[The last two evenings I stucked in searching for more or less complex examples of different JPA 2 queries. By complex I mean, constructing constructor queries with multiple joins, group by and an average function (avg). The JPQL solution (using a normal query defined as string) wasn't to hard to find, compared to the Criteria [...]


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The last two evenings I stucked in searching for more or less complex examples of different JPA 2 queries. By complex I mean, constructing constructor queries with multiple joins, group by and an average function (avg). The JPQL solution (using a normal query defined as string) wasn't to hard to find, compared to the Criteria API version (introduced in the JPA 2 specification).</p>
<p>In the following article I'm going to describe three semantically identical queries using:</p>
<ol>
<li>JPQL query</li>
<li>Criteria API string based Query</li>
<li>Criteria API dynamic, typesafe Query (using a canonical Metamodel)</li>
</ol>
<p>I don't want to go to much in details by explaining Criteria API here, because there are obviously enough resources on the net (see <a href="#refs">references</a>).  To construct a complex query, I use three Entity Beans: <strong>Car</strong>, <strong>CarModel</strong>, <strong>CarManufacturer</strong>. The dependencies between the classes are straightforward: a car has a reference to a model and the model refer to a car manufacturer. The car also has a property mileage (Double), consider a used car. Furthermore, both, car model and manufacturer, also have a name property (String). Here is the graphical representation of this class structure.</p>
<p><a href="http://armin.widegreen.de/wp-content/uploads/2010/05/awqueriesapientities1.png"><img src="http://armin.widegreen.de/wp-content/uploads/2010/05/awqueriesapientities1.png" alt="" title="awqueriesapientities" width="512" height="329" class="aligncenter size-full wp-image-292" /></a></p>
<p>All subsequent queries correspond to the following <strong>SQL</strong>-Statement:</p>
<div class="codecolorer-container sql dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="sql codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #993333; font-weight: bold;">SELECT</span> cmf<span style="color: #66cc66;">.</span>name<span style="color: #66cc66;">,</span> AVG<span style="color: #66cc66;">&#40;</span>c<span style="color: #66cc66;">.</span>mileage<span style="color: #66cc66;">&#41;</span><br />
<span style="color: #993333; font-weight: bold;">FROM</span> Car c<br />
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> CarModel cm<br />
&nbsp; <span style="color: #993333; font-weight: bold;">ON</span> c<span style="color: #66cc66;">.</span>carModel <span style="color: #66cc66;">=</span> cm<span style="color: #66cc66;">.</span>uuid<br />
<span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> CarManufacturer cmf<br />
&nbsp; <span style="color: #993333; font-weight: bold;">ON</span> cm<span style="color: #66cc66;">.</span>manufacturer <span style="color: #66cc66;">=</span> cmf<span style="color: #66cc66;">.</span>uuid<br />
<span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> cmf<span style="color: #66cc66;">.</span>name</div></div>
<p>meaning: Get all car manufacturer name and the belonging average mileage for all cars of the manufacturer.</p>
<p>Before getting started with the interesting stuff, I must introduce an additional class that is essential for this examples. The problem is, if you want to compound your Query result, you have to construct a value object class like <em>CompoudElement</em> I use. It is important that you have a constructor that explicitly matches your Query Selection-clause. So, I want to receive a String (name) and a Double (avg value) for my query, so the class looks something like this:</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> CompoundElement <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adouble+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Double</span></a> dValue<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> CompoundElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adouble+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Double</span></a> value<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> <span style="color: #339933;">=</span> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">dValue</span> <span style="color: #339933;">=</span> value<span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/* needed for Criteria query */</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> CompoundElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> name, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a> num<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">name</span> <span style="color: #339933;">=</span> name<span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">dbValue</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Adouble+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Double</span></a><span style="color: #009900;">&#41;</span>num<span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #666666; font-style: italic;">/* getter an setter */</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The <strong>JPQL</strong> query isn't so far away from the SQL one. This query is also called <strong>constructor query</strong>, because of the previous mentioned CompoundElement class you need.</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SomeClassJPQL <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;@PersistenceContext<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> EntityManager em<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> findAvgMileageForManufacturer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; Query query <span style="color: #339933;">=</span> em.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;SELECT NEW aw.queries.api.vo.CompoundElement(cmfJoin.name, AVG(c.mileage)) &quot;</span> <span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;FROM Car c &quot;</span> <span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;JOIN c.carModel cm &quot;</span> <span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;JOIN cm.manufacturer cmfJoin &quot;</span> <span style="color: #339933;">+</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #0000ff;">&quot;GROUP BY cmfJoin.name&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>query.<span style="color: #006633;">getResultList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>While the query is executed, the JPA creates a List of CompoundElements, adds a new CompoundElement for every result tuple and returns the constructed result list (see getResultList).</p>
<p>Now lets view the Criteria API code for that string based query. In contrast to the JPQL code, the query here uses the</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">CompoundElement<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a>, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aobject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Object</span></a><span style="color: #009900;">&#41;</span></div></div>
<p>constructor. So we have to cast the Object to Double inside the constructor (see CompoundElement definition).</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SomeClassStrings <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;@PersistenceContext<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> EntityManager em<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> findAvgMileageForManufacturer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; CriteriaBuilder cb <span style="color: #339933;">=</span> em.<span style="color: #006633;">getCriteriaBuilder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; CriteriaQuery<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> q <span style="color: #339933;">=</span> cb.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>CompoundElement.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Root<span style="color: #339933;">&lt;</span>Car<span style="color: #339933;">&gt;</span> c <span style="color: #339933;">=</span> q.<span style="color: #006633;">from</span><span style="color: #009900;">&#40;</span>Car.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Join<span style="color: #339933;">&lt;</span>Car, CarModel<span style="color: #339933;">&gt;</span> cmJoin <span style="color: #339933;">=</span> c.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;carModel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Join<span style="color: #339933;">&lt;</span>CarModel, CarManufacturer<span style="color: #339933;">&gt;</span> cmfJoin &nbsp;<span style="color: #339933;">=</span> cmJoin.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;manufacturer&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Expression<span style="color: #339933;">&lt;</span>Double<span style="color: #339933;">&gt;</span> mileage <span style="color: #339933;">=</span> c.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;mileage&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; CompoundSelection<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> cSelect <span style="color: #339933;">=</span> cb.<span style="color: #006633;">construct</span><span style="color: #009900;">&#40;</span>CompoundElement.<span style="color: #000000; font-weight: bold;">class</span>, cmfJoin.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span>, cb.<span style="color: #006633;">avg</span><span style="color: #009900;">&#40;</span>mileage<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; q.<span style="color: #006633;">select</span><span style="color: #009900;">&#40;</span>cSelect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Expression<span style="color: #339933;">&lt;</span>String<span style="color: #339933;">&gt;</span> manuName <span style="color: #339933;">=</span> cmfJoin.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; q.<span style="color: #006633;">groupBy</span><span style="color: #009900;">&#40;</span>manuName<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; TypedQuery<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> query <span style="color: #339933;">=</span> em.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>q<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>query.<span style="color: #006633;">getResultList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>The last example uses the Criteria API <strong>typesafe query</strong> based on a metamodel which you have to define [<a href="http://java.sun.com/javaee/6/docs/tutorial/doc/gjiup.html">JavaEE6Tut</a>]. This is obviously a very annoying task, thats why <i>eclipseLink</i> provides you a metamodel generator [<a href="http://blog.gueck.com/2009/12/generating-jpa-20-criteria-canonical.html">genCanonicalModel</a>]. I had some strange experiences with this generation process using maven and NetBeans 6.8.</p>
<p>Using the standard canonical classes definition results in: Car_, CarModel_ and CarManufacturer_. The query for the typesafe version looks like this:</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SomeClassDynamic <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;@PersistenceContext<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> EntityManager em<span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> findAvgMileageForManufacturer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; CriteriaBuilder cb <span style="color: #339933;">=</span> em.<span style="color: #006633;">getCriteriaBuilder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; CriteriaQuery<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> q <span style="color: #339933;">=</span> cb.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>CompoundElement.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; Root<span style="color: #339933;">&lt;</span>Car<span style="color: #339933;">&gt;</span> c <span style="color: #339933;">=</span> q.<span style="color: #006633;">from</span><span style="color: #009900;">&#40;</span>Car.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Join<span style="color: #339933;">&lt;</span>Car, CarModel<span style="color: #339933;">&gt;</span> cmJoin <span style="color: #339933;">=</span> c.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span>Car_.<span style="color: #006633;">carModel</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; Join<span style="color: #339933;">&lt;</span>CarModel, CarManufacturer<span style="color: #339933;">&gt;</span> cmfJoin &nbsp;<span style="color: #339933;">=</span> cmJoin.<span style="color: #006633;">join</span><span style="color: #009900;">&#40;</span>CarModel_.<span style="color: #006633;">manufacturer</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; CompoundSelection<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> cSelect <span style="color: #339933;">=</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; cb.<span style="color: #006633;">construct</span><span style="color: #009900;">&#40;</span>CompoundElement.<span style="color: #000000; font-weight: bold;">class</span>, cmfJoin.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>CarManufacturer_.<span style="color: #006633;">name</span><span style="color: #009900;">&#41;</span>, cb.<span style="color: #006633;">avg</span><span style="color: #009900;">&#40;</span>c.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>Car_.<span style="color: #006633;">mileage</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; q.<span style="color: #006633;">select</span><span style="color: #009900;">&#40;</span>cSelect<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; q.<span style="color: #006633;">groupBy</span><span style="color: #009900;">&#40;</span>cmfJoin.<span style="color: #006633;">get</span><span style="color: #009900;">&#40;</span>CarManufacturer_.<span style="color: #006633;">name</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; TypedQuery<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span> query <span style="color: #339933;">=</span> em.<span style="color: #006633;">createQuery</span><span style="color: #009900;">&#40;</span>q<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>List<span style="color: #339933;">&lt;</span>CompoundElement<span style="color: #339933;">&gt;</span><span style="color: #009900;">&#41;</span>query.<span style="color: #006633;">getResultList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p><a name="refs"></a>References:</p>
<ul>
<li>[<a href="http://www.ibm.com/developerworks/java/library/j-typesafejpa/">1</a>] IBM developer works - Dynamic, typesafe queries in JPA 2.0</li>
<li>[<a href="http://java.sun.com/javaee/6/docs/tutorial/doc/gjitv.html">2</a>] Oracle (Sun) - The Java EE 6 Tutorial Part I</li>
<li>[<a href="http://relation.to/Bloggers/ATypesafeCriteriaQueryAPIForJPA">3</a>] In Relation to ... - A typesafe criteria query API for JPA</li>
<li>[<a href="http://blog.gueck.com/2009/12/generating-jpa-20-criteria-canonical.html">4</a>] The little island of excitement - Generating JPA 2.0 Criteria canonical metamodels ...</li>
<li>[<a href="http://www.siriusict.com/2010/02/08/a-look-at-jpa-2-0-criteria-api/">5</a>]  Sirius ICT - A Look at JPA 2.0 Criteria API</li>
</ull>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2010/05/comparing-jpql-criteria-string-based-and-typesafe-queries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Short node on (B)Lobs in Entity Beans</title>
		<link>http://armin.widegreen.de/2010/05/short-node-on-blobs-in-entity-beans/</link>
		<comments>http://armin.widegreen.de/2010/05/short-node-on-blobs-in-entity-beans/#comments</comments>
		<pubDate>Mon, 03 May 2010 21:08:33 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Blob]]></category>
		<category><![CDATA[Entity Bean]]></category>
		<category><![CDATA[JavaEE]]></category>
		<category><![CDATA[JPA]]></category>
		<category><![CDATA[Lob]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=217</guid>
		<description><![CDATA[Have you ever thought about storing files in an Entity-Table, using the JPA? Well here is the solution: @Entity @Table&#40;name = &#34;histories&#34;&#41; @NamedQueries&#40;&#123; &#160; &#160;@NamedQuery&#40;name = History.FIND_ALL, query = &#34;SELECT his FROM History his&#34;&#41; &#125;&#41; public class History extends EntityBase &#123; &#160; &#160;public static final String FIND_ALL = &#34;findAllHistories&#34;; &#160; &#160;@Temporal&#40;TemporalType.TIMESTAMP&#41; &#160; &#160;@Column&#40;name=&#34;import_date&#34;&#41; &#160; &#160;private [...]


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Have  you ever thought about storing files in an Entity-Table, using the JPA? Well here is the solution:</p>
<div class="codecolorer-container java dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="java codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">@<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aentity+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Entity</span></a><br />
@Table<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;histories&quot;</span><span style="color: #009900;">&#41;</span><br />
@NamedQueries<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;@NamedQuery<span style="color: #009900;">&#40;</span>name <span style="color: #339933;">=</span> History.<span style="color: #006633;">FIND_ALL</span>, query <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT his FROM History his&quot;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><br />
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> History <span style="color: #000000; font-weight: bold;">extends</span> EntityBase <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000000; font-weight: bold;">final</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> FIND_ALL <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;findAllHistories&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp;@Temporal<span style="color: #009900;">&#40;</span>TemporalType.<span style="color: #006633;">TIMESTAMP</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp;@Column<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;import_date&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Acalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Calendar</span></a> importDate<span style="color: #339933;">;</span><br />
&nbsp; &nbsp;...<br />
&nbsp; &nbsp;<span style="color: #666666; font-style: italic;">/* BEGIN here */</span><br />
&nbsp; &nbsp;@Column<span style="color: #009900;">&#40;</span>name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;excel_file&quot;</span>, length<span style="color: #339933;">=</span><span style="color: #cc66cc;">20000000</span>, columnDefinition<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;longblob&quot;</span><span style="color: #009900;">&#41;</span><br />
&nbsp; &nbsp;@Lob<br />
&nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> excelFile<span style="color: #339933;">;</span><br />
&nbsp; &nbsp;<span style="color: #666666; font-style: italic;">/* END here */</span><br />
<span style="color: #009900;">&#125;</span></div></div>
<p>As usual the <strong>name</strong> in the Column annotation specifies the corresponding Column-name in the destination table.   The <strong>length</strong> property specifies the length of the Column. Actually, this is important, because the default length, provided by the JPA, is 4096, I think.  Obviously, the <strong>columnDefinition</strong> defines the datatype, which should be created from the JPA. At least add the <strong>@Lob</strong> annotation.</p>
<p>The resulting column in the database table should look smth like:</p>
<ul>
<li>name: excel_file</li>
<li>nulls allowed: no</li>
<li>data type: LONGVARBINARY</li>
<li>column size: 2147483647</li>
<li>...</li>
</ul>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2010/05/short-node-on-blobs-in-entity-beans/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>A paper made tux</title>
		<link>http://armin.widegreen.de/2010/01/a-paper-made-tux/</link>
		<comments>http://armin.widegreen.de/2010/01/a-paper-made-tux/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 19:29:34 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tux]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=195</guid>
		<description><![CDATA[Actually, I really have to learn for my exam ... but then I found this: http://en.digitalkamera.com/make-a-paper-tux-linux-penguin-in-less-than-15-minutes penguin But I think 15 minutes are indeed very optimistic - I took an hour or so. Here is my result of tux: No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Actually, I really have to learn for my exam ... but then I found this:</p>
<ul>
<li><a href="http://en.digitalkamera.com/make-a-paper-tux-linux-penguin-in-less-than-15-minutes">http://en.digitalkamera.com/make-a-paper-tux-linux-penguin-in-less-than-15-minutes</a></li>
<li><a href="http://armin.widegreen.de/wp-content/uploads/2010/01/penguin.pdf">penguin</a></li>
</ul>
<p>But I think 15 minutes are indeed very optimistic - I took an hour or so. Here is my result of tux:</p>

<a href='http://armin.widegreen.de/2010/01/a-paper-made-tux/dsc00512/' title='DSC00512'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/DSC00512-150x150.jpg" class="attachment-thumbnail" alt="DSC00512" title="DSC00512" /></a>
<a href='http://armin.widegreen.de/2010/01/a-paper-made-tux/dsc00513/' title='DSC00513'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/DSC00513-150x150.jpg" class="attachment-thumbnail" alt="DSC00513" title="DSC00513" /></a>
<a href='http://armin.widegreen.de/2010/01/a-paper-made-tux/dsc00516/' title='DSC00516'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/DSC00516-150x150.jpg" class="attachment-thumbnail" alt="DSC00516" title="DSC00516" /></a>
<a href='http://armin.widegreen.de/2010/01/a-paper-made-tux/dsc00519/' title='DSC00519'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/DSC00519-150x150.jpg" class="attachment-thumbnail" alt="DSC00519" title="DSC00519" /></a>



<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2010/01/a-paper-made-tux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy New Year 2010!</title>
		<link>http://armin.widegreen.de/2010/01/happy-new-year-2010/</link>
		<comments>http://armin.widegreen.de/2010/01/happy-new-year-2010/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 13:03:06 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Rügen]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=188</guid>
		<description><![CDATA[Binz / Rügen - 01.01.2010: No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Binz / Rügen - 01.01.2010:
<a href='http://armin.widegreen.de/2010/01/happy-new-year-2010/img_0905_1/' title='IMG_0905_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/IMG_0905_1-e1262523826197-150x150.jpg" class="attachment-thumbnail" alt="IMG_0905_1" title="IMG_0905_1" /></a>
<a href='http://armin.widegreen.de/2010/01/happy-new-year-2010/img_0913_1/' title='IMG_0913_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/IMG_0913_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_0913_1" title="IMG_0913_1" /></a>
<a href='http://armin.widegreen.de/2010/01/happy-new-year-2010/img_0920_1/' title='IMG_0920_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2010/01/IMG_0920_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_0920_1" title="IMG_0920_1" /></a>
</p>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2010/01/happy-new-year-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter impressions from Rügen</title>
		<link>http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/</link>
		<comments>http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 17:10:41 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Photos]]></category>
		<category><![CDATA[Rügen]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=170</guid>
		<description><![CDATA[20th Dec. 2009: Garz/Rügen, -12°C and Snow - so I went out and took some photos (Glewitz and Puddemin): No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>20th Dec. 2009: Garz/Rügen, -12°C and Snow - so I went out and took some photos (<a href="http://maps.google.de/maps/place?ftid=0x47ab6e36907a020d:0xa251aeb32316430" target="_blank">Glewitz</a> and <a href="http://maps.google.de/maps/place?ftid=0x47ab6ee37f607f8b:0xa251aeb32315ad0" target="_blank">Puddemin</a>):</p>

<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5410_1/' title='IMG_5410_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5410_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5410_1" title="IMG_5410_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5411_1/' title='IMG_5411_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5411_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5411_1" title="IMG_5411_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5412_1/' title='IMG_5412_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5412_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5412_1" title="IMG_5412_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5413_1/' title='IMG_5413_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5413_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5413_1" title="IMG_5413_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5414_1/' title='IMG_5414_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5414_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5414_1" title="IMG_5414_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5417_1/' title='IMG_5417_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5417_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5417_1" title="IMG_5417_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5418_1/' title='IMG_5418_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5418_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5418_1" title="IMG_5418_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5420_1/' title='IMG_5420_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5420_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5420_1" title="IMG_5420_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5421_1/' title='IMG_5421_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5421_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5421_1" title="IMG_5421_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5424_1/' title='IMG_5424_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5424_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5424_1" title="IMG_5424_1" /></a>
<a href='http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/img_5425_1/' title='IMG_5425_1'><img width="150" height="150" src="http://armin.widegreen.de/wp-content/uploads/2009/12/IMG_5425_1-150x150.jpg" class="attachment-thumbnail" alt="IMG_5425_1" title="IMG_5425_1" /></a>



<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2009/12/winter-impressions-from-rugen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>executebin-servicemenu-kde</title>
		<link>http://armin.widegreen.de/2009/11/executebin-servicemenu-kde/</link>
		<comments>http://armin.widegreen.de/2009/11/executebin-servicemenu-kde/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 17:25:57 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[KDE]]></category>
		<category><![CDATA[Servicemenu]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=160</guid>
		<description><![CDATA[The executebin-servicemenu-kde is an KDE service menu for setting a file (e.g. the google-earth install file *.bin)  as executable (chmod +x) and executing the file from your favorite filesystem-browser (e.g. Dolphin). I've published the service menu on kde-apps.org: http://kde-apps.org/content/show.php?content=116129 No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>The executebin-servicemenu-kde is an KDE service menu for setting a file (e.g. the google-earth install file *.bin)  as executable (chmod +x) and executing the file from your favorite filesystem-browser (e.g. Dolphin).</p>
<p>I've published the service menu on kde-apps.org: <a href="http://kde-apps.org/content/show.php?content=116129" target="_blank">http://kde-apps.org/content/show.php?content=116129</a></p>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2009/11/executebin-servicemenu-kde/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PathFinder on OpenDesktop.org</title>
		<link>http://armin.widegreen.de/2009/11/pathfinder-on-opendesktop-org/</link>
		<comments>http://armin.widegreen.de/2009/11/pathfinder-on-opendesktop-org/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 22:20:57 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[OpenDesktop.org]]></category>
		<category><![CDATA[pathfinding]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=156</guid>
		<description><![CDATA[We also published PathFinder on OpenDesktop.org: http://opendesktop.org/content/show.php/PathFinder?content=115719 No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>We also published PathFinder on OpenDesktop.org: <a href="http://opendesktop.org/content/show.php/PathFinder?content=115719" target="_blank">http://opendesktop.org/content/show.php/PathFinder?content=115719</a></p>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2009/11/pathfinder-on-opendesktop-org/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PathFinder goes SourceForge</title>
		<link>http://armin.widegreen.de/2009/11/pathfinder-goes-sourceforge/</link>
		<comments>http://armin.widegreen.de/2009/11/pathfinder-goes-sourceforge/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 16:32:56 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[pathfinding]]></category>
		<category><![CDATA[wegfindung]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=151</guid>
		<description><![CDATA[Today, we hosted our project PathFinder on SourceForge.net. So, if you're interested, visit the project homepage: https://sourceforge.net/projects/jpathfinder/. Feel free to contribute some comments or enhancements here or on the projectpage. No related posts. Ähnliche Artikel bereitgestellt von Yet Another Related Posts Plugin.


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Today, we hosted our project <a href="http://armin.widegreen.de/2009/10/pathfinder/">PathFinder</a> on SourceForge.net. So, if you're interested, visit the project homepage: <a href="https://sourceforge.net/projects/jpathfinder/">https://sourceforge.net/projects/jpathfinder/</a>. </p>
<p>Feel free to contribute some comments or enhancements here or on the projectpage.</p>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2009/11/pathfinder-goes-sourceforge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A fuzzyclock for the bash (german)</title>
		<link>http://armin.widegreen.de/2009/11/a-fuzzyclock-for-the-bash-german/</link>
		<comments>http://armin.widegreen.de/2009/11/a-fuzzyclock-for-the-bash-german/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 22:11:42 +0000</pubDate>
		<dc:creator>Armin Widegreen</dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://armin.widegreen.de/?p=118</guid>
		<description><![CDATA[Last weekend I've got some time to do some funny stuff. A friend of mine asked me if I know a script which displays a fuzzyclock in the bash. To refresh my bash skills, I took the time and "hacked" (a bit dirty) this for him. The script displays the current time as written german [...]


No related posts.

Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Last weekend I've got some time to do some funny stuff. A friend of mine asked me if I know a script which displays a fuzzyclock in the bash. To refresh my bash skills, I took the time and "hacked" (a bit dirty) this for him. The script displays the current time as written german words ... see the following screenshot:<img src="http://armin.widegreen.de/wp-content/uploads/2009/11/fuzzyclock_screenshot.png" alt="fuzzyclock_screenshot" title="fuzzyclock_screenshot" width="377" height="154" class="aligncenter size-full wp-image-124" /><br />
If you are interested, here is the script: <a href='http://armin.widegreen.de/wp-content/uploads/2009/11/fuzzyclock_v0.1.tar.gz'>fuzzyclock_v0.1.tar.gz</a><br />
For feedback or improvements, please leave a comment.</p>


<p>No related posts.</p>
<p>Ähnliche Artikel bereitgestellt von <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://armin.widegreen.de/2009/11/a-fuzzyclock-for-the-bash-german/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	<img style='margin:0;padding:0;border:0;' width='1px' height='1px' src="http://armin.widegreen.de/wp-content/plugins/mystat/mystat.php?act=time_load&id=67313&rnd=1968625117" /></channel>
</rss>

