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

  <title><![CDATA[Mind.random()]]></title>
  <link href="http://arunma.com/atom.xml" rel="self"/>
  <link href="http://arunma.com/"/>
  <updated>2012-09-06T07:15:40+08:00</updated>
  <id>http://arunma.com/</id>
  <author>
    <name><![CDATA[Arun Manivannan]]></name>
    
  </author>
  <generator uri="http://octopress.org/">Octopress</generator>

  
  <entry>
    <title type="html"><![CDATA[Rerunning me]]></title>
    <link href="http://arunma.com/2012/08/rerunning-me/"/>
    <updated>2012-08-28T02:07:00+08:00</updated>
    <id>http://arunma.com/2012/08/rerunning-me</id>
    <content type="html"><![CDATA[<p><strong>Gist :</strong> All new tech items will be posted on to <a href="http://rerun.me">rerun.me</a></p>

<p><strong>What? Another blog? Why ? </strong></p>

<p>Over the past few years, as part of my college and outside, I managed to read some very interesting books and some cool stuff managed to stick in my brain. A few of them got retained in few notebooks and evernotes - all of which are terribly difficult to find when you need them. So, I decided to take a deliberate attempt to take some time and log all the most interesting information in an organized manner. And in the process of doing so, I don&#8217;t want to be a  selfish @$$. So, here you go. <a href="http://rerun.me">http://rerun.me</a></p>

<p><strong>So, what&#8217;s up with arunma.com?</strong></p>

<p>Oh. Yeah. I am still unsure of how I am going to use this one. Now that all my mail ids are bound by google apps, I can&#8217;t shut it down (Frankly, I don&#8217;t want to). Few of the options that I could think of is to start whining about life or how great my family is. One of my friends was suggesting that I write an autobiography (huh??!!!). Just kidding.</p>

<p>As always, my ideas are dumb. Mail yours to arun AT arunma.com</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Multiple connections to a server or shared resource]]></title>
    <link href="http://arunma.com/2011/11/multiple-connections-to-a-server-or-shared-resource/"/>
    <updated>2011-11-16T02:31:00+08:00</updated>
    <id>http://arunma.com/2011/11/multiple-connections-to-a-server-or-shared-resource</id>
    <content type="html"><![CDATA[<p>I was trying to connect to my NAS drive from my Windows 7 machine and got an interesting error.  A little googling told me that a restart of the PC should solve the problem. I don&#8217;t want to and I know that is why you are here too.</p>

<p>So, if your problem as stated <a href="http://support.microsoft.com/kb/938120">here</a> is this</p>

<p><code>The network folder specified is currently mapped using a different user name and password. To connect using a different user name and password, first disconnect any existing mappings to this network share.</code></p>

<p>and this</p>

<p><code>Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again.</code></p>

<p>then all you have to do is this</p>

<p>1) Open your Run window or Hit Window+R and type <code>cmd</code>. That should open your command window.</p>

<p>2) Type <code>net use</code> as in</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'>C:\Users\Jason>net use
</span><span class='line'>New connections will be remembered.
</span><span class='line'>
</span><span class='line'>
</span><span class='line'>Status       Local     Remote                    Network
</span><span class='line'>
</span><span class='line'>-------------------------------------------------------------------------------
</span><span class='line'>OK                     \\192.168.1.7\IPC$        Microsoft Windows Network
</span><span class='line'>The command completed successfully.</span></code></pre></td></tr></table></div></figure>


<p>3) Type <code>net use /delete &lt;your serverpath\sharedfoldername&gt;</code> as in</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'>C:\Users\Jason>net use /delete \\192.168.1.7\IPC$
</span><span class='line'>\\192.168.1.7\IPC$ was deleted successfully.</span></code></pre></td></tr></table></div></figure>


<p>Now, try reconnecting.</p>

<p><em>I am still experimenting with octopress and don&#8217;t know how to trackback to the <a href="http://www.howtogeek.com/forum/topic/how-to-disconnect-vista-from-a-shared-resource">original source</a>. Apologies.</em></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Prototype Design Pattern : Mindmap and implementation]]></title>
    <link href="http://arunma.com/2011/11/prototype-design-pattern-mindmap-and-implementation/"/>
    <updated>2011-11-14T21:38:00+08:00</updated>
    <id>http://arunma.com/2011/11/prototype-design-pattern-mindmap-and-implementation</id>
    <content type="html"><![CDATA[<p>I was going through the <a href="http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612">Gang of Four</a> again after a long time as part of my college elective and had a very interested experience.</p>

<p>There are some which I misunderstood or realised had few other interesting implementations or forgot they even existed.</p>

<p>Now, comparing and contrasting design patterns is a funny task when all my struggle goes into remembering them.</p>

<p>I have been using mindmaps lately to help organize my thoughts and thought I&#8217;ll convert few design patterns into maps. Hope you would find it useful too.</p>

<p>Click to see the full web optimized image. Mail me/Drop a comment for a bigger one or the iMindmap file.</p>

<h2>MindMap</h2>

<p><a href="http://arunma.com/canvas/Prototype.png"><img src="http://arunma.com/canvas/Prototype.png" width="800" height="800"></a></p>

<h2>Implementation</h2>

<p>This implementation snippet is from my college CA task.  The idea is to read a property file and create new instances of <code>Coin</code> objects. The <code>CashPropertyLoader</code> uses the <code>StoreObjectFactory</code> to clone and initialize the <code>Coin</code> object. Both these methods are available in the <code>Coin</code> object. The <code>StoreObjectFactory</code> also uses a <code>StoreObjectRegistry</code> to cache the prototypes. The <code>StoreObjectRegistry</code> acts as the <em>prototype manager</em></p>

<h3>Class Diagram</h3>

<p><a href="http://arunma.com/canvas/ClassDiagramPrototype.jpg"><img src="http://arunma.com/canvas/ClassDiagramPrototype.jpg" width="800" height="800"></a></p>

<h5>Cash Property Loader</h5>

<figure class='code'><figcaption><span>CashPropertyLoader  </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>
</pre></td><td class='code'><pre><code class='java'><span class='line'> <span class="kd">public</span> <span class="n">CashStoreItem</span> <span class="nf">getItem</span><span class="o">(</span><span class="kt">int</span> <span class="n">idx</span><span class="o">){</span>
</span><span class='line'>  
</span><span class='line'>      <span class="n">CashStoreItem</span>   <span class="n">cit</span><span class="o">;</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span><span class="n">String</span><span class="o">&gt;</span> <span class="n">params</span><span class="o">=</span><span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;();</span>
</span><span class='line'>  
</span><span class='line'>      <span class="n">String</span>  <span class="n">item</span><span class="o">,</span> <span class="n">itemv</span><span class="o">;</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">item</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">(</span><span class="s">&quot;Name&quot;</span> <span class="o">+</span> <span class="n">idx</span><span class="o">);</span>
</span><span class='line'>      <span class="n">itemv</span> <span class="o">=</span> <span class="n">getValue</span><span class="o">(</span><span class="n">item</span><span class="o">);</span>
</span><span class='line'>      <span class="n">params</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;name&quot;</span><span class="o">,</span> <span class="n">itemv</span><span class="o">);</span>
</span><span class='line'>  
</span><span class='line'>      <span class="n">item</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">(</span><span class="s">&quot;Weight&quot;</span> <span class="o">+</span> <span class="n">idx</span><span class="o">);</span>
</span><span class='line'>      <span class="n">itemv</span> <span class="o">=</span> <span class="n">getValue</span><span class="o">(</span><span class="n">item</span><span class="o">);</span>
</span><span class='line'>      <span class="n">params</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;weight&quot;</span><span class="o">,</span> <span class="n">itemv</span><span class="o">);</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">item</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">(</span><span class="s">&quot;Value&quot;</span> <span class="o">+</span> <span class="n">idx</span><span class="o">);</span>
</span><span class='line'>      <span class="n">itemv</span> <span class="o">=</span> <span class="n">getValue</span><span class="o">(</span><span class="n">item</span><span class="o">);</span>
</span><span class='line'>      <span class="n">params</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="s">&quot;value&quot;</span><span class="o">,</span> <span class="n">itemv</span><span class="o">);</span>
</span><span class='line'>  
</span><span class='line'>      <span class="n">Coin</span> <span class="n">coin</span> <span class="o">=</span> <span class="o">(</span><span class="n">Coin</span><span class="o">)</span><span class="n">StoreObjectRegistry</span><span class="o">.</span><span class="na">lookup</span><span class="o">(</span><span class="n">StoreObjectEnum</span><span class="o">.</span><span class="na">COIN</span><span class="o">);</span>
</span><span class='line'>      <span class="n">coin</span><span class="o">.</span><span class="na">initialize</span><span class="o">(</span><span class="n">params</span><span class="o">);</span>
</span><span class='line'>  
</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;ToString&quot;</span> <span class="o">+(</span><span class="s">&quot;Idx :&quot;</span><span class="o">+</span><span class="n">idx</span><span class="o">+</span> <span class="s">&quot;\nCoin &quot;</span><span class="o">+</span><span class="n">coin</span><span class="o">));</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">item</span> <span class="o">=</span> <span class="k">new</span> <span class="n">String</span><span class="o">(</span><span class="s">&quot;Quantity&quot;</span> <span class="o">+</span> <span class="n">idx</span><span class="o">);</span>
</span><span class='line'>      <span class="n">itemv</span> <span class="o">=</span> <span class="n">getValue</span><span class="o">(</span><span class="n">item</span><span class="o">);</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">cit</span> <span class="o">=</span> <span class="k">new</span> <span class="n">CashStoreItem</span><span class="o">(</span><span class="n">coin</span><span class="o">,</span> <span class="n">Integer</span><span class="o">.</span><span class="na">parseInt</span><span class="o">(</span><span class="n">itemv</span><span class="o">));</span>
</span><span class='line'>      <span class="c1">//System.out.println(&quot;ToString&quot; +(&quot;Idx :&quot;+idx+ &quot;\nCashstore item &quot;+cit));</span>
</span><span class='line'>  
</span><span class='line'>      <span class="k">return</span> <span class="n">cit</span><span class="o">;</span>
</span><span class='line'>  <span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<h5>StoreObjectRegistry</h5>

<figure class='code'><figcaption><span>StoreObjectRegistry  </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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">StoreObjectRegistry</span> <span class="o">{</span>
</span><span class='line'>
</span><span class='line'>  <span class="kd">private</span> <span class="kd">static</span> <span class="n">Map</span><span class="o">&lt;</span><span class="n">StoreObjectEnum</span><span class="o">,</span> <span class="n">StoreObject</span><span class="o">&gt;</span> <span class="n">storeObjectRegistry</span><span class="o">=</span><span class="k">new</span> <span class="n">HashMap</span><span class="o">&lt;</span><span class="n">StoreObjectEnum</span><span class="o">,</span> <span class="n">StoreObject</span><span class="o">&gt;();</span>
</span><span class='line'>  
</span><span class='line'>  <span class="kd">public</span> <span class="kd">static</span> <span class="n">StoreObject</span> <span class="nf">lookup</span><span class="o">(</span><span class="n">StoreObjectEnum</span> <span class="n">storeObjecType</span><span class="o">)</span>  <span class="o">{</span>
</span><span class='line'>      
</span><span class='line'>      <span class="n">StoreObject</span> <span class="n">storeObject</span><span class="o">=</span><span class="kc">null</span><span class="o">;</span>
</span><span class='line'>      
</span><span class='line'>      <span class="k">try</span> <span class="o">{</span>
</span><span class='line'>          <span class="n">StoreObject</span> <span class="n">storeObjectImpl</span><span class="o">=</span><span class="kc">null</span><span class="o">;</span>
</span><span class='line'>          
</span><span class='line'>          <span class="k">switch</span><span class="o">(</span><span class="n">storeObjecType</span><span class="o">){</span>
</span><span class='line'>              
</span><span class='line'>              <span class="k">case</span> <span class="nl">COIN:</span>
</span><span class='line'>                  <span class="n">storeObjectImpl</span><span class="o">=</span><span class="k">new</span> <span class="n">Coin</span><span class="o">();</span>
</span><span class='line'>                  <span class="k">break</span><span class="o">;</span>
</span><span class='line'>                  
</span><span class='line'>              <span class="k">case</span> <span class="nl">DRINK:</span>
</span><span class='line'>                  <span class="n">storeObjectImpl</span><span class="o">=</span><span class="k">new</span> <span class="n">DrinksBrand</span><span class="o">();</span>
</span><span class='line'>                  <span class="k">break</span><span class="o">;</span>
</span><span class='line'>              <span class="o">}</span>
</span><span class='line'>              
</span><span class='line'>              <span class="k">if</span> <span class="o">(</span><span class="n">storeObjectImpl</span><span class="o">!=</span><span class="kc">null</span><span class="o">){</span>
</span><span class='line'>                  <span class="n">storeObjectRegistry</span><span class="o">.</span><span class="na">put</span><span class="o">(</span><span class="n">storeObjecType</span><span class="o">,</span> <span class="n">storeObjectImpl</span><span class="o">);</span>  
</span><span class='line'>              <span class="o">}</span>
</span><span class='line'>              <span class="k">else</span><span class="o">{</span>
</span><span class='line'>                  <span class="n">System</span><span class="o">.</span><span class="na">err</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">&quot;Store Object Implementation could not be resolved. Please check your store object type and store object mapping&quot;</span><span class="o">);</span>
</span><span class='line'>              <span class="o">}</span>
</span><span class='line'>              
</span><span class='line'>              <span class="n">storeObject</span> <span class="o">=(</span><span class="n">StoreObject</span><span class="o">)</span><span class="n">storeObjectRegistry</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">storeObjecType</span><span class="o">).</span><span class="na">clone</span><span class="o">();</span>
</span><span class='line'>          
</span><span class='line'>      <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">CloneNotSupportedException</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>          <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
</span><span class='line'>      <span class="o">}</span>
</span><span class='line'>      <span class="k">return</span> <span class="n">storeObject</span><span class="o">;</span>
</span><span class='line'>      
</span><span class='line'>  <span class="o">}</span>
</span><span class='line'>  
</span><span class='line'><span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>


<h5>StoreObject</h5>

<figure class='code'><figcaption><span>StoreObject  </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>
</pre></td><td class='code'><pre><code class='java'><span class='line'><span class="kd">public</span> <span class="kt">void</span> <span class="nf">initialize</span><span class="o">(</span><span class="n">Map</span><span class="o">&lt;</span><span class="n">String</span><span class="o">,</span> <span class="n">String</span><span class="o">&gt;</span> <span class="n">params</span><span class="o">){</span>
</span><span class='line'>
</span><span class='line'>      <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Field</span><span class="o">&gt;</span> <span class="n">fieldsList</span><span class="o">=</span><span class="k">new</span> <span class="n">ArrayList</span><span class="o">&lt;</span><span class="n">Field</span><span class="o">&gt;();</span>
</span><span class='line'>      <span class="n">addDeclaredAndInheritedFields</span><span class="o">(</span><span class="k">this</span><span class="o">.</span><span class="na">getClass</span><span class="o">(),</span> <span class="n">fieldsList</span><span class="o">);</span>
</span><span class='line'>      
</span><span class='line'>      <span class="k">for</span> <span class="o">(</span><span class="n">Field</span> <span class="n">field</span> <span class="o">:</span> <span class="n">fieldsList</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>          
</span><span class='line'>          <span class="n">field</span><span class="o">.</span><span class="na">setAccessible</span><span class="o">(</span><span class="kc">true</span><span class="o">);</span>
</span><span class='line'>          
</span><span class='line'>          <span class="k">if</span> <span class="o">(</span><span class="n">params</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">())==</span><span class="kc">null</span><span class="o">){</span>
</span><span class='line'>              <span class="k">continue</span><span class="o">;</span>
</span><span class='line'>          <span class="o">}</span>
</span><span class='line'>          <span class="k">try</span> <span class="o">{</span>
</span><span class='line'>
</span><span class='line'>               <span class="k">if</span> <span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getType</span><span class="o">()</span> <span class="o">==</span> <span class="kt">boolean</span><span class="o">.</span><span class="na">class</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>                  
</span><span class='line'>                  <span class="n">field</span><span class="o">.</span><span class="na">setBoolean</span><span class="o">(</span><span class="k">this</span><span class="o">,</span> <span class="k">new</span> <span class="n">Boolean</span><span class="o">(</span><span class="n">params</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">())));</span>
</span><span class='line'>                  
</span><span class='line'>              <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getType</span><span class="o">()</span> <span class="o">==</span> <span class="kt">int</span><span class="o">.</span><span class="na">class</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>                  
</span><span class='line'>                  <span class="n">field</span><span class="o">.</span><span class="na">setInt</span><span class="o">(</span><span class="k">this</span><span class="o">,</span><span class="n">Integer</span><span class="o">.</span><span class="na">parseInt</span><span class="o">(</span><span class="n">params</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">())));</span>
</span><span class='line'>                  
</span><span class='line'>              <span class="o">}</span> <span class="k">else</span> <span class="k">if</span> <span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getType</span><span class="o">()</span> <span class="o">==</span> <span class="kt">double</span><span class="o">.</span><span class="na">class</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>                  <span class="n">field</span><span class="o">.</span><span class="na">setDouble</span><span class="o">(</span><span class="k">this</span><span class="o">,</span><span class="n">Double</span><span class="o">.</span><span class="na">parseDouble</span><span class="o">(</span><span class="n">params</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">()</span> <span class="o">)));</span>
</span><span class='line'>                  
</span><span class='line'>              <span class="o">}</span> <span class="k">else</span> <span class="o">{</span>
</span><span class='line'>                  <span class="n">field</span><span class="o">.</span><span class="na">set</span><span class="o">(</span><span class="k">this</span><span class="o">,</span><span class="n">params</span><span class="o">.</span><span class="na">get</span><span class="o">(</span><span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">()));</span>
</span><span class='line'>              <span class="o">}</span>
</span><span class='line'>          <span class="o">}</span> <span class="k">catch</span> <span class="o">(</span><span class="n">Exception</span> <span class="n">e</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>              <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</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;Unable to map field : &quot;</span> <span class="o">+</span> <span class="n">field</span><span class="o">.</span><span class="na">getName</span><span class="o">());</span>
</span><span class='line'>              <span class="n">e</span><span class="o">.</span><span class="na">printStackTrace</span><span class="o">();</span>
</span><span class='line'>          <span class="o">}</span>
</span><span class='line'>      <span class="o">}</span>
</span><span class='line'>      
</span><span class='line'>    <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>
</span><span class='line'>    <span class="kd">private</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">addDeclaredAndInheritedFields</span><span class="o">(</span><span class="n">Class</span> <span class="n">c</span><span class="o">,</span> <span class="n">List</span><span class="o">&lt;</span><span class="n">Field</span><span class="o">&gt;</span> <span class="n">fields</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>      
</span><span class='line'>        <span class="n">fields</span><span class="o">.</span><span class="na">addAll</span><span class="o">(</span><span class="n">Arrays</span><span class="o">.</span><span class="na">asList</span><span class="o">(</span><span class="n">c</span><span class="o">.</span><span class="na">getDeclaredFields</span><span class="o">()));</span>
</span><span class='line'>        <span class="n">Class</span> <span class="n">superClass</span> <span class="o">=</span> <span class="n">c</span><span class="o">.</span><span class="na">getSuperclass</span><span class="o">();</span>
</span><span class='line'>        <span class="k">if</span> <span class="o">(</span><span class="n">superClass</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span>
</span><span class='line'>            <span class="n">addDeclaredAndInheritedFields</span><span class="o">(</span><span class="n">superClass</span><span class="o">,</span> <span class="n">fields</span><span class="o">);</span>
</span><span class='line'>        <span class="o">}</span>
</span><span class='line'>    <span class="o">}</span>
</span><span class='line'>
</span><span class='line'>    <span class="kd">public</span> <span class="n">Object</span> <span class="nf">clone</span><span class="o">()</span> <span class="kd">throws</span> <span class="n">CloneNotSupportedException</span> <span class="o">{</span>
</span><span class='line'>        <span class="k">return</span> <span class="kd">super</span><span class="o">.</span><span class="na">clone</span><span class="o">();</span>
</span><span class='line'>    <span class="o">}</span>
</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Easiest way to create Hadoop cluster on Amazon EC2]]></title>
    <link href="http://arunma.com/2011/07/easiest-way-to-create-hadoop-cluster-on-amazon-ec2/"/>
    <updated>2011-07-28T01:58:06+08:00</updated>
    <id>http://arunma.com/2011/07/easiest-way-to-create-hadoop-cluster-on-amazon-ec2</id>
    <content type="html"><![CDATA[<p>Never thought creating a hadoop cluster on EC2 is this easy. I always thought
the real cluster is difficult to create compared to the pseudo.</p>

<p><a href="http://ashenfad.blogspot.com/2011/01/hadoop-cluster-on-ec2-using-cloudera.html">http://ashenfad.blogspot.com/2011/01/hadoop-cluster-on-ec2-using-
cloudera.html</a></p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Flexing time to the extreme]]></title>
    <link href="http://arunma.com/2011/04/flexing-time-to-the-extreme/"/>
    <updated>2011-04-10T17:25:04+08:00</updated>
    <id>http://arunma.com/2011/04/flexing-time-to-the-extreme</id>
    <content type="html"><![CDATA[<p>Seriously, what&#8217;s up with Java Swing?  Trust me, I tried really hard to
understand what could have gone into the minds of the Swing designers. But
still,  applets are the pioneers of the interactive web (and way better than
programming in the naturally 128-bit encrypted Perl on CGI). So, I am going to
go easy on applets.  It&#8217;s like what they say in my native tongue - beating up
a dead snake.</p>

<p>Alright let me tell the background of why would anyone touch Swing in 2011
unless they are maintaining a legacy JNLP talking to MQ backed by Pro-C to
Oracle (btw, that combo is a real working application in Verizon).  As you
know, I am taking this postgrad in Software engineering and one of the core
modules is Java.  As part of the module, each group were given an small
application to build using only the vanilla JDK.  No external libraries.
Sounded simple initially but the project was a real eye opener at so many
levels.</p>

<p><strong>Don&#8217;t forget the basics : </strong></p>

<p>The assignment project was JDK alone.  Over the years, I started taking the
value of open source libraries for granted.  Say, log4j, commons-lang,
collections, xml parsers or even an RDBMS database.  While it was funny to
notice how dependent I&#8217;ve become on many of these libraries, it was very
interesting to write your own and really challenging to keep the code decently
readable.  So, next time I blame a framework for bad design,  I have this
project to bring me down to earth.  One thing that I realised is that if your
creativity is <a href="http://en.wikipedia.org/wiki/Flow_%28psychology%29">&#8220;in the flow&#8221;</a>, you dont want to get disturbed by design
constraints.  Resisting the temptation and still sticking on to a good design
is a hard thing to do but you have to do it for the sake of the <a href="http://stackoverflow.com/questions/876089/who-wrote-this-programing-saying-always-code-as-if-the-guy-who-ends-up-maintain">psychopath
programmer</a>.</p>

<p><strong>Team work and delegation :</strong></p>

<p>All developers are loners.  They think that they do their best when alone.  I
am no exception.  However, being a part of a team and pulling each other up is
real fun.  Understanding what each person is good at and adjusting your tasks
according to that is real art.  We had humble beginnings - I could work only
one day of the weekend but when code started pouring in, I could see what
synergy really means.  It&#8217;s like the <a href="http://www.extremelinux.info/stonesoup/stonesoup.html">story of the stone soup</a>. No wonder
the best projects in the world are delivered by groups.</p>

<p><strong>Time management : </strong></p>

<p>This year (even from the close of last year),  day job has been super crazy.
May be that is the reason they call it a deadline.  You really have to die to
finish the project on time.  This project really means a lot to me, my team
and the entire center. Working 80+ hours in the week is already taxing.   That
killed the 2011 resolution right from the first week - Weekends only for
personal projects and experiments.   And with the MTech, family and learning
hadoop and flex, I had to do something to manage time.  Like my mentor used to
say,<strong> you can&#8217;t manage time, you can just manage priorities</strong>.  I don&#8217;t have
a choice at office.  I can&#8217;t do badly on MTech. If I do badly on the core
module, I am out of the course.  Call it a horrible decision, but I decided to
send my family on vacation to India (that was 2 months ago and they are coming
back next week. I am super excited).  I&#8217;ll be learning Hadoop and cloud as
part of my elective module in May.  So, pause on my hadoop/solr/lucene
projects until then (trust me, they are really addictive).  Now that I have a
little free time on the trains and before bed, I am currently learning Flex in
what I would like to call &#8220;micro-installments&#8221;.  I am taking the Flex in a
week course for the past month and still I am on Day 2 of the course.  I think
I am taking &#8220;It doesn&#8217;t matter how slow you go as long as you don&#8217;t stop&#8221;, a
little too seriously.  So, why am I learning flex now?  You&#8217;ll see.</p>

<p><strong>All things are difficult before they are easy : </strong></p>

<p>Being aware of your weakness is good.  Even better is to minimize the
intensity of the weakness - from scary to manageable.  I was really worried
when the front end is supposed to be on Swing and Swing gave me nightmares in
2003.  So, after designing and coding the back end of the project, I still
wanted to give swing a try.  Surprisingly, I actually managed to pull it off.
It is not that bad&#8230;.  Ah who am I kidding. I was horrible but Google&#8217;s
window builder made my job way way easier.  For some reason, I found it much
better than Netbeans Matisse.  I pulled up a couple of JTables and did some
fancy stuff on it. (Swing developers, please dont laugh at me).</p>

<p>Over all, this year has now personally rated the toughest year in the past 10
years.  Like they say, when the going gets tough, the tough gets rough (whoaa
that&#8217;s a little too much boasting even for me).</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[log4j JSONLayout and JLogIndexer]]></title>
    <link href="http://arunma.com/2011/03/log4j-jsonlayout-and-jlogindexer/"/>
    <updated>2011-03-15T02:17:01+08:00</updated>
    <id>http://arunma.com/2011/03/log4j-jsonlayout-and-jlogindexer</id>
    <content type="html"><![CDATA[<p>As I mentioned in my previous post, I am working on building a Solr based
log indexing and search.  My idea was simple.  Write a custom appender, use
XML Layout, parse the XML into a Document and use SolrJ to push to Solr.
Very soon reality struck me :</p>

<p><strong>1)  log4j XML Layout is not a good idea for our requirement</strong>.  I really
dont want to spend time on parsing about 100 XMLs every second.  That is a lot
of time even for a StAX based <a href="http://woodstox.codehaus.org/">Woodstox</a>.  So, I just extended log4j layout
and over-rid a couple of methods to create a JSON Layout.</p>

<p>2)  Using <a href="http://wiki.fasterxml.com/JacksonDownload">Jackson Streaming API</a> to parse the JSON string from the Layout
opened my eyes.  There were too many external dependency libraries (jackson,
solrj and their dependent jars) that I was adding on to the application which
ultimately will all go to the host application.  That is totally insane.</p>

<p>So, I figured out that way to go is to use</p>

<p>1) log4j JMS appender to put JSON strings into</p>

<p>2) Active MQ running on a app server running Solr.</p>

<p>I am hoping that this should give us the following benefits :</p>

<p>1) <strong>No complications on the host application</strong>. (copying libraries,
classloader issues with library version incompatibility etc)</p>

<p>2) Non-log4j based java applications and non-java applications could use one
of the various <strong>connectivity options available with ActiveMQ t</strong>o put
messages into its queue.</p>

<p><a href="http://activemq.apache.org/connectivity.html">http://activemq.apache.org/connectivity.html</a></p>

<p>3)  <strong>Extension and replacing the layout and message parsing</strong>.</p>

<p>4)  <strong>Solr Document construction and the interface </strong>(initial version will
still be on SolrJ) can be customized.</p>

<p>This weekend should be pretty awesome then.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[log4j Log Indexing using Solr]]></title>
    <link href="http://arunma.com/2011/02/log4j-log-indexing-using-solr/"/>
    <updated>2011-02-26T23:02:20+08:00</updated>
    <id>http://arunma.com/2011/02/log4j-log-indexing-using-solr</id>
    <content type="html"><![CDATA[<p>We are finding it very hard to monitor the logs spread over a cluster of four
managed servers. So, I am trying to build a simple log4j appender which uses
solrj api to store the logs in the solr server. The idea is to use leverage
REST of solr to build a better GUI which could help us</p>

<p>1) search the logs and the display the previous and the next 50 lines or so
and</p>

<p>2) tail the logs</p>

<p>Being awful on front ends, I am trying to cookup something with GWT (a
prototype version). I am planning to host the project on googlecode under ASL.</p>

<p>Greatly appreciate if you could throw some insights on</p>

<p>1) Whether it makes sense to create a project like this ?</p>

<p>2) Is using Solr for this an overkill?</p>

<p>3) Any suggestions on web framework/tool which will help me build a tab-based
front end for tailing.</p>

<p>I owe you guys. Thanks.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Back on track - Watch out for updates]]></title>
    <link href="http://arunma.com/2011/02/back-on-track-watch-our-for-updates/"/>
    <updated>2011-02-15T17:47:21+08:00</updated>
    <id>http://arunma.com/2011/02/back-on-track-watch-our-for-updates</id>
    <content type="html"><![CDATA[<p>I have been doing so many crazy things in the last quarter of last year and
this year so far. And interestingly, all turned out to be very good.  Lets
say, staying hungry and foolish really pays. So, I felt the need to revamp my
blog (my blog being brought down to its knees last month by an attack is
really a blessing in disguise).</p>

<p>So, please watch out for the updates.  I will try my best to make it regular
and useful.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Shutdown Windows XP from Remote Desktop/VPN Connection]]></title>
    <link href="http://arunma.com/2010/09/shutdown-windows-xp-from-remote-desktopvpn-connection/"/>
    <updated>2010-09-12T15:40:32+08:00</updated>
    <id>http://arunma.com/2010/09/shutdown-windows-xp-from-remote-desktopvpn-connection</id>
    <content type="html"><![CDATA[<p>Funny story. I wanted to login to my office PC from my Mac due to some
emergency work only to see Murphy staring at me. My office windows PC got hung
and I was unable to do anything useful. I tried doing a &#8221;<strong>taskmgr</strong>&#8221; on the
Run Window but the window simply wouldnt come up.</p>

<p>I wanted to restart but unfortunately the Ctrl+Alt+Delete doesnt work on my
Mac the way it is intended to. After a lot of struggle, I managed to open a
command window and hit &#8221;<strong>shutdown -r</strong>&#8221;.  Does the job.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Resolution : Apache commons configuration (XMLConfiguration) in a Spring bean]]></title>
    <link href="http://arunma.com/2010/07/426/"/>
    <updated>2010-07-26T15:43:37+08:00</updated>
    <id>http://arunma.com/2010/07/426</id>
    <content type="html"><![CDATA[<p>I was trying to inject apache commons configuration (XMLConfiguration) into a
Spring bean and faced the error :</p>

<p><strong><code>hint: specify index/type/name arguments for simple parameters to avoid type
ambiguities</code></strong></p>

<p>I was breaking my head for a while only to find later that my config XML is
not even in the classpath. You can find the configuration below</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>
</pre></td><td class='code'><pre><code class='xml'><span class='line'><span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;xmlConfig&quot;</span><span class="nt">&gt;</span> <span class="nt">&lt;constructor-arg</span> <span class="na">type=</span><span class="s">&quot;java.net.URL&quot;</span> <span class="na">value=</span><span class="s">&quot;classpath:alert-config.xml&quot;</span> <span class="nt">/&gt;</span>
</span><span class='line'><span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;reloadingStrategy&quot;</span><span class="nt">/&gt;</span>
</span><span class='line'><span class="nt">&lt;/bean&gt;</span>
</span><span class='line'>
</span><span class='line'><span class="nt">&lt;bean</span> <span class="na">id=</span><span class="s">&quot;alertConfig&quot;</span><span class="nt">&gt;</span> <span class="nt">&lt;property</span> <span class="na">name=</span><span class="s">&quot;xmlConfig&quot;</span> <span class="na">ref=</span><span class="s">&quot;xmlConfig&quot;</span><span class="nt">&gt;&lt;/property&gt;</span>
</span><span class='line'><span class="nt">&lt;/bean&gt;</span>
</span></code></pre></td></tr></table></div></figure>



]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Why Google opensourced VP8?]]></title>
    <link href="http://arunma.com/2010/05/why-google-opensourced-vp8/"/>
    <updated>2010-05-26T20:45:49+08:00</updated>
    <id>http://arunma.com/2010/05/why-google-opensourced-vp8</id>
    <content type="html"><![CDATA[<p>Here&#8217;s why I think Google open sourced VP8.</p>

<p>If you think 120 million is a lot, think about this :</p>

<p>1)      HTML5 will run against VP8 which means that Apple cannot say no to
supporting it now.  All browsers have to support a STANDARD called HTML5. This
will destroy Apple’s ecosystem.</p>

<p>2)      Google is now praised by all the open source circles.. This translates
to lots of community building around its Android mobile platform.  (not to
mention the huge disappointment with the selection procedure for Apple store)</p>

<p>3)      VP8 open sourcing would mean that Linux will now ship with VP8 out of
the box.  This means that all the linux/freebsd users will now have a soft
corner for Google and its products in general.  Interestingly, Google Chrome 5
which was released yesterday suddenly ate a good percentage from Firefox.
Since “early adopters” primarily come from the open source circles, this would
mean unconditional support for Google products from now.</p>

<p>4)      Sun Microsystems always had a very friendly name in the technology
circles.  Now that it is dead and Oracle failed to fill in the “good
Samaritan” role, Google tries to adjust its feet to its shoes.</p>

<p>Bottom line :   Business, all along.</p>

<p>What do you think? Leave your comments.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[How I met my first NAS - Qnap or Synology]]></title>
    <link href="http://arunma.com/2010/03/how-i-met-my-first-nas-qnap-or-synology/"/>
    <updated>2010-03-11T11:44:08+08:00</updated>
    <id>http://arunma.com/2010/03/how-i-met-my-first-nas-qnap-or-synology</id>
    <content type="html"><![CDATA[<p>I have a bad habit.  I buy impulsively.  But the good part about it is that
when the pressure to buy becomes overwhelming, I wait.  I go back home and
read every single word on the planet about what I wanted to buy in the first
place.  Eventually, I end up buying something else.</p>

<p>A couple of weeks back, I read a blog about Thecus NAS drives and immediately
wanted to buy one.  I wanted to own it on that very day.  Then the pressure
built so much that I had to sit and let it mellow.  I googled.</p>

<p>The noise level of most Thecus drives was a huge turn off considering the high
probability of getting murdered by my wife (I fondly remember the days when my
desktop was louder than an average car on the road).  Netgear NVX and NV+
series were good but they are a bit pricey for the features they offer.</p>

<p>Forgot to mention that my drives will be <strong>primarily used for storage and as a
torrent slave</strong>.  I will also be running a few services like <strong>Photo manager,
Tomcat, iTunes </strong>(more services depends on the success in setting up DDNS) .
If it helps, I dont use windows at home (mac and linux) and I am planning for
a RAID 5 setup.</p>

<p>So, I decided to get either the Synology of the Qnap drives.  <strong>Synology 1010
and Qnap 459 </strong>were my choices after long hours of search. These were the
points that I considered.</p>

<p>1)   Buy an <strong>Intel Atom based drive </strong>because of the support for a variety of
software packages.</p>

<p>2)</p>

<p><strong>QNAP models TS-459, 659, 859</strong></p>

<ul>
<li>high overall performance + supports scheduled <strong>power on and off </strong>- no RAID
10 support - no hybrid RAID functionality - storage cannot be expanded with a
companion unit (# drivebays is max, you could buy a 2nd unit of course or use
one of the many ports) - No biggie (I backup using my USB drives) + has 5 USB
2.0 ports + has 2 eSATA ports + volume based encryption + built-in DHCP server</li>
<li><strong>handy LCD display </strong> + USB Copy function on the frontpanel + supports the
EXT4 filesystem (> 16 TB volumes) + supports WebDAV + advanced iSCSI support +
all the drives are lockable with a key + in general, no problem with
downgrading of firmware - one year guarantee + great build quality + already
much experience, add-on software and models available on x86 platform</li>
</ul>


<p><strong>Synology DS 1010+</strong></p>

<ul>
<li>only supports scheduled power off + RAID 10 support + hybrid RAID
functionality (SHR) + storage can be expanded (with the extra 5 drivebays
case, however will eSATA connection become bottleneck?) - has 4 USB 2.0 ports</li>
<li>has 1 eSATA port + folder based encryption - no built-in DHCP server - no
LCD display - no USB Copy function on the front - no EXT4 filesystem support
(volumes > 16 TB volume will not be possible) - no WebDAV support - less
advanced iSCSI support - the drives are not lockable with a key - in general,
very problematic to downgrade firmware - less models, less choice + three
years guarantee - build quality is not as good as QNAP - first model based on
x86 platform</li>
</ul>


<p>Source : <a href="http://forums.smallnetbuilder.com/showthread.php?t=2855">http://forums.smallnetbuilder.com/showthread.php?t=2855</a></p>

<p>3)  At the end of the read, I wanted to go for one of those Qnap drives - 459,
509 or 659. 659 was way above my budget but I wanted to keep it in the
background because it had support for 6 drives and I can always buy 4 drives
in the beginning and fill up the other drives on need basis.</p>

<p>Later, I read that <strong>RAID is not a backup</strong> (did i say that I am totally new
to RAID and the whole world of NAS drives) and does not guarantee dataloss and
that I will need to have another plan for backup. I then decided to use my USB
drives for the important backups (mostly my son&#8217;s photos and videos).  So, it
doesnt make any sense to buy a 659 for an extra 600 SGD. May be later, I can
always go for another NAS for an extra 200 SGD and have it as a backup.</p>

<p>So, 509 and 459. 459 had an Atom Dual core processor and 509 had a Celeron
processor. The best part about 509, though, is that you can upgrade the
processor to something big (say, Core2Duo) but I always have the fear to open
up my system after i burnt a couple of RAMs on my first desktop (a 16 MB was a
100 USD then. that burnt a lot of my fingers) and I found very few people
upgrading their processor on a 509.  So, 459 it is.</p>

<p><strong>Hard drives : </strong></p>

<p>Then comes the problem about hard-drives. I wanted to buy the <strong>Seagate 1.5 TB
7200.11</strong> or any other 2 TB drives so that i can make a good 6 TB out of my 4
slot 459 (2 TB gone for parity).  Later, I found that the 1.5 TBs are
notoriously fault prone. The <strong>WD Caviar Greens play horribly with Qnaps
</strong>(Google &#8220;site:forum.qnap.com Caviar Green&#8221;) and so are most of the other WD
drives. The Caviar blacks 1 TB are excellent drives despite their noise level
but some say that the noise and the clicks are that not that troublesome.
schumaku from the forum is known for his expertise in harddrives. He was
suggesting not to buy the highest capacity of any drive - they are known to
create the highest number of problems.</p>

<p>Most were complaining that Seagates gave a lot of problem and they had various
problems with different drives and that they were unlucky.  (my luck factor is
near to zero). I never wanted to take any risk.</p>

<p>The Hitachi Ultrastar A7K2000 is the best for Qnap drives. Everybody agrees to
it but at 513 SGD for a 2 TB, I&#8217;ll give it a pass. Finally, I decided to go
for Samsung drives F1 or F3.  They say that F3s should work very well but I
dont see them on the Qnap compatibility list
(<a href="http://www.qnap.com/pro_compatibility.asp">http://www.qnap.com/pro_compatibility.asp</a>).  So, here is my final
configuration.</p>

<p><strong>NAS : </strong></p>

<p>Qnap 459 Pro (Intel Atom D510 1.66 GHz (Dual-Core) - RAM - 1GB DDRII (I might
end up upgrading the RAM alone))</p>

<p><strong>HDD: </strong></p>

<p>4 * 1 TB (RAID 5) - Samsung Spinpoint F1 HE103UJ (buying RAID Class depends on
availability)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Last day with Credit Suisse]]></title>
    <link href="http://arunma.com/2010/03/last-day-with-credit-suisse/"/>
    <updated>2010-03-04T16:59:01+08:00</updated>
    <id>http://arunma.com/2010/03/last-day-with-credit-suisse</id>
    <content type="html"><![CDATA[<p>I recently read a quote about writers - Writers don&#8217;t write because they have
to say something. It&#8217;s because they have something to say.   That was exactly
what went through my mind when I was asked to give a speech today in my
farewell lunch. I have a lot of things to say but I just cant say anything,
leave alone something.  I always used to wonder during the farewell lunches,
&#8220;How is that these guys who leave are not thankful for the days they spent
here. How come they dont speak a word&#8221; and as always my immediate thought
would be &#8220;Nah.. I will just give that movie-like pep talk&#8221;.  &#8221;I am awesome&#8221;.
&#8220;I can do more than that&#8221;.   Interestingly, I was no better than anybody else.</p>

<p>It is saddening to leave CS.  Thankfully, it is not the &#8220;invariably saddening&#8221;
kind.  I have nothing to repent.  In fact, the past couple of years taught a
lot about confidence, communication, trust and that there is a time for
everything.  CS is really a wonderful place to work.  Peaceful, organized and
balanced.</p>

<p>Two years ago, I came here as a lonely man. Nobody to talk to.  But today, It
is a wonderful feeling to see that all my friends came together to host a
farewell lunch for me.   What did i do to them? Nothing.   You bet, I will
miss all of them.   From Monday, I can&#8217;t meet them personally too often as I
do today but then I learnt from life that long distance relationship don&#8217;t
work, unless the relationship is friendship.</p>

<p>See you around.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Tips for a good resume]]></title>
    <link href="http://arunma.com/2010/02/tips-for-a-good-resume/"/>
    <updated>2010-02-18T12:16:59+08:00</updated>
    <id>http://arunma.com/2010/02/tips-for-a-good-resume</id>
    <content type="html"><![CDATA[<p>I am no guru in this and I am sure you could find a lot of resources  about
how to write a perfect resume.  Recently, a friend of mine passed me a resume
and asked me to suggest improvements and the technology he needs to update.
To my shock and dismay,  the resume was a total disaster.  Some things, which
we take for granted, turn out to be the most important ones.   I just happen
to sum up my personal thoughts in building a decent looking profile :</p>

<p>1)    Keep an <strong>uniform font</strong> for the resume. I see a lot of profiles with
different fonts spilled all over. Using italics and bold to highlight is fine
but different fonts irritate the eyes.</p>

<p>2)   <strong> Tabulate the professional experience, education and skillsets</strong>.  I
understand that it is a bad idea to tabulate when you wanted to pass the
profile as plain text.  But AFAIK, doc and pdf are the standard formats i have
circulated my CV as (I am a big fan of Pareto).</p>

<p>You will be shocked to know that the consultants take no more than 5-10
seconds to process your resume for a position (i saw it myself). Nobody except
you is interested in reading the entire profile.</p>

<p>3)   <strong> Highlight your prominent skillsets and be precise</strong>. You are trying to
sell your profile to a technical person and he will be interested in knowing
the version of software you are experienced in. Spring and Java doesnt convey
anything. How about Spring 2.0 or Java 1.5 or even better Concurrency API in
Java 1.5?</p>

<p>4)    Trust me, this is not going to help &#8212;</p>

<p><em><strong>Responsible for: </strong>Team Management, Project Management, Co-ordination with
clients and Production Support.</em></p>

<p><strong>Explain in detail your role in the project</strong>. Highlight your achievements.
something like&#8230; &#8220;being a co-developer and team manager, i was involved in
full development of the case folder module&#8221;.. or whatever. Please don&#8217;t lie.
Sooner of later, they will find out. Just be more detailed in what exactly you
did.</p>

<p><strong>Highlight your expertise.</strong> If you are a developer, highlight your
development experience. Highlight the various technologies you have worked in.
Show the depth of your experience.  Having a tabulated list of the technology
against the experience (in months) is not a bad idea.</p>

<p><strong> Tally your years of experience with your expertise.</strong> Mentioning that you
are into team leading and project management and have lost touch of
development when you have less than 5 years experience makes no sense at all.
If you are applying for a programmer role, let your resume show it.</p>

<p>5)    Put in an<strong> &#8220;Achievement&#8221; section</strong> and highlight only the relevant
achievements - both academic and work related. People will be very much
interested in looking at it.</p>

<p>6)    <strong>Update your skillset</strong>. Resolve to learn at least one new technology
(or get expert knowledge in the known one) every couple of months. Learn a new
language every year.  Not all technologies and languages will suit your taste.
And you can&#8217;t develop a taste for something which you have never tried even
once.</p>

<p><strong>Choose essential and related skill sets:</strong> Come on, you and I know that VSS
doesnt tally well with a Java developer. Gain experience in SVN at the minimum
and  a DVCS (git for example) going forward. Knowledge of the automated
testing frameworks (JUnit to start with) is a must.</p>

<p>7)    <strong>Read a lot of books or atleast the <a href="http://davybrion.com/blog/2009/11/a-reading-guide-to-becoming-a">minimum needed</a>, have a pet
project (even better, involve in an open source project) </strong>and highlight it on
your resume. It shows that you have lots of passion for your work.</p>

<p>Feel free to drop in a comment if you feel the need to add more to the list.</p>

<p>-better-developer/</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[2010 - Resuming the personal projects]]></title>
    <link href="http://arunma.com/2010/02/2010-resuming-the-personal-projects/"/>
    <updated>2010-02-05T17:46:42+08:00</updated>
    <id>http://arunma.com/2010/02/2010-resuming-the-personal-projects</id>
    <content type="html"><![CDATA[<p>Wow Wow Wow. By God&#8217;s grace, this year had a wonderful start. Beginning with
Jason&#8217;s 1st birthday on 7th and the Merrill interview on the same day,
vacation to home and the best of it all - re-joining Merrill. Needless to say
that i always enjoyed working in Merrill. Of course, it means less amount of
family time but at least at the end of the day, i will have a satisfied heart
that i have done something worth.</p>

<p>I fondly remember the first 4 months in ML India when working till 2 AM is
almost a daily event. What the heck. I am awake till 2 AM even here in
Singapore fighting with the code. I love programming and i&#8217;ll do it till death
does us apart. That&#8217;s right, ML is aggressive but so am I.</p>

<p>Now that everything is settled and I have a definite and promising road in
front of me, I am resuming my work on the personal projects - our lunarcodes.</p>

<p>I wanted to write an app which indexes all the ebooks, movies and songs on my
machine and use amazon or google or any other webservice to fetch meta
information about them - including the cover pictures, popularity, reviews and
any other information that could be possibly useful. I seriously dont want a
bloated webapp for this. A pretty SWT/Swing would be great. Flex would be
brilliant but AFAIK i dont see any good search and index libraries for Flex.
Flex and Java would require a server running which I dont want to. Python, on
the other hand, has Lucene extensions and has good web service support too but
felt that nothing would come close to using the original lucene libraries
instead of extensions.</p>

<p>Ah&#8230; i really love this year.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Installing Flash without Admin rights]]></title>
    <link href="http://arunma.com/2010/01/installing-flash-without-admin-rights/"/>
    <updated>2010-01-06T12:13:14+08:00</updated>
    <id>http://arunma.com/2010/01/installing-flash-without-admin-rights</id>
    <content type="html"><![CDATA[<p>You know why we have the need to install Flash without admin rights&#8230;.</p>

<p>Here is the link</p>

<p><a href="http://www.varesano.net/blog/fabio/installing+flash+player+plugin+fire">http://www.varesano.net/blog/fabio/installing+flash+player+plugin+firefox+wit
hout+having+administrator+access+or+premissions</a></p>

<p>Works great with Firefox 3.x</p>

<p>fox+without+having+administrator+access+or+premissions</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Disturbia]]></title>
    <link href="http://arunma.com/2009/12/disturbia/"/>
    <updated>2009-12-31T12:40:12+08:00</updated>
    <id>http://arunma.com/2009/12/disturbia</id>
    <content type="html"><![CDATA[<p>It&#8217;s a wonderful day, the last day of the year and I was eagerly looking
forward to the first new year in Singapore with my family. I was extra happy
to leave for office this morning, being a half day on new years eve.</p>

<p>But here comes the spoiler. As i entered the train, i saw one young chinese
woman with a very small kid in hand STANDING near the door in front of the
priority seat. I was amazed and eager to see who has more priority to sit in
the seat if this woman does not. To my shock and dismay i found a young local
sitting and doing the &#8220;sleep act&#8221;. He looked up and saw the woman with the kid
and then just continued. I was petrified.</p>

<p>Yes. Curse me all you want. I didnt have the balls to ask him to offer the
seat but an Indian woman nearby called him and requested him. The guy was
ignoring the first couple of requests and when the Indian woman touched him
gently and asked him, the guy was &#8220;CANT YOU SEE THAT I AM A LITTLE BUSY&#8221;. WHAT
the hell??? BUSY? really? For God&#8217;s sake he is sleeping on a freaking priority
seat. I thought the woman had the right to be seated. The North-East line just
went a little further to mark the seat as &#8220;Reserved Seat&#8221; just so that these
morons be a little more sensible. I was so shocked and couldnt even read a
single line out of my book after that wondering &#8220;can somebody be this rude?&#8221;.</p>

<p>I can&#8217;t now help think of my middle aged aunt in India who underwent uterus
removal 5 years ago. Post-surgery she got a tummy which gave her the &#8220;pregnant
look&#8221;. She used to joke telling that everytime she got into a bus she was
offered a seat. If you are not aware, Indian buses are jam packed. She also
used to say that she gently refuses the offer (and sometimes even shout if
they still insist).</p>

<p>I am definitely not blaming the entire singaporean community. I have seen very
generous and wonderful human beings here. I have seen middle-aged women offer
seats to my wife even when we had our kid on a pram. I have seen lots of young
girls and guys promptly offer seats to the elderly. But there are the sleepers
too.. who simply cannot be woken up.</p>

<p>I just hope that the discourteous few prevent the contagious coma from
spreading. (And i just hope that i can sleep tonight without feeling guilty
that i didn&#8217;t do anything about it)</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Fej2Me - Upcoming tasks]]></title>
    <link href="http://arunma.com/2009/12/fej2me-upcoming-tasks/"/>
    <updated>2009-12-15T17:19:19+08:00</updated>
    <id>http://arunma.com/2009/12/fej2me-upcoming-tasks</id>
    <content type="html"><![CDATA[<p>This weekend, i managed to migrate a few core portions of Fetch2Me from Python
to Java. It was an amazing experience and a wonderful feeling to be bilingual.
Though the Java version looks more elegant (to me), i personally loved my
Python. The &#8220;the first project in Python&#8221; feeling&#8230;</p>

<p>So, here are the upcoming tasks in the Java version :</p>

<p><strong>1) SMS Service : </strong>SMS service is not a part of the the system right now.
Implement SMS service into fej2me through Google Voice account</p>

<p><strong>2) Encryption : </strong> The config.xml used in the project has plaintext &#8220;mail id
and password&#8221;.  I was thinking on the lines of AES having an external private
key stored in a non-project folder without which the password hash would not
make any sense.</p>

<p><strong>3) Use JavaMail instead of Commons Email :</strong> I happen to use Apache Commons
email instead of for sending mails (SMTP) because it looked simple. But later
i realised that we cant attach streams. What i am currently doing is that i am
attaching an URL directly to the email like</p>

<p><code>emailAttachment.setURL(new URL(http://www.google.com));</code></p>

<p>which is good for our current needs but will limit our options. Plain JavaMail
on the other hand will use a DataSource which will give us a lot of options.</p>

<p><strong>4) Apache HttpClient : </strong>As of now, the URL is directly attached to the
email. What if the target URL is down or isnt even an URL. We would want to
use HttpClient to ping the URL and check whether the status code returned is
200.</p>

<p><strong>5) Search functionality using Google AJAX search and JSON :</strong> Google search
or Wiki search (idea by Rajesh) is not a part of the system right now. Need to
use Google Ajax API and JSON to pull data from Google. Please refer to
http://code.google.com/apis/ajaxsearch/documentation/</p>

<p>You might get some additional ideas on Book search, Movie search from the
following URL (Idea by Dinesh)</p>

<p>http://code.google.com/apis/ajax/playground/#hello_world</p>

<p><strong>6) Interactive browsing using Apache HttpUtils (functionality similar to
Mechanize/Beautiful soup) :</strong> Use HttpUtils/HttpClient to simulate user
browsing with Java. This will open a whole world of accessing authenticated
systems.</p>

<p><strong>7) Recurring updates using Quartz scheduler : </strong> Everybody would like to
have recurring updates from sites, say like cricinfo or nseindia. users should
be able to set a recurring job with us and get updates. something like..
&#8220;between 1 pm and 8 pm, get updates from
http://www.cricinfo.com/nzvpak2009/engine/current/match/423780.html&#8221; every 1
minute&#8221;. we should enable persisted scheduling using a backend database (which
is also available with quartz)</p>

<p><strong>8) Multithreaded processing :</strong> Currently, the processing and handling of
requests is sequential. We have to think about exploiting ThreadPool API to
process multiple requests.</p>

<p><strong>9) Quartz scheduler with BigTable/HBase :</strong> This is totally optional, but
somebody is yet to come up with a Quartz scheduler extension using the backend
as HBase. May be&#8230; may be&#8230; we could think of that. Though, HBase is good
for large data, it is still an idea worth considering. Optionally, if we have
a need to store large data into our systems, we could consider HBase.. Just
for the fun of it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[Lunarcodes - Coding when the moon goes up]]></title>
    <link href="http://arunma.com/2009/12/lunarcodes-coding-when-the-moon-goes-up/"/>
    <updated>2009-12-09T03:37:44+08:00</updated>
    <id>http://arunma.com/2009/12/lunarcodes-coding-when-the-moon-goes-up</id>
    <content type="html"><![CDATA[<p>After a lot of thought over the weekend, I decided to rewrite Fetch2Me in
Java. Not that Python is bad. Python is brilliant. However, i felt that my
code quality in Java (from where i come) is not yet production standard. Over
the past year, i had the opportunity to open up a lot of open source projects
and realised that my code quality is horrible. HORRIBLE !!!</p>

<p>So, this is the plan i came up with.  Bring together our old NIIT gang and -</p>

<p>1)    Rewrite Fetch2Me in Java using HttpUnit and Java Mail API</p>

<p>2)    Expose the core functionality of Fetch2Me as a REST service</p>

<p>3)    Write a front end for web access to the REST service. Typically we
should be writing a Inbox like web page for checking gmail (or any mail for
that case), sending mails (with and without attachments). This front end will
be written using GWT and Guice.</p>

<p>4)    Write a Firefox plugin similar to the requirement in (3)</p>

<p>5)    SMS service should also be exposed as REST service.</p>

<p>Use Maven for build purposes and Git for source control.  Optionally use
Hudson for continuous integration and come up with an Eclipse plugin. Write
lots and lots of of JUnit test cases.  My gut feeling is that this should take
at least a few months development time.</p>

<p>I am sure there are a million products out there which does the same thing but
there are two important highlights in this effort.</p>

<p>1)  We get to learn a lot of new things, open up the source code of lot of
other open source projects, started reading PHP, ASP.net, C#, Ruby, Python
(and convert them to Java) &#8211; all those which we wouldnt have done in our day
job. I thought we could learn by mistakes - both development and design, we
could refactor the code as much as we want at any point of time in the project
(we understand that optimizing early is a crime).</p>

<p>and</p>

<p>2)  Soon after we are done with increments in the project, we&#8217;ll open source
it. People can just pick our code and host it in their domain and call it a
day. I am sure many will find interest in our work and hopefully start using
it.</p>
]]></content>
  </entry>
  
  <entry>
    <title type="html"><![CDATA[The Dominoes and the birth of Fetch2Me]]></title>
    <link href="http://arunma.com/2009/10/the-dominoes-and-the-birth-of-fetch2me/"/>
    <updated>2009-10-27T08:25:41+08:00</updated>
    <id>http://arunma.com/2009/10/the-dominoes-and-the-birth-of-fetch2me</id>
    <content type="html"><![CDATA[<p>Over the past few weeks a lot of things are happening in my life and i feel
really guilty of not jotting them down in here. Its amazing how naturally
things evolve and looking back you think everything happened so fast.</p>

<p>I was talking to my wife a couple of days back on how all things in my life
fell in place naturally, like the neatly arranged dominos, and how much God is
great that we can never have the faintest idea of what he thinks and what he
has in store for us.</p>

<p>Myself and Rajesh always had the inner fire to do something big and our focus
has always been a new &#8220;idea&#8221; - something which dazzles. And we were pretty
sure that no idea falls from the roof. We have to be into a lot of ideas to
have a new perspective to see ours. We always felt that it is always not about
the money. And, I, for one reason felt that contributing to open source is
&#8220;the idea&#8221; to have something meaningful in your life.</p>

<p>This blog is not about how things went on well and how we achieved the &#8220;idea&#8221;
but how bad things could go and we still have our &#8220;dream of the youth&#8221; alive
and active.</p>

<p>I left for Singapore and a couple of months later Rajesh got laid off from
Merrill. Recession hit badly all over and the only thing i could think of is
to pray that i retain my job. Simply because i dont want to depend on my
parents when my kid is born. Rajesh got his engagement cancelled and was at
home for 9 months. If i were him, with my family, i am not sure how my
reaction would be. It could either be a &#8220;face what may come&#8221; or &#8220;hibernate for
winter&#8221;.  Looking back at myself and my reaction to various &#8220;things&#8221; that
happened in my life, I am sure i would have given the situation a cold
shoulder. But then there is this new addition to the situation called family.
Nevertheless, Rajesh&#8217;s situation really scared me a lot. He was unable to find
a job despite being one hell of a developer. The calls are simply not coming
his way, leave alone interviews.</p>

<p>Singapore is a good place to live but still this is not my home. I wanted to
go back and i was unable to. That was when i told to myself that none of
things that happened in my life is entirely shaped by me. And i am not going
to whine anymore. I decided to take up technical reading more seriously and
got the national library membership. Singapore&#8217;s NLB has a very limited
collection of technical books and that motivated me even more. I resolved that
i am going to finish off the entire IT section (except of course, those scary
looking System 3 manuals)</p>

<p>I read the truly random books and some <a href="http://stackoverflow.com/questions/82639/how-to-become-a-better-">recommended ones</a>. Among the many
interesting books which gives that wonderful satisfaction at the last page, I
had to meekly admit that once in a while, i had to return some books half way
to pick another. One amongst the beautiful ones is <a href="http://www.amazon.com/Dreaming-Code-Programmers-Transcendent-">&#8220;Dreaming in code&#8221;</a> -
the journey of <a href="http://chandlerproject.org/">Chandler</a> and its team. It gave a lot of insight into how
everybody starts small and everybody makes mistakes. But then, they all had a
bigger dream and they were focussed. The grit and the patience of <a href="http://en.wikipedia.org/wiki/Mitch_Kapor">Mitch
Kapor</a> all through the project was beautiful. I am yet to see a truly
impressive tool like Chandler. Even today, I composed a mail (outlook) to our
corporate technical group appreciating their efforts on a recent technical
event. I then mentioned in the mail that we should be meeting tomorrow to see
what we can do next. Only then i realised i actually needed a meeting request.
So, i copied all the contents, composed a new meeting request and pasted the
contents and then started typing in the whole &#8220;To&#8221; list. In Chandler, it is
just ONE FREAKING CLICK !!! Your mail is converted to a meeting request.</p>

<p>The <a href="http://stackoverflow.com/questions/82639/how-to-become-a-better-">&#8220;better programmer&#8221;</a> link and &#8220;Dreaming in code&#8221; made me want to learn
Python. Meanwhile, Rajesh started doing projects of his own. He fell in love
with Rails and became a fan of Ruby. The speed of Python and the quantity of
code needed to be written to do something useful was amazing. List
comprehensions and slicing had me dumbstuck. After reading &#8221;<a href="http://www.amazon.com/Learning-Python-Second-Mark-Lutz/dp/0596002815">Learning in
Python</a>&#8221;, I wanted to write something USEFUL. Rajesh got through Tech
Mahindra as a contractor and moved to Pune. He didnt have internet access in
office. And that was the birth of Fetch2Me - the name fondly given by my
wonderfully best friend &#8220;Mirth Machine&#8221; Gaurav. Fetch2Me was a simple screen
scraping application and it had a simple raison d&#8217;etre. Use your corporate id
and send the url as the subject to fetch2me AT gmail DOT com and it will fetch
the page. If the subject could not be resolved to a valid url, respond with
the google results of the search string. But then, all my friends wanted more
out of the project. I am not saying that this is all I had in mind from the
start but I am considering this as a start - to be useful. Stay tuned.</p>

<p>programmer</p>

<p>Software/dp/1400082463</p>
]]></content>
  </entry>
  
</feed>
