<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" version="2.0">

<channel>
	<title>planetgeek.ch</title>
	
	<link>http://www.planetgeek.ch</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 30 Jul 2010 05:38:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/planetgeekch" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="planetgeekch" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Obscure reactions within terminal client</title>
		<link>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/</link>
		<comments>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/#comments</comments>
		<pubDate>Fri, 30 Jul 2010 05:37:37 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[flipp]]></category>
		<category><![CDATA[mstsc]]></category>
		<category><![CDATA[remote desctop]]></category>
		<category><![CDATA[tab]]></category>
		<category><![CDATA[tabulator]]></category>
		<category><![CDATA[terminal client]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1798</guid>
		<description><![CDATA[Since we use the new terminal client from microsoft we register sometimes obscure reactions. For example: program flipping while pressing the tab key solo, get the dialog which is shown normally pressing &#8216;Ctr-Alt-Del&#8217; while pressing the delete key solo. The problem is&#8230; We discovered that it is very important in which order we release some [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/";
		var dzone_title = "Obscure reactions within terminal client";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since we use the new terminal client from microsoft we register sometimes obscure reactions. For example: program flipping while pressing the tab key solo, get the dialog which is shown normally pressing &#8216;Ctr-Alt-Del&#8217; while pressing the delete key solo.<br />
<span id="more-1798"></span></p>
<h2>The problem is&#8230;</h2>
<p>We discovered that it is very important in which order we release some key combinations like &#8216;Alt-Shift&#8217;. If we press them in the order &#8216;Alt&#8217; and then &#8216;Shift&#8217; and release them in the order &#8216;Alt&#8217; and then &#8216;Shift&#8217; the terminal client will not receive the &#8216;Alt&#8217; key is released. So it is very important to release the keys in reverse order they were pressed. (And in our IDE we need this key combination a lot :S )</p>
<h2>What is to do when&#8230;</h2>
<p>If this happens just press the combination again and release the keys in reverse order. That&#8217;s the trick. <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/30/obscure-reactions-within-terminal-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multiscreen with microsoft terminal client</title>
		<link>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/</link>
		<comments>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 14:34:25 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[dual screen]]></category>
		<category><![CDATA[mstsc]]></category>
		<category><![CDATA[mulit monitor]]></category>
		<category><![CDATA[Terminalclient]]></category>
		<category><![CDATA[windows XP]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1757</guid>
		<description><![CDATA[Since a few months I&#8217;m working in a new project where we have remote PC&#8217;s for developing. Since they updated the clients from Windows XP SP1 to SP3 we we have the new remote desktop client. Now it&#8217;s possible to show the terminal client on two monitors (or a monitor with a resolution over 1600&#215;1200). [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/";
		var dzone_title = "Multiscreen with microsoft terminal client";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since a few months I&#8217;m working in a new project where we have remote PC&#8217;s for developing. Since they updated the clients from Windows XP SP1 to SP3 we we have the new remote desktop client. Now it&#8217;s possible to show the terminal client on two monitors (or a monitor with a resolution over 1600&#215;1200). We just had to do the following:</p>
<ol>
<li>create a Shortcut to mstsc.exe</li>
<li>add as params</li>
<ul>
<li>/w:2560 (The screen witdth)</li>
<li>/h:1024 (The screen height)</li>
<li>/v:hostname</li>
</ul>
</ol>
<p>The link will look like this: <strong>mstsc.exe /w:2560 /h:1024 /v:hostname</strong><br />
Our expirience was it works not bad. The only thing we noticed was, the client needs more power.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/28/multiscreen-with-microsoft-terminal-client/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows7, Resharper 5.1, VS2010 and xunit.contrib problem</title>
		<link>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/</link>
		<comments>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 18:55:40 +0000</pubDate>
		<dc:creator>Daniel Marbach</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Resharper]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Windows7]]></category>
		<category><![CDATA[Xunit]]></category>
		<category><![CDATA[Xunit.Contrib]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1780</guid>
		<description><![CDATA[Just a short notice. If you are using Resharper 5.1 under Windows7 and xunit.contrib and your unit tests are not executed anymore in VS2010 you need to check the following: Close all running VS2010 instances Upgrade to latest xunit.contrib for Resharper 5.1 If you have xunit.contrib under Program Files\Jetbrains\Resharper\..\Bin\Plugins then move them to [Root]:\Users\[YourUser]\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\Plugins\XunitContrib Open [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/";
		var dzone_title = "Windows7, Resharper 5.1, VS2010 and xunit.contrib problem";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Just a short notice. If you are using Resharper 5.1 under Windows7 and xunit.contrib and your unit tests are not executed anymore in VS2010 you need to check the following:</p>
<ol>
<li>Close all running VS2010 instances</li>
<li>Upgrade to latest xunit.contrib for Resharper 5.1</li>
<li>If you have xunit.contrib under Program Files\Jetbrains\Resharper\..\Bin\Plugins then move them to<br />
[Root]:\Users\[YourUser]\AppData\Roaming\JetBrains\ReSharper\v5.1\vs10.0\Plugins\XunitContrib</li>
<li>Open VS2010 again and you should be able to run the unit tests in unit test runner of Resharper again.</li>
</ol>
<p>Hope that helps</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/27/windows7-resharper-5-1-vs2010-and-xunit-contrib-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fileformat and the impacts in bash scripts</title>
		<link>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/</link>
		<comments>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 08:22:47 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1746</guid>
		<description><![CDATA[I had the problem calling a bash script I got the error: &#8220;syntax error: unexpected end of file&#8221; and &#8220;: command not foundne 2: &#8221; I created a simple scritp for demonstration #!/bin/bash echo &#34;hello&#34; In this sample we have following error after execution: &#8220;: command not foundne 2: &#8221; As you can see, there is [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/";
		var dzone_title = "Fileformat and the impacts in bash scripts";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I had the problem calling a bash script I got the error:<br />
<strong>&#8220;syntax error: unexpected end of file&#8221;<br />
</strong>and<br />
<strong>&#8220;: command not foundne 2: &#8221; </strong></p>
<p><span id="more-1746"></span>I created a simple scritp for demonstration</p>
<pre class="brush: bash;">
#!/bin/bash

echo &quot;hello&quot;
</pre>
<p>In this sample we have following error after execution: <strong>&#8220;: command not foundne 2: &#8221; </strong>As you can see, there is nothing on line 2.</p>
<p>The solution was as simple as the problem heavy.  Just execute the following command on the linux system.</p>
<pre class="brush: bash; light: true;">

dos2unix myScript.sh myScript.sh
</pre>
<p>And the script will work fine.</p>
<p>The easiest way to spot that the file format is wrong would be:</p>
<pre class="brush: bash; light: true;">

 head myScript.sh | od -c
</pre>
<p> 0000000   #   !   /   b   i   n   /   b   a   s   h  <strong>\r  \n  \r  \n</strong>   e<br />
 0000020   c   h   o       &#8220;   h   e   l   l   o   &#8221;<br />
 0000033</p>
<p>So you can see the newlines are done with <em>(\r\n)</em>. This can occur if you write the script under windows and moved it to a linux system. After executing dos2unix the head will look like this:</p>
<p> 0000000   #   !   /   b   i   n   /   b   a   s   h  <strong>\n  \n</strong>   e   c   h<br />
 0000020   o       &#8220;   h   e   l   l   o   &#8221;<br />
 0000031</p>
<p>Every &#8220;linefeed carriage return&#8221; is replaced with a simple &#8220;linefeed&#8221;.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/22/fileformat-and-the-impacts-in-bash-scripts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mockito – Answer vs. Return</title>
		<link>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/</link>
		<comments>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 19:18:33 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[answer]]></category>
		<category><![CDATA[ejb]]></category>
		<category><![CDATA[Mocking]]></category>
		<category><![CDATA[Mockito]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1744</guid>
		<description><![CDATA[Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito. First of all [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/";
		var dzone_title = "Mockito &#8211; Answer vs. Return";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Did you had the problem your mock must act like a bean? And you could not create the object with the real implementation? And the interface was too large, so you would not create a innerclass for the test? I had this problem too. I solved it with the answer in mockito.</p>
<p><span id="more-1744"></span>First of all we need an interface. On the interface we define a setter and a getter. Imagine we must be able to get back the value we set.  The sample interface will be quite easy but with a little imagination we know the interface would have a lot more methods. And we don&#8217;t want to implement the class in our test.</p>
<p>The interface would look like this:</p>
<pre class="brush: java;">
public interface SetGet {
    void setString(String newString);
    String getString();
}
</pre>
<p>We create the mock as usual:</p>
<pre class="brush: java;">
SetGetSample mock = Mockito.mock(SetGetSample.class);
</pre>
<p>Following code snipped shows how to record the value which is set on <strong>setString</strong>.</p>
<pre class="brush: java;">
doAnswer(new Answer&lt;Object&gt;() {
    @Override
    public Object answer(InvocationOnMock invocation) throws Throwable {
        theString = (String) invocation.getArguments()[0];
        return null;
    }
}).when(mock).setString(anyString());
</pre>
<p>We need the <em>Answer</em> for recording the input and do not give something back. Because there is a void return value we have to do the answer with the command <strong>doAnswer</strong> since the <em>when </em>only can be used on methods which have a return value.</p>
<p>We know there is a <strong>string</strong> used as parameter so we can cast the first argument to String. In other cases we should check if it is an instance of this type. And we set our field to the given value. (Yep, you read correct we need a field in the test class to set the value.</p>
<p>Now the code to get the recorded value:</p>
<pre class="brush: java;">
when(mock.getString()).thenAnswer(new Answer&lt;String&gt;() {
    @Override
    public String answer(InvocationOnMock invocation) throws Throwable {
        return theString;
    }
});
</pre>
<p>You see, know we use the standard <strong>when</strong> but we use the <strong>thenAnswer</strong> instead of the <strong>thenReturn</strong> the difference is: answer will everytime be executed. Return remembers the value we told them in the when. And the following test will become a green bar. <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: java;">
mock.setString(&quot;foo&quot;);
assertEquals(&quot;foo&quot;, mock.getString());

mock.setString(&quot;bar&quot;);
assertEquals(&quot;bar&quot;, mock.getString());
</pre>
<p>I think this is not the solution you should use for a large interface. But imho this is a practicable solution if there is just a set of one or two setter/getter.</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/20/mockito-answer-vs-return/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iPad</title>
		<link>http://www.planetgeek.ch/2010/07/12/ipad/</link>
		<comments>http://www.planetgeek.ch/2010/07/12/ipad/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 15:07:26 +0000</pubDate>
		<dc:creator>konrad.dambeck</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[dropox]]></category>
		<category><![CDATA[funbox]]></category>
		<category><![CDATA[goodreader]]></category>
		<category><![CDATA[iPad]]></category>
		<category><![CDATA[mosess]]></category>
		<category><![CDATA[pocketCAS]]></category>
		<category><![CDATA[wlan]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/2010/07/12/ipad/</guid>
		<description><![CDATA[Currently I’m in the refresher course of the swiss armed forces in Andermatt. So I get plenty of time to test my new Apple iPad. I have the 16 GB model without the 3G (UMTS) modem. I decide to buy the cheapest model because I think I don’t need much storage on my web tablet. [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/12/ipad/";
		var dzone_title = "iPad";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Currently I’m in the refresher course of the swiss armed forces in Andermatt. So I get plenty of <a href="http://www.planetgeek.ch/wp-content/uploads/2010/07/charltonhestonMossesiPad.jpg"  rel="lightbox" rel="lightbox[roadtrip]"><img style="border-right-width: 0px; margin: 10px 10px 10px 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="charlton-heston-Mosses-iPad" border="0" alt="charlton-heston-Mosses-iPad" align="left" src="http://www.planetgeek.ch/wp-content/uploads/2010/07/charltonhestonMossesiPad_thumb.jpg" width="164" height="165" /></a> time to test my new Apple iPad. I have the 16 GB model without the 3G (UMTS) modem. I decide to buy the cheapest model because I think I don’t need much storage on my web tablet. The 3G option was for me secondary because I own a notebook with built in UMTS modem. As a side note you can use the freeware Connectify to switch any pc in to a wlan access point <a href="http://www.connectify.me/">http://www.connectify.me/</a>. Or create a wlan network proxy with an iPhone and the app NetShare (10$) from the Sydia store.</p>
<p>First I will make my coming out as an Apple fan boy. So this article reflects my personal meaning and may not be 100% objective. The physical dimensions of the device are 243mm x 190mm x 13mm. The weight of the iPad is 0,68 kg or 0.73 kg for the 3G model. By the way the 3g models have also an compass and a GPS module. The display is 9.7 inch and has a resolution of 1024×768 (132ppi). The battery live is beyond 10 hours witch is very, very, very impressive. There are only three points witch are semi optimal. The reflecting display is not my favorite option. And if you use the iPad in the Sun in became a little bit hot and shuts himself down. The iBook store of Switzerland only host’s only free book from the Gutenberg project. As you can imagine Nathan the wise from Lessing is note my favorite bed lecture. </p>
<p> <span id="more-1738"></span>
<p>My top 5 apps for the iPad are:</p>
<p>FunBox: It is an very simple app. There are 60 buttons each of the buttons play’s a funny sound.    <br /><a href="http://linktoapp.com/FunBox" target="_blank">fun box</a></p>
<p>GoodReader is for my case the best eBook reader for the iPad. I assume you don’t need it if you buy books in the Apple Store. At the moment I buy e-books on the Exlibris web store and print the Adobe DRM contaminated files to a pdf printer (Freepdf) and send it to GoodReader.    <br /><a href="http://linktoapp.com/GoodReader" target="_blank">GoodReader</a></p>
<p>NewsRack (thx Dani for the hint) is very nice RSS reader. A very nice feature is the sync with the Google reader. The reader can cash posts and pictures.</p>
<p>PocketCAS is a very nice function plotter. Which is very usefully in my studies at the university of Lucerne   <br /><a href="http://linktoapp.com/PocketCAS" target="_blank">PocketCAS</a></p>
<p>Dropbox the best way to keep your files in sync.   <br /><a href="http://linktoapp.com/dropbox" target="_blank">dropbox</a></p>
<p>After all I like the iPad and give him 4.5 geeks from max 5 geeks</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/12/ipad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu console command completition</title>
		<link>http://www.planetgeek.ch/2010/07/10/ubuntu-console-command-completition/</link>
		<comments>http://www.planetgeek.ch/2010/07/10/ubuntu-console-command-completition/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 15:36:06 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[Kubuntu]]></category>
		<category><![CDATA[pageup]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1700</guid>
		<description><![CDATA[Since I always have to search how to enable the history search in (k)ubuntu I post it here. I don&#8217;t know why this feature is disabled by default in (k)ubuntu. Imo it&#8217;s one of the greatest features under the linux term. Just start the command you entered last time in the term and then press [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/10/ubuntu-console-command-completition/";
		var dzone_title = "Ubuntu console command completition";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>Since I always have to search how to enable the history search in (k)ubuntu I post it here. I don&#8217;t know why this feature is disabled by default in (k)ubuntu. Imo it&#8217;s one of the greatest features under the linux term. Just start the command you entered last time in the term and then press the key &#8216;PageUp&#8217; to get the last history entry you used the letters.</p>
<p>For everybody who wants to enable the feature too:<br />
Open the file &#8216;/etc/inputrc&#8217; and enable the following two lines: (It&#8217;s in the section &#8216;# alternate mappings for &#8220;page up&#8221; and &#8220;page down&#8221; to search the history&#8217;)<br />
&#8220;\e[5~&#8221;: history-search-backward<br />
&#8220;\e[6~&#8221;: history-search-forward</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/10/ubuntu-console-command-completition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at BASTA! in Mainz (Germany) on September 21st 2010</title>
		<link>http://www.planetgeek.ch/2010/07/01/speaking-at-basta-in-mainz-germany-on-september-21st-2010/</link>
		<comments>http://www.planetgeek.ch/2010/07/01/speaking-at-basta-in-mainz-germany-on-september-21st-2010/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 11:12:03 +0000</pubDate>
		<dc:creator>Urs Enzler</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Agile]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Clean Code]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Test Driven Development]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1725</guid>
		<description><![CDATA[I&#8217;m going to speak about code quality (see my short version of the presentation) at the conference BASTA! BASTA! is mainly focused on .NET technology and gives you the opportunity to see and speak with a wide range of technology experts. If you have any feedback of what you are missing in my short presentation, [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/07/01/speaking-at-basta-in-mainz-germany-on-september-21st-2010/";
		var dzone_title = "Speaking at BASTA! in Mainz (Germany) on September 21st 2010";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I&#8217;m going to speak about code quality (see my short version of the <a href="http://www.planetgeek.ch/2010/06/17/code-quality-building-code-you-wont-curse-tomorrow/">presentation</a>) at the conference <a href="http://basta.net">BASTA!</a></p>
<p>BASTA! is mainly focused on .NET technology and gives you the opportunity to see and speak with a wide range of technology experts.</p>
<p>If you have any feedback of what you are missing in my short presentation, please write a comment here or on the post with the presentation. The short version takes about 30 minutes and my speak at BASTA! is scheduled for 1 hour and 15 minutes.  I will mainly show real life examples of the theory shown in the short version. But if you want to here something specific, ask for it <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I&#8217;ll probably will publish the long version on this blog, too &#8211; for all of you not joining the conference.</p>
<p>So long&#8230;</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/07/01/speaking-at-basta-in-mainz-germany-on-september-21st-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create mocks with mockito</title>
		<link>http://www.planetgeek.ch/2010/06/25/create-mocks-with-mockito/</link>
		<comments>http://www.planetgeek.ch/2010/06/25/create-mocks-with-mockito/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 19:14:50 +0000</pubDate>
		<dc:creator>Adrian Elsener</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Test Driven Development]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Mockito]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1701</guid>
		<description><![CDATA[This is a small summarization what the differences are between the different variations creating mocks with mockito. Null values (default) Per default, after creating a mock, every method will return null. Just create your mock with: Sample sample = Mockito.mock(ISample.class); I think, this is very useful and straight forward. (And based by mockito developers idea, [...]]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/06/25/create-mocks-with-mockito/";
		var dzone_title = "Create mocks with mockito";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>This is a small summarization what the differences are between the different variations creating mocks with mockito.</p>
<h2>Null values (default)</h2>
<p>Per default, after creating a mock, every method will return null. Just create your mock with:</p>
<pre class="brush: java;">
Sample sample = Mockito.mock(ISample.class);
</pre>
<p>I think, this is very useful and straight forward. (And based by mockito developers idea, to create very fast a mock for testing). Sometimes it is very difficult to determine an error which was produced through such a null value. For this case it is very practicable to tell mockito, returning SmartNullValues.</p>
<p><span id="more-1701"></span></p>
<h2>Smart null values</h2>
<p>By using SmartNullValues, you will receive a stack trace which tells you, where the NullPointer was thrown and which mock object returned the SmartNullValue.<br />
Just create a mock with:</p>
<pre class="brush: java;">
Sample sample = Mockito.mock(ISample.class, RETURNS_SMART_NULLS);
</pre>
<p>I will explain the difference between the smart null values and the default values with the following stack traces. The following code will show you how to produce the NullPointer.</p>
<pre class="brush: java;">
public class SNPETest {
   @Test
   public void testSmartNPE() throws Exception {
      Writer wr = mock(Writer.class, RETURNS_SMART_NULLS);
      doSomething(wr);
   }

   void doSomething(Writer wr) throws Exception {
      Writer wr2 = wr.append('a');
      wr2.append('b');
   }

   @Test
   public void testNPE() throws Exception {
      Writer wr = mock(Writer.class);
      doSomething(wr);
   }

}
</pre>
<pre>testSmartNPE(test.SNPETest)
org.mockito.exceptions.verification.SmartNullPointerException:
You have a NullPointerException here:
-&gt; at test.SNPETest.doSomething(SNPETest.java:23)
Because this method was *not* stubbed correctly:
-&gt; at test.SNPETest.doSomething(SNPETest.java:22)

        at test.SNPETest.doSomething(SNPETest.java:23)
        at test.SNPETest.testSmartNPE(SNPETest.java:18)

testNPE(test.SNPETest)
java.lang.NullPointerException
        at test.SNPETest.doSomething(SNPETest.java:23)
        at test.SNPETest.testNPE(SNPETest.java:29)
</pre>
<p>BUT, there is at least one disadvantage. If you have conditions that check for null, you have to stub the method and tell mockito to return null for this method.</p>
<h2>Mocks</h2>
<p>RETURNS_MOCKS and RETURNS_DEEP_STUBS is very similar. If you want to receive another mock by calling a method RETURNS_MOCKS is suitable.</p>
<pre class="brush: java;">
Sample sample = Mockito.mock(ISample.class, RETURNS_MOCKS);
</pre>
<p>Every method on the mocked object will return another mock. OK OK, your right, not every method, there are some limitations. There are NO mocks returned on final methods. AND there are NO mocks on methods they return an object with a final class. The final methods you cant mock with default mockito. If you have a method which returns an object with a final class you have to stub it yourself.</p>
<h2>Deep Stubs</h2>
<p>And now you know whats going on with your mock if you do:</p>
<pre class="brush: java;">
Sample sample = Mockito.mock(ISample.class, RETURNS_DEEP_STUBS);
</pre>
<p>right! If you get a chain of mocks. RETURNS_MOCKS stops mocking after one level. RETURNS_DEEP_STUBS goes deeper. If you call a method you receive a mock and if you call a method on this mock you receive a mock and &#8230; so on. There are the same limitations as they are on RETURNS_MOCKS. -&gt; No final methods and no final classes as return values.<br />
This is one of the newest variants creating mocks. Major problem is, if no stubbing is done, there will never returned null.</p>
<h2>Mocking with annotation</h2>
<p>If you need a mock without any logic or you don&#8217;t want always call Mockito.mock(ISample.class) there is also a possibility to create mock objects with annotations.</p>
<p>It works very simple. Just add the annotation @Mock to the member declaration and call MockitoAnnotations.initMocks(this); before tests. (this is in this case the test <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>At the moment it does not look as there is a possibility to set SMART_NULLS or something like this with the annotations. Just run the test with MockitoJUnitRunner.</p>
<p>(All about the Mock interface you can find on www.mockito.org -&gt; Documentation <img src='http://www.planetgeek.ch/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> )</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/06/25/create-mocks-with-mockito/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Speaking at LAS 2010 in Zurich (Lean Agile and Scrum Conference)</title>
		<link>http://www.planetgeek.ch/2010/06/24/speaking-at-las-2010-in-zurich-lean-agile-and-scrum-conference/</link>
		<comments>http://www.planetgeek.ch/2010/06/24/speaking-at-las-2010-in-zurich-lean-agile-and-scrum-conference/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 15:32:15 +0000</pubDate>
		<dc:creator>Urs Enzler</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Architecture]]></category>
		<category><![CDATA[Conference]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.planetgeek.ch/?p=1696</guid>
		<description><![CDATA[I&#8217;m glad to announce that I&#8217;ll speak at the Lean Agile and Scrum Conference in Zurich on September 7th 2010 about Agile Architecture: From User Stories to Architecture (in german). There will be great speakers present like Mary Poppendieck and Henrik Kniberg! Join the conference at http://www.leanagilescrum.ch/veranstaltungen. Looking forward to see you there&#8230; &#160;]]></description>
			<content:encoded><![CDATA[<!--S-ButtonZ 1.1.5 Start--><div style="float: left; width: 42px; padding-right: 10px; margin: 0 10px 0 0;">
		<script type="text/javascript">
		<!--
		var dzone_url = "http://www.planetgeek.ch/2010/06/24/speaking-at-las-2010-in-zurich-lean-agile-and-scrum-conference/";
		var dzone_title = "Speaking at LAS 2010 in Zurich (Lean Agile and Scrum Conference)";
		var dzone_style = "1";
		var dzone_blurb = "";
		//-->
		</script>
		<script language="javascript" src="http://widgets.dzone.com/widgets/zoneit.js"></script></div><!--S-ButtonZ 1.1.5 End--><p>I&#8217;m glad to announce that I&#8217;ll speak at the Lean Agile and Scrum Conference in Zurich on September 7th 2010 about Agile Architecture: <a href="../2010/03/29/from-user-stories-to-architecture/">From  User Stories to Architecture</a> (in german).</p>
<p>There will be great speakers present like <span style="font-size: small;">Mary Poppendieck and Henrik Kniberg!<br />
</span></p>
<p>Join the conference at http://www.leanagilescrum.ch/veranstaltungen.</p>
<p>Looking forward to see you there&#8230;</p>
<div style="clear:both;">&nbsp;</div>]]></content:encoded>
			<wfw:commentRss>http://www.planetgeek.ch/2010/06/24/speaking-at-las-2010-in-zurich-lean-agile-and-scrum-conference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
