<?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>Blog.Project13.pl &#187; coding</title>
	<atom:link href="http://www.blog.project13.pl/index.php/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.project13.pl</link>
	<description>The Blog of a Coder</description>
	<lastBuildDate>Sun, 05 Feb 2012 02:28:52 +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>[review] CodeRetreat.SCKRK.com</title>
		<link>http://www.blog.project13.pl/index.php/fun/1230/review-coderetreat-sckrk-com/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1230/review-coderetreat-sckrk-com/#comments</comments>
		<pubDate>Tue, 12 Apr 2011 09:18:06 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[clean code]]></category>
		<category><![CDATA[clojure]]></category>
		<category><![CDATA[coderetreat]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[meeting]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[scala]]></category>
		<category><![CDATA[TDD]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1230</guid>
		<description><![CDATA[This Saturday we&#8217;ve (the Software Craftsmanship in Cracow guys) organized a Code Retreat, right after AgileCE. We&#8217;ve invited Corey Haines to join us and facilitate this meetup, and later on even Alexandru Bolboaca AND Maria Diaconu joined us in facilitating the event and so it got even better :-) Before we start, just a quick reminder [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://www.blog.project13.pl/wp-content/uploads/2011/04/cr-sckrk.gif"><img class="aligncenter size-full wp-image-1261" title="Code Retreat . SCKRK .com" src="http://www.blog.project13.pl/wp-content/uploads/2011/04/cr-sckrk.gif" alt="" width="520" /></a></p>
<p>This Saturday we&#8217;ve (the <a href="http://sckrk.com" onclick="urchinTracker('/outgoing/sckrk.com?referer=');">Software Craftsmanship in Cracow</a> guys) organized a <a href="http://www.coderetreat.com/" onclick="urchinTracker('/outgoing/www.coderetreat.com/?referer=');">Code Retreat</a>, <strong>right after AgileCE</strong>. We&#8217;ve invited <a href="http://www.coreyhaines.com/" onclick="urchinTracker('/outgoing/www.coreyhaines.com/?referer=');"><strong>Corey Haines</strong></a> to join us and facilitate this meetup, and later on even <a href="http://www.alexbolboaca.ro/" onclick="urchinTracker('/outgoing/www.alexbolboaca.ro/?referer=');"><strong>Alexandru Bolboaca</strong></a> AND <strong><a href="https://twitter.com/#!/fireladym" onclick="urchinTracker('/outgoing/twitter.com/_/fireladym?referer=');">Maria Diaconu</a> </strong> joined us in facilitating the event and so it got <strong>even better</strong> :-)</p>
<div class="wp-caption aligncenter" style="width: 557px"><img class=" " src="https://lh4.googleusercontent.com/_R79BchylD5A/TaI4-NlZY9I/AAAAAAAASrw/A7wNhXDuTd0/s1024/IMG_9268.jpg" alt="Corey doing the introductional Keynote" width="547" /><p class="wp-caption-text">Corey doing the introductional Keynote</p></div>
<p>Before we start, just a quick reminder what a CodeRetreat actually is (for the sake of everyone reading this blog not knowing what the hell I&#8217;m so excited about ;-)). The rules are really easy, take a bynch of passionate programmers, put them in a room for 1 whole day and tell them to code the game of life. There are about 6 sessions, where each time you&#8217;d <strong>pair up with another person </strong>and code away. After <strong>45 minutes you have to delete the code you&#8217;ve written</strong>, then after a 15m pause to talk about your results you find a new pair and code it again from scratch. It&#8217;s important to embrace the code deleting part &#8211; it&#8217;s somewhat like catharsis&#8230; :-) No matter how bad (or great) the code you&#8217;ve written was, on average in 22.5 minutes it will go away :-)  The idea is to embrace that you most probably won&#8217;t finish the problem in time, so you can just focus on honing your skills in TDD, pairing, IDE usage and generale code style and skillz. There&#8217;s no better way to learn these skills than to confront them with someone else&#8217;s &#8211; that way you both can learn new tricks or find out why some ol tricks you used actually suck :-) In the end of the day, you&#8217;ve become a better programmer&#8230; and will hopefully take these new skills into your workplace and <strong>improve the code quality</strong> there :-)</p>
<div class="wp-caption aligncenter" style="width: 557px"><img class=" " src="https://lh6.googleusercontent.com/_R79BchylD5A/TaI5H7DwO6I/AAAAAAAASsc/JuG5XZ0j8lA/s912/P1020923.jpg" alt="" width="547" height="410" /><p class="wp-caption-text">Happy hacking!</p></div>
<p>The response to our CR was really amazing. We&#8217;ve had quite a few sponsors &#8211; LunarLogic, AppliCake, ABB, Sii&#8230; and the PolishJUG helped out as well as it could with organizing the whole thing :-) Oh, and I hope you&#8217;ve seen our <a href="http://coderetreat.sckrk.com" onclick="urchinTracker('/outgoing/coderetreat.sckrk.com?referer=');">nice website</a> created by Olga from LLP? The interest from participants was equally big &#8211; all places where <strong>&#8220;sold out&#8221;</strong> <strong>in just about 3 hours</strong>&#8230; ;-) We where around 50 people in total and I think that&#8217;s a perfect number of coders for such an event. Some coded in <strong>Java</strong>, some in <strong>.NET</strong> and others in <strong>Ruby</strong> or <strong>Python</strong>, oh and there was an <strong>Objective-C</strong> and <strong>Scala</strong> team too. One of the nive things during a CR is being able to try out a new language, so the Ruby guys where really overflown by people wanting to try Ryby for example ;-) I&#8217;ve spent the rest of my sessions (4/5) coding in <strong>Java</strong> and just once had to lay hands on Eclipse&#8230; ;-) During one session I tried out ruby (<strong>ルビ</strong>) with Adam from SCKRK, which was fun as I did read some books/articles about it and really enjoyed the<strong> BDD</strong> that <strong>rspec</strong> uses. I also noticed that scala test seems to have derrived from it (or the other way arround :p)&#8230; :-)</p>
<div class="wp-caption aligncenter" style="width: 557px"><img src="https://lh6.googleusercontent.com/_R79BchylD5A/TZy8APe9mVI/AAAAAAAASlY/W2immHPMbrw/s912/P1000737.JPG" alt="The 2nd room was also full" width="547" height="410" /><p class="wp-caption-text">The 2nd room was also full</p></div>
<p style="text-align: left;">After two sessions we had <strong>nice long lunch</strong>, to relinquish our coding skills and ideas (we&#8217;ve ordered from <a href="http://thaisty.pl/" onclick="urchinTracker('/outgoing/thaisty.pl/?referer=');">thaist</a>y). And then a next set of 3 sessions followed. This time more focused on experimentation etc. For example one session we managed to <strong>not use if&#8217;s and for&#8217;s at all</strong> (sigh, upto one place but the time ran out then..). Google Guava was a great help there :-) On another sessions we&#8217;ve focused on <strong>Mockito</strong> and the more advanced mocking techniques such as parameter catching etc&#8230; In the end we really knew how much over engeenired it was but nevertheless it was really <strong>interesting to learn and play</strong> with these thoughts &#8211; that&#8217;s what CR is about.</p>
<div class="wp-caption aligncenter" style="width: 557px"><img class="  " title="Final Wrap Up" src="https://lh5.googleusercontent.com/_R79BchylD5A/TaI5gGby0xI/AAAAAAAAStU/vrCo3rVcnq4/s1024/IMG_9249.jpg" alt="" width="547" />1<p class="wp-caption-text">Final Wrap Up</p></div>
<p>Later on we&#8217;ve sent out a questionary on how much you enjoyed the CR and the response was also really positive. We&#8217;ll think about coffee next time &#8211; promissed. :-)</p>
<p>Stanley just pulled in my quick gallery commit to our website <strong>git</strong> repo a moment ago, so you can now visit <a href="http://coderetreat.sckrk.com/gallery/" onclick="urchinTracker('/outgoing/coderetreat.sckrk.com/gallery/?referer=');"><strong>coderetreat.</strong>sckrk.com/<strong>gallery</strong></a> and look for yourself on the pics :-) They&#8217;re fetched from <a href="https://picasaweb.google.com/ktosopl/CodeRetreat2011#" onclick="urchinTracker('/outgoing/picasaweb.google.com/ktosopl/CodeRetreat2011?referer=');">my picasa</a> so if you&#8217;d rather download them all from there, please do so :-)</p>
<div id="attachment_1274" class="wp-caption aligncenter" style="width: 557px"><a href="http://www.blog.project13.pl/wp-content/uploads/2011/04/P1020931.jpg"><img class="size-full wp-image-1274 " title="group photo coderetreat" src="http://www.blog.project13.pl/wp-content/uploads/2011/04/P1020931.jpg" alt="" width="547" height="410" /></a><p class="wp-caption-text">Group Photo</p></div>
<p>All in all&#8230; I&#8217;m really happy and proud to have been part of this event. It&#8217;s really been one of a kind and I hope all of you feel the same way about it. Well, it would certainly seem so after the opinions on the final wrap up and questionary later on. :-) So, once again, <strong>thank you for participating</strong> and see you soon on most major coding events :-) (ps: <a href="http://2011.geecon.org" onclick="urchinTracker('/outgoing/2011.geecon.org?referer=');"><strong>GeeCON</strong></a> is one of them).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1230/review-coderetreat-sckrk-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[git] bisect + maven = automate &#8220;breaking&#8221; commit search</title>
		<link>http://www.blog.project13.pl/index.php/coding/1217/git-bisect-maven-automate-breaking-commit-search/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/1217/git-bisect-maven-automate-breaking-commit-search/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 21:34:31 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[#maven]]></category>
		<category><![CDATA[bisect]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[runner]]></category>
		<category><![CDATA[SCM]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1217</guid>
		<description><![CDATA[Hey there guys. I hope some you enjoyed my presentation on SFI last weekend. The workshop was kinda chaotic (network problems mailny) but I&#8217;m sure some of you got convinced to use, or begin with trying out, git in yout next projects&#8230; :-) Well, that was all nice and cool but git (other DVCS have [...]]]></description>
			<content:encoded><![CDATA[<p>Hey there guys. I hope some you enjoyed my presentation on SFI last weekend. The workshop was kinda chaotic (network problems mailny) but I&#8217;m sure some of you got convinced to use, or begin with trying out, git in yout next projects&#8230; :-)</p>
<p>Well, that was all nice and cool but git (other DVCS have this too) has a lot more to offer! :-) Today we&#8217;ll look into git bisect and how to automate it&#8217;s execution using maven to look for a commit that breakes something. You may run ANY SCRIPT and even write your own and git will use it to test if a commit is &#8220;bad&#8221; or &#8220;good&#8221;. Ok, but let&#8217;s slowdown a little&#8230; What git bisect basically does is performing an binary search, between a range of commits you specify looking for &#8220;the first bad commit&#8221; you you can easily find what caused the bug and fix it. You can drive it by hand and after starting git bisect just test the commit by hand and tell git if it&#8217;s good or bad by &#8220;git bisect bad&#8221; &#8220;git bisect good&#8221;. Git is smart enough to find what commit he should &#8220;git checkout &#8230;&#8221; next to perform a binary search based on your anwsers. </p>
<p>Today we&#8217;ll learn how to make git cooperate with maven and find the first commit that introduced a test failure. See bellow for the full workflow you showcasing this:</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames breakMe $ mvn org.apache.maven.plugins:maven-archetype-plugin:<span class="nu0">1.0</span>-alpha<span class="nu0">-7</span>:create -<span class="re2">DarchetypeGroupId=</span>org.apache.maven.archetypes -<span class="re2">DarchetypeArtifactId=</span>maven-archetype-quickstart -<span class="re2">DartifactId=</span>bisectfun -<span class="re2">DgroupId=</span>pl.project13</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames breakMe $ <span class="kw2">ls</span></div>
</li>
<li class="li1">
<div class="de1">bisectfun &nbsp;mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames breakMe $ <span class="kw3">cd</span> bisectfun<span class="sy0">/</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ <span class="kw2">mkdir</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ git init .</div>
</li>
<li class="li1">
<div class="de1">Initialized empty Git repository <span class="kw1">in</span> <span class="sy0">/</span>tmp<span class="sy0">/</span>breakMe<span class="sy0">/</span>bisectfun<span class="sy0">/</span>.git<span class="sy0">/</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ git commit ^C</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ vim .gitignore</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ git add .</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun $ git commit </div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master <span class="br0">&#40;</span>root-commit<span class="br0">&#41;</span> 5b46510<span class="br0">&#93;</span> &nbsp;Initial commit</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">4</span> files changed, <span class="nu0">78</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">0</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> .gitignore</div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> pom.xml</div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> src<span class="sy0">/</span>main<span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>App.java</div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">********************************************************************************</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Git Achievement Unlocked<span class="sy0">!</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Master Author <span class="br0">&#40;</span>Level <span class="nu0">10</span><span class="br0">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Made <span class="nu0">2</span>^Level commits using git commit. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">********************************************************************************</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ mvn <span class="kw3">test</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>INFO<span class="br0">&#93;</span> BUILD SUCCESSFUL</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
</ol>
</div>
<p>Ok up until now we&#8217;ve just created a simple repository we&#8217;ll be running the tests on. Let&#8217;s tag this state as &#8220;yeah it&#8217;s working here&#8221; just so that I don&#8217;t have to remeber the SHA-1 of this commit. </p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git tag wasOkHere</div>
</li>
</ol>
</div>
<p>And now we&#8217;ll run a script that does some random commit action, just so that bisect has a lot of commits to work on.</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw1">for</span> i <span class="kw1">in</span> <span class="br0">&#123;</span><span class="nu0">1</span>..<span class="nu0">50</span><span class="br0">&#125;</span>; <span class="kw1">do</span> fortune <span class="sy0">&gt;</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span>fortune<span class="re1">$i</span>; git add .; git commit -a -m <span class="st0">&#39;some commit&#39;</span>; <span class="kw1">done</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master 20ae1c1<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">1</span> files changed, <span class="nu0">3</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">0</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span>fortune1</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master 64b779e<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">1</span> files changed, <span class="nu0">15</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">0</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;create mode <span class="nu0">100644</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span>fortune2</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ mvn clean <span class="kw3">test</span> <span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw3">echo</span> <span class="re4">$?</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">0</span></div>
</li>
</ol>
</div>
<p>The tests are still passing&#8230; time to change that! We&#8217;ll break the build with the following commit. And then generate yet another 50 commits to &#8220;hide it&#8221;&#8230; ;-)</p>
<div class="geshi no bash">
<div class="head">ktoso@dynames bisectfun @ master $ echo &#8220;fail :D&#8221; >> src/test/java/pl/project13/AppTest.java</div>
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw3">echo</span> <span class="st0">&quot;fail :D&quot;</span> <span class="sy0">&gt;&gt;</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java </div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw3">echo</span> <span class="st0">&quot;fail :D&quot;</span> <span class="sy0">&gt;&gt;</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java </div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git add .</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git commit </div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master 09a58fb<span class="br0">&#93;</span> <span class="kw3">let</span> it crash</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">1</span> files changed, <span class="nu0">3</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">0</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw1">for</span> i <span class="kw1">in</span> <span class="br0">&#123;</span><span class="nu0">1</span>..<span class="nu0">50</span><span class="br0">&#125;</span>; <span class="kw1">do</span> fortune <span class="sy0">&gt;</span> src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span>fortune<span class="re1">$i</span>; git add .; git commit -a -m <span class="st0">&#39;some commit&#39;</span>; <span class="kw1">done</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master f83cdae<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">1</span> files changed, <span class="nu0">3</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">3</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>master 725c5ce<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="nu0">1</span> files changed, <span class="nu0">4</span> insertions<span class="br0">&#40;</span>+<span class="br0">&#41;</span>, <span class="nu0">15</span> deletions<span class="br0">&#40;</span>-<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;rewrite src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>resources<span class="sy0">/</span>fortune2 <span class="br0">&#40;</span><span class="nu0">100</span><span class="sy0">%</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw1">for</span> i imvn clean <span class="kw3">test</span> <span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw3">echo</span> <span class="re4">$?</span></div>
</li>
<li class="li1">
<div class="de1"><span class="nu0">1</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ <span class="kw3">echo</span> <span class="st0">&#39;!!!!!!!!!!!!!!OH NO IT FAILS!!!!!!!!&#39;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">!!!!!!!!!!!!!!!!</span>OH NO IT FAILS<span class="sy0">!!!!!!!!</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git tag failsHere</div>
</li>
</ol>
</div>
<p>Ok the test&#8217;s fail now. But suppose you didn&#8217;t know which commit introduced the bug (in our case made the test&#8217;s fail). You&#8217;d have to guess which one, or check them all or just work it out by looking at your current repository state. But since you&#8217;re doing small commits and do them often &#8211; it&#8217;ll be great if you found out which commit caused this failure. As it&#8217;s preferably small, it&#8217;ll be very easy to find out what change caused the build to fail. No is the time to use <strong>git bisect</strong>!</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git bisect start</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git bisect bad failsHere </div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ git bisect good wasOkHere </div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">50</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">6</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ca199e0cbd19e498eabf6196036313e206b00a7f<span class="br0">&#93;</span> some commit</div>
</li>
</ol>
</div>
<p>We&#8217;ve started bisect, and told him which commit we&#8217;re sure is working and which we&#8217;re sure is failing. Git will now checkout a commit he found &#8220;somewhat in the middle&#8221; and will continue to bisect (binary search) the commit history based on wether a commit is &#8220;good&#8221; or &#8220;bad&#8221;. We could just tell it git by hand by doing &#8220;git bisect good/bad&#8221; etc. But let&#8217;s <strong>git bisect run</strong> a script to do this for us :</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> <span class="br0">&#40;</span>no branch<span class="br0">&#41;</span> $ git bisect run ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">25</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">5</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>c8658db8e0c5df1d603a9a96ae7a04e71c4ba9d1<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">12</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">4</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ddc2100ab90d0624df74e81f17d7ed7ea0fc9a61<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">5</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">3</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>31ba35661eecb7a96159e483954d315a63a3789d<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">2</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">2</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>725c5cec8803b1e62dd36a3b74fd8c52d42e807c<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">0</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">1</span> step<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>f83cdaeb34072a6f9c9a63abf8bb8f2390b996de<span class="br0">&#93;</span> some commit</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">Bisecting: <span class="nu0">0</span> revisions left to <span class="kw3">test</span> after this <span class="br0">&#40;</span>roughly <span class="nu0">0</span> steps<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>09a58fbf2821c4f66c003a65f19f6ff99f5ee37d<span class="br0">&#93;</span> <span class="kw3">let</span> it crash</div>
</li>
<li class="li1">
<div class="de1">running ..<span class="sy0">/</span>mavenbisect.<span class="kw2">sh</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">09a58fbf2821c4f66c003a65f19f6ff99f5ee37d is the first bad commit</div>
</li>
<li class="li1">
<div class="de1">commit 09a58fbf2821c4f66c003a65f19f6ff99f5ee37d</div>
</li>
<li class="li1">
<div class="de1">Author: Konrad Malawski <span class="sy0">&lt;</span>konrad .malawski<span class="sy0">@</span>project13.pl<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">Date: &nbsp; Wed Mar <span class="nu0">16</span> <span class="nu0">22</span>:<span class="nu0">02</span>:<span class="nu0">38</span> <span class="nu0">2011</span> <span class="nu0">+0100</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> it crash</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">:<span class="nu0">040000</span> <span class="nu0">040000</span> ef88527072e0b1532819a75f288a0e65a2737c6a 49083a7d820a731d5edad117a4af097bd9ffb444 M &nbsp; &nbsp; &nbsp;src</div>
</li>
<li class="li1">
<div class="de1">bisect run success</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> <span class="br0">&#40;</span>no branch<span class="br0">&#41;</span> $ git show 09a58fbf2821c4f66c003a65f19f6ff99f5ee37d</div>
</li>
<li class="li1">
<div class="de1">commit 09a58fbf2821c4f66c003a65f19f6ff99f5ee37d</div>
</li>
<li class="li1">
<div class="de1">Author: Konrad Malawski <span class="sy0">&lt;/</span>konrad<span class="sy0">&gt;&lt;</span>konrad .malawski<span class="sy0">@</span>project13.pl<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">Date: &nbsp; Wed Mar <span class="nu0">16</span> <span class="nu0">22</span>:<span class="nu0">02</span>:<span class="nu0">38</span> <span class="nu0">2011</span> <span class="nu0">+0100</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">let</span> it crash</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">diff</span> &#8211;git a<span class="sy0">/</span>src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java b<span class="sy0">/</span>src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java</div>
</li>
<li class="li1">
<div class="de1">index c6ffd44..b27c8b8 <span class="nu0">100644</span></div>
</li>
<li class="li1">
<div class="de1">&#8212; a<span class="sy0">/</span>src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java</div>
</li>
<li class="li1">
<div class="de1">+++ b<span class="sy0">/</span>src<span class="sy0">/</span><span class="kw3">test</span><span class="sy0">/</span>java<span class="sy0">/</span>pl<span class="sy0">/</span>project13<span class="sy0">/</span>AppTest.java</div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">@@</span> <span class="nu0">-36</span>,<span class="nu0">3</span> <span class="nu0">+36</span>,<span class="nu0">6</span> <span class="sy0">@@</span> public class AppTest</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;assertTrue<span class="br0">&#40;</span> <span class="kw2">true</span> <span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">+fail :D</div>
</li>
<li class="li1">
<div class="de1">+fail :D</div>
</li>
<li class="li1">
<div class="de1">+fail :D</div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> <span class="br0">&#40;</span>no branch<span class="br0">&#41;</span> $ git bisect reset </div>
</li>
<li class="li1">
<div class="de1">Previous HEAD position was 09a58fb&#8230; <span class="kw3">let</span> it crash</div>
</li>
<li class="li1">
<div class="de1">Switched to branch <span class="st0">&#39;master&#39;</span></div>
</li>
<li class="li1">
<div class="de1">ktoso<span class="sy0">@</span>dynames bisectfun <span class="sy0">@</span> master $ </div>
</li>
<li class="li1">
<div class="de1"><span class="sy0">&lt;/</span>konrad<span class="sy0">&gt;</span></div>
</li>
</ol>
</div>
<p>Yeah, we&#8217;ve found our failing commit :-) You could use any script you want here, it just has to return 0 if git should think it&#8217;s a &#8220;good commit&#8221; and &#8220;not 0&#8243; if it&#8217;s a &#8220;bad commit&#8221;. I&#8217;ve even seen runners written in PHP running or spellcheckers &#8211; you name it&#8230; :-) Ok but how does this magical script that we&#8217;ve just run look like?</p>
<div class="geshi no bash">
<ol>
<li class="li1">
<div class="de1"><span class="co0">#!/bin/sh</span></div>
</li>
<li class="li1">
<div class="de1">mvn clean <span class="kw3">test</span> <span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null <span class="nu0">2</span><span class="sy0">&gt;</span> <span class="sy0">/</span>dev<span class="sy0">/</span>null</div>
</li>
</ol>
</div>
<p>Whoa, that&#8217;s simple&#8230; :-) Keep on git hacking guys! See you soon, with some more git or java tips&#8230; :-) Oh and I&#8217;ll post my presentation (holefully with video) from SFI soon, so keep an eye out! :-)</p>
<p>PS: Yup, the <strong>code retreat</strong> we&#8217;re (SCKRK with a little help from the <a href="http://www.java.pl" onclick="urchinTracker('/outgoing/www.java.pl?referer=');">PolishJUG</a>) organizing got &#8220;sold out&#8221; after just 3h&#8230; ;-) Be sure to take a look and be quicker next time! <a href="http://coderetreat.sckrk.com" onclick="urchinTracker('/outgoing/coderetreat.sckrk.com?referer=');">http://coderetreat.sckrk.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/1217/git-bisect-maven-automate-breaking-commit-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[review] Devmeeting &#8211; Javascript Game Development</title>
		<link>http://www.blog.project13.pl/index.php/fun/1181/review-devmeeting-javascript-game-development/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1181/review-devmeeting-javascript-game-development/#comments</comments>
		<pubDate>Sun, 20 Feb 2011 23:21:12 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[clientside]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[meeting]]></category>
		<category><![CDATA[node.js]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[serverside]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[training]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1181</guid>
		<description><![CDATA[Yesterday and today I&#8217;ve been hacking some JavaScript during a free training organized by http://releasingforce.com/ although they&#8217;re not really braging that it&#8217;s them who do these meetings, more precisely: http://www.devmeetings.pl/ :-) As I&#8217;m coding quite a lot GWT and JS has also become quite powerfull in the last years I enlisted the training to learn [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday and today I&#8217;ve been hacking some JavaScript during a free training organized by <a href="http://releasingforce.com/" onclick="urchinTracker('/outgoing/releasingforce.com/?referer=');">http://releasingforce.com/</a> although they&#8217;re not really braging that it&#8217;s them who do these meetings, more precisely: <a href="http://www.devmeetings.pl/" onclick="urchinTracker('/outgoing/www.devmeetings.pl/?referer=');">http://www.<strong>devmeetings</strong>.pl/</a> :-)</p>
<p>As I&#8217;m coding quite a lot GWT and JS has also become quite powerfull in the last years I enlisted the training to learn more about JS optimalization and add some more tricks to my toolbox. Also some real life use scenarios would be very welcome. Turns out Tanadu (a polish &#8220;heroes-like&#8221; browser game) was implemented 100% in plain JS. Which is quite shocking and as we later agreed on developing such code can really be a pain in the neck. &#8220;Use GWT&#8221; would be my anwser to such an use case I guess &#8211; you wouldn&#8217;t loose the refactoring tooling Java gives you and could still fallback to JSNI if really needed. <strong>Did the &#8220;training&#8221; meet my expectations? Yup. Want more details? Read on&#8230; :-)</strong></p>
<p>It was really fun and I&#8217;ve even (and unexpectedly) met a friend of mine with whom (and one other developer) we&#8217;ve paired up and were coding a JS Mortal Kombat in JavaScript for those two days. We&#8217;ve learnt how to use CSS3 *-animation, *- transition and other cool new features (well, most of them &#8220;webkit only&#8221; but very cool nevertheless). Then we&#8217;ve coded a little and went on to dinner ate Jeff&#8217;s where I&#8217;ve lead the group to :-) Sadly dinner took a little too much time and we had less time to code than Poznań during their meeting a few weeks ago.</p>
<p>By the way&#8230; MVC in JavaScript is quite weird (<em>hey, most of the teams ended up with GodObjects anyways! ;-)</em>), as is any acting &#8220;hey, let&#8217;s just say we can have classess and inherit them blabla&#8230;&#8221;. We&#8217;ve seen quite a few examples on how to <strong>emulate OOP</strong> <strong>in JavaScript</strong> which was both: really weird and interesting at the same time. In the end, the thought &#8220;if you have no type system, in the end you develop your own&#8221; seems really true here. I believe this was said by someone from twitter about their Ruby code, which had a hell lot of assertions in it just to be sure &#8220;abc is really of type AbcType&#8221;. That&#8217;s why I&#8217;m more for Scalas apparoach than Groovy&#8217;s or Javascript/Ruby/Php, but I&#8217;m not that advanced in Scala yet to judge it as &#8220;super perfect&#8221;&#8230; ;-)</p>
<div id="attachment_1188" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.blog.project13.pl/wp-content/uploads/2011/02/mk1.png"><img class="size-medium wp-image-1188" title="mk1" src="http://www.blog.project13.pl/wp-content/uploads/2011/02/mk1-300x167.png" alt="" width="300" height="167" /></a><p class="wp-caption-text">MK in Javascript using Node.js</p></div>
<p>On the next day we implemented the serverside stuff, using <strong>node.js</strong> and <strong>socket.io</strong> for the clientside wich worked really well I have to addmit. Although I&#8217;m still wondering how I&#8217;d handle auth/security to be _really_ secure using such server instances (&#8220;nodes&#8221; ;-))&#8230; Finally our game had a very nice and developed state machine for all basic mortal kombat moves (including high/low punch etc, how much such state is blocking and which sprite to use for it, jumping etc.). As this state manipulation took most of our time, our server didn&#8217;t support an infinite number of players as some other implementations did but as a trade off they didn&#8217;t have any combo/move logic in their games :-) Of course the game was playable (well, &#8220;almost playable&#8221; &#8211; both players think they&#8217;re &#8220;on the left&#8221;, but we&#8217;d fix that very quick if needed&#8230; ;-)). A quick finishing talk touched some performance tweaks &#8211; quite some we should have used in mSejf etc &#8211; so I feel a little smarter than before :-) Sadly we didn&#8217;t talk too much about TDD using JavaScript which may be really a good idea (ugh this loose typing can make you mad sometimes&#8230; ;-)).</p>
<div id="attachment_1182" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.blog.project13.pl/wp-content/uploads/2011/02/mk2.png"><img class="size-medium wp-image-1182" title="mk2" src="http://www.blog.project13.pl/wp-content/uploads/2011/02/mk2-300x169.png" alt="mortal kombat" width="300" height="169" /></a><p class="wp-caption-text">Our mortal kombat game ;-)</p></div>
<p><strong>What could be definitely improved</strong> is the internet connection (well, &#8220;organization&#8221; as a whole I guess) as we had quite a lot problems with it (choose a hotel which is no noob in terms of IT meetings :-)) and the lead&#8217;s knowlage about git. Since it&#8217;s quite an deep tool, and we&#8217;re not here to focus on it but on JavaScript some quick info about how to use it and more developers who aren&#8217;t using it the first time in their lifes would have been really helpful. But fear not, I&#8217;ve helped out all the teams with learning git and all merges, push/pull flows and other weird problems :-) So it became quite an hybrid training where some of the participants learnt quite a lot about git :-) Some may actually like it in spite of the difficulties we encountered in our very chaotic flow during our hack sessions&#8230; :-) On the other hand, any way of introducing git to new people is a good thing, but I fear some may expierience some discomfort/distrust to a tool they&#8217;ve just &#8220;learnt&#8221; on a &#8220;fly by basis&#8221;, from&#8230; well, me &#8211; another participant. ;-)</p>
<p>From my perspective it was a great and fun meeting and I&#8217;d like to attend more such meetings, sharing the same  formula, or slightly improved. What I loved was of course the hacking and fun of working in a team + teaching people git&#8230; :-) If you&#8217;re hungry for some team coding you may want to checkout one of the upcomming meetings or wait for <strong>SCKRK</strong>s + <strong>PolishJUG</strong>s &#8220;<strong>Code Retreat</strong>&#8221; that we&#8217;ll be announcing really soon&#8230; :-)</p>
<p>PS: I&#8217;ve pushed our game implementation (less than 8h of real coding (rest of the time was talking/presentations/eating etc ;-)) to github, here: <a href="https://github.com/ktoso/mk-javascript" target="_blank" onclick="urchinTracker('/outgoing/github.com/ktoso/mk-javascript?referer=');">https://github.com/ktoso/<strong>mk-javascript</strong></a> so you may want to take a look. Event out of pure curiosity :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1181/review-devmeeting-javascript-game-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>git-hacking: pre-commit hook and custom command</title>
		<link>http://www.blog.project13.pl/index.php/fun/1076/git-hacking-pre-commit-hook-and-custom-command/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1076/git-hacking-pre-commit-hook-and-custom-command/#comments</comments>
		<pubDate>Sun, 21 Nov 2010 02:07:39 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[#eclipse]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[intellij]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[SCM]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[xsolve]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1076</guid>
		<description><![CDATA[As my team is using a kinda weird source eclipse code formatter setup, that other IDEs can&#8217;t emulate in 100% I sometimes found myself committing in a file with only a few changed spaces. Of course, I could use &#8220;external-formatter&#8221; plugins etc but that&#8217;s no good. Running eclipse&#8217;s formatter each time I want to format [...]]]></description>
			<content:encoded><![CDATA[<p>As my team is using a kinda weird source eclipse code formatter setup, that other IDEs can&#8217;t emulate in 100% I sometimes found myself committing in a file with only a few changed spaces. Of course, I could use &#8220;external-formatter&#8221; plugins etc but that&#8217;s no good. Running eclipse&#8217;s formatter each time I want to format my source (_very_ often) proved to be too slow and really getting on my nerves.</p>
<p>So&#8230; Since I&#8217;ve started using <strong>git</strong>-svn at work, I do have an possibility to make things better now! The answer lies in client-side-<strong>hooks</strong> and <strong>git aliases</strong> (&#8220;custom commands&#8221;). First let&#8217;s write this as an simple bash script, that we&#8217;ll locate in the <strong>.git/hooks/</strong> folder:<br />
<script src="https://gist.github.com/708972.js?file=gistfile1.sh"></script> It&#8217;s a fairly simple script, so I wont bore you explaining it in detail &#8211; if in doubt, feel free to ask. We only need to place this script as &#8220;<strong>.git/hooks/pre-commit</strong>&#8221; and make it executable and git will take care of the rest for us. Oh and in case you&#8217;re wondering where that <strong>org.eclipse.jdt.core.prefs</strong> came from. It&#8217;s created by eclipse into the .settings folder when you check some option to &#8220;use formatter per project&#8221; &#8211; that&#8217;s the only time I had to fire up and click around in eclipse to get it&#8217;s formatter running &#8220;headless&#8221;. Ok, let&#8217;s check if it works&#8230; <script src="https://gist.github.com/708982.js?file=gistfile1.java"></script><br />
<script src="https://gist.github.com/708976.js?file=gistfile1.sh"></script> <script src="https://gist.github.com/708981.js?file=gistfile1.java"></script><br />
Yup, you can agree or not with the formatting rules &#8211; but what matters is that the whole team decided on it and that we keep it consistent throughout the whole project. This hook will definitely help with this. :-)  Step two for me was changing this into a git command, so that I wouldn&#8217;t launch eclipse each time I just do some quick local commiting. The solution is to drop the hook idea (although it&#8217;s quite nice) and create an custom git command. We do this by doing an alias like that:</p>
<pre>git config --global alias.eclipse-formatter '!~/git-hook-eclipse-formatter'</pre>
<p>The <strong>!command </strong>alias<strong> </strong>support is with us in git since 1.5.0 and it enables us to launch any program/script as an git command. Great, just what I wanted! Let&#8217;s now see what this command really did:</p>
<p><script src="https://gist.github.com/708977.js?file=gistfile1.sh"></script><br />
As you can see, adding an alias is as simple as adding it to your<strong> ~/.gitconfig</strong> or, if you want to setup the alias &#8220;per project&#8221;, to <strong>.git/config</strong> &#8211; pretty cool, ay? Also, this command will be included in bash-autocompletition suggestions! :-)</p>
<p>That&#8217;s it for today&#8230; <em>happy hacking!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1076/git-hacking-pre-commit-hook-and-custom-command/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>@RunWith JUnit4 with BOTH SpringJUnit4ClassRunner and Parameterized</title>
		<link>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/#comments</comments>
		<pubDate>Sat, 13 Nov 2010 00:05:39 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[junit]]></category>
		<category><![CDATA[junit4]]></category>
		<category><![CDATA[spring]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[testing]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1077</guid>
		<description><![CDATA[Ok, now for a quick trick before I get into writing more about git and our last javacamp (movies are still being converted, sorry for the long wait). If you code in Java, you most probably use (you really should use) some dependecy injection mechanisms. They&#8217;re really great and take care about all the setup [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, now for a quick trick before I get into writing more about git and our last javacamp (movies are still being converted, sorry for the long wait).</p>
<p>If you code in Java, you most probably use (you really should use) some dependecy injection mechanisms. They&#8217;re really great and take care about all the setup that need&#8217;s to be done before you can move on to your coding. The same thigh applies to testing, you&#8217;d rather write:</p>
<div class="geshi no java">
<div class="head">//yay</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Autowired</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; MyComponent component<span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>Than use the new operator, or worse, perform some super weird setup to build this object. If you use spring, you&#8217;d write an test like this to make it support Spring&#8217;s DI:</p>
<div class="geshi no java">
<div class="head">//an JUnit test with spring DI</div>
<ol>
<li class="li1">
<div class="de1">@RunWith<span class="br0">&#40;</span>SpringJUnit4ClassRunner.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">@ContextConfiguration<span class="br0">&#40;</span>locations = <span class="br0">&#123;</span><span class="st0">&quot;classpath:applicationContext.xml&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Autowired</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; MyComponent component<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; awesome tests</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
<p>That&#8217;s all you need to make your tests properly autowire all components they&#8217;re using. So far so good &#8211; probably nothing new here, and nothing complicated. So let&#8217;s move on to some &#8220;super big data set&#8221; that needs to be tested, over the same flow over and over again. We&#8217;ll use an super conplicated example to showcase what I mean:</p>
<div class="geshi no java">
<div class="head">//inside an test class</div>
<ol>
<li class="li1">
<div class="de1">@Test</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;hey, that&#39;s an good email!&quot;</span>, isValidEmail<span class="br0">&#40;</span>validEmail1<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more tests&#8230;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;hey, that&#39;s an good email!&quot;</span>, isValidEmail<span class="br0">&#40;</span>validEmail2<span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230;over and over again&#8230;</span></div>
</li>
</ol>
</div>
<p>Ok, that&#8217;s obviously stupid&#8230; :-) So, how do we deal with repetitive tests, that need some bigger dataset than just this email example (given here because it&#8217;s short and good enough for our example test)&#8230;? We&#8217;d use @RunWith(Parameterized.class), the class would then look something like this:</p>
<div class="geshi no java">
<div class="head">//my test with only params</div>
<ol>
<li class="li1">
<div class="de1">@RunWith<span class="br0">&#40;</span>Parameterized.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="coMULTI">/** We&#39;re testing only good emails, for the sake of simplicity of the example */</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Parameters</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">static</span> Collection<span class="sy0">&amp;</span>lt<span class="sy0">;</span>Object<span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">&amp;</span>gt<span class="sy0">;</span> data<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw3">Arrays</span>.<span class="me1">asList</span><span class="br0">&#40;</span><span class="kw2">new</span> <span class="kw3">Object</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="st0">&quot;a@a.pl&quot;</span> <span class="coMULTI">/*more params here*/</span><span class="br0">&#125;</span>, <span class="br0">&#123;</span><span class="st0">&quot;exmaple@example.com&quot;</span>, <span class="coMULTI">/* more params here*/</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> EmailTest<span class="br0">&#40;</span><span class="kw3">String</span> validEmail <span class="coMULTI">/* more params would land here*/</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">validEmail</span> = validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Test</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> wasOk = StringTools.<span class="me1">isEmail</span><span class="br0">&#40;</span>validEmail<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;This should have been ok&quot;</span>, wasOk<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more stuff</span></div>
</li>
</ol>
</div>
<p>Ok, that&#8217;s a nice way to make your code in the tests smaller yet have an nice overview through all of your tested data. Each array will be inserted in the constructor, and then ran as an seperate test &#8211; with each dataset. Nice, isn&#8217;t it?</p>
<p>Ok, but what if we want to have both Spring&#8217;s DI and an @Parameters &#8220;test data provider&#8221;&#8230;? Can you spot the problem? Yup, JUnit4 can only have ONE @RunWith annotation, and it doesn&#8217;t accept multiple runners. Which totaly makes sense when you think about it, but then there is our special case of DI, which really doesn&#8217;t change the way an test wotks, it just makes setup easier&#8230; All that said, here&#8217;s how to use both spring and parameters in your Junit4 tests:</p>
<div class="geshi no java">
<div class="head">//mytest with DI and params</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @RunWith<span class="br0">&#40;</span>Parameterized.<span class="kw2">class</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @ContextConfiguration<span class="br0">&#40;</span>locations = <span class="br0">&#123;</span><span class="st0">&quot;classpath:applicationContext.xml&quot;</span><span class="br0">&#125;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">class</span> EmailTest <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">private</span> TestContextManager testContextManager<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw3">String</span> validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Before</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> setUpContext<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//this is where the magic happens, we actually do &quot;by hand&quot; what the spring runner would do for us,</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">// read the JavaDoc for the class bellow to know exactly what it does, the method names are quite accurate though</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">testContextManager</span> = <span class="kw2">new</span> TestContextManager<span class="br0">&#40;</span>getClass<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">testContextManager</span>.<span class="me1">prepareTestInstance</span><span class="br0">&#40;</span><span class="kw2">this</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Parameters</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw2">static</span> Collection<span class="sy0">&lt;</span>object <span class="br0">&#91;</span><span class="br0">&#93;</span><span class="sy0">&gt;</span> data<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">return</span> <span class="kw3">Arrays</span>.<span class="me1">asList</span><span class="br0">&#40;</span><span class="kw2">new</span> <span class="kw3">Object</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#91;</span><span class="br0">&#93;</span><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><span class="st0">&quot;a@a.pl&quot;</span><span class="br0">&#125;</span>,<span class="br0">&#123;</span><span class="st0">&quot;exmaple@example.com&quot;</span><span class="br0">&#125;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> EmailTest<span class="br0">&#40;</span><span class="kw3">String</span> validEmail<span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">this</span>.<span class="me1">validEmail</span> = validEmail<span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; @Test</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="kw2">public</span> <span class="kw4">void</span> testIsValidEmail<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="kw2">throws</span> <span class="kw3">Exception</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">boolean</span> email = StringTools.<span class="me1">isEmail</span><span class="br0">&#40;</span>validEmail<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; assertTrue<span class="br0">&#40;</span><span class="st0">&quot;should be OK&quot;</span>, wasOk<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; <span class="co1">//&#8230; more stuff&#8230;&lt;/object&gt;</span></div>
</li>
</ol>
</div>
<p>That&#8217;s it :-) We do what the spring Runner would do for us, instanciate an application context and prepare it &#8211; that&#8217;s when the DI happens. Note that we cant use another runner annotation, but we can as usual specify where to find the appContext.xml&#8217;s.</p>
<p>That&#8217;s all, hope this will prove useful to some of you :-) <strong>Keep your tests clean!</strong></p>
<p>PS: Warning, most of this code was written in wordpress, it may contain minor spelling errors ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/1077/runwith-junit4-with-both-springjunit4classrunner-and-parameterized/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>[review] Amazon Kindle (3)</title>
		<link>http://www.blog.project13.pl/index.php/fun/1063/review-amazon-kindle-3/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/1063/review-amazon-kindle-3/#comments</comments>
		<pubDate>Sun, 31 Oct 2010 17:55:01 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[fun]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[amazon]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[lifestyle]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=1063</guid>
		<description><![CDATA[Yup, I&#8217;m now an happy owner of an Amazon Kindle. In case you don&#8217;t know what it is (&#8230;how&#8217;s that even possible&#8230;?) it&#8217;s an ebook reader. One of that kind we&#8217;ve been waiting for a loooong time now &#8211; with an e-ink display and free internet access etc etc&#8230; Here&#8217;s an super quick review of [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://lh5.ggpht.com/_R79BchylD5A/TM2hYJXnynI/AAAAAAAASMA/ZVnbKJmka7k/P1040282.JPG" onclick="urchinTracker('/outgoing/lh5.ggpht.com/_R79BchylD5A/TM2hYJXnynI/AAAAAAAASMA/ZVnbKJmka7k/P1040282.JPG?referer=');"><img class="aligncenter" title="kindle" src="http://lh5.ggpht.com/_R79BchylD5A/TM2hYJXnynI/AAAAAAAASMA/ZVnbKJmka7k/P1040282.JPG" alt="" width="550" /></a></p>
<p style="text-align: left;">Yup, I&#8217;m now an happy owner of an <a href="http://www.amazon.com/dp/B002Y27P3M/?tag=gocous-20&amp;hvadid=5731245437&amp;ref=pd_sl_dd9w6mlkw_e" onclick="urchinTracker('/outgoing/www.amazon.com/dp/B002Y27P3M/?tag=gocous-20_amp_hvadid=5731245437_amp_ref=pd_sl_dd9w6mlkw_e&amp;referer=');"><strong>Amazon Kindle</strong></a>. In case you don&#8217;t know what it is (&#8230;how&#8217;s that even possible&#8230;?) it&#8217;s an ebook reader. One of that kind we&#8217;ve been waiting for a loooong time now &#8211; with an <strong><a href="http://en.wikipedia.org/wiki/E_Ink" onclick="urchinTracker('/outgoing/en.wikipedia.org/wiki/E_Ink?referer=');">e-ink</a></strong> <strong>display</strong> and free internet access etc etc&#8230;</p>
<p>Here&#8217;s an super quick review of it&#8217;s features:</p>
<ul>
<li>Amazing <strong>e-ink display</strong> &#8211; Yes, it looks really really good. I was kind of sceptic about it but it has proven to me that it really is a pleasure to read from it. It&#8217;s even better than some books &#8211; printed on this damn &#8220;shiny paper&#8221;. So yes, I do see great potential in E-Ink, too bad it&#8217;s proprietary.</li>
<li><strong>NOT an time waster</strong> &#8211; other than the iPad and it&#8217;s concurrence the Kindle will not distract me. No awesome GUI, no shiny buttons. Just a few short cuts (yay for keyboard fans) for just about anything. Finally I&#8217;ll just focus and read some books I&#8217;ve been trying to start/finish since a long time, but didn&#8217;t want to drag them to the uni of some place else (because they&#8217;re really big (coding books)).</li>
<li><span style="text-decoration: line-through;"><strong>No shipping fee for books</strong> that I order from the US/UK -</span> I striked this one out as you can see. Why? Because Amazon has just expanded to another 16 countries or so, and thus I wouldn&#8217;t have to pay any shipping if I&#8217;d order an print book (mainly coding books btw) from the UK. Also this point is for all ebook readers, not just the kindle.</li>
<li><strong>Free 3G internet connection world wide</strong> &#8211; although in Poland I do have my phone connected to the web most of the time. While being aboard this may really be useful &#8211; It certainly would be welcome during my last Japan trip.</li>
<li>It also <strong>reads images, pdf&#8217;s audiobooks doc&#8217;s etc</strong>. I&#8217;ll be using it during my classes a lot, since we often get a lot of PDF&#8217;s to be used during our laboratory classes.</li>
<li><strong>Emailing my Kindle</strong> &#8211; this is an way to deliver myself (or let someone send me) some document and have it immediately downloaded by the kindle. It also allows converting of normal PDF books to Kindles format, which allows it to scale pages a little better and enables <strong>text-to-speech</strong>.</li>
<li><strong>Text-To-Speech</strong> is actually <strong>not bad</strong>! I&#8217;ll probably listen to some chapters on my way to work (I&#8217;m going alone by car most of the time). And music playback is also a nice touch, I always listen to some ambient or chilloutish stuff while doing anything that involves concentrating.</li>
<li>Yup it&#8217;s <strong>Linux</strong> (well, but not much GNU I guess&#8230;) and <strong>Java</strong> powered. They&#8217;re now testing their SDK (KDK) and will be releasing it quite soon. Although I don&#8217;t think the Kindle really needs a whole lot of apps &#8211; that&#8217;s why I wanted it in the first place: simple + not distractive. And as there will be quotas per user-&gt;per kindle-&gt;per app on 3G conectivity (100KB per app, I believe) it won&#8217;t be coming with some cool rss clients I guess &#8211; that&#8217;s something I&#8217;d definitely like to have on it.</li>
</ul>
<p>Oh and<strong> stop asking me about the iPad</strong> and other such devices &#8211; <strong>I&#8217;m not interested</strong>. <strong>For now,</strong> they&#8217;re just <strong>&#8220;yet another time waster&#8221;</strong> and I really don&#8217;t have that much time to buy myself another &#8220;time waster&#8221;. Most people who are so fond of the iPad and it&#8217;s clones are mostly just like &#8220;wooo it shines so coool&#8221; and &#8220;waaaa these animations are so cool&#8221;. Yes, i perfectly do see potential in such tablets, but not if they&#8217;re so limited that their neither an Kindle (1 purpose, very good at it.) or an laptop replacement &#8211; please launch NetBeans or IntelliJ on the iPad and we&#8217;ll slowly start talking.</p>
<p style="text-align: center;"><a href="http://lh6.ggpht.com/_R79BchylD5A/TM2hSW1D7pI/AAAAAAAASLM/CK5_gde7A60/P1040269.JPG" onclick="urchinTracker('/outgoing/lh6.ggpht.com/_R79BchylD5A/TM2hSW1D7pI/AAAAAAAASLM/CK5_gde7A60/P1040269.JPG?referer=');"><img class="aligncenter" title="chunky" src="http://lh6.ggpht.com/_R79BchylD5A/TM2hSW1D7pI/AAAAAAAASLM/CK5_gde7A60/P1040269.JPG" alt="" width="500" /></a></p>
<p>A few <strong>downsides:</strong></p>
<ul>
<li>Oh, there is one big thing I really don&#8217;t like &#8211; <strong>no GNU/Linux client app for Kindle.</strong> Although I do understand that we GNU Guys dont want such software on our platform, it would have been useful&#8230;</li>
<li><strong>It still is a little expensive</strong> (well I&#8217;m still just a polish student, right?) to buy ebooks for the kindle. It may seem that the books are cheaper than their print counterparts (which is true) but all in all we don&#8217;t end up paying less for the books, and are at the risk of loosing them because &#8220;amazon had a bad hair day&#8221;.</li>
</ul>
<p>PS: I&#8217;ll take it with my to the next<strong> JavaCamp</strong> (where I&#8217;ll be speaking about GIT (warning, it&#8217;ll be an extremely &#8220;other kind of&#8221; presentation))<strong> </strong>so if you&#8217;re interested  feel free to apparoach me and ask me for a quick demo ;-)</p>
<p>PPS: Do you know the book sampled in the first picture? If not, google the first sentence and start reading right now!</p>
<p><strong>PPS: <em>Chunky Bacon!</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/1063/review-amazon-kindle-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweets in WordPress; same timeline but skip in rss feed</title>
		<link>http://www.blog.project13.pl/index.php/project13/938/tweets-in-wordpress-same-timeline-but-skip-in-rss-feed/</link>
		<comments>http://www.blog.project13.pl/index.php/project13/938/tweets-in-wordpress-same-timeline-but-skip-in-rss-feed/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 22:00:56 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[Project13]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=938</guid>
		<description><![CDATA[Hi guys, todays post is about yet another fun and small hack, namely: Having twitter posts (tweets) to be displayed right along all wordpress blog posts (posts) in the same timeline (wordpress main view). しかし!!! As my blog is being listed on http://www.dworld.pl/Blogsfera (and for other obvious reasons) I didn&#8217;t want all my tweets to [...]]]></description>
			<content:encoded><![CDATA[<p>Hi guys, todays post is about yet another fun and small hack, namely: Having twitter posts (tweets) to be displayed right along all wordpress blog posts (posts) in the same timeline (wordpress main view). <strong><acronym title="but (in japanese)">しかし</acronym>!!!</strong></p>
<p>As my blog is being listed on <a href="http://www.dworld.pl/Blogsfera" onclick="urchinTracker('/outgoing/www.dworld.pl/Blogsfera?referer=');">http://www.dworld.pl/Blogsfera</a> (and for other obvious reasons) I didn&#8217;t want all my tweets to be translated &#8220;1 to 1&#8243; to plain old blog posts since this would cause each of my tweets (which can be silly sometimes (but quite <strong>rarely!</strong>)) to land on dworld, which they obviously shouldn&#8217;t as it&#8217;s only an place for Java/Development oriented posts. Also I&#8217;d rather they&#8217;d take less space, and would skip all the categories/tags &#8211; it&#8217;s all in the tweet, so why repeat it again and again?</p>
<p>So&#8230; let&#8217;s start by importing tweets into wordpress. There&#8217;s an great plugin for that, and it&#8217;s called <strong><a href="http://skinju.com/wordpress/tweet-import" onclick="urchinTracker('/outgoing/skinju.com/wordpress/tweet-import?referer=');">Tweet Import</a> by skinju</strong>. Just install it and set it up to fetch your tweet&#8217;s at an regular basis. Ok, we&#8217;re done with step 1 &#8211; but neither are the current tweets smaller or ommitted in the rss feed. Let&#8217;s start by filtering them out from the rss feed:</p>
<p>Open up the file <em><strong>/wp-content/themes/default/functions.php </strong></em>and go to the end of the file, we&#8217;ll add an filter here. Please note that in step 1 you should have created an &#8220;twitter&#8221; category all tweets should be marked with. Let&#8217;s assume this category has an ID of 131, then the following code would do the filtering for us:</p>
<div class="geshi no php">
<div class="head">//add at end of file</div>
<ol>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span> ?php</div>
</li>
<li class="li1">
<div class="de1"><span class="co1">// filter out twitter posts from feed</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">function</span> exclude_category<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="kw1">if</span> <span class="br0">&#40;</span> is_feed<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="coMULTI">/* || is_home()*/</span><span class="br0">&#41;</span> <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;set_query_var<span class="br0">&#40;</span><span class="st0">&#39;cat&#39;</span><span class="sy0">,</span> <span class="st0">&#39;-131&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">add_filter<span class="br0">&#40;</span><span class="st0">&#39;pre_get_posts&#39;</span><span class="sy0">,</span> <span class="st0">&#39;exclude_category&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">?&gt;</span></div>
</li>
</ol>
</div>
<p>It&#8217;s a very nice trick, and it&#8217;s <a href="http://zeo.my/exclude-category-in-wordpress/" onclick="urchinTracker('/outgoing/zeo.my/exclude-category-in-wordpress/?referer=');">explained more in detail here</a>. The code is really simple, so no explaining here and let&#8217;s go and tune our view (<strong>yup, the RSS feed is already fixed!</strong>).</p>
<p>To setup our view to work a little different for tweets than for posts, well have to edit: <em><strong>/wp-content/themes/maze/index.php</strong></em> so open it up in your favourite editor and add such an if statement inside an post&#8217;s while statement:</p>
<div class="geshi no php">
<div class="head">//add the 2nd line, the rest is just here for the ease of locating the right place</div>
<ol>
<li class="li1">
<div class="de1">&nbsp; <span class="sy0">&lt;</span> ?php <span class="kw1">while</span> <span class="br0">&#40;</span>have_posts<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="sy0">:</span> the_post<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span> ?php <span class="kw1">if</span> <span class="br0">&#40;</span>in_category<span class="br0">&#40;</span><span class="st0">&#39;twitter&#39;</span><span class="br0">&#41;</span> <span class="sy0">==</span> <span class="kw2">false</span><span class="br0">&#41;</span><span class="sy0">:</span> <span class="co1">//display post?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span>div id<span class="sy0">=</span><span class="st0">&quot;post-&lt;?php the_ID(); ?&gt;&quot;</span><span class="sy0">&gt;&lt;/</span>div<span class="sy0">&gt;</span></div>
</li>
</ol>
</div>
<p>Ok, with this done let&#8217;s write the else part&#8230;</p>
<div class="geshi no php">
<div class="head">//the else for the above if</div>
<ol>
<li class="li1">
<div class="de1"><span class="sy0">&lt;</span> ?php <span class="kw1">else</span><span class="sy0">:</span> <span class="co1">//display tweet ?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span>div id<span class="sy0">=</span><span class="st0">&quot;tweet-&lt;?php the_ID(); ?&gt;&quot;</span> style<span class="sy0">=</span><span class="st0">&quot;padding: 15px 15px 0 0&quot;</span><span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span>div style<span class="sy0">=</span><span class="st0">&quot;background:none repeat scroll 0 0 #262626; font-size:12px; font-weight:normal; line-height:12px; margin:0 30px 10px 0; padding:5px 5px 5px 10px;&quot;</span><span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span> ?php the_content<span class="br0">&#40;</span><span class="st0">&#39;Read More&#8230;&#39;</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;/</span>div<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span>div<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;Tweeted by <span class="sy0">&lt;</span>a href<span class="sy0">=</span><span class="st0">&quot;http://www.twitter.com/ktosopl&quot;</span><span class="sy0">&gt;@</span>ktosopl<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">@</span> <span class="sy0">&lt;</span>a href<span class="sy0">=</span><span class="st0">&quot;&lt;?php $key=&quot;</span>tweetimport_twitter_post_uri<span class="st0">&quot;; echo get_post_meta($post-&gt;ID, $key, true); ?&gt;&quot;</span><span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span> ?php <span class="re1">$key</span><span class="sy0">=</span><span class="st0">&quot;tweetimport_date_imported&quot;</span><span class="sy0">;</span> <span class="kw3">echo</span> get_post_meta<span class="br0">&#40;</span><span class="re1">$post</span><span class="sy0">-&gt;</span><span class="me1">ID</span><span class="sy0">,</span> <span class="re1">$key</span><span class="sy0">,</span> <span class="kw2">true</span><span class="br0">&#41;</span><span class="sy0">;</span> <span class="kw2">?&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sy0">&lt;/</span>div<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;/</span>div<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sy0">&lt;</span> ?php <span class="kw1">endif</span> <span class="co1">//end display mode if?&gt;</span></div>
</li>
</ol>
</div>
<p><em>(You can complain about the in line css styling if you want later, I know it&#8217;s bad but this wordpress theme is a mess anyways&#8230; ;-))</em> Let&#8217;s have a look at the more important parts of this code part. You&#8217;ll notice that I&#8217;m using some weird <strong>get_post_meta()</strong> function. It&#8217;s an method that fetches additional information that each post CAN but doesn&#8217;t have to have. And as the TweetImport plugin does fill an post with a lot of useful tweet data, such as post time and tweet url &#8211; that&#8217;s what I&#8217;m fetching here. The rest should be quite self explanatory, there are bit&#8217;s of hardcoded &#8220;ktosopl&#8221; in there but hey &#8211; it&#8217;s just my blog and I&#8217;m a busy person ;-)</p>
<p>Hope you found this post interesting and maybe you&#8217;ll implement the same thing on your blogs&#8230;? :-)<br />
Cheers!</p>
<p>PS: Oh, and if your interested in talking on one of your upcomming JavaCamps &#8211; feel free to contact me or anyone from the <a href="http://www.java.pl" onclick="urchinTracker('/outgoing/www.java.pl?referer=');"><strong>java.pl</strong></a> team, we&#8217;re looking forward to hearing from you. The nearest meeting will probably be organized around 23&#8242;th or 6&#8242;th&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/project13/938/tweets-in-wordpress-same-timeline-but-skip-in-rss-feed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Terminal Heroes] sed mastery &#8211; group catching</title>
		<link>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/</link>
		<comments>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/#comments</comments>
		<pubDate>Sat, 09 Oct 2010 19:24:36 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=884</guid>
		<description><![CDATA[Just a quick sed (the stream editor) example, as someone from work needed it a few minutes ago and I was more happy to supply an quick solution: # replace the href part &#91;ktoso@homunculus ~&#93;$ cat sedmastery &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;hibernate&#34;&#62;Hibernate&#60;/a&#62; &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;html&#34;&#62;HTML&#60;/a&#62; &#160; &#160;&#60;a href=&#34;#&#34; id=&#34;js&#34;&#62;JavaScript&#60;/a&#62; &#91;ktoso@homunculus ~&#93;$ sed &#39;s&#124;\([^#]*\)#\([^&#62;]*\)&#62;\([^&#60; ]*\)&#124;\1/\3\2&#62;\3&#124;g&#39; sedmastery [...]]]></description>
			<content:encoded><![CDATA[<p>Just a quick <strong>sed</strong> (the stream editor) example, as someone from work needed it a few minutes ago and I was more happy to supply an quick solution:</p>
<div class="geshi no bash">
<div class="head"># replace the href part</div>
<ol>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">cat</span> sedmastery</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;hibernate&quot;</span><span class="sy0">&gt;</span>Hibernate<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;html&quot;</span><span class="sy0">&gt;</span>HTML<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;#&quot;</span> <span class="re2">id=</span><span class="st0">&quot;js&quot;</span><span class="sy0">&gt;</span>JavaScript<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#91;</span>ktoso<span class="sy0">@</span>homunculus ~<span class="br0">&#93;</span>$ <span class="kw2">sed</span> <span class="st0">&#39;s|<span class="es0">\(</span>[^#]*<span class="es0">\)</span>#<span class="es0">\(</span>[^&gt;]*<span class="es0">\)</span>&gt;<span class="es0">\(</span>[^&lt; ]*<span class="es0">\)</span>|<span class="es0">\1</span>/<span class="es0">\3</span><span class="es0">\2</span>&gt;<span class="es0">\3</span>|g&#39;</span> sedmastery</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/Hibernate&quot;</span> <span class="re2">id=</span><span class="st0">&quot;hibernate&quot;</span><span class="sy0">&gt;</span>Hibernate<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/HTML&quot;</span> <span class="re2">id=</span><span class="st0">&quot;html&quot;</span><span class="sy0">&gt;</span>HTML<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sy0">&lt;</span>a <span class="re2">href=</span><span class="st0">&quot;/JavaScript&quot;</span> <span class="re2">id=</span><span class="st0">&quot;js&quot;</span><span class="sy0">&gt;</span>JavaScript<span class="sy0">&lt;/</span>a<span class="sy0">&gt;</span></div>
</li>
</ol>
</div>
<p>Yup, that&#8217;s basically it. You may also apply this <strong>directly in vim</strong> <a href="http://www.youtube.com/watch?v=MzxEt9sK5eM" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=MzxEt9sK5eM&amp;referer=');">as I&#8217;ve showed here a few years ago</a> and you&#8217;ll probably need to <a href="http://www.ibm.com/developerworks/linux/library/l-sed2.html" onclick="urchinTracker('/outgoing/www.ibm.com/developerworks/linux/library/l-sed2.html?referer=');">look some stuff up here</a> or on this <a href="http://www.grymoire.com/Unix/Sed.html#uh-4" onclick="urchinTracker('/outgoing/www.grymoire.com/Unix/Sed.html_uh-4?referer=');">awesome sed guide</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/terminal-heroes/884/terminal-heroes-sed-mastery-group-catching/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[review] JDD 2010</title>
		<link>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 20:53:19 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[jdd]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[meeting]]></category>
		<category><![CDATA[scala]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=872</guid>
		<description><![CDATA[After I came back to Poland this week I had an bazillion of things to do&#8230; Now it&#8217;s just getting even more but I&#8217;ll try survive this. One additional time-taker this week was this years Java Developers&#8217; Day. In fact, it should have been renamed and I&#8217;m very wondered that it wasn&#8217;t to: &#8220;Java Developer [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><img class="aligncenter" title="Java Developer Days" src="http://10.jdd.org.pl/images/jdd_01.gif" alt="Java Developer Days" height="70" /></p>
<p>After I came back to Poland this week I had an <a href="http://www.urbandictionary.com/define.php?term=bazillion" onclick="urchinTracker('/outgoing/www.urbandictionary.com/define.php?term=bazillion&amp;referer=');">bazillion</a> of things to do&#8230; Now it&#8217;s just getting even more but I&#8217;ll try survive this.</p>
<p>One additional time-taker this week was this years Java Developers&#8217; Day. In fact, it should have been renamed and I&#8217;m very wondered that it wasn&#8217;t to: &#8220;Java Developer Days&#8221; or something like this, as this time the event lasted 2 days, from 8h per day. Of course it&#8217;s an paid conference. Having all that said, JDD was the first Java conference I took part in some time ago. I was lucky enough to see the amazing Scott Davis in action and a whole lot of other VERY inspiring talks during the last JDD I&#8217;ve seen. So I decided to go there once more, to get inspired once again&#8230; and <strong>was it worth it this year&#8230;? I&#8217;m not really sure&#8230; </strong>But let&#8217;s continue with an quick-review:</p>
<p>(There was only one session path on each day &#8211; no concurent sessions, thus I attended &#8220;all there was&#8221;.)</p>
<h2><em>RESTful Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/bill-burke" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/bill-burke?referer=');">Bill Burke</a></strong></h2>
<p>I wouldn&#8217;t say it was a &#8220;bad&#8221; presentation. But with practically no coding, and mostly speaking about the core concepts of ROA and REST it wasn&#8217;t an interesting nor informative talk. Even more as <a href="http://www.youtube.com/watch?v=nPvx16UtYrY&amp;feature=related" target="_blank" onclick="urchinTracker('/outgoing/www.youtube.com/watch?v=nPvx16UtYrY_amp_feature=related&amp;referer=');">last year we&#8217;ve seen the amazing Scott Davis talking</a> about the same topic (and being an total mind-opener and show-maker). I mean, hey, we&#8217;re Java Devs, we know about JAX-RS, right? Or am I just living in my bobble where everyone is well informed about such technology. Well it&#8217;s not that new of a technology to start with. REST is everywhere so it was kinda weird to start again with just the basic example use cases. I&#8217;d wish Bill would&#8217;ve showed a little more complicated scenarios &#8211; such as just coding an client (with maybe some nice tricks for it) or working with JSON or custom Object-&gt;XML serialization or something, not just the basic &#8220;HTTP method = java method mapping&#8221; stuff.</p>
<h2><em>Java Programming in a Multicore World</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/angelika-langer" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/angelika-langer?referer=');">Angelika Langer</a></strong></h2>
<p>This presentation came as an small surprise to us. Angelika indeed seems to know a lot about the internals of the JVM and the presentation did cover some interesting quirks about when memory is &#8220;flushed&#8221; (let&#8217;s call it like that for simplicities sake) so other threads would see an changed state. There was an particiulary interesting note about how transient REALLY works. Although not being an eye-opener, this presentation had some tips and tricks.<strong><br />
</strong></p>
<h2><em>Testing the Efficiency of Java Enterprise Applications</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/jaroslaw-blad" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/jaroslaw-blad?referer=');">Jarosław Błąd</a></strong></h2>
<p>I believe I&#8217;ve seen some of Jarosław&#8217;s speeches on some recordings, and they kinda keep an steady level, but are not that shocking after you&#8217;ve spent some time in JEE and such enviroments. There were some more or less useful sidenotes and some info about &#8220;how they did it&#8221; which is always interesting to hear&#8230; I&#8217;d give another 0.5pt to JDD for this one.</p>
<h2><em>The Busy Developer’s Guide to Functional Programming in Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/ted-neward" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/ted-neward?referer=');">Ted Neward</a></strong></h2>
<p>Ted did very well with delivering quite an &#8220;show&#8221; on stage and we had a ton of laughter. The basic idea behind this presentation was to show some basic Functional Progremming concepts CAN be implemented using plain Java. Yeah, with all the verboseness of interfaces and anonymous inner classes but it can be done. As I&#8217;ve been hacking a little with python/scala/groovy I felt quite at home with some of the presented methods, whilst I need to note that Ted&#8217;s explainations were really good&#8230; After this presentation my urge to code in Scala grew even bigger, as most of such functional tasks would be an charm to implement in Scala&#8230; Ah well, for the time being we (you :P) can use some library such as <a href="http://functionaljava.org/" onclick="urchinTracker('/outgoing/functionaljava.org/?referer=');">Functional Java</a> or <a href="http://code.google.com/p/guava-libraries" target="_blank" onclick="urchinTracker('/outgoing/code.google.com/p/guava-libraries?referer=');">Google Guava</a> which both introduce some basic Functional Ideas in an quite nice manner. (BTW: Please do remember that Java&#8217;s not really fit to use such mechanisms, but it&#8217;s a good idea to get used to it, as we&#8217;ll get closures someday, and a LOT of langs are getting more and more functional lately&#8230; :-)) I really like Guava and have even given an presentation about it sometime ago&#8230; :-) Another point for JDD for this speaker.</p>
<h2><em>Flex in the front, Java in the back: multi-screen RIAs with Adobe AIR and Flex</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/piotr-walczyszyn" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/piotr-walczyszyn?referer=');">Piotr Walczyszyn</a></strong></h2>
<p>We&#8217;ve all seen Piotr talk about FLEX sometime I guess (well, if you go to a lot conferences I&#8217;m sure you have) and if you&#8217;re not an FLEX fan it can get a little tiresome. But this time we were <strong>positively suprised</strong>. His flow though the presentation was quite nice and there weren&#8217;t much downtimes. Also he presented the upcoming support for AIR on Android devices (since Android 2.2). As my friend from work didn&#8217;t know anything about flex before, the presentation seemed to introduce him quite well into the basic concepts how such an app would work.</p>
<h2><em>Fearless Change: Patterns for Introducing New Ideas</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/linda-rising" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/linda-rising?referer=');">Linda Rising</a></strong></h2>
<p>Linda&#8217;s talk was supposed to be the &#8220;weird talk&#8221; as she called it herself. I think that even thought most of us won&#8217;t admitt it, the talk she gave was really important I think. I&#8217;ve been trying to introduce an &#8220;new idea&#8221; in our company ever since &#8220;week 1&#8243; and now it seems that we&#8217;re getting ready for it&#8230; Along with the support of some other coders and our new R&amp;D team. I noticed that all the patterns Linda mentioned, were used by us sometime during this process. It wasn&#8217;t like &#8220;hey! let&#8217;s change everything!&#8221;, but just as she said, this process took time and the support of some other team members&#8230; Let&#8217;s hope we&#8217;re able to implement this &#8220;new idea&#8221; in XSolve &#8211; I&#8217;d be very happy if we did &#8211; everyone together&#8230; :-)</p>
<h2><em>Apprenticeship – way to effective professional development</em> – <a href="http://10.jdd.org.pl/prelegenci/lukasz-szydlo" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/lukasz-szydlo?referer=');"><strong>Łukasz Szydło</strong></a></h2>
<p>And we arrived at day 2 of this conference&#8230; This presentation was a little like Linda&#8217;s on the previous day. Even Łukasz mentioned that he used some of Linda&#8217;s patterns in action and showed us how he managed to do some things in his work life&#8230; Not so much new ideas, but it was an quite OK talk I guess.</p>
<p>(Łukasz is working for one of the sponsors of JDD. And as you&#8217;ll notice &#8211; moste of the people presenting on this day were sponsored&#8230; I really didn&#8217;t like this all that much, since We&#8217;ve paid for this conference and didn&#8217;t even have an CHOICE but to listen to sponsored talks&#8230;? That&#8217;s NOT nice.)</p>
<h2><em>Comet enabled application with Lift in 15 minutes</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/lukasz-kuczera" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/lukasz-kuczera?referer=');">Łukasz Kuczera</a></strong></h2>
<p>Łukasz was talking about Lift on our 4th JavaCamp, but this time all the focus went on on stage coding and Comet. Lift is an quite nice small and simple framework and a nice point to start using Scala if you can&#8217;t find any other place for it. Implementing an coment chat was shockingly simple &#8211; even though I anticipated that it&#8217;ll be &#8220;easy&#8221; thanks to Scala&#8217;s and Lift&#8217;s abstrctions around everything. It was a very nice presentation and I liked how it showed both Scala and Lift in action. My coluege from work was also quite amazed at the elegance of Scala (he hasn&#8217;t been coding in it before) and we&#8217;ve talked a little about it later&#8230; A big big point here&#8230; :-)</p>
<h2><em>One size won’t fit everyone: on NoSQL in Java</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/jaroslaw-palka" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/jaroslaw-palka?referer=');">Jarosław Pałka</a></strong></h2>
<p>A quick review of some of the NOSQL databases out there. Jarek mailny covered <strong>neo4j</strong> and <strong>BarkleyDB</strong> as well as <strong>CouchDB</strong> (about which we had an interesting talk during the NOSQL Summer I&#8217;ve attended (it&#8217;s using <strong>map/reduce</strong>)). His talk was an very in depth insight into HOW and WHY one would or wouldn&#8217;t use <strong>NotOnly SQL</strong> databases.  (I really like the term Not Only SQL by the way, it explains so much of the philosophy in so little words&#8230; :-)) Also a nice presentation &#8211; espessialy if someone was not well informed about NOSQL databases before. I was also quite happy with it as I wasn&#8217;t too familiar with <strong>neo4j</strong> and always thought that it&#8217;s cleanly an very interesting DB for some specific operations (anything graph heavy&#8230; ;-)).</p>
<h2><em>Advanced HTTP session management with Oracle Coherence</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/michal-kuratczyk" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/michal-kuratczyk?referer=');">Michał Kuratczyk</a></strong></h2>
<p>As I&#8217;ve been listening to talks about Coherence for over an year now&#8230;<strong> </strong>I kinda went on with hacking some of my stuff on my notebook during this presentation. Coherence is nice, of course as is any Map shared among multiple nodes, but it&#8217;s a) uber-expensive b) there are other non-oracle tools that can be used to achieve this goal. Of course, if you really need some heavy weight enterprise support you&#8217;d go with Oracle&#8217;s solution. BTW, normally Waldemar Kot would be talking about this and Michał seemed to be more like an replacement for Waldek? Also, he was surprised with having to talk in english &#8211; which he cleanly didn&#8217;t expect.</p>
<h2><em>Technical Debt</em> – <strong><a href="http://10.jdd.org.pl/prelegenci/thomas-sundberg" onclick="urchinTracker('/outgoing/10.jdd.org.pl/prelegenci/thomas-sundberg?referer=');">Thomas Sundberg</a></strong></h2>
<p>The<strong> </strong>last presentation on this year&#8217;s JDD&#8230; Most of the ideas Thomas supplied were already covered by Linda or Łukasz &#8211; study groups etc etc. And the &#8220;Technical Debt&#8221; is basically just an name for how much shitty parts you have in your codebase. I didn&#8217;t really like this presentation as it was mostly &#8220;all talk and no &#8216;do&#8217;&#8230;&#8221; but it may have inspired someone to cleanup his code base on next monday etc&#8230; ;-)</p>
<p>All in all&#8230; The <strong>organization </strong>was kinda weak (with super chaotic agenda changes), one of the reasons may have been the 1 to 2 day switch, or maybe no money or something like that&#8230;? The <strong>T-Shirts </strong>look bad (it&#8217;s quite possible that one might not recognise that it&#8217;s an JDD shirt at all&#8230;), and <strong>did cost extra</strong> money&#8230; ;-) And the booths were kinda poor. Comparing it to last year&#8217;s JDD, it was worse, in many aspects. I think that blowing it up into these 2 days was an bad idea and probably caused a lot of these problems. I believe that Javarsovia was an even bigger and more interesting conference (not even mentioning the uber-awesome GeeCON &#8211; I really mean it, the atmosphere and amount of people interaction and networking was much much greater there!) or other fun things like our JavaCamps or NYAC and other initiatives. The poster claimed that JDD is &#8220;Poland&#8217;s biggest Java Conference&#8221; &#8211; eeeee&#8230;.? <em><strong>No</strong></em>, no way. It&#8217;s not, just look at Javarsovia or GeeCON, now THAT are the BIG conferences! The good thing is surely that I&#8217;ve met some of my friends there and had some nice short talks about Japan and work (no, I didn&#8217;t go to the party as I had lot&#8217;s of work to be done). ;-)</p>
<p>I&#8217;m not entirely sure what to think about this year&#8217;s edition. I really loved the previous one, but this time it was kinda &#8220;meh&#8221; and mostly concerning a lot &#8220;<strong>basic</strong><strong>s</strong>&#8221; and &#8220;<strong>soft stuff</strong>&#8220;. This isn&#8217;t really what I&#8217;m paying for &#8211; I&#8217;d like some core, good, rock solid technical presentations. Ok, one might say that the agenda is public so I might just wait for it to be filled out ant then judge if it&#8217;s worth to go there &#8211; but there&#8217;s a catch here, the agenda was not final until the very last week before it (and that would cost me around 500-1000PLN &#8211; LOL). Ah well, it&#8217;s YAC&#8230;. ;-)</p>
<p>I&#8217;m kinda interested how <strong>Radek </strong>is enjoying his stay in<strong> Berlin at JUDCon, </strong>as it&#8217;s being held at the exact same time as JDD&#8230; ;-) In other news&#8230; I&#8217;m coding the GeeCON c4p app and I&#8217;m hoping you&#8217;ll like it when it&#8217;s done. Also&#8230; we&#8217;re starting out with <strong>a new series of JavaCamp meetings very soon</strong> &#8211; can&#8217;t wait to see you there!</p>
<p>Till then, Sayonara~</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/872/review-jdd-201/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>props2xls &#8211; GWT i18n Properties to Google Spreadsheet uploader</title>
		<link>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/#comments</comments>
		<pubDate>Sun, 12 Sep 2010 02:12:41 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[groovy]]></category>
		<category><![CDATA[gwt]]></category>
		<category><![CDATA[jee]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=808</guid>
		<description><![CDATA[!UPDATED POST &#8211; see bellow! As I&#8217;ve been recently given a task to &#8220;copy &#38; paste&#8221; all our properties into an specific document on google docs &#8211; that the client wanted to use in order to translate these properties into other languages. Of course I decided NOT to do this by hand &#8211; but script [...]]]></description>
			<content:encoded><![CDATA[<p><strong>!UPDATED POST &#8211; see bellow!</strong></p>
<p>As I&#8217;ve been recently given a task to &#8220;copy &amp; paste&#8221; all our properties into an specific document on <strong>google docs</strong> &#8211; that the client wanted to use in order to translate these properties into other languages. Of course <strong>I decided NOT to do this by hand</strong> &#8211; but script it &#8211; and that&#8217;s how <strong>props2xls </strong>came to be.</p>
<p>It&#8217;s an Groovy + Java app that traverses an directory searching for *.properties files, and then matches their names together &#8211; and extracts their Locale from the filenames. Next, those strings are uploaded into an specified Google Spreadsheet. You can use any google account + password anc choose which spreadsheet/worksheet should be filled out with your data.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/RneIPxq9qLs?fs=1&amp;hl=en_US&amp;color1=0x2b405b&amp;color2=0x6b8ab6" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/RneIPxq9qLs?fs=1&amp;hl=en_US&amp;color1=0x2b405b&amp;color2=0x6b8ab6" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Note that the bottleneck here is the inserting into the Spreadsheet. <strong>This can be easily and very much improved as one may use Batch inserts. </strong>But as it&#8217;s just a proof-of-contept, I didn&#8217;t actually care for the time being ;-)<strong><br />
</strong></p>
<p>Here are some useful links if this post got you interested in this API:</p>
<ul>
<li><a href="http://code.google.com/p/gdata-java-client/" onclick="urchinTracker('/outgoing/code.google.com/p/gdata-java-client/?referer=');">http://code.google.com/p/gdata-java-client/</a></li>
<li><a href="http://code.google.com/apis/gdata/" onclick="urchinTracker('/outgoing/code.google.com/apis/gdata/?referer=');">http://code.google.com/apis/gdata/articles/java_client_lib.html#linux</a></li>
</ul>
<p>As all programmers&#8230; you&#8217;d also probably want to check out the source &#8211; <a href="http://github.com/ktoso/props2xls" onclick="urchinTracker('/outgoing/github.com/ktoso/props2xls?referer=');">so here (on github) it is</a>. But be warned, it&#8217;s very low quality as it&#8217;s just been hacked on for a few hours today at night (after midnight&#8230; ;-)).</p>
<p>&#8212;- the UPDATE &#8212;-</p>
<p>As you&#8217;ve probably noticed. In the first version I was using cell-by-cell updated. Each of them would fire an HttpRequest&#8230; And that is very expensive. So&#8230; I&#8217;ve rewritten some of the code to enable <strong>Batch updates</strong>. Goodle APIs support is quite well and I&#8217;m happy with the end result (as seen in the above movie).</p>
<p>There is a bug in the Java Client Library from 2.0 up though&#8230; When creating the SpreadsheetService use the following code, or you&#8217;ll <a href="//bug workaround! http://code.google.com/p/gdata-java-client/issues/detail?id=103">run into some weird bugs at runtime</a>:</p>
<div class="geshi no java">
<div class="head">//note line 3 here</div>
<ol>
<li class="li1">
<div class="de1">service = <span class="kw2">new</span> SpreadsheetService<span class="br0">&#40;</span><span class="st0">&quot;Props-2-Xls&quot;</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1">service.<span class="me1">setUserCredentials</span><span class="br0">&#40;</span>username, password<span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co1">//bug workaround! http://code.google.com/p/gdata-java-client/issues/detail?id=103</span></div>
</li>
<li class="li1">
<div class="de1">service.<span class="me1">setProtocolVersion</span><span class="br0">&#40;</span>SpreadsheetService.<span class="me1">Versions</span>.<span class="me1">V1</span><span class="br0">&#41;</span><span class="sy0">;</span></div>
</li>
</ol>
</div>
<p>PS: One might call it an proof-of-concent, as the code is quite ugly but it was written in about 3-4hours. And will probably spare us a lot of time if some client wants to translate our properties once again&#8230; ;-)</p>
<p>PPS: Did you know that on the <em>netbeans.edu.pl</em> website, I used the <strong>Google Data API for Picasa</strong> to develop <a href="http://www.netbeans.edu.pl/gallery" onclick="urchinTracker('/outgoing/www.netbeans.edu.pl/gallery?referer=');">the gallery</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/808/props2xls-gwt-i18n-properties-to-google-spreadsheet-uploader/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

