<?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>coffeecoders.de &#187; howto</title>
	<atom:link href="http://coffeecoders.de/tag/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeecoders.de</link>
	<description>professional devs at work</description>
	<lastBuildDate>Tue, 13 Sep 2011 16:34:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Make your bash-prompt git-aware</title>
		<link>http://coffeecoders.de/2011/09/make-your-bash-prompt-git-aware/</link>
		<comments>http://coffeecoders.de/2011/09/make-your-bash-prompt-git-aware/#comments</comments>
		<pubDate>Fri, 09 Sep 2011 16:41:46 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[daily tasks]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=284</guid>
		<description><![CDATA[This post shows you how to make git status-info show up in your bash prompt. So you will always know which status the current git-repo has and which branch you're on. Sweet! <a href="http://coffeecoders.de/2011/09/make-your-bash-prompt-git-aware/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today a friend of mine shared a very nice piece of configuration for using git with me.</p>
<p><code>stevie@box:~/dev/myproject/common [<span style="color: #3333FF;">master</span>]$<br />
</code></p>
<p>If you add the following lines into your <strong>~/.bashrc</strong> you&#8217;ll always know which branch you are on.</p>
<p>Additionally you&#8217;ll be informed if the remote branch (if any) has been changed by adding &#8220;*&#8221; to the branches name. <em>How cool is that?</em></p>
<p><code>stevie@box:~/dev/myproject/common [<span style="color: #3333FF;">master *</span>]$<br />
</code></p>
<p>Here are the lines to add which will do the magic for you:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p284code1'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2841"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p284code1"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GIT_PS1_SHOWDIRTYSTATE</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GIT_PS1_SHOWUNTRACKEDFILES</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">GIT_PS1_SHOWSTASHSTATE</span>=<span style="color: #c20cb9; font-weight: bold;">true</span>
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PS1</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${PS1::$((${#PS1}</span>-3))}<span style="color: #000099; font-weight: bold;">\$</span>(__git_ps1 ' [\[\e[34;1m\]%s\[\e[0m\]]')<span style="color: #000099; font-weight: bold;">\$</span> &quot;</span></pre></td></tr></table></div>

 <p><a href="http://coffeecoders.de/?flattrss_redirect&amp;id=284&amp;md5=dfcd0a8b28c63f41407c9af93b8555b1" title="Flattr" target="_blank"><img src="http://coffeecoders.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2011/09/make-your-bash-prompt-git-aware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pretty-print a SimpleXmlObject in php</title>
		<link>http://coffeecoders.de/2011/03/how-to-pretty-print-a-simplexmlobject-in-php/</link>
		<comments>http://coffeecoders.de/2011/03/how-to-pretty-print-a-simplexmlobject-in-php/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 12:29:56 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=277</guid>
		<description><![CDATA[Today I had to find a simple way to format a parsed xml-string into a pretty looking output for a file and the screen. My search on Google return this stackoverflow-comment which helped me out. I thought I&#8217;d share it &#8230; <a href="http://coffeecoders.de/2011/03/how-to-pretty-print-a-simplexmlobject-in-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today I had to find a simple way to format a parsed xml-string into a pretty looking output for a file and the screen. My search on Google return <a href="http://stackoverflow.com/questions/798967/php-simplexml-how-to-save-the-file-in-a-formatted-way">this stackoverflow-comment</a> which helped me out.</p>
<p>I thought I&#8217;d share it with the world.<br />
<span id="more-277"></span></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p277code3'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2773"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code" id="p277code3"><pre class="php" style="font-family:monospace;">  <span style="color: #009933; font-style: italic;">/**
   * formats the xml output readable
   *
   * @param $simpleXmlObject instance of SimpleXmlObject to pretty-print
   * @return string of indented xml-elements
   */</span>
  <span style="color: #000000; font-weight: bold;">function</span> format<span style="color: #009900;">&#40;</span><span style="color: #339933;">&amp;</span><span style="color: #000088;">$simpleXmlObject</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span> <a href="http://www.php.net/is_object"><span style="color: #990000;">is_object</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$simpleXmlObject</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
      	<span style="color: #666666; font-style: italic;">//Format XML to save indented tree rather than one line</span>
  	<span style="color: #000088;">$dom</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> DOMDocument<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'1.0'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">preserveWhiteSpace</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">formatOutput</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  	<span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">loadXML</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$simpleXmlObject</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">asXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  	<span style="color: #b1b100;">return</span> <span style="color: #000088;">$dom</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">saveXML</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>PS: In case you don&#8217;t know how to get a <a href="http://de.php.net/manual/en/ref.simplexml.php">SimpleXml-Object</a>.</p>
 <p><a href="http://coffeecoders.de/?flattrss_redirect&amp;id=277&amp;md5=c7eca7794a6f84384ffad5d40e438b65" title="Flattr" target="_blank"><img src="http://coffeecoders.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2011/03/how-to-pretty-print-a-simplexmlobject-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert a JAVA keystore from PKCS12 to JKS</title>
		<link>http://coffeecoders.de/2011/03/convert-a-java-keystore-from-pkcs12-to-jks/</link>
		<comments>http://coffeecoders.de/2011/03/convert-a-java-keystore-from-pkcs12-to-jks/#comments</comments>
		<pubDate>Fri, 11 Mar 2011 09:28:17 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[cheat sheet]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[keytool]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=272</guid>
		<description><![CDATA[Although it&#8217;s in the man page of the keytool I think it&#8217;s worth mentioning. JKS has a big advantage over the PKCS12-format: It knows trusted certificates. This way you can use certificates, normally untrusted by your application because the Certificate &#8230; <a href="http://coffeecoders.de/2011/03/convert-a-java-keystore-from-pkcs12-to-jks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Although it&#8217;s in the man page of the <strong>keytool</strong> I think it&#8217;s worth mentioning.</p>
<p>JKS has a big advantage over the PKCS12-format: It knows trusted certificates. This way you can use certificates, normally untrusted by your application because the Certificate Authority (CA) is not trusted within the default keystore.<br />
<span id="more-272"></span><br />
To convert your PKCS12-keystore to a JKS-type use the following line:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p272code5'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2725"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p272code5"><pre class="bash" style="font-family:monospace;"> keytool <span style="color: #660033;">-importkeystore</span> <span style="color: #660033;">-srckeystore</span> oldkeystore.pkcs <span style="color: #660033;">-srcstoretype</span> pkcs12 <span style="color: #660033;">-srcstorepass</span> oldsecret <span style="color: #660033;">-destkeystore</span> newkeystore.jks <span style="color: #660033;">-deststoretype</span> jks <span style="color: #660033;">-deststorepass</span> newsecret</pre></td></tr></table></div>

<p>After execution of this line you will have a 2nd keystore in the directory named &#8220;newkeystore.jks&#8221;.</p>
 <p><a href="http://coffeecoders.de/?flattrss_redirect&amp;id=272&amp;md5=c35995ff71fd248b05cecb3f61a91066" title="Flattr" target="_blank"><img src="http://coffeecoders.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2011/03/convert-a-java-keystore-from-pkcs12-to-jks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Website Optimization Best Practices</title>
		<link>http://coffeecoders.de/2009/06/website-optimization-best-practices/</link>
		<comments>http://coffeecoders.de/2009/06/website-optimization-best-practices/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 11:25:33 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[webdesign]]></category>
		<category><![CDATA[webdevelopment]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=232</guid>
		<description><![CDATA[Many new projects grow from a small base to a full blown app in time. Besides the pride of the accomplishments the developer now has to care about behind-the-scenes-stuff like page load, caching and effective webdesign to keep or improve &#8230; <a href="http://coffeecoders.de/2009/06/website-optimization-best-practices/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Many new projects grow from a small base to a full blown app in time. Besides the pride of the accomplishments the developer now has to care about behind-the-scenes-stuff like page load, caching and effective webdesign to keep or improve the current speed when using the project.</p>
<p>Speed &#8211; or to be more precise the lack of it &#8211; is one of the major annoyances and a main reason for users to not come back. So it is in your own best interest to reach the best possible speed.</p>
<p>I found a <em>very </em>extensive list of website optimization techniques which I wanted to share with you (and to keep a link for future references). I can&#8217;t really say that by now I even follow half the list of improvements but I will certainly try to make the next app better than the one before &#8211; as always.</p>
<p>Link: <a href="http://www.chazzuka.com/blog/?p=175">www.chazzuka.com: Website Optimization Best Practices, speed up your website load</a></p>
 <p><a href="http://coffeecoders.de/?flattrss_redirect&amp;id=232&amp;md5=cc90b27f4d123001f7101365ec98b412" title="Flattr" target="_blank"><img src="http://coffeecoders.de/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/06/website-optimization-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn Java by camp fire stories</title>
		<link>http://coffeecoders.de/2009/04/learn-java-by-camp-fire-stories/</link>
		<comments>http://coffeecoders.de/2009/04/learn-java-by-camp-fire-stories/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 14:43:34 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=215</guid>
		<description><![CDATA[Certainly there are many many ways out there on how to learn a programming language. But did you ever hear about learning a new language by hearing (ie. reading) a camp fire story? No? Sure you didn&#8217;t! The guys of &#8230; <a href="http://coffeecoders.de/2009/04/learn-java-by-camp-fire-stories/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Certainly there are many many ways out there on how to learn a programming language. But did you ever hear about learning a new language by hearing (ie. reading) a camp fire story? No? Sure you didn&#8217;t!</p>
<p><span id="more-215"></span>The guys of <a href="http://www.javaranch.com/">JavaRanch.com</a> try to accomplish just that:</p>
<blockquote><p><em><span style="color: #804000;">Grab your marshmallows and a stick and gather &#8217;round the campfire for some Java stories. The Ranch writers won&#8217;t be winnin&#8217; any literary prizes, that&#8217;s fer sure. But ya still might learn a thing or two.</span></em></p></blockquote>
<p>I find this approach very refreshing and I&#8217;m sure some of you dealing with certain more technical description will enjoy the casual written, funny illustrated yet informing stories.</p>
<p>So hop on your horse, ride on over to the ranch and give it a read @<br />
<a href="http://www.javaranch.com/campfire.jsp">JavaRanch Campfire &#8211; Getting in Touch with your Inner Class</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/04/learn-java-by-camp-fire-stories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adding a simple pagination to your site</title>
		<link>http://coffeecoders.de/2009/02/adding-a-simple-pagination-to-your-site/</link>
		<comments>http://coffeecoders.de/2009/02/adding-a-simple-pagination-to-your-site/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 02:19:28 +0000</pubDate>
		<dc:creator>Erik</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[beginner]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[pagination]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=184</guid>
		<description><![CDATA[or: the dangerousness of simple mathematics I guess many people had this problem before and I think everybody managed to solve this quite similar. Anyways, just in case this is useful for anybody: here&#8217;s how I added a pagination to &#8230; <a href="http://coffeecoders.de/2009/02/adding-a-simple-pagination-to-your-site/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h3>or: the dangerousness of simple mathematics</h3>
<p>I guess many people had this problem before and I think everybody managed to solve this quite similar. Anyways, just in case this is useful for anybody: here&#8217;s how I added a pagination to a site recently.</p>
<p>Given you have an array of products for example. Or maybe search results, a list of articles&#8230; something like that. Unfortunately they are too many to display them on a single page. Well, sure, you could but let&#8217;s be honest: that isn&#8217;t an option as the page would exceed its &#8220;scrollable-with-no-harm-to-scroll-fingers&#8221; length. And you don&#8217;t want to get sued by your visitors, right <img src='http://coffeecoders.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Ok, so you&#8217;re going to add a nice pagination to your site, so that everybody is happy.<br />
What I found out to be a bit tricky was to calculate the actual number of pages. We need that number so that we know, how many page links we will show next to our current view.<br />
<span id="more-184"></span><br />
Two simple examples to illustrate the probelm:<br />
Let&#8217;s say we have <strong>8</strong> items. <strong>8 divided by 4 is 2</strong>, so we&#8217;re going to need two pages. No big deal, right?<br />
Okay then we try this with <strong>9</strong> items. <strong>9 divided by 4 gives us 2.25</strong>. So we will clearly need a 3rd page for product number 9, but how do we calculate this from our result?<br />
<code><br />
$itemcount = $res-&gt;length();<br />
$pagemin = $itemcount / 4;<br />
$pagemax = ceil($itemcount / 4);<br />
if ( $pagemax - intval($pagemin) === 1) ) {<br />
$pages = $pagemax;<br />
} else {<br />
$pages = intval($pagemin);<br />
}<br />
</code></p>
<h3>The code explained</h3>
<p>That&#8217;s why I compare two values here: the actual division result and the next bigger integer. Now we try to find out if both values differ. If they do, we have a scenario where we do want another page, so we pick the bigger result as our page number. If not we are just happy and use the smaller number.</p>
<p>So now that we know our actual page count we can do something (slightly simplified) like this:</p>
<p><code><br />
while($i = 0;$i &lt; $pages; $i++) {<br />
print '&lt;a href="?page=' . $i . '"&gt;Page ' . $i . '';<br />
}<br />
</code></p>
<figure id="attachment_192" aria-labelledby="figcaption_attachment_192" class="wp-caption aligncenter" style="width: 499px"><img class="size-full wp-image-192" src="http://coffeecoders.de/wp-content/uploads/2009/02/pagination.jpg" alt="A pagination helps to navigate through long lists of items" width="489" height="134" /><figcaption id="figcaption_attachment_192" class="wp-caption-text">A pagination helps to navigate through long lists of items</figcaption></figure>
<p>With a little bit of styling this even looks nice. And of course, this is just a start. You also might want to add &#8220;previous&#8221; and &#8220;next buttons&#8221;, or those &#8220;first page&#8221;, &#8220;last page&#8221; buttons, limit the maximum number of page links shown, or you could center the currently viewed page in the middle, hide the previous button on the first page, etc&#8230; There are a lot of fine tuning options that will improve the user experience of your pagination.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/02/adding-a-simple-pagination-to-your-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checkout a project from svn &#8211; the right way</title>
		<link>http://coffeecoders.de/2009/02/checkout-a-project-from-svn-the-right-way/</link>
		<comments>http://coffeecoders.de/2009/02/checkout-a-project-from-svn-the-right-way/#comments</comments>
		<pubDate>Sat, 14 Feb 2009 02:42:39 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[daily tasks]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=147</guid>
		<description><![CDATA[Do you use eclipse? Do you use svn? Did you ever checked out a new project into your workspace? If you could answer all these questions with a &#8220;yes&#8221; you might have noticed afterwards that you can&#8217;t do anything with &#8230; <a href="http://coffeecoders.de/2009/02/checkout-a-project-from-svn-the-right-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Do you use eclipse? Do you use svn? Did you ever checked out a new project into your workspace?</p>
<p>If you could answer all these questions with a &#8220;yes&#8221; you might have noticed afterwards that you can&#8217;t do anything with this project because eclipse created it as &#8220;general project&#8221;, meaning no java, php or anything other specialized nature. This results in certain functions like <em>Run as Java application</em> not being accessable.</p>
<p>There are several solutions to that problem &#8211; but most of them are really ugly, imho. But since I don&#8217;t want to keep anything from you I will explain these methods too. So let&#8217;s get started&#8230;</p>
<p><span id="more-147"></span></p>
<h2>The wrong way</h2>
<p>The intuitive way you propably would start the task &#8220;to checkout a new project from SVN&#8221; might be &#8220;File -&gt; New -&gt; Project -&gt; Others&#8230;-&gt; Checkout a project from SVN&#8221;. In the result you&#8217;d have the previously mentioned &#8220;general project&#8221; which is pretty useless.</p>
<h3>solution #1: edit .project</h3>
<p>After the creation of the new project you quit eclipse, browse to the project folder in your file system and open the .project-file in a editor.</p>
<p>You&#8217;ll find these lines:</p>
<blockquote><p>&lt;natures&gt;<br />
&lt;/natures&gt;</p></blockquote>
<p>Change it to match:</p>
<blockquote><p>&lt;natures&gt;<br />
&lt;nature&gt;org.eclipse.jdt.core.javanature&lt;/nature&gt;<br />
&lt;/natures&gt;</p></blockquote>
<p>Save the file and fire up eclipse again, you will have your svn-project recognized as Java-project. This solution might be quick but the drawbacks are the quit/edit/start-sequence outside of eclipse and the necessity to find the right &#8220;nature&#8221; for your svn project.</p>
<h3>solution #2: delete and recreate</h3>
<p>After having completed the checkout you will delete your project. Yes, you read right. (I told you these methods are ugly! <img src='http://coffeecoders.de/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ) But when deleting be sure you <strong>don&#8217;t check </strong>the box for physically deletion of the files (so they&#8217;ll remain inside your workspace).</p>
<p>When you finished deleting the project you create a new project for the kind of project the svn project should represent (i.e. java, php etc.). While in the creation wizard be sure you select the same folder where the svn project has been checked out into.</p>
<p>The newly created project will have the right project type and will contain all files from the repository. Sometimes it is necessary to refresh the workspace (windows: hit F5 on the project).</p>
<p>Although this method also results in having the right data with the correct project type it has a bad taste jumping through these hoops in order to finish a simple task like that.</p>
<p>Since I wasn&#8217;t pleased with all those solutions I kept on looking. Finally I found&#8230;</p>
<h2>The right way</h2>
<p>Besides the following solution is the one most hoopless (no pun intended) the claim &#8220;right&#8221; is justified because it seems that this is the way the eclipse devs want us to check out a project.</p>
<p>In order to accomplish the task at hand you have to</p>
<ul>
<li>open the <em>SVN Exploring</em>-perspective<br />
( Windows -&gt; Open Perspective -&gt; Other&#8230; -&gt; SVN Exploring)</li>
<li>create a new repository location or select the desired source</li>
<li>browse to the parent folder of your new project (e.g. trunk)</li>
<li>right click on the folder, choose <em>Checkout&#8230;</em></li>
<li>in the new dialogue you will have the chance to select <em>Check out as a project configured using the New Project Wizard</em>, take that chance, fill out the rest as you please and hit <em>Finish</em></li>
<li>in the new project wizard which will open next you can choose your desired project type (e.g. java) and set up everything like you would in a normal project (e.g. compliler compliance level, JRE, related projects etc.)</li>
<li>after hitting this finish button you will notice that the svn is queried to retrieve the code</li>
<li>and you&#8217;re done!</li>
</ul>
<p>In my opinion this way is the most hazzle-free way to check out a new project though I love to see it the other way around too (New-&gt;Project-&gt;New Project from SVN -&gt; yada yada yada -&gt; &#8220;Please select a project type or press OK to let it remain a generel project.&#8221;). Until this is implemented I will go with the second best solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/02/checkout-a-project-from-svn-the-right-way/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>trac: Solving sqlite-issues when upgrading from Debian etch to lenny</title>
		<link>http://coffeecoders.de/2009/02/trac-solving-sqlite-issues-when-upgrading-from-debian-etch-to-lenny/</link>
		<comments>http://coffeecoders.de/2009/02/trac-solving-sqlite-issues-when-upgrading-from-debian-etch-to-lenny/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 14:06:41 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[trac]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=128</guid>
		<description><![CDATA[On my dev-server I had to upgrade to the newer version of debian lenny (which will be released as stable version this week). The upgrade went fine but after it was finished trac (0.11.2.1 ) refused to start, throwing the &#8230; <a href="http://coffeecoders.de/2009/02/trac-solving-sqlite-issues-when-upgrading-from-debian-etch-to-lenny/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>On my dev-server I had to upgrade to the newer version of debian lenny (which will be released as stable version this week).</p>
<p>The upgrade went fine but after it was finished <a href="http://trac.edgewall.org/">trac (0.11.2.1 )</a> refused to start, throwing the error message</p>
<blockquote><p>DatabaseError: file is encrypted or is not a database</p></blockquote>
<p><span id="more-128"></span>According to the <a href="http://trac.edgewall.org/ticket/2585">ticket system of trac</a> the problem is the wrong version of sqlite which is used by trac. Sadly all my efforts to make the database useable again failed with the error message above.</p>
<p>After some research I discovered another way to let trac use the default sqlite3 but keeping my data alive. <a href="http://pacopablo.com/irclogs/2008/10/21">This chatlog</a> states a simple way to convert your sqlite2 database to the newer sqlite3-format. Here is a quick walkthrough:</p>
<ol>
<li>Install the packages sqlite (v2) and sqlite3 (guess the version <img src='http://coffeecoders.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p128code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1288"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p128code8"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sqlite sqlite3</pre></td></tr></table></div>

</li>
<li>Dump the old database and convert it to sqlite3

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p128code9'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1289"><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code" id="p128code9"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>trac-repos
<span style="color: #7a0874; font-weight: bold;">cd</span> db
<span style="color: #c20cb9; font-weight: bold;">mv</span> trac.db trac.db.old-sqlite2
sqlite trac.db.old-sqlite2 .dump <span style="color: #000000; font-weight: bold;">|</span> sqlite3 trac.db
<span style="color: #c20cb9; font-weight: bold;">chown</span> www-data:www-data trac.db
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

</li>
</ol>
<p>And you&#8217;re done. The old database is now named <em>trac.db.old-sqlite2</em> in case you need it for whatever reason. The new one is named with the default name <em>trac.db</em> so trac will use this one if not specified otherwise in <em>conf/trac.ini</em>.</p>
<p>I hope this tip saves you from some worries after upgrading to Debian Lenny. Keep on coding!</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/02/trac-solving-sqlite-issues-when-upgrading-from-debian-etch-to-lenny/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using PHP5&#8242;s XMLWriter</title>
		<link>http://coffeecoders.de/2009/01/using-php5s-xmlwriter/</link>
		<comments>http://coffeecoders.de/2009/01/using-php5s-xmlwriter/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 18:04:58 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=95</guid>
		<description><![CDATA[The Class library of PHP5 offers a possibility to easily generate valid XML-files. Sadly the documentation and the usage examples are very poor on this topic so PHPBuilder Forum member iceomnia decided to do something about it and wrote a &#8230; <a href="http://coffeecoders.de/2009/01/using-php5s-xmlwriter/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The Class library of PHP5 offers a possibility to easily generate valid XML-files.</p>
<p>Sadly the documentation and the usage examples are very poor on this topic so <a href="http://www.phpbuilder.com/board/index.php">PHPBuilder Forum</a> member <a href="http://www.phpbuilder.com/board/member.php?u=189469">iceomnia</a> decided to do something about it and wrote a quick howto on this subject.</p>
<p>With that information you can jump right into the code and generate your own XML files within minutes. Have fun&#8230;</p>
<p>Link: <a href="http://www.phpbuilder.com/columns/iceomnia_20090116.php3">PHPBuilder.com, the best resource for PHP tutorials, templates, PHP manuals, content management systems, scripts, classes and more.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/01/using-php5s-xmlwriter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introduction into &#8220;Cloud-Computing&#8221;</title>
		<link>http://coffeecoders.de/2009/01/introduction-into-cloud-computing/</link>
		<comments>http://coffeecoders.de/2009/01/introduction-into-cloud-computing/#comments</comments>
		<pubDate>Fri, 16 Jan 2009 12:27:11 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[link]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=91</guid>
		<description><![CDATA[If you never heard of Cloud Computing or always wanted to look into it, Robert Mühsig posted a detailed introduction into this topic filled with examples and links to dive deeper into this topic. Note: The article mentioned here is &#8230; <a href="http://coffeecoders.de/2009/01/introduction-into-cloud-computing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you never heard of <span class="linkle_link" link_type="wiki" link_term="Cloud Computing" link_text="Cloud Computing"><a title="Search Wikipedia for 'Cloud Computing'" href="http://www.wikipedia.org/search-redirect.php?language=en&amp;go=go&amp;search=Cloud+Computing">Cloud Computing</a></span> or always wanted to look into it, Robert Mühsig posted a detailed introduction into this topic filled with examples and links to dive deeper into this topic.</p>
<p>Note: The article mentioned here is in German. Sorry if you can&#8217;t read it. Maybe <a href="http://keenpath.com/articles/brief-introduction-to-cloud-computing/">this article</a> could be a start for you though.</p>
<p>Link: <a href="http://code-inside.de/blog/2009/01/15/howto-einstieg-in-cloud-computing/">Code-Inside Blog: HowTo: Einstieg in &#8220;Cloud-Computing&#8221;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/01/introduction-into-cloud-computing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

