<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title><![CDATA[Passionate Development]]></title>
  <link href="http://passionatedevelopment.com/atom.xml" rel="self"/>
  <link href="http://passionatedevelopment.com/"/>
  <updated>2012-05-10T09:53:36+10:00</updated>
  <id>http://passionatedevelopment.com/</id>
  <author>
    <name><![CDATA[Felix Tjandrawibawa]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Install Ruby Manually For Rbenv]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/05/06/install-ruby-manually/"/>
    <updated>2012-05-06T17:21:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/05/06/install-ruby-manually</id>
    <content type="html"><![CDATA[<p>The easiest way to install Ruby on your system is to use one of these Ruby version managers:
<a href="https://github.com/wayneeseguin/rvm">RVM</a> or <a href="https://github.com/sstephenson/rbenv">rbenv</a>.</p>

<p>But sometimes, you just need to install Ruby from source, for example for your production
environment where there isn&#8217;t version manager installed.
In fact, I was tasked with upgrading Ruby on our production server last week.
And it was not as straight forward as I was expecting.</p>

<!-- more -->


<h2>TL;DR</h2>

<p>This is the original post that has everything you need to install Ruby 1.9.3 manually
from the source:
<a href="http://collectiveidea.com/blog/archives/2011/10/31/install-ruby-193-with-libyaml-on-centos/">Collective Idea - Install ruby 1.9.3 with LibYAML on CentOS</a></p>

<p>I wish I had read the post before attempting Ruby installation.</p>

<h2>Install Ruby for rbenv</h2>

<p>Before I attempted upgrade on the production server, I &#8220;practice&#8221; the upgrade first
on my dev environment.</p>

<p>I use rbenv and while rbenv does the version management for you, one thing that it doesn&#8217;t do is install Ruby.
For installing Ruby, most rbenv users would use its <a href="https://github.com/sstephenson/ruby-build">ruby-build</a>.
This is the easiest option to get ruby installed and configured for rbenv.</p>

<p>But of course you could also just install Ruby from the source to be used for rbenv.
Below are the steps that I took to install Ruby 1.9.3-p194 manually for rbenv.</p>

<h3>Install LibYAML (if not installed)</h3>

<p>First thing first - make sure LibYAML is installed. If you aren&#8217;t sure - it doesn&#8217;t hurt
to just install it.</p>

<p>Since Ruby 1.9.3-p0, libyaml is required so YAML parsing. You could install Ruby
without it but that just doesn&#8217;t make sense as there are important Ruby libraries that depend
on it (such as Bundler).</p>

<p>The Collective Idea link above outlines steps to do it.</p>

<h3>Configure and Install Ruby</h3>

<p>Ruby installation is straight forward (if you know what to set up - more on that later),
after download, extrac and cd into the directory, you&#8217;d just need to issue following:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>./configure --prefix=[RBENV_DIR]/versions/1.9.3-p194 --enable-shared --with-opt-dir=/usr/local/lib 
</span><span class='line'>./make
</span><span class='line'>./make install</span></code></pre></td></tr></table></div></figure>


<p>Notice the first command, this is crucial to get your Ruby correctly compiled and installed:</p>

<ul>
<li>prefix options tells where to put the Ruby after installation. Rbenv keeps
the ruby versions on ~/.rbenv/versions. Subsitute [RBENV_DIR] above with the full path of your
rbenv installation (normally on ~/.rbenv)</li>
<li>with-opt-dir is the location of the libraries needed
to compile Ruby (libyaml location should be specified here).</li>
</ul>


<p>Now if you do <code>rbenv versions</code>, you should see 1.9.3-p194 installed there.</p>

<p>Change your global Ruby by issuing <code>rbenv global 1.9.3-p194</code>. And you&#8217;re done!</p>

<h2>Summary</h2>

<p>Installing Ruby from source is not that terribly difficult, while it doesn&#8217;t beat
the simplicity of using ruby-build, it&#8217;s always good to do it the manual way just
in case you&#8217;d need to do it in the future.</p>

<p>I did make a mistake on my first attempt, my mistake was<br/>
not specifying with-opt-dir when running <code>configure</code>. And
as a result Ruby was compiled without YAML support.</p>

<p>When I did that, I got this warning:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>/usr/local/lib/ruby/1.9.1/yaml.rb:56:in `&lt;top (required)&gt;':
</span><span class='line'>It seems your ruby installation is missing psych (for YAML output).
</span><span class='line'>To eliminate this warning, please install libyaml and reinstall your ruby.</span></code></pre></td></tr></table></div></figure>


<p>Anyway, lesson learned.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Review of Vim for Rails Developers]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/04/11/review-vim-for-rails/"/>
    <updated>2012-04-11T22:31:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/04/11/review-vim-for-rails</id>
    <content type="html"><![CDATA[<p>Few months back when I started working extensively Vim, I came across
a screencast from Ben that is specifically about using
<a href="https://workshops.thoughtbot.com/products/2-vim">Vim for Rails Developer</a></p>

<p>I am the perfect target audience of the screencast - as I was both new to
Rails and Vim.</p>

<p>It is a paid screencast, but Ben is kind enough to send me a
free copy in return of a blog review. Well, this is the promised review -
a couple of months late.</p>

<!-- more -->


<p>It goes without saying that the single most important plugin for doing
Rails dev with Vim is Tim Pope&#8217;s <a href="https://github.com/tpope/vim-rails">Rails.vim</a>.
And the screencast does an excellent job in introducing and covering the
basics of the plugin.
It&#8217;s true that you could probably get all of the information
from the documentation (:help rails), but having an experienced developer
showing all the ropes is just priceless.</p>

<p>An example of some of the things that&#8217;s shown: when editing a Rails unit test
vertically split the screen to open the model file that is being tested. A very
handy thing to do when doing TDD.</p>

<p>In my opinion the coverage of this plugin alone has boosted my productivity
the most from watching it. And that&#8217;s not all.</p>

<p>Ben then shows how he uses <a href="http://www.vim.org/scripts/script.php?script_id=2540">Snipmate</a>
which I haven&#8217;t had chance to try yet.</p>

<p>Next thing is <a href="http://ctags.sourceforge.net/">ctags</a>, which
I just started to look at in last week (partly also due to watching
a bit of <a href="https://peepcode.com/products/play-by-play-tenderlove-ruby-on-rails">Peepcode Play by Play with Aaron Peterson</a>).
I am interested in trying it out to navigate around Rails codebase (which
shown on this screencast).</p>

<p><a href="http://betterthangrep.com">Ack</a> - a grep replacement, is explained next as well
as how to integrate it to Vim.</p>

<p>And then finally as a bonus, Ben shares some his very handy Vim tips.</p>

<h2>Conclusion</h2>

<p>When writing this review today, I just realized how information dense this
screencast is. If you are newish to using Vim as your main editor, I would
advise to focus on Rails.vim part of the screencast. The other bits can
be investigated later.</p>

<p>It&#8217;s kind of obvious &#8211; while watching the screencast
do open your Vim loaded with your Rails project, so you can try out things mentioned
on the screencast straight away - this will help with remembering.</p>

<p>All in all a worthwhile screencast to watch, especially if you are just
starting out on using Vim as your main editor for Rails. You will definitely
watch it more than once given the amount of information in it.</p>

<p>The screencast can be found here:
<a href="https://workshops.thoughtbot.com/products/2-vim">Vim for Rails Developer</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Lessons Learned On Upgrading Rails]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/03/15/lessons-learned-when-upgrading-rails/"/>
    <updated>2012-03-15T22:52:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/03/15/lessons-learned-when-upgrading-rails</id>
    <content type="html"><![CDATA[<p><em>Originally titled: Encoding Issues When Upgrading to Rails 3.2 -
after doing some more detective work - the problems might actually
be something else..</em></p>

<!-- more -->


<p>
Before I start, I have to mention that 80% of what I discovered
during this process comes from the patient mentoring of my colleague
<a href="https://twitter.com/#!/chuckdbacon">@chuckdbacon</a>.</p>

<p>And so we attempted to upgrade our Rails 3.1.3 app to 3.2.2 few days ago.
At first everything seems to be smooth sailing with tests passing and all that.</p>

<p>Unfortunatelly that&#8217;s not how the story ends, the day after deploying the upgrade,
we got a flurry of exception notifications from the app.</p>

<h2>LDAP dying</h2>

<p>The issue comes from the our LDAP importing code.</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>Contact.import_from_ldap
</span><span class='line'>Encoding::UndefinedConversionError: "\x82" from ASCII-8BIT to UTF-8</span></code></pre></td></tr></table></div></figure>


<p>At first, I was blaming Rails upgrade for this - but the error is probably
caused from the <a href="https://rubygems.org/gems/net-ldap">net-ldap</a> gem that got upgraded when I did bundle update.
So the proper &#8220;fix&#8221; is to locked the gem version on Gemfile.</p>

<h2>Encoding issue that&#8217;s not really the issue</h2>

<p>UPDATE: Ok, so everything from below of this paragraph is actually WRONG.</p>

<p>We suspected firstly that the Rails 3.2 upgrade introduced an encoding
issue in our app.
However we finally realized that the error that we&#8217;re experiencing (see below)
- happened after we <strong>rolled back</strong> the deployment (due to the first issue above).</p>

<p>So it&#8217;s the case of a bad deployment rollback rather than Rails issue.</p>

<p>Our theory so far is, the cache was corrupted somehow during the rollback. Restarting memcached
fixed the issue.</p>

<p>Again, it&#8217;s unfortunate that I&#8217;ve spent hours working out &#8220;this encoding issue&#8221; as
explained below. Feel free to see my detective work going after a false path below.</p>

<p><strong> WRONG START </strong>  <br/>
And then one of the controllers was returning this error:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>A Encoding::CompatibilityError occurred in bos#index:
</span><span class='line'>
</span><span class='line'> incompatible character encodings: UTF-8 and ASCII-8BIT
</span><span class='line'> builder (3.0.0) lib/builder/xmlmarkup.rb:276:in `_text'</span></code></pre></td></tr></table></div></figure>


<p>Obviously, the next step is to work out what has changed in Rails 3.2
with regards to encoding. Weird thing is, I can&#8217;t find anywhere in Rails
release notes regarding encoding changes.
And it doesn&#8217;t look like that this is a common issue that people have._</p>

<p>Other difficulty that I have is reproducing the problem locally for some
reasons that&#8217;s hard to explain.</p>

<p>One of possible causes is the encoding of variables that set in the
application.rb - this is quite interesting. Let the output explains
itself:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>[1] pry(main)&gt; Beqik2::Application.config.ihl_path.encoding
</span><span class='line'>=&gt; #&lt;Encoding:US-ASCII&gt;
</span><span class='line'>[2] pry(main)&gt; "just a string".encoding
</span><span class='line'>=&gt; #&lt;Encoding:UTF-8&gt;
</span><span class='line'>[3] pry(main)&gt; </span></code></pre></td></tr></table></div></figure>


<p>
As you can see above - the application config variable has US-ASCII encoding
(which I don&#8217;t understand why) - while the normal string is UTF-8 encoded as
expected as this is the default in Rails.</p>

<p>The closest thing that I can find is the blog post here:
<a href="http://rorguide.blogspot.com.au/2011/06/incompatible-character-encodings-ascii.html">Incompatible character encoding</a>
I&#8217;ll try the suggested solution and will update this post with the outcome.</p>

<p>This is one of those problems when I just have absolutely no idea what&#8217;s going
on.
<strong> WRONG END </strong></p>

<h2>So Rails is not at fault at all??</h2>

<p>We just found out that the serialization works differently in
Rails 3.2. And this has meant another deployment rollback for us.
This is not the first time serialization issue bit us - we encountered
similar issue when upgrading Rails 2.3 to Rails 3.0.</p>

<p>But that&#8217;s probably for another post.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Shell Scripting]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/03/02/shell-scripting/"/>
    <updated>2012-03-02T08:16:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/03/02/shell-scripting</id>
    <content type="html"><![CDATA[<p>I&#8217;m inspired. I have watched a couple of <a href="http://twitter.com/#!/garybernhardt/">Gary Bernhardt</a> screencasts
on <a href="http://destroyallsoftware.com">Destroy All Software</a> - particularly on Unix scripting and I guess I am
a inspired and quite happy that I already can put into practice what I learned.</p>

<!-- more -->


<h2>Case 1</h2>

<p>Had to investigate a production issue couple of days ago. I tailed the log file and saw a lot of noise
from New Relic agent - which I am not really interested in. So I need to remove these New Relic agent
lines so that I concentrate on finding the real errors.</p>

<p>Sed to the rescue:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>sed 's/New\ Relic\ Agent\ not\ running\.//g' importing.log| sed '/^$/d' &gt; importing_cleaned.log</span></code></pre></td></tr></table></div></figure>


<p>The first sed command, replaces the string &#8220;New Relic Agent not running&#8221; with empty string. This unfortunatelly leaves
the newlines behind. The second sed command takes care of that, /d at the end is for delete, the pattern
that we want to delete is ^$. What&#8217;s ^$? Regex speak, ^ is the beginning of the line and $ is the end of the line.
So ^$ with nothing between them represent an empty line.</p>

<p>There&#8217;s a better way to achieve what I did above for sure, I am just happy that I can get to learn
a little bit about sed.</p>

<h2>Case 2</h2>

<p>Naughty me, making changes to the code without creating test for it nor running the full test suite.
When I remember to do that, surprise surprise I broke some tests. I didn&#8217;t know for sure which
commit that introduces this bug, so I want to run the broken spec on the last few commits.</p>

<p>The following script did just that - this one is truly inspired by Gary&#8217;s screencast (note: broken down
to few lines for readability):</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>git log -5 --pretty=format:'%h' |    
</span><span class='line'>while read revision; 
</span><span class='line'>    do echo "Checking out $revision"; 
</span><span class='line'>    git co $revision -b temp_branch; 
</span><span class='line'>    be rspec spec/requests/customer_request_spec.rb; 
</span><span class='line'>    git co master; 
</span><span class='line'>    git br -D temp_branch; 
</span><span class='line'>done</span></code></pre></td></tr></table></div></figure>


<p>Again could have been done better.</p>

<p>What the command above does is: <br/>
Firstly find the hashes of the last 5 revisions, pipe the result to the while loop.
Inside the loop, check out the revision into a new branch, run the spec on that branch
(be is my alias for bundle exec), check out master and delete the branch - repeat.</p>

<h2>Summary</h2>

<p>Unix has powertools, learn them.  <br/>
Might be useful:  <br/>
<a href="http://confreaks.com/videos/615-cascadiaruby2011-the-unix-chainsaw">The Unix Chainsaw - Cascadia Ruby 2011</a>  <br/>
<a href="http://destroyallsoftware.com">Destroy All Software</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Flash Builder Dark Background]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/02/17/flash-builder-dark-background/"/>
    <updated>2012-02-17T22:09:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/02/17/flash-builder-dark-background</id>
    <content type="html"><![CDATA[<p>Ok, let me start by saying this - I hate working with <a href="http://www.adobe.com/products/flash-builder.html">Flash Builder</a>.
Being an <a href="http://eclipse.org">Eclipse</a> based software - of course it is bound to be slow and resource hungry.
I can only get it to work just below my frustration threshold after I installed it on an SSD.</p>

<!-- more -->


<p>Now that being said - this week, I managed to get a little bit happier by installing a dark background/theme.</p>

<p>First of all - I came across this plugin (and site) that has a repository of themes for Eclipse, the site is
<a href="http://www.eclipsecolorthemes.org/">Eclipse Color Themes</a>.
Follow the instruction on how to install the plugin
to your Eclipse/Flash Builder: <a href="http://www.eclipsecolorthemes.org/?view=plugin">plugin install</a></p>

<p>That bit is straight forward - now if you try to apply any of the dark themes, you&#8217;d notice that something isn&#8217;t quite
right:</p>

<p><img src="http://passionatedevelopment.com/files/2012/02/17/before.png" alt="" /></p>

<p>Now, I&#8217;m not sure, why the syntax highlighting isn&#8217;t updated straight away. But fortunatelly this is an
easy fix. Open Preferences and search for the word syntax, on the left pane - select Flash Builder > Editors > Syntax Coloring.
Go to MXML on the right pane, and go through the elements and hit Apply button - this somehow activates the
syntax coloring of the theme.</p>

<p><img src="http://passionatedevelopment.com/files/2012/02/17/syntax.png" alt="" /></p>

<p>Final result - a less sucky Flash Builder!
<img src="http://passionatedevelopment.com/files/2012/02/17/after.png" alt="" /></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Learning Notes #1]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/02/08/learning-notes-number-1/"/>
    <updated>2012-02-08T08:10:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/02/08/learning-notes-number-1</id>
    <content type="html"><![CDATA[<p>Last week at work, we had to rewrite the reporting module for our application,
as there were some issues with the old report and the complexity of the code
makes it hard to work out the cause of the issues.</p>

<!-- more -->


<p>Firstly, we pair programmed until we worked out the general direction for the
implementation and then I took over the implementation while my colleague
working on investigating the data source.</p>

<p>This report work forced me to learn more about ActiveRecord scope.
What&#8217;s an ActiveRecord scope? According to Rails guide:</p>

<blockquote><p>Scoping allows you to specify commonly-used ARel queries which can be
referenced as method calls on the association objects or models.
With these scopes, you can use every method previously covered such as
where, joins and includes.
All scope methods will return an
ActiveRecord::Relation object which will allow for
further methods (such as other scopes) to be called on it.</p></blockquote>

<p>These two Rails guides on ActiveRecord helped me quite a bit:</p>

<ul>
<li><a href="http://guides.rubyonrails.org/active_record_querying.html">Active Record Querying</a></li>
<li><a href="http://guides.rubyonrails.org/association_basics.html">Active Record Association</a></li>
</ul>


<p>Given that our report query is a little bit more complex than usual - it was
quite difficult to get the scoping right. But after a lot of trial and error and
re-reading the guides so many times - I managed to get the code that I am happy with.</p>

<p>I also found out about HashWithIndifferentAccess - by accident..
Having worked with Rails for awhile, I was under the impression that a string key
for a hash is interchangable with a symbol key.</p>

<p>This is where I got Ruby and Rails mixed up. Lucky before I spent too much time
ripping out my hairs - my colleague told me that I was thinking about Rails&#8217;
special hash not Ruby&#8217;s normal hash. This magical hash is called
<a href="http://as.rubyonrails.org/classes/HashWithIndifferentAccess.html">HashWithIndifferentAccess</a>.
Thank Rails. Anyway code speaks a thousand word:</p>

<figure class='code'><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class=''><span class='line'>&gt;hash = { "hello" =&gt; "world" }
</span><span class='line'>&gt;p hash["hello"]
</span><span class='line'>=&gt; "world"
</span><span class='line'>&gt;p hash[:hello]
</span><span class='line'>=&gt;nil
</span><span class='line'>&gt;hash = HashWithIndifferentAccess.new
</span><span class='line'>&gt;hash["hello"] = "world"
</span><span class='line'>&gt;p hash[:hello]
</span><span class='line'>=&gt; "world"</span></code></pre></td></tr></table></div></figure>


<p></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Realization]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/01/31/realization/"/>
    <updated>2012-01-31T23:35:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/01/31/realization</id>
    <content type="html"><![CDATA[<p>I came to the realization that I am a long way away from where I am now to where I want
to be with regards to mastering Ruby.</p>

<!-- more -->


<p>There are just so much to learn and the wealth of information out there can be overwhelming sometimes.
It&#8217;s not just the language that I need to learn but also the pratices (BDD, TDD), the frameworks
(Rails - y u so black magic?), patterns (Ruby is NOT Java).</p>

<p>But that&#8217;s OK - this journey will take me longer than I expected and I can live with that.
What I really need is focus and ignore all distractions.</p>

<p>What are the distractions? Latest trends - looking at you JS stuffs - Node, CoffeeScript
and friends. Information overload - I have taken steps to fix this:</p>

<ul>
<li>Unsubscribed from ColdFusion bloggers feed and mailing lists - not relevant for me at this point of time</li>
<li>Trim the noise from Twitter by unfollowing people - wasted a lot of time reading tweets that I don&#8217;t care from people that I don&#8217;t know. I intend to cap
my follow number to 100.</li>
<li>Filtering Ruby information to my level - for example: some of Ruby Rogues episodes (metaprogramming) is just beyond my comprehension at this time.</li>
</ul>


<p>Focus on what specifically? Well, Ruby of course!
Goalwise, this year:</p>

<ul>
<li>Getting better at TDD especially getting better at writing specs</li>
<li>Understanding Ruby and OOP in Ruby better</li>
<li>Understanding Rails better especially ActiveRecord (maybe enroll in owning rails course)</li>
</ul>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[From WordPress to Octopress]]></title>
    <link href="http://passionatedevelopment.com/blog/2012/01/22/from-wordpress-to-octopress/"/>
    <updated>2012-01-22T22:05:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2012/01/22/from-wordpress-to-octopress</id>
    <content type="html"><![CDATA[<p>Just switched from <a href="http://wordpress.com">WordPress</a> to a static blogging platform called
<a href="http://octopress.org">Octopress</a>. Kind of taking
the opposite direction from <a href="http://passionatedevelopment.com/blog/2011/02/08/giving-some-long-overdue-love-for-wordpress/">last year</a>
when I was loving WordPress more.</p>

<!-- more -->


<p>As I have been trying to blog during my commute, I found that WordPress blogging with
little internet access is just painful. Main culprit is the bloated wp-admin and oh
that dreadful TinyMCE editor.</p>

<p>Why can&#8217;t I just use an offline editor? Well, I can - in fact back on my Windows days,
<a href="http://explore.live.com/windows-live-essentials-other-programs?T1=t5">Live Writer</a> is the primary tool for my blogging. But I am not on Windows anymore, and I
couldn&#8217;t see anything on Mac that comes close to Live Writer.</p>

<p>WordPress has just become too complicated and too distracting to me (with thousands
of plugins and themes to choose from). Also I got lots of spammers trying to find some holes
on my WordPress installation - evidence: 80% of traffic goes to wp-comments.php.</p>

<p>I then decided to give Octopress a go. Some things that I like about Octopress or static blogging
platform in general:</p>

<ul>
<li>Better offline experience. You&#8217;d always have a local version of your blog to play around.</li>
<li>Simpler platform, no database, simple rsync for deployment.</li>
<li>Complete control - no need to rely on crappy WYSIWYG editor.</li>
<li>Octopress is based on Jekyll - both are Ruby projects. A language that I love and use daily - I don&#8217;t have to mess with PHP anymore.</li>
<li>Writing blog posts on vim - awesome!</li>
</ul>


<p>I think I will also not bother with comments at this point.</p>

<p>At the end of the day - I just want something simple, Octopress seems to fit the bill.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Employees are temporary]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/12/18/employees-are-temporary/"/>
    <updated>2011-12-18T00:00:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/12/18/employees-are-temporary</id>
    <content type="html"><![CDATA[<p>Stumbled upon Tamer Saleh&#8217;s (VP Engineering of Engine Yard) post: <a href="http://tammersaleh.com/posts/jobs-are-temporary-teams-are-for-life">Jobs are temporary, teams are for life</a> - which I found worth reading. If I were in a management/leadership position, that&#8217;s how I would see my developers - by helping them reaching their long term goals.</p>

<!-- more -->


<p>But company is all about bottom line right? Focusing on the individuals want seem inappropriate. Not necessarily. Paraphrasing my previous manager&#8217;s statement on our first one on one session: we (you and the company) will get the best of each other where there is big intersection between what the company wants to achieve and what you personally want to achieve careerwise.</p>

<p>A quote from Tamer&#8217;s post:</p>

<blockquote>People move on, and the team as a whole constantly grows and evolves with those changes. This is healthy, as long as it’s strongly embraced.</blockquote>


<p>Embraced is the keyword, do expect people to move on, help them to go where they want to. Have strategies in place to deal with changes. Avoid over reliance on your current developers.</p>

<p>Do it right - know what your developers aspire to, work out how you can help them in a way that is also bring benefit the company, look after them and keep them motivated and challenged, so that they will stay long and happy. But also always have a succession plan - employees are temporary.</p>

<p>A manager with this insight is worth hiring and working for.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Coding Cubicle Again]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/12/18/coding-cubicle-again/"/>
    <updated>2011-12-18T00:00:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/12/18/coding-cubicle-again</id>
    <content type="html"><![CDATA[<p>Although strictly speaking, I am not in working in a cubicle, 
but rather sharing a small room with the senior developer here.</p>


<p>Now some pictures.</p>


<!-- more -->


<p>Below shows my lovely MacBook Pro (very nice machine and oh working on Mac is sooo much better compared to Windows). 
The company looks after me very well, they provided me with brand new 24&#8221; LG monitor. 
I use MacVIm for my Ruby on Rails coding (a joy) and Flash Builder for Flex coding 
(don&#8217;t like Eclipse - so sluggish). Lately, I&#8217;m using my MacBook Pro in clamshell mode (i.e.; just using the secondary display and keep the MacBook closed) - I found the large screen area is enough.</p>


<p><img src="http://passionatedevelopment.com/blog/files/2011/12/IMG_2332.jpg" border="0" alt="IMG 2332" width="600" height="448" /></p>


<p>My colleague collection of books - bah, I didn&#8217;t notice that my iPhone camera was out of focus, so sorry for this blurry picture. There are a LOT of Ruby and Rails books here. And he&#8217;s got more digital books.</p>


<p><img src="http://passionatedevelopment.com/blog/files/2011/12/IMG_2336.jpg" border="0" alt="IMG 2336" width="600" height="448" /></p>


<p>Ah more books, the first two belongs to my colleagues, the rest belongs the rest belongs to me. Oh, I love Eclipse mints!! My previous colleague got me to it and before long almost every developers in the office were chewing mints on daily basis.</p>


<p><img src="http://passionatedevelopment.com/blog/files/2011/12/IMG_2333.jpg" border="0" alt="IMG 2333" width="600" height="448" /></p>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[On Telecommuting (and Shorter Working Hours)]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/11/06/on-telecommuting-and-shorter-working-hours/"/>
    <updated>2011-11-06T00:00:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/11/06/on-telecommuting-and-shorter-working-hours</id>
    <content type="html"><![CDATA[<p>And so I have been working at the new work place for about a month now - which located quite far away from where I live.</p>

<!-- more -->


<p>Commuting to work involves bus trip to the Central Station, followed by train from Central to Blacktown and another bus trip from Blacktown station to the office. All up it&#8217;s about 1h 40m one way. Previously work was located conveniently 8km away from where I live, which normally takes 30-40 mins commuting by bus. So naturally, at first it was a major concern for me and my wife - we weren&#8217;t sure how this would affect our family life.</p>

<p>However after been doing it for 4 weeks now - it&#8217;s actually not too bad, in fact it works quite well.</p>

<p>First of all, the whole longer time commute works because of:</p>

<ul>
    <li>Shorter work hour (9-5) as opposed to 9-6 previously</li>
    <li>Flexible working hours arrangement.</li>
</ul>


<p>Because of the earlier finishing time - I ended coming home about the same time as before. I do have to leave home 45 minutes earlier than before though - so morning is more hectic than before. But there&#8217;s a solution to that.
This is where point no 2 kicks in - the folks there are quite relaxed about starting time and even with how many hours per week. I don&#8217;t have to work 37.5 hours week if I don&#8217;t want to. Since I am a contractor I got paid based on the hours that I worked.</p>

<p>I also found that 9 to 5 working hour (with 30 mins lunch + 2 x 10mins coffee breaks) feels right with the way my body and mind work. I am usually quite intense when coding and my limit is usually around 5 hours after that my concentration deteriorates and I won&#8217;t be as productive.
That&#8217;s why working long hour (especially overtime) will not work with me - I will take note to myself to never take a role that requires long working hour (if possible).</p>

<p>Another plus point - telecommuting time gives me opportunity to be efficient with my time. Now I have about an hour a day in train that I can use for something productive. Naturally, I use the time for my personal development time mostly - now the good thing about it is, when I got home I am really done - I have done both my professional work and my own personal learning - so I can just wind down without feeling any guilt.</p>

<p>Now the learning bit is very important as I am working with 2 technologies that I have limited experience in (Flex and Ruby).
My learning so far take in the following forms:</p>

<ul>
    <li>Watching <a href="http://www.adobe.com/devnet/flex/videotraining.html">Flex in a week</a> video training</li>
    <li>Watching various screencasts in particular <a href="http://vimcasts.org/">Vimcasts</a> and <a href="http://railscasts.com">Railscasts</a></li>
    <li>Coding Ruby - doing <a href="http://rubykoans.com/">Ruby koans</a>, just hacking around, playing around with IRB/PRY</li>
    <li>Reading Ruby and Rails books - still reading Well Grounded Rubyist.</li>
    <li>Doing some work, very rarely that I feel the need to do extra work outside the 9-5 block (which I do for free and I don&#8217;t mind doing since it&#8217;s helping me with my personal learning anyway)</li>
</ul>


<p>Beside learning - I&#8217;m also using the time to work on the backlog of my (non-technical) books to read - the latest being <a href="http://timothykeller.com/books/counterfeit_gods/">this one</a>.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Moving On]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/10/23/moving-on/"/>
    <updated>2011-10-23T00:00:00+11:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/10/23/moving-on</id>
    <content type="html"><![CDATA[<p>Roughly 2 weeks ago I finished up my time with the young (as in the average age of the employees) and funky digital agency - <a href="http://www.gruden.com">Gruden</a>. I can&#8217;t believe it had been 1 year and 10 months.</p>

<!-- more -->


<p>The move is kind of significant point in my working life - as I have finally transitioned from being primarily a ColdFusion developer to something else (but that&#8217;s for another post).</p>

<p>It was a blessing to be working with folks at Gruden, made quite a few good friends over there whom I am really keen to stay in touch.</p>

<p>Interestingly, I was kind of stumbled upon the role at Gruden. At the end of 2009 - I was burnt out quite badly from my previous employment that led me to taking a few months career break. I was trying to cross skill myself in Java and Ruby on Rails at that time and wasn&#8217;t really looking for a pure ColdFusion role.</p>

<p>However, my ex-colleague was interviewing for a .NET role with Gruden and he mentioned me to Gruden. Long story short, I was offered a 3 month contract position. And yes it is a ColdFusion contract role - but I thought it&#8217;s only for 3 months and I have heard good things about Gruden before.</p>

<p>After 3 months - we liked each other and the contract became a permanent gig.</p>

<p>I can confidently say that they are one of the the best guys to work with if you are a ColdFusion developer. The ColdFusion applications that I worked at at Gruden are well architected - with best practices in mind. OOP all the way through - with Mach-II, Reactor and ColdSpring as the foundation. It was very refreshing to me as developer - that I didn&#8217;t have to convince and fight people about the benefits of OOP (as what I had done at my previous jobs).</p>

<p>It was interesting to me as well as I had the opportunity to be the lead developer in some projects, doing lots of analysis, costing (which I don&#8217;t particularly like), training and mentoring - AND handling support issues. It was full on - but I learned heaps in the process.</p>

<p>I will miss the bi-weekly development meetings (when we take turn to present on interesting topics), the soccer competition, the coffee, the scenic Circular Quay, the ping pong and the pool games - and the people of course!</p>

<p>So bye for now (professionally). If you are looking for ColdFusion gig - I do recommend get in touch with Gruden, they are a bunch of creative, honest, friendly and hardworking people.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[5 Minutes of Fame]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/09/15/5-minutes-of-fame/"/>
    <updated>2011-09-15T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/09/15/5-minutes-of-fame</id>
    <content type="html"><![CDATA[<p>And I have done it - on my 5th <a href="http://rubyonrails.com.au">RORO</a> meeting this year - I gave a lighting talk!</p>

<!-- more -->


<p>I did a 5 minute book review on <a href="http://www.manning.com/black2/">Well Grounded Rubyist</a> - yes the book that I have always talked about in this blog.</p>

<p>Back to the lighting talk - I must have at least put in 10 hours of preparation on it, yeah so much effort just for such a short talk. But I am glad that I did it - I&#8217;ve learned a lot both on the preparation and on the delivery. This is my first user group presentation ever - although I have done a couple team pressos for companies that I worked for.</p>

<p>My aims for the talk were:</p>

<ul>
    <li>Sharing what I like about the book aimed especially for the new people (to my disappointment - not that many new people that night).</li>
    <li>Making people who are new to Ruby welcomed. At least they&#8217;d know that not all of them who come to the meetup is expert.</li>
</ul>


<p>Some of the things that I&#8217;ve learned:</p>

<ul>
    <li>I need to speak clearer (even with my thick Indonesian accent)</li>
    <li>I need to speak slower and maybe less material for a lighting talk.</li>
    <li>My slides looked terrible compared to other presenters.</li>
</ul>


<p>In the subject of new people - I think I kind of work out how I want to be involved in Ruby community. And that is to help new people be involved in the community and help them learn at the same time.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Utopia]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/08/27/the-utopia/"/>
    <updated>2011-08-27T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/08/27/the-utopia</id>
    <content type="html"><![CDATA[<p>I have been doing some thinking on the &#8220;perfect&#8221; place to work - perfect (or closest to) according to me anyway.</p>

<!-- more -->


<p>This the place would look like if I am in charge of the company (or at least for the development department) and I am given unlimited freedom and unlimited resources to realize it.</p>

<p>The place would look like this: <a href="https://gist.github.com/f63f2d60f2bf270dfbb5">https://gist.github.com/f63f2d60f2bf270dfbb5</a></p>

<p>I intend to refine this as continue on my career and I will expand some of the points through this blog.</p>

<p>That&#8217;s how the dream work will look like - how about yours? What&#8217;s your dream work look like? I dare you to dream :)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Putting TDD into Practice]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/08/27/putting-tdd-into-practice/"/>
    <updated>2011-08-27T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/08/27/putting-tdd-into-practice</id>
    <content type="html"><![CDATA[<p>A couple of weeks ago, I was given a couple of programming tasks to complete.</p>

<p>When I looked at the tasks&#8217; description - I realised Test Driven Development (TDD would be a good fit to approach them. Another plus for me is, I have never used TDD before - although I have been reading and hearing it quite a lot, so it is a good opportunity to give it a try.</p>

<!-- more -->


<p>One of the tasks is to write a cheque writer program - a program that converts a dollar value in number to its text representation (if it were written for a cheque), for example: given an input 2.50, the output should be a string &#8220;two DOLLARS and fifty CENTS&#8221;.</p>

<p>I chose to implement the solution in Java since I&#8217;m quite comfortable with it. And I am using <a href="http://www.junit.org">JUnit</a> to assist with TDD.</p>

<p>By employing TDD - I was writing my unit tests <strong>BEFORE</strong> I wrote the implementation.</p>

<p>Below is a snippet of my JUnit test (the first time I wrote JUnit test for a long time - so definitely can be done better):</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
<span class='line-number'>38</span>
<span class='line-number'>39</span>
<span class='line-number'>40</span>
<span class='line-number'>41</span>
<span class='line-number'>42</span>
<span class='line-number'>43</span>
<span class='line-number'>44</span>
<span class='line-number'>45</span>
<span class='line-number'>46</span>
<span class='line-number'>47</span>
<span class='line-number'>48</span>
<span class='line-number'>49</span>
<span class='line-number'>50</span>
<span class='line-number'>51</span>
<span class='line-number'>52</span>
<span class='line-number'>53</span>
<span class='line-number'>54</span>
<span class='line-number'>55</span>
<span class='line-number'>56</span>
<span class='line-number'>57</span>
<span class='line-number'>58</span>
<span class='line-number'>59</span>
<span class='line-number'>60</span>
<span class='line-number'>61</span>
<span class='line-number'>62</span>
<span class='line-number'>63</span>
<span class='line-number'>64</span>
<span class='line-number'>65</span>
<span class='line-number'>66</span>
<span class='line-number'>67</span>
<span class='line-number'>68</span>
<span class='line-number'>69</span>
<span class='line-number'>70</span>
<span class='line-number'>71</span>
<span class='line-number'>72</span>
<span class='line-number'>73</span>
<span class='line-number'>74</span>
<span class='line-number'>75</span>
<span class='line-number'>76</span>
<span class='line-number'>77</span>
<span class='line-number'>78</span>
<span class='line-number'>79</span>
<span class='line-number'>80</span>
<span class='line-number'>81</span>
<span class='line-number'>82</span>
<span class='line-number'>83</span>
<span class='line-number'>84</span>
<span class='line-number'>85</span>
<span class='line-number'>86</span>
<span class='line-number'>87</span>
<span class='line-number'>88</span>
<span class='line-number'>89</span>
<span class='line-number'>90</span>
<span class='line-number'>91</span>
<span class='line-number'>92</span>
<span class='line-number'>93</span>
<span class='line-number'>94</span>
<span class='line-number'>95</span>
<span class='line-number'>96</span>
<span class='line-number'>97</span>
<span class='line-number'>98</span>
<span class='line-number'>99</span>
<span class='line-number'>100</span>
<span class='line-number'>101</span>
<span class='line-number'>102</span>
<span class='line-number'>103</span>
<span class='line-number'>104</span>
<span class='line-number'>105</span>
<span class='line-number'>106</span>
<span class='line-number'>107</span>
<span class='line-number'>108</span>
<span class='line-number'>109</span>
<span class='line-number'>110</span>
<span class='line-number'>111</span>
<span class='line-number'>112</span>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kn">package</span> <span class="n">org</span><span class="o">.</span><span class="na">tjandrawibawa</span><span class="o">.</span><span class="na">testcase</span><span class="o">;</span>
</span><span class='line'>
</span><span class='line'><span class="kn">import</span> <span class="nn">org.junit.Test</span> <span class="o">;</span>
</span><span class='line'><span class="kn">import</span> <span class="nn">static</span> <span class="n">org</span><span class="o">.</span><span class="na">junit</span><span class="o">.</span><span class="na">Assert</span><span class="o">.*</span> <span class="o">;</span>
</span><span class='line'><span class="kn">import</span> <span class="nn">org.tjandrawibawa.task.*</span><span class="o">;</span>
</span><span class='line'>
</span><span class='line'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">TestChequeWriter</span> <span class="o">{</span>
</span><span class='line'>  <span class="n">ChequeWriter</span> <span class="n">writer</span> <span class="o">=</span> <span class="k">new</span> <span class="n">ChequeWriter</span><span class="o">();</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testSimple</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 1&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one DOLLARS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testSimpleDecimal</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 41.01&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;41.01&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;forty one DOLLARS AND one CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testHundreds</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 151.59&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;151.59&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one hundred and fifty one DOLLARS AND fifty nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  
</span><span class='line'>  <span class="cm">/* BEGIN: Boundary Tests */</span>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary1</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 99.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;99.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;ninety nine DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary2</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 100.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;100.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one hundred DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary3</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 999.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;999.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;nine hundred and ninety nine DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary4</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 1000.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1000.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one thousand DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary6</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 999999.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;999999.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;nine hundred and ninety nine thousand, nine hundred and ninety nine DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary7</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 1000000.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1000000.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one million DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary8</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 9999999.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;999999999.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;nine hundred and ninety nine million, nine hundred and ninety nine thousand, nine hundred and ninety nine DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testBoundary9</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 10000000.99&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1000000000.99&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;one billion DOLLARS AND ninety nine CENTS&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'>  <span class="cm">/* END: Boundary Tests */</span>
</span><span class='line'>  
</span><span class='line'>  <span class="cm">/* BEGIN: Test failures */</span>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testAmountNegative</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: -1&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;-1&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;-1 is invalid - valid amount is between 0 to 2 billions dollars (inclusive)&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testAmountGreaterThanTwoBillion</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 2000000001&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;2000000001&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;2000000001 is invalid - valid amount is between 0 to 2 billions dollars (inclusive)&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testDecimalPrecision</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 1.222&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1.222&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;1.222 is invalid - only up to 2 decimal places is accepted&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testNonNumberInput1</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: 1.22.2&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;1.22.2&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;1.22.2 is not a valid number format&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>  <span class="nd">@Test</span>
</span><span class='line'>  <span class="kd">public</span> <span class="kt">void</span> <span class="nf">testNonNumberInput2</span><span class="o">()</span> <span class="o">{</span>
</span><span class='line'>      <span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Test input: xx&quot;</span><span class="o">);</span>
</span><span class='line'>      <span class="n">assertTrue</span><span class="o">(</span> <span class="n">writer</span><span class="o">.</span><span class="na">write</span><span class="o">(</span><span class="s">&quot;xx&quot;</span><span class="o">).</span><span class="na">equals</span><span class="o">(</span><span class="s">&quot;xx is not a valid number format&quot;</span><span class="o">));</span>
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  <span class="cm">/* END: Test failures */</span>
</span><span class='line'>
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<p>The steps that I went through to solve the task:</p>

<ul>
    <li>Scribble the solution in paper. I found this practice generally helps my thinking a lot.</li>
    <li>I then write the skeleton for the solution - which is mainly a class with methods that don&#8217;t do anything as yet.</li>
    <li>I then write unit tests for the main method in JUnit.</li>
    <li>I then write the implementation, run the test and repeat until I got all green (all tests passed)</li>
</ul>


<p>I found that this approach worked very well for this particular task. Especially the boundary tests exposed the wrong approach that I took when developing the solution.</p>

<p><strong>Refactoring</strong> has also become very easy as well.</p>

<p>While I am not convinced writing tests first and code the implementation to the test is applicable and beneficial all the time. One thing that I am sold of is: having test coverage is awesome. Particularly with refactoring - there is no way that you can confidently refactor without having a good enough test coverage.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The First Pull Request]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/08/05/the-first-pull-request/"/>
    <updated>2011-08-05T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/08/05/the-first-pull-request</id>
    <content type="html"><![CDATA[<p>As you may recall (speaking as if I have regular visitors) - about <a href="http://passionatedevelopment.com/blog/2011/06/30/ror-journey-continues/">a month ago</a> I decided to adding features to <a href="https://github.com/dailymile/dailymile-ruby">dailymile-ruby</a> library. As expected - working on it, has helped me in my Ruby learning journey.</p>

<!-- more -->


<p>So today - I made a pull request and hopefully it will be accepted. But accepted or not - that&#8217;s not really the point - I am just happy at the moment that I have made my first contribution to an open source project.</p>

<div><a href="http://passionatedevelopment.com/blog/files/2011/08/Screen-shot-2011-08-04-at-10.59.35-PM.png"><img class="alignleft size-full wp-image-625" src="http://passionatedevelopment.com/blog/files/2011/08/Screen-shot-2011-08-04-at-10.59.35-PM.png" alt="Felix's First Pull Request" width="690" height="298" /></a>
</div>


<div style="clear:both"></div>


<div style="clear:both"></div>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Why Ruby (on Rails)?]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/08/03/why-ruby-on-rails/"/>
    <updated>2011-08-03T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/08/03/why-ruby-on-rails</id>
    <content type="html"><![CDATA[<p>I have been asked that question and have asked the question myself a couple of times. There are so many different technologies that I can choose to complement my current skill set, why Ruby?</p>

<p>Well, I came across an interview from <a href="http://www.engineyard.com/blog/">EngineYard blog</a> recently - <a href="http://www.engineyard.com/blog/2011/chicks-that-rip-ines-sombra/">Chicks That Rip: Ines Sombra</a>.</p>

<p>Ines&#8217; answer is almost exactly word for word of my own answer to the question:</p>

<blockquote>What attracted me most to the Ruby on Rails community is how bold it is. This community is not afraid to experiment and innovate. What I find especially interesting is the prevalence of polyglot systems and cutting-edge data store solutions. Databases are put to the test in Ruby on Rails, and these applications are defining the future of how systems will be constructed. It’s amazing.

&#8230;</blockquote>


<p>The community, the rate of innovation and polyglot systems - this gets the geek in me excited.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Got MacBook Pro]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/08/03/got-macbook-pro/"/>
    <updated>2011-08-03T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/08/03/got-macbook-pro</id>
    <content type="html"><![CDATA[<p><img class="alignleft size-medium wp-image-614" style="margin: 10px" src="http://passionatedevelopment.com/blog/files/2011/08/my-comps-300x224.jpg" alt="My three mean machines" width="300" height="224" />And so after contemplating for half a year or more - I finally decided that it&#8217;s time to get a Mac.</p>

<p>I bought the Feb 2011 model - second hand from Ebay and it looks like to be a good purchase so far (well it&#8217;s only been few days). To sidetrack a bit - it was quite scary experience buying something expensive from Ebay - it took three weeks for the thing to arrive due to seller being slow in posting, AusPost messed up (or maybe it was the seller&#8217;s fault all along), the item had to be returned to sender, and then re-sent back to me - just a mess!! But thank God - it&#8217;s here.</p>

<p>And yes - people were asking why - even today someone at work compares Mac with Dell - which he thinks it&#8217;s the best value for money. Well, everyone is entitled to their opinions I guess.</p>

<p>To me the reasons for getting a Mac is as follow:</p>

<ul>
    <li>I just want to see and to experience what the hype is all about. I have been to user group meetings and conferences and Macs dominated the development scene - why???</li>
    <li>Still related to the above, Mac seems to be the de facto platform for Ruby coder (although apparently in Japan - Rubyists are more likely to be on Windows). One of the famous Ruby IDE - Textmate runs only Mac.</li>
    <li>And hopefully sometimes in the future (I am not holding my breath though) - I will get into native iPhone/iPad development as well.</li>
</ul>


<p>Now the OS war - some people are just M$ haters - I am not, I have been using Windows for ages and things have been improving, in fact Windows 7 is pretty good. But I have never been comfortable with Windows as a platform for development. I mean I use it at work because I need the other M$ softwares like Outlook, Word and Project - but I won&#8217;t do my personal coding on Windows.</p>

<p>For fun coding things - I have been using Ubuntu. This is especially true for my Ruby and Rails learning. And I am quite happy with it - for dev-ing Linux is certainly way more enjoyable than Windows.</p>

<p>I&#8217;m quite excited to see how my experience will be different with Mac OS. As of now, I am looking into settling to an IDE for my Ruby dev - Sublime Text looks to be most likely candidate at the moment - followed by MacVim. A couple of recommendations from friends: TextMate (of course), TextWrangler (BBEdit).</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Knowing Self]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/07/29/knowing-self/"/>
    <updated>2011-07-29T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/07/29/knowing-self</id>
    <content type="html"><![CDATA[<p>This is an attempt on consolidating my thoughts on Ruby&#8217;s self, taken from <a href="http://www.manning.com/black2/">Well Grounded Rubyist</a> chapter 5.</p>

<p>Another crucial point of Ruby to understand is the notion of self. Self is used to refer to the current object or the default object at a given time. At every point of your program there is one and only self.</p>

<p>Self inside Class and Module is straight forward. Self in method is also not too hard to understand, but you need to understand the context of the method.</p>

<p>Method can belong to class, self in method class will return the class object itself (remember that class IS object in Ruby).
Method can belong to an instance of a class, self in that context will surprise2 return the instance.
Method can be a singleton - in this case, calling self will also return the instance of a class.</p>

<p>Another point about self is: it is the default receiver of messages (see the code snippet below - it is explained there).</p>

<p>Below is code snippet that I hope illustrate the points above (stitched together from the examples in the book):</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
<span class='line-number'>10</span>
<span class='line-number'>11</span>
<span class='line-number'>12</span>
<span class='line-number'>13</span>
<span class='line-number'>14</span>
<span class='line-number'>15</span>
<span class='line-number'>16</span>
<span class='line-number'>17</span>
<span class='line-number'>18</span>
<span class='line-number'>19</span>
<span class='line-number'>20</span>
<span class='line-number'>21</span>
<span class='line-number'>22</span>
<span class='line-number'>23</span>
<span class='line-number'>24</span>
<span class='line-number'>25</span>
<span class='line-number'>26</span>
<span class='line-number'>27</span>
<span class='line-number'>28</span>
<span class='line-number'>29</span>
<span class='line-number'>30</span>
<span class='line-number'>31</span>
<span class='line-number'>32</span>
<span class='line-number'>33</span>
<span class='line-number'>34</span>
<span class='line-number'>35</span>
<span class='line-number'>36</span>
<span class='line-number'>37</span>
<span class='line-number'>38</span>
<span class='line-number'>39</span>
<span class='line-number'>40</span>
<span class='line-number'>41</span>
<span class='line-number'>42</span>
<span class='line-number'>43</span>
<span class='line-number'>44</span>
<span class='line-number'>45</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="k">class</span> <span class="nc">C</span>
</span><span class='line'>  <span class="k">module</span> <span class="nn">M</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="s2">&quot;Inside module C::M&quot;</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="nb">self</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>  <span class="c1"># class method</span>
</span><span class='line'>  <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">stuff</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="s2">&quot;Inside class method&quot;</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="nb">self</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>  <span class="c1"># instance method</span>
</span><span class='line'>  <span class="k">def</span> <span class="nf">stuff</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="s2">&quot;Inside instance method&quot;</span>   
</span><span class='line'>    <span class="nb">puts</span> <span class="nb">self</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># calling the class method (and module)</span>
</span><span class='line'><span class="n">C</span><span class="o">.</span><span class="n">stuff</span>
</span><span class='line'><span class="n">C</span><span class="o">::</span><span class="n">M</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># calling the class method</span>
</span><span class='line'><span class="n">c</span> <span class="o">=</span> <span class="n">C</span><span class="o">.</span><span class="n">new</span>
</span><span class='line'><span class="n">c</span><span class="o">.</span><span class="n">stuff</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># singleton method</span>
</span><span class='line'><span class="k">def</span> <span class="nc">c</span><span class="o">.</span><span class="nf">stuff_it</span>
</span><span class='line'>  <span class="nb">puts</span> <span class="s2">&quot;Inside singleton method&quot;</span>
</span><span class='line'>  <span class="nb">puts</span> <span class="nb">self</span> <span class="c1">#instance C</span>
</span><span class='line'><span class="k">end</span>
</span><span class='line'>
</span><span class='line'><span class="c1">#calling the singleton method</span>
</span><span class='line'><span class="n">c</span><span class="o">.</span><span class="n">stuff_it</span>
</span><span class='line'>
</span><span class='line'><span class="c1"># Self as the default receiver of messages</span>
</span><span class='line'><span class="k">class</span> <span class="nc">B</span>
</span><span class='line'>  <span class="k">def</span> <span class="nc">self</span><span class="o">.</span><span class="nf">no_dot</span>
</span><span class='line'>    <span class="nb">puts</span> <span class="s2">&quot;self no dot&quot;</span>
</span><span class='line'>  <span class="k">end</span>
</span><span class='line'>
</span><span class='line'>  <span class="c1">#no need to explicitly specify self.no_dot - self is the default receiver of no_dot message</span>
</span><span class='line'>  <span class="n">no_dot</span>
</span><span class='line'><span class="k">end</span>
</span></code></pre></td></tr></table></div></figure>


<p>And here is the output:</p>

<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
<span class='line-number'>2</span>
<span class='line-number'>3</span>
<span class='line-number'>4</span>
<span class='line-number'>5</span>
<span class='line-number'>6</span>
<span class='line-number'>7</span>
<span class='line-number'>8</span>
<span class='line-number'>9</span>
</pre></td><td class='code'><pre><code class='ruby'><span class='line'><span class="no">Inside</span> <span class="k">module</span> <span class="nn">C</span><span class="p">:</span>
</span><span class='line'><span class="n">C</span><span class="o">::</span><span class="n">M</span>
</span><span class='line'><span class="no">Inside</span> <span class="k">class</span> <span class="n">met</span>
</span><span class='line'><span class="n">C</span>
</span><span class='line'><span class="no">Inside</span> <span class="n">instance</span>
</span><span class='line'><span class="c1">#</span>
</span><span class='line'><span class="no">Inside</span> <span class="n">singleton</span>
</span><span class='line'><span class="c1">#</span>
</span><span class='line'><span class="nb">self</span> <span class="n">no</span> <span class="n">dot</span>
</span></code></pre></td></tr></table></div></figure>

]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[RORO Hack Night 26/07 - A Newbie Perspective]]></title>
    <link href="http://passionatedevelopment.com/blog/2011/07/27/roro-hack-night-a-newbie-perspective/"/>
    <updated>2011-07-27T00:00:00+10:00</updated>
    <id>http://passionatedevelopment.com/blog/2011/07/27/roro-hack-night-a-newbie-perspective</id>
    <content type="html"><![CDATA[<p>I had the pleasure of attending my first ever Sydney <a href="https://github.com/rails-oceania/roro/wiki/rorosyd-hack-night">RORO Hack Night</a> last night and it was a great experience for a newbie for me.
Place, pizzas and beers were provided by the kind folks at <a href="http://ninefold.com">Ninefold</a> (<a href="http://twitter.com/#!/lachlanhardy">@lachlanhardy</a> was the host of the night) - thanks guys!</p>

<p>I went there with <a href="http://filippovitale.it/">Filippo </a>and <a href="http://technophile.it/">Ronaldo </a>who are (ex) colleagues and friends. I also finally met Glenn (<a href="http://passionatedevelopment.com//twitter.com/#!/glennmartin76">@glennmartin76</a>) in person.</p>

<p>Glenn like me is new to Ruby - not sure how he found my blog and my RORO meetup post - but he did. And he contacted me via my blog asking questions about Sydney RORO. And then we exchanged emails couple of times - he&#8217;s got some good questions about all things Ruby (note to self: I should create a list of things that helped me get started and &#8220;stay&#8221; motivated to learn Ruby).</p>

<p>Hopefully I did some part to encourage him to come on the night.</p>

<p>Ok about the night itself - the night began with food and beers and casual chat.</p>

<p>I took a quick glance on people&#8217;s machines - the three newbies have Windows laptop (hey I do my Ruby dev on Ubuntu VM - so not that bad!) and the rest is on their shiny Macs.</p>

<p>And then Lachlan asked if people have interesting projects that they are working on or need help on. Some people put their hands up - some interesting stuffs being mentioned - Backbone.js, MongoDB, XML/XSLT(?) etc.</p>

<p>I then put my hands up for my <a href="https://github.com/cemeng/dailymile-ruby">dailymile-ruby</a> gem fork that I am working on, I basically wanted to someone with more Ruby experience to review my code and to provide some feedbacks.</p>

<p>And I was fortunate enough to get Ryan Bigg (<a href="http://twitter.com/ryanbigg">@ryanbigg</a>) to help with that. Working with someone with Ryan&#8217;s experience was really cool - I got some good feedbacks and good tips on coding standard as well.</p>

<p>I got to ask questions like how would certain things be done in Ruby, like the good practice for raising exceptions, parameter type checking (I am a bit paranoid with type checking coming from ColdFusion/Java background).</p>

<p>I then asked Ryan on how to build a test for the feature that implemented. I did actually have a stand alone Ruby script to test but I wanted to make a proper Test Unit out of it. And he showed me exactly how to do that - and as bonus point I was pointed to to <a href="https://github.com/bblimke/webmock">WebMock</a> which looks like to be very handy for API testing.</p>

<p>So hopefully another few hours worth of work and my work is ready for a pull request (oh that elusive first pull request.. ).</p>

<p>I then sat with Damien (<a href="http://twitter.com/its_damo">@its_damo</a>) - he was working on fixing a bug on his <a href="http://somanyfeeds.com/">somanyfeeds</a> app and he was kind enough to explain how he implemented the app. I was quite impressed on the effort and the thoughts he put on this - things like JavaScript minification and fingerprinting, caching and queues using RabbitMQ.</p>

<p>Somanyfeeds is an Sinatra app by the way and he implemented some of Rails-inspired features to his app. Do check the <a href="https://github.com/dam5s/somanyfeeds">app&#8217;s code out on GitHub</a> - he showed me some documentations that he&#8217;s written for the app which looks like a solid piece of work as well.</p>

<p>And just by talking to him - I got free lesson on Ruby symbol. I actually haven&#8217;t got to the part of learning symbols yet and I always wonder what they are. Ruby symbol behaves like Java string - they are immutable while apparently Ruby string is not.</p>

<p>At some point - an accident happened - Ryan accidentally spilled beer on Ron&#8217;s Mac. But Ron was complaining about his old MacBook before the hack night started - so I am slightly suspicious that this is staged so that he can upgrade his Mac :)</p>

<p>I then sit with Filippo looking at his Python project. He kept on telling me not to mention Python loudly - and I don&#8217;t understand why :) Filippo was working on an app similar to <a href="http://athlinks.com">athlinks.com</a>. Got introduced to <a href="http://www.tipfy.org/">TipFy</a> library and stuffs.</p>

<p>Went home around 10pm - some people were still hacking away. So yeah I had a great time last night - meeting great and friendly people from the Ruby (and JavaScript) community.</p>

<p>I think if you are new to Ruby - all the more reason to attend the hack night.</p>

<p><a href="http://www.flickr.com/photos/lachlanhardy/5977622898/">Photo from the night</a> courtesy of Lachlan.</p>
]]></content>
  </entry>
  
</feed>

