<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Rubberducking</title>
	
	<link>http://mathieuberube.net/blog</link>
	<description>Thoughts about programming, technology and agility</description>
	<lastBuildDate>Thu, 02 Sep 2010 03:12:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/rubberducking" /><feedburner:info uri="rubberducking" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Retro</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/-FfUaB3mWRQ/</link>
		<comments>http://mathieuberube.net/blog/2010/09/01/retro/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 03:12:23 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[goals]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=106</guid>
		<description><![CDATA[In September 2009, I decided that for the next year, I would concentrate on three goals: Reading (12 books) Blogging (40 posts) Coding (4 projects) What did I learn about setting objectives? What do I need to improve? These questions will be answered in a few moments&#8230; and if you care you might even hear [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://mathieuberube.net/blog/2009/09/21/personnal-goals/">September 2009</a>, I decided that for the next year, I would concentrate on three goals:</p>
<ul>
<li>Reading (12 books)</li>
<li>Blogging (40 posts)</li>
<li>Coding (4 projects)</li>
</ul>
<p>What did I learn about setting objectives? What do I need to improve? These questions will be answered in a few moments&#8230; and if you care you might even hear how I fared.</p>
<h4>The results (drum roll)</h4>
<p>Overall I&#8217;m happy with what I accomplished. I read more books than what I planned (16 books that I remember plus tons of blogs), and I blogged as planned (*exactly* as planned if I include this post and another I posted only on the <a href="http://pyxis-tech.com/blog/2010/08/27/unit-testing-your-views-with-velocity/">Pyxis blog</a>). However I wanted to code a lot more than I did. I&#8217;m still pleased with the small projects that I worked on but I envisioned something bigger. I mostly did prototypes, katas and experimentation with Rails. No big projects, nothing on github (yet).</p>
<p>I did learn a lot about setting objectives for the future:</p>
<h4>Lesson #1 : Never write about goals other people set for you</h4>
<p>My wife convinced me to put something about losing a bit of weight. Fail. It wasn&#8217;t my goal, it should never have made the list</p>
<h4>Lesson # 2 : Keep your objectives focused</h4>
<p>For me, three goals was one too much. Very early on I could see that it was easier for me to write blogs or read books than it was to code &#8211; books were feeding me for blogs, blogs were giving me questions to read about. Coding felt lonely. Next time I&#8217;m going to go with two goals max to start with &#8211; and coding is going to be one of them.</p>
<h4>Lesson # 3 : Do it gradually</h4>
<p>Setting goals is definitely something that allowed me to improve. When I did it in the past, I usually started with a big goal in mind. I suggest you try it with small objectives at first and grow more ambitious as you go. Get started, have habits in place. Then think big.</p>
<h4>Lesson #4 : Think about your next goals in advance</h4>
<p>Especially if you plan on blogging about it on time. Shame on me.</p>
<p>I have a few ideas but I&#8217;m not fixed yet, so I&#8217;ll set a few very short term goals for now.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/-FfUaB3mWRQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/09/01/retro/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/09/01/retro/</feedburner:origLink></item>
		<item>
		<title>Rediscovering ERB (without Rails)</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/7bBUIfluZcI/</link>
		<comments>http://mathieuberube.net/blog/2010/08/26/rediscovering-erb-without-rails/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 03:40:35 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=103</guid>
		<description><![CDATA[Since I discovered Haml for my HTML templates in Rails, I stopped using ERB. Haml is more intuitive and readable to me. I am rediscovering ERB though for something else completely &#8211; Java code generation. There is a lot of boilerplate code in most Java projects. A good IDE can help you alleviate some of [...]]]></description>
			<content:encoded><![CDATA[<p>Since I discovered Haml for my HTML templates in Rails, I stopped using ERB. Haml is more intuitive and readable to me.</p>
<p>I am rediscovering ERB though for something else completely &#8211; Java code generation.</p>
<p>There is a lot of boilerplate code in most Java projects. A good IDE can help you alleviate some of it but most (if not all) applications will have additional boilerplate very specific to your application. Using ERB, you can easily create cut down on mindless typing.</p>
<p>For example, let&#8217;s suppose you are writing many Java listeners. Just create a script that will do it for you. I&#8217;ll make an exemple with a ContactListener class that is notified when a user is added, removed or blacklisted from your contact list.</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'erb'</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># setup - could be initialized from script arguments</span>
classname = <span style="color:#996600;">&quot;Contact&quot;</span>
listener_methods = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;added&quot;</span>, <span style="color:#996600;">&quot;removed&quot;</span>, <span style="color:#996600;">&quot;blackListed&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># create file based on 'listener.java.erb'</span>
content = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">'listener.java.erb'</span><span style="color:#006600; font-weight:bold;">&#41;</span>
template = <span style="color:#CC00FF; font-weight:bold;">ERB</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span>content<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#CC0066; font-weight:bold;">open</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;#{classname}Listener.java&quot;</span>, <span style="color:#996600;">'w'</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#006600; font-weight:bold;">|</span>f<span style="color:#006600; font-weight:bold;">|</span> f.<span style="color:#CC0066; font-weight:bold;">puts</span><span style="color:#006600; font-weight:bold;">&#40;</span>template.<span style="color:#9900CC;">result</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span></pre></div></div>

<p>If I run this using listener.java.erb:</p>
<pre>public interface &lt;%= classname %&gt;Listener {
  &lt;% listener_methods.each do |method|  %&gt;
  void &lt;%= method %&gt;(&lt;%= classname %&gt;Event event);
  &lt;% end %&gt;
}</pre>
<p>Then I generate this file:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">interface</span> ContactListener <span style="color: #009900;">&#123;</span>
  <span style="color: #000066; font-weight: bold;">void</span> added<span style="color: #009900;">&#40;</span>ContactEvent event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">void</span> removed<span style="color: #009900;">&#40;</span>ContactEvent event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">void</span> blackListed<span style="color: #009900;">&#40;</span>ContactEvent event<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>That was easy &#8211; and it&#8217;s not that useful I admit. I&#8217;m sure you can create your own listeners just as fast in your own IDE. Probably even faster.</p>
<p>However here comes the fun part &#8211; the same script can be used to create lots of other classes:</p>
<ul>
<li>The ContactAdapter class</li>
<li>The ContactEvent class</li>
<li>The ContactController</li>
<li>The Contact model</li>
<li>The ContactRepository (maybe even with a few methods to add/remove/retrieve a contact by id)</li>
<li>The ContactView through which users will be able to trigger ContactEvents (maybe with a simple UI &#8211; even buttons to trigger each events on the ContactHandler)</li>
<li>Registration of the ContactHandler and the ContactView by your favorite IOC framework</li>
<li>Registration of the ContactView so it is accessible from your application&#8217;s menu</li>
<li>Test classes for all of the above (including failing test cases that you&#8217;re going to have to write)</li>
</ul>
<p>And probably other bits here and there to glue everything together.</p>
<p>Your mileage may vary, but code generation might be a great way to make your path shorter.</p>
<p>Can your IDE do that?</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/7bBUIfluZcI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/08/26/rediscovering-erb-without-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/08/26/rediscovering-erb-without-rails/</feedburner:origLink></item>
		<item>
		<title>Dear Java, Please Let Me Work</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/xC5SBJvcDHY/</link>
		<comments>http://mathieuberube.net/blog/2010/08/20/dear-java-please-let-me-work/#comments</comments>
		<pubDate>Sat, 21 Aug 2010 04:27:58 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=90</guid>
		<description><![CDATA[I had to read the content of a file for a ruby project. This is how I did it: def read_file_content&#40;filename&#41; File.read&#40;filename&#41; end Simple enough, right? Then for some reason I thought about how I would have to the same in Java: public String readFileContent&#40;String filename&#41; &#123; try &#123; BufferedReader reader = new BufferedReader&#40;new FileReader&#40;filename&#41;&#41;; [...]]]></description>
			<content:encoded><![CDATA[<p>I had to read the content of a file for a ruby project. This is how I did it:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">def</span> read_file_content<span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">read</span><span style="color:#006600; font-weight:bold;">&#40;</span>filename<span style="color:#006600; font-weight:bold;">&#41;</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Simple enough, right?</p>
<p>Then for some reason I thought about how I would have to the same in Java:</p>

<div class="wp_syntax"><div class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #003399; font-weight: bold;">String</span> readFileContent<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> filename<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003399; font-weight: bold;">BufferedReader</span> reader = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">BufferedReader</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">FileReader</span><span style="color: #009900;">&#40;</span>filename<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399; font-weight: bold;">StringBuilder</span> buffer = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">StringBuilder</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #003399; font-weight: bold;">String</span> line = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #000000;  font-weight: bold;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>line = reader.<span style="color: #006633;">readLine</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      buffer.<span style="color: #006633;">append</span><span style="color: #009900;">&#40;</span>line<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000000; font-weight: bold;">return</span> buffer.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">IOException</span> e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Need I really explain why I prefer Ruby these days? Even if you remove the try/catch clause and rethrow the exception, that&#8217;s still a lot of code compared to a single line of ruby. I am also aware that it is possible to write the same Java code in a single line using Apache&#8217;s commons-io (IOUtils.toString(InputStream) &#8211; but still, why are the base Java libraries so verbose for file manipulation?</p>
<p>I still like Java, but I&#8217;m impress by the compactness of Ruby. It just works as it should. Sometimes working in Java it seems I&#8217;m just smashing the keyboard instead of getting actual work done.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/xC5SBJvcDHY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/08/20/dear-java-please-let-me-work/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/08/20/dear-java-please-let-me-work/</feedburner:origLink></item>
		<item>
		<title>Unreasonable Fear</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/vK2LemxP5x8/</link>
		<comments>http://mathieuberube.net/blog/2010/08/11/unreasonable-fear/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 02:38:59 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=101</guid>
		<description><![CDATA[Sometimes, developers are a bunch of wimps. We get so comfortable with our programming language that many of us are afraid to try something else. Many of us learn one programming language (Java, C# or something else) and we stick to it no matter what. We do use libraries and frameworks and we&#8217;re often eager [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, developers are a bunch of wimps.</p>
<p>We get so comfortable with our programming language that many of us are afraid to try something else.</p>
<p>Many of us learn one programming language (Java, C# or something else) and we stick to it no matter what. We do use libraries and frameworks and we&#8217;re often eager to try a new one in our project. But talks about learning a new programming language are usually met with quick rejection. We want to stay in our comfort zone.</p>
<p>I think something is wrong with this picture. Is learning Ruby on Rails really more difficult than learning Spring? Is Hibernate really simpler than activerecord?</p>
<p>Why are developers afraid of trying something new? Some problems can be solved easily in Clojure or Erlang. Are you sure Java/C# is the solution to your problem? It might be part of the solution, but probably not the entire solution.</p>
<p>Discovering ruby (and rails), I see flaws in Java that I didn&#8217;t see before. I learn a different way of doing things that expands my knowledge. When I come back to Java, I see problems from another point of view and sometimes use a different solution than I would before learning ruby.</p>
<p>Why are you still afraid?</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/vK2LemxP5x8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/08/11/unreasonable-fear/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/08/11/unreasonable-fear/</feedburner:origLink></item>
		<item>
		<title>Training On Hold – For Now</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/sq3oKWzUoIc/</link>
		<comments>http://mathieuberube.net/blog/2010/08/10/training-on-hold-for-now/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 01:47:20 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[practice]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=98</guid>
		<description><![CDATA[I planned on continuing my training sessions while I was on vacation. However it seems that I am even more tired after a day in the sun than I am after a day at the office. Go figure. Anyway I decided to put the training on hold until I come back. A guy has to [...]]]></description>
			<content:encoded><![CDATA[<p>I planned on continuing my training sessions while I was on vacation. However it seems that I am even more tired after a day in the sun than I am after a day at the office. Go figure.</p>
<p>Anyway I decided to put the training on hold until I come back. A guy has to take a break from time to time. And it gives me more time to read and think about my objectives for the next year. That&#8217;s what I&#8217;m going to do for the next two weeks.</p>
<p>I&#8217;ll continue to do katas and small projects when I come back.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/sq3oKWzUoIc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/08/10/training-on-hold-for-now/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/08/10/training-on-hold-for-now/</feedburner:origLink></item>
		<item>
		<title>Keyboard Powered Web Search</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/Jwa2w9k30S0/</link>
		<comments>http://mathieuberube.net/blog/2010/07/27/keyboard-powered-web-search/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:01:44 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[productivity]]></category>
		<category><![CDATA[tools]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=93</guid>
		<description><![CDATA[For the past two weeks I&#8217;ve used DuckDuckGo as my search engine. It&#8217;s a search engine built on open-source software. What made me switch is the capacity to navigate through search results with the keyboard using vi-like keys (hjkl). I didn&#8217;t know at the time but Google also allows you do something similar. You just [...]]]></description>
			<content:encoded><![CDATA[<p>For the past two weeks I&#8217;ve used <a href="https://duckduckgo.com/">DuckDuckGo</a> as my search engine. It&#8217;s a search engine built on <a href="http://ostatic.com/blog/duckduckgo-a-new-search-engine-built-from-open-source">open-source software</a>. What made me switch is the capacity to navigate through search results with the keyboard using vi-like keys (hjkl).</p>
<p>I didn&#8217;t know at the time but Google also allows you do something similar.  You just need to go to http://www.google.ca/experimental/ (also works for google.com and I guess most other domains). There you can opt-in to be part of the <em>Keyboard shortcuts</em> experiment. That&#8217;s it! J/K are used to navigate through search results, O (or enter) to open them.</p>
<p>Hopefully this is going to be useful for the other keyboard junkies out there.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/Jwa2w9k30S0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/07/27/keyboard-powered-web-search/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/07/27/keyboard-powered-web-search/</feedburner:origLink></item>
		<item>
		<title>Touch-Typing Training – Results</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/EJ-uj6_rzlE/</link>
		<comments>http://mathieuberube.net/blog/2010/07/23/touch-typing-training-results/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 03:12:55 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[goals]]></category>
		<category><![CDATA[practice]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=97</guid>
		<description><![CDATA[As I wrote a week ago, I trained touch-typing this week. My objective was to attain 85 wpm. Here&#8217;s a recap of my week: Monday : I decided to use Typeracer as my baseline. It&#8217;s an online game that allows you to race others. The fastest typist wins. I had not played in 6 months [...]]]></description>
			<content:encoded><![CDATA[<p>As I wrote <a href="http://mathieuberube.net/blog/2010/07/18/training-week-2-and-a-challenge/">a week ago</a>, I trained touch-typing this week. My objective was to attain 85 wpm. Here&#8217;s a recap of my week:</p>
<p><strong>Monday </strong>: I decided to use Typeracer as my baseline. It&#8217;s an online game that allows you to race others. The fastest typist wins. I had not played in 6 months or so &#8211; and it showed. My score for the last ten races dropped a bit. This was not a good start. Result after the day : 74 wpm</p>
<p><strong>Tuestday </strong>: I did some drills on goodtyping.com to get back to speed. It must have helped because I raised my speed to 78 wpm.</p>
<p><strong>Wednesday </strong>: mostly played Typeracer. I managed to cut down on typing errors and I&#8217;m up to 81 wpm.</p>
<p><strong>Thursday </strong>: I tried to practice at night instead of during lunch time. Without much success &#8211; 80 wpm. My fingers were not obeying me. I did a few drills on goodtyping.com to increase accuracy.</p>
<p><strong>Friday </strong>: Success! I managed to consistently type over 80 wpm today by concentrating on typing slower but with less mistakes. I managed an average of 87 wpm on my last 10 races.</p>
<p>The week is over and I achieved my objective of 85 wpm. I did this mostly by reducing mistakes &#8211; they can get really slow you down. </p>
<p>Thanks to my colleagues who followed in my track and helped me focus on this challenge.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/EJ-uj6_rzlE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/07/23/touch-typing-training-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/07/23/touch-typing-training-results/</feedburner:origLink></item>
		<item>
		<title>How to warn users not to use an interface</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/69gg1pmJeIo/</link>
		<comments>http://mathieuberube.net/blog/2010/07/22/how-to-warn-users-not-to-use-an-interface/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 03:38:38 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=96</guid>
		<description><![CDATA[Everybody knows no one reads documentation. Hamcrest found an original way to warn users to use the org.hamcrest.BaseMatcher class instead of the org.hamcrest.Matcher interface. Look at the interface yourself. They added a dummy deprecated method called _dont_implement_Matcher___instead_extend_BaseMatcher_ in the interface. I am still unsure whether I will ever use this in my own projects. But [...]]]></description>
			<content:encoded><![CDATA[<p>Everybody knows no one reads documentation. Hamcrest found an original way to warn users to use the <code>org.hamcrest.BaseMatcher</code> class instead of the <code>org.hamcrest.Matcher</code> interface.</p>
<p><a href="http://code.google.com/p/hamcrest/source/browse/trunk/hamcrest-java/hamcrest-core/src/main/java/org/hamcrest/Matcher.java">Look at the interface yourself.</a></p>
<p>They added a dummy deprecated method called <code>_dont_implement_Matcher___instead_extend_BaseMatcher_</code> in the interface.</p>
<p>I am still unsure whether I will ever use this in my own projects. But when this method appeared in my code today I could not help but look at it. It was then totally clear that I was not doing what they wanted me to do. I&#8217;ve seldom seen documentation that obvious.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/69gg1pmJeIo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/07/22/how-to-warn-users-not-to-use-an-interface/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/07/22/how-to-warn-users-not-to-use-an-interface/</feedburner:origLink></item>
		<item>
		<title>Training week #2 and a challenge</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/HwYYeVa4Afw/</link>
		<comments>http://mathieuberube.net/blog/2010/07/18/training-week-2-and-a-challenge/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 04:17:42 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[kata]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=95</guid>
		<description><![CDATA[This week I consolidated the two katas I did last time (Prime Number and Bloom Filter). Nothing much to talk about. The only thing of note is that I got late in my RSS feed (again) so I missed the announcement of Corey Haines&#8217; Learn How to Type Week. I repent and decided to try [...]]]></description>
			<content:encoded><![CDATA[<p>This week I consolidated the two katas I did last time (Prime Number and Bloom Filter). Nothing much to talk about.</p>
<p>The only thing of note is that I got late in my RSS feed (again) so I missed the announcement of <a href=" http://github.com/plataformatec/devise/tree/v1.0">Corey Haines&#8217; Learn How to Type Week</a>.</p>
<p>I repent and decided to try my own this week (along with a few colleagues).</p>
<p>I&#8217;ll keep you posted about the results. I&#8217;ll work in increasing my wpm.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/HwYYeVa4Afw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/07/18/training-week-2-and-a-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/07/18/training-week-2-and-a-challenge/</feedburner:origLink></item>
		<item>
		<title>Developer in Training</title>
		<link>http://feedproxy.google.com/~r/rubberducking/~3/I4uvts_WnYc/</link>
		<comments>http://mathieuberube.net/blog/2010/07/11/developer-in-training/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 04:19:54 +0000</pubDate>
		<dc:creator>Mathieu Berube</dc:creator>
				<category><![CDATA[kata]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://mathieuberube.net/blog/?p=91</guid>
		<description><![CDATA[I believe in software craftsmanship and in training to become better. That&#8217;s why when I was challenged at work to take a few hours each week to train, I thought &#8220;What a great opportunity!&#8221;. Well that&#8217;s what I should have thought. Instead I said: &#8220;But what about the project? The deadline? The world is going [...]]]></description>
			<content:encoded><![CDATA[<p>I believe in software craftsmanship and in training to become better.</p>
<p>That&#8217;s why when I was challenged at work to take a few hours each week to train, I thought &#8220;What a great opportunity!&#8221;.</p>
<p>Well that&#8217;s what I should have thought. Instead I said: &#8220;But what about the project? The deadline? The world is going to end!&#8221;</p>
<p>Then I realized how lucky I was to work at <a href="http://www.pyxis-tech.com/en/">Pyxis</a>. I asked the Product Owner and it wasn&#8217;t such a big issue.</p>
<p><strong>Lesson #1</strong>: Ask and thou shall receive</p>
<p>For my first training session, I decided to do the some <a href="http://mathieuberube.net/blog/2009/12/28/why-katas-work/">katas</a> in ruby as it has become my language of choice for pet projects.</p>
<h3><strong>Part 1 &#8211; Primes</strong></h3>
<p>I started my first session with the Prime Number kata. I like this kata since it is really simple, can easily be done in less than 30 minutes (closer to 10 once you&#8217;ve done it a few times) and I learned a few useful tricks in ruby by watching this kata permormed <a href="http://katas.softwarecraftsmanship.org/?p=71">by Uncle Bob on Katacast</a>.</p>
<p>I plan on doing the Prime Number kata every week as a warm up.</p>
<h3><strong>Part 2 &#8211; Bloom filters</strong></h3>
<p>Afterwards I tried kata #5 from http://codekata.pragprog.com/2007/01/kata_five_bloom.html &#8211; implementing a <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Bloom_filter">Bloom Filter</a>. It&#8217;s an algorithm that probabilistically determine if an element is part of a set. It works like this : if the element is in the set, it will always return true. However if the element is not in the set, the bloom filter might still return true depending on some probabilistic stuff.</p>
<h3>Training ends</h3>
<p>Here are my highlights of the session:</p>
<ul>
<li>I learned a new algorithm, it&#8217;s purpose and a few use cases</li>
<li>I performed everything in pure TDD</li>
<li>Continued to learn new keyboard shortcuts in Rubymine (I try never to use the mouse in katas. If there is a keyboard shortcut I forgot, I look it up and make a point on using it)</li>
<li>I managed to take some time to train!</li>
</ul>
<p>The only downside I can think about is that I spent a little while trying to configure ruby 1.9.2, rspec and the latest beta of Rubymine 2.5 before reverting to ruby 1.8.7.</p>
<p>As for improvements, I see lots of ways to improve the Bloom Filter katas, especially when it comes to my tests. I&#8217;ll give it another try next time.</p>
<img src="http://feeds.feedburner.com/~r/rubberducking/~4/I4uvts_WnYc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mathieuberube.net/blog/2010/07/11/developer-in-training/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mathieuberube.net/blog/2010/07/11/developer-in-training/</feedburner:origLink></item>
	</channel>
</rss>
