<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" version="2.0">

<channel>
	<title>Veerasundar</title>
	
	<link>http://veerasundar.com/blog</link>
	<description>Web app developer.</description>
	<lastBuildDate>Sat, 23 Feb 2013 21:02:12 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<feedburner:info uri="veerasundar" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/veerasundar/dreamz" /><feedburner:info uri="veerasundar/dreamz" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/</creativeCommons:license><feedburner:emailServiceId>veerasundar/dreamz</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Loading Raphael JS via require JS</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/96UdjnfcrjY/</link>
		<comments>http://veerasundar.com/blog/2013/02/loading-raphael-js-via-require-js/#comments</comments>
		<pubDate>Sat, 23 Feb 2013 18:47:35 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[commonjs]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[module]]></category>
		<category><![CDATA[raphael]]></category>
		<category><![CDATA[requirejs]]></category>
		<category><![CDATA[svg]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3515</guid>
		<description><![CDATA[Raphael, the SVG JavaScript library, does not support require JS (yet). When loaded via require('raphael'), the code breaks throwing 'eve is not defined' error in the console. There is a year long issue thread going on regarding this issue, but still there is no official fix yet. Anyway, in the same thread, people started providing [...]]]></description>
				<content:encoded><![CDATA[<p>Raphael, the SVG JavaScript library, does not support require JS (yet). When loaded via <code>require('raphael')</code>, the code breaks throwing <code>'eve is not defined'</code> error in the console. There is a year long <a title="raphael breaks if loaded via require-js." href="https://github.com/DmitryBaranovskiy/raphael/issues/524" target="_blank">issue thread</a> going on regarding this issue, but still there is no official fix yet.</p>
<p>Anyway, in the same thread, people started providing patches that fix this issue (for time being). And in one of the project, I saw the Raphael source code split into different files and converted to CommonJS module pattern.</p>
<p>I took the liberty to extract only the raphael-js modules and put them together in this Github repo: <a title="raphael-js source split into modules so that it can be loaded via require-js" href="https://github.com/vraa/raphael-require" target="_blank">https://github.com/vraa/raphael-require</a></p>
<p>So, if you have a need, please feel free to use the above repo and let me know if you face any issues.</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/HGOQhXSo5I8" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=96UdjnfcrjY:1rr4isjLbg8:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=96UdjnfcrjY:1rr4isjLbg8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=96UdjnfcrjY:1rr4isjLbg8:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=96UdjnfcrjY:1rr4isjLbg8:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=96UdjnfcrjY:1rr4isjLbg8:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=96UdjnfcrjY:1rr4isjLbg8:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=96UdjnfcrjY:1rr4isjLbg8:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=96UdjnfcrjY:1rr4isjLbg8:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/96UdjnfcrjY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2013/02/loading-raphael-js-via-require-js/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2013/02/loading-raphael-js-via-require-js/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/HGOQhXSo5I8/</feedburner:origLink></item>
		<item>
		<title>Help Vinodhini!</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/0BnXjB4ZRMw/</link>
		<comments>http://veerasundar.com/blog/2013/01/help-vinodhini/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 03:49:42 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[campaign]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[vinodhini]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3493</guid>
		<description><![CDATA[tldr; http://www.helpvinodhini.com/ She didn&#8217;t do anything wrong except being born as a woman in India. It&#8217;s a shameless society that we live in. At 23, J Vinodhini was her parents’ only pillar of support. When she joined an engineering college in Karaikal district in Puducherry for a B.Tech. (information technology) course, her parents, Jayapal and Saraswati, [...]]]></description>
				<content:encoded><![CDATA[<p>tldr; <a href="http://www.helpvinodhini.com/">http://www.helpvinodhini.com/</a></p>
<p>She didn&#8217;t do anything wrong except being born as a woman in India. It&#8217;s a shameless society that we live in.</p>
<blockquote><p><img class="alignleft size-full wp-image-3496" alt="Help Vinodhini" src="http://veerasundar.com/blog/wp-content/uploads/2013/01/vinodhini.jpg" width="355" height="270" />At 23, J Vinodhini was her parents’ only pillar of support. When she joined an engineering college in Karaikal district in Puducherry for a B.Tech. (information technology) course, her parents, Jayapal and Saraswati, sold their small plot of ancestral property to finance her education. They too moved to Karaikal, where Jayapal got a job as a watchman at a school.</p>
<p>About three months back, Vinodhini joined a private company in Chennai after completing her education, bringing hope and joy to her parents. But all their dreams shattered on November 14, when Vinodhini suffered an acid attack by a spurned suitor that has left her blind in both her eyes.</p>
<p>The accused has been identified as Suresh Kumar, alias Appu, 32, an engineering diploma holder who runs a business renting out concrete mixer machine. Kumar had reportedly expressed an interest in Vinodhini, after which she had informed her parents. Jayapal had complained to the local police, who summoned Kumar and issued a warning. He was made to give a written assurance that he would not trouble Vinodhini.</p>
<p>On November 14, Vinodhini, accompanied by Jayapal and a family friend, Padmanabhan, was on her way to the bus station at about 10:30 pm when Kumar reportedly threw acid on her. Having gone home for Diwali, Vinodhini was to return to Chennai that night. Kumar has since been arrested.</p>
<p>Vinodhini suffered 40 per cent burns in the acid attack, including injuries to her face, chest and hand. Both her eyes were severely damaged. Jayapal and Padmanabhan were also injured in the attack. Kumar himself suffered 10 per cent burn injuries.</p>
<p>Vinodhini was rushed to a local hospital, from where she was later shifted to JIPMER hospital. From there, she was referred to the Government Kilpauk Medical College Hospital in Chennai for specialised treatment. While her condition is now stable, both her eyes have been irreparably damaged. Doctors are waiting for the wounds to heal so that they can remove what is left in the sockets.</p>
<p>“In usual cases of burns due to fire, the eyes are saved because we involuntarily close our eyes tight. However, in the case of acid attacks, it takes a moment for the victim to realise what is happening. In Vinodhini’s case, it was a direct hit on the face, causing serious injuries. The acid burned her eyes completely. We now have to wait and treat her over the next few weeks before removing what is left there. We will then do a reconstruction and fix artificial eyes, which will happen in the next three to six months,” said V Jayaraman, who has been treating her.</p>
<p>Outside the burns ward, her parents keep vigil. The despair is evident on their faces.</p></blockquote>
<p>Even a small amount you donate will bring lots of hope to <strong>Vinodhini </strong>and humanity! Do your part and ask your friend to do theirs!</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/5g8t4piPLDY" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=0BnXjB4ZRMw:_WsiYvzjFVg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=0BnXjB4ZRMw:_WsiYvzjFVg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=0BnXjB4ZRMw:_WsiYvzjFVg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=0BnXjB4ZRMw:_WsiYvzjFVg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=0BnXjB4ZRMw:_WsiYvzjFVg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=0BnXjB4ZRMw:_WsiYvzjFVg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=0BnXjB4ZRMw:_WsiYvzjFVg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=0BnXjB4ZRMw:_WsiYvzjFVg:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/0BnXjB4ZRMw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2013/01/help-vinodhini/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2013/01/help-vinodhini/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/5g8t4piPLDY/</feedburner:origLink></item>
		<item>
		<title>Underscore.js and guid function</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/SCnlKd0H9B0/</link>
		<comments>http://veerasundar.com/blog/2013/01/underscore-js-and-guid-function/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 16:18:17 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[backbone]]></category>
		<category><![CDATA[guid]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[underscore]]></category>
		<category><![CDATA[uuid]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3485</guid>
		<description><![CDATA[Underscore library comes with the uniqueId() function that generates globally unique IDs to use in code. But it was not enough for my Backbone models as I needed the IDs to be unique across  invocations and users, i.e. something like UUID. I have been using this code snippet to generate pseudo unique IDs for sometime. Since it&#8217;s [...]]]></description>
				<content:encoded><![CDATA[<p>Underscore library comes with the <a title="UniqueId function to generate globally unique IDs" href="http://underscorejs.org/#uniqueId" target="_blank">uniqueId()</a> function that generates globally unique IDs to use in code. But it was not enough for my <a title="Backbone JS Hello World" href="http://veerasundar.com/blog/2012/01/backbone-js-hello-world-tutorial/">Backbone</a> models as I needed the IDs to be unique across  invocations and users, i.e. something like <a title="Universally unique identifier" href="http://en.wikipedia.org/wiki/Universally_unique_identifier" target="_blank">UUID</a>.</p>
<p>I have been using <a title="guid in JavaScript" href="http://stackoverflow.com/a/2117523/42372" target="_blank">this code snippet</a> to generate pseudo unique IDs for sometime. Since it&#8217;s a utility function and it made lots of sense to move it to Underscore itself. Here&#8217;s how I did it.</p>
<pre>_.mixin({
    guid : function(){
      return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
        var r = Math.random()*16|0, v = c == 'x' ? r : (r&amp;0x3|0x8);
        return v.toString(16);
      });
    }
  });</pre>
<p>Once the above code is in place, then creating a unique ID is as simple as calling <em>_.guid()</em>.</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/p1kLydWm0us" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SCnlKd0H9B0:_5tjCHqFSuw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SCnlKd0H9B0:_5tjCHqFSuw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SCnlKd0H9B0:_5tjCHqFSuw:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SCnlKd0H9B0:_5tjCHqFSuw:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SCnlKd0H9B0:_5tjCHqFSuw:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SCnlKd0H9B0:_5tjCHqFSuw:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SCnlKd0H9B0:_5tjCHqFSuw:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SCnlKd0H9B0:_5tjCHqFSuw:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/SCnlKd0H9B0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2013/01/underscore-js-and-guid-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2013/01/underscore-js-and-guid-function/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/p1kLydWm0us/</feedburner:origLink></item>
		<item>
		<title>Looking back and forward (2012)</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/7TspthD4DgM/</link>
		<comments>http://veerasundar.com/blog/2012/12/looking-back-and-forward-2012/#comments</comments>
		<pubDate>Mon, 31 Dec 2012 03:05:15 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[2012]]></category>
		<category><![CDATA[anniversary]]></category>
		<category><![CDATA[new-year]]></category>
		<category><![CDATA[resolution]]></category>
		<category><![CDATA[retrospection]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3461</guid>
		<description><![CDATA[Ever since I started blogging, during end of the year I used to write a retrospection of things I did in that year. It has kinda become a tradition to me and an excuse for a new post. As the year 2012 has only a day of fuel left in it, let me stop and look back. Last year [...]]]></description>
				<content:encoded><![CDATA[<p>Ever since I started blogging, during end of the year I used to write a <a title="New year retrospection" href="http://veerasundar.com/blog/tag/new-year/" target="_blank">retrospection of things</a> I did in that year. It has kinda become a tradition to me and an excuse for a new post. As the year <strong>2012 </strong>has only a day of fuel left in it, let me stop and look back.</p>
<h2>Last year resolutions:</h2>
<p>You follow them or not, but you must make a list of new years resolutions. So, did I. For 2012, I had <a title="Looking back and forward (2011)" href="http://veerasundar.com/blog/2011/12/looking-back-and-forward/">three things</a> in my mind.</p>
<ol>
<li><span style="line-height: 14px;">Release <span style="line-height: 14px;"><strong>treesk.com </strong>- it&#8217;s my web app that I&#8217;ve started working on during the first quarter of 2012. Initially I planned to release it before 2012, but due to some personnel setbacks (definitely not because of <em>Mayans&#8217;s</em>), I couldn&#8217;t. But I&#8217;m quite happy with its current progress. The 0.9 version of it &#8216;<em>almost</em>&#8216; ready and I&#8217;m hoping that the 1.0 version will see the light before first quarter of 2013.</span></span></li>
<li><span style="text-decoration: line-through;">Get a new job</span> &#8211; I did kinda get a <em>new </em>job. I mean, I joined <em>PayPal </em>again. Even though I worked at PayPal for last 2 years, I was a CSC employee then. Last year, I directly joined PayPal. Not sure what 2013 has in its store for my career! <img src='http://veerasundar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
<li>Improve skills in photography &#8211; totally nuked this. I hardly took out my Camera last year (apart from the time when I was in <a href="http://veerasundar.com/blog/2012/09/walking-from-pier-39-to-golden-gate-bridge-photos/">San Jose/San Francisco</a>). Next year, SHOULD.GO.FOR.PHOTO.WALKS.</li>
</ol>
<h2>New year resolutions:</h2>
<ol>
<li><span style="line-height: 14px;">Release <strong>treesk</strong>. Make it reach people. </span></li>
<li>Write. A lot. Get back to blogging. And, possibly an eBook.</li>
<li>Open source <a title="task management app" href="http://www.timethetask.com" target="_blank"><b>timethetask</b></a>.</li>
</ol>
<h2>Some important events:</h2>
<ol>
<li><span style="line-height: 14px;"><a title="Twikural" href="http://twikural.veerasundar.com/" target="_blank">Launched</a> and <a href="http://veerasundar.com/blog/2012/04/open-sourcing-twikural-an-app-engine-project/" target="_blank">open sourced</a> <strong>Twikural</strong>.</span></li>
<li>Became a <a title="Dzone MVB" href="http://java.dzone.com/users/veerasundark" target="_blank">DZone Most Valuable Blogger</a> (MVB).</li>
<li>This blog crossed <strong>1 million </strong>page views.</li>
</ol>
<h2>Stats for veerasundar.com/blog:</h2>
<p><img class="aligncenter size-full wp-image-3463" alt="2012 statistics" src="http://veerasundar.com/blog/wp-content/uploads/2012/12/2012-stats.png" width="640" height="400" /></p>
<h2>Happy new year!</h2>
<p>I take this moment to wish every one of you and your family a <strong>happy and prosperous new year!</strong></p>
<p>So, screw you <em><strong>Mayans </strong></em>and what&#8217;s up <strong><em>2013</em>?</strong><span style="text-decoration: underline;" data-mce-mark="1"><br />
</span></p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/LvN829WooeU" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=7TspthD4DgM:e-O_lStVZqU:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=7TspthD4DgM:e-O_lStVZqU:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=7TspthD4DgM:e-O_lStVZqU:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=7TspthD4DgM:e-O_lStVZqU:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=7TspthD4DgM:e-O_lStVZqU:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=7TspthD4DgM:e-O_lStVZqU:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=7TspthD4DgM:e-O_lStVZqU:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=7TspthD4DgM:e-O_lStVZqU:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/7TspthD4DgM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/12/looking-back-and-forward-2012/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/12/looking-back-and-forward-2012/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/LvN829WooeU/</feedburner:origLink></item>
		<item>
		<title>How to change the default webapp deployment location of Tomcat in Eclipse</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/Kzu7GTuSCnQ/</link>
		<comments>http://veerasundar.com/blog/2012/12/how-to-change-the-default-webapp-deployment-location-of-tomcat-in-eclipse/#comments</comments>
		<pubDate>Mon, 10 Dec 2012 03:46:07 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[tomcat]]></category>
		<category><![CDATA[webapp]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3444</guid>
		<description><![CDATA[When you deploy your Java web application to the Apache Tomcat server, via Eclipse, by default the web app will be deployed under {YOUR_ECLIPSE_WORKSPACE}\.metadata\.plugins\org.eclipse.wst.server.core\tmp{a-number}\wtpwebapps. Suppose if you want to deploy your web app to a location that is easily navigable, follow these steps. First make sure you have removed all the web apps that are currently [...]]]></description>
				<content:encoded><![CDATA[<p>When you deploy your Java web application to the Apache Tomcat server, via Eclipse, by default the web app will be deployed under <strong>{YOUR_ECLIPSE_WORKSPACE}\.metadata\.plugins\org.eclipse.wst.server.core\tmp{a-number}\wtpwebapps</strong>.</p>
<p>Suppose if you want to deploy your web app to a location that is easily navigable, follow these steps.</p>
<ol>
<li>First make sure you have removed all the web apps that are currently added to your server instance (In <em>servers </em>view, right click on the server name and then <em>Add and Remove</em>). After removing the web app, right click on the server and select <em>clean</em>. If you do not do this first, then the option to change the deployment location will stay disabled.</li>
<li>And then double click on the server instance in <em>servers </em>view which will open up that server&#8217;s configuration page.</li>
<li>On that page, see under <em>Server Locations </em>and select either the option <strong>Use Tomcat Installation </strong>to deploy the web app under the directory where the Tomcat server is installed or <strong>Use custom location </strong>to manually specify.</li>
<li>Save, Re-add the web application and then Publish.</li>
</ol>
<div><a href="http://veerasundar.com/blog/wp-content/uploads/2012/12/server-config.png"><img class="aligncenter  wp-image-3446" title="server-config" alt="Tomcat server configuration in Eclipse" src="http://veerasundar.com/blog/wp-content/uploads/2012/12/server-config.png" width="688" height="376" /></a></div>
<p>Now the deployed web app will be under the directory of your choice.</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/lMrhCRK75lg" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=Kzu7GTuSCnQ:xPw_3qnCmaI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=Kzu7GTuSCnQ:xPw_3qnCmaI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=Kzu7GTuSCnQ:xPw_3qnCmaI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=Kzu7GTuSCnQ:xPw_3qnCmaI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=Kzu7GTuSCnQ:xPw_3qnCmaI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=Kzu7GTuSCnQ:xPw_3qnCmaI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=Kzu7GTuSCnQ:xPw_3qnCmaI:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=Kzu7GTuSCnQ:xPw_3qnCmaI:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/Kzu7GTuSCnQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/12/how-to-change-the-default-webapp-deployment-location-of-tomcat-in-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/12/how-to-change-the-default-webapp-deployment-location-of-tomcat-in-eclipse/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/lMrhCRK75lg/</feedburner:origLink></item>
		<item>
		<title>Creating a shortcut to console.log in Sublime Text 2</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/SVoyCJjznlI/</link>
		<comments>http://veerasundar.com/blog/2012/11/creating-a-shortcut-to-console-log-in-sublime-text-2/#comments</comments>
		<pubDate>Fri, 16 Nov 2012 03:08:36 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[echo]]></category>
		<category><![CDATA[editor]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[shortcut]]></category>
		<category><![CDATA[sublime]]></category>
		<category><![CDATA[sublimetext]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3432</guid>
		<description><![CDATA[While writing JavaScript code, I often write debug messages to console using console.log. Though it is shorter than System.out.println() (hey, you Java!), which I am used to a lot, I still find it ineffective to type it every time. So, I was following the approach to bind console.log function to shorter name. Here&#8217;s another technique which is specific to [...]]]></description>
				<content:encoded><![CDATA[<p>While writing JavaScript code, I often write debug messages to console using <strong>console.log. </strong>Though it is shorter than <strong>System.out.println() </strong>(hey, you Java!), which I am used to a lot, I still find it ineffective to type it every time.</p>
<p>So, I was following the approach to <a title="Shortcut to console.log" href="http://veerasundar.com/blog/2012/02/shortcut-to-console-log/">bind console.log function to shorter name</a>. Here&#8217;s another technique which is specific to Sublime Text.</p>
<p>Using Sublime Text <strong>Snippets </strong>option, you can create a shortcut to a template and then you can insert that template in multiple places just by triggering the shortcut. Here&#8217;s how I did it so that every time, I type <strong>echo</strong>, Sublime Text converts it into <strong>console.log();</strong></p>
<ol>
<li>Go to <strong>Tools -&gt; New Snippet&#8230;</strong></li>
<li>Sublime will open a template in a new file. Now make sure you have this content in that file (or change it the way you want).
<pre>&lt;snippet&gt;
  &lt;content&gt;&lt;![CDATA[
console.log();
]]&gt;&lt;/content&gt;
  &lt;!-- Optional: Set a tabTrigger to define how to trigger the snippet --&gt;
  &lt;tabTrigger&gt;echo&lt;/tabTrigger&gt;
  &lt;!-- Optional: Set a scope to limit where the snippet will trigger --&gt;
  &lt;scope&gt;source.js&lt;/scope&gt;
&lt;/snippet&gt;</pre>
</li>
<li>Then save this snippet file as <strong>echo.sublime-snippet </strong>under <strong>Packages/User </strong>folder. To find the location of <strong>Packages/User </strong>folder, in Sublime, go to <strong>Preferences -&gt; Browser packages </strong>and note the location.</li>
<li>Restart sublime and then in a JavaScript file, start typing <strong>echo </strong>and Sublime will provide you with a drop down to replace <strong>echo </strong>with the template you just created.</li>
</ol>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/evbxHQ8xynI" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SVoyCJjznlI:Q5Ih2eyLYO4:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SVoyCJjznlI:Q5Ih2eyLYO4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SVoyCJjznlI:Q5Ih2eyLYO4:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SVoyCJjznlI:Q5Ih2eyLYO4:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SVoyCJjznlI:Q5Ih2eyLYO4:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SVoyCJjznlI:Q5Ih2eyLYO4:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=SVoyCJjznlI:Q5Ih2eyLYO4:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=SVoyCJjznlI:Q5Ih2eyLYO4:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/SVoyCJjznlI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/11/creating-a-shortcut-to-console-log-in-sublime-text-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/11/creating-a-shortcut-to-console-log-in-sublime-text-2/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/evbxHQ8xynI/</feedburner:origLink></item>
		<item>
		<title>Day one of JSFoo</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/y8DWP1EiPWU/</link>
		<comments>http://veerasundar.com/blog/2012/10/day-one-of-jsfoo/#comments</comments>
		<pubDate>Fri, 19 Oct 2012 14:57:02 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bangalore]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[js]]></category>
		<category><![CDATA[jsfoo]]></category>
		<category><![CDATA[nimhans]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3416</guid>
		<description><![CDATA[Day one of JSFoo is just got over. Went to the event with lot of expectations and came back with some new ideas/topics to explore. Here&#8217;s a summary of what I learnt from today&#8217;s sessions. Except the keynote, rest of the sessions simultaneously happened in two tracks. So, I had to opt for one session [...]]]></description>
				<content:encoded><![CDATA[<p>Day one of <a href="http://jsfoo.in">JSFoo</a> is just got over. Went to the event with lot of expectations and came back with some new ideas/topics to explore. Here&#8217;s a summary of what I learnt from today&#8217;s sessions.</p>
<p>Except the keynote, rest of the sessions simultaneously happened in <a href="http://jsfoo.in/2012/#schedule">two tracks</a>. So, I had to opt for one session while missing the other one. Anyway, the organizers seems to be recording the whole event. So, I hope I can catch up with the sessions I missed later in video format.</p>
<p>The first session I chose was &#8220;<strong>Scaling node at Errorception</strong>&#8221; by <a title="Errorception" href="http://errorception.com/">Errorception</a> founder, <a title="Rakesh Pai" href="http://blog.rakeshpai.me/">Rakesh Pai</a>. As I&#8217;m exploring node for my own web app, its very obvious for me to go for this. The speaker talked about how he&#8217;s running Errorception on Node + Mongodb stack. The highlights from his speech was:</p>
<ol>
<li>Don&#8217;t write monolithic app. Instead break them into several micro apps (front end, queue processor, etc). This helps you to maintain it without much pain and deploy/take down the apps without affecting each other.</li>
<li>Build a Queue layer for inter-app communication. That way, even if you take down a app, the messages won&#8217;t be lost and they&#8217;ll just be there in the queue until your app pick them up. He seems to be using <strong>redis </strong>for this purpose at Errorception.</li>
<li>CPU bound app? Run away from node.</li>
</ol>
<p>Then there was a 30 minutes of Q/A session about &#8220;<strong>Web Storage</strong>&#8220;. The presenter talked about different options for storing data locally at browser. It was new information to me that developers (ab)used the <strong>window.name </strong>property in order to persist data. This hack is totally an insecure way to preserve data and should never be considered for anything secure.</p>
<p>After a delicious lunch (I always complain about food in Bangalore, so when I say delicious, it is DELICIOUS!), I sit there in the &#8220;<strong>Create JS</strong>&#8221; session by <a href="http://hsivaram.com/">Harish Sivaramakrishnan</a>.<strong> </strong>He totally inspired the audience by building a game from scratch in 45 minutes using <a href="http://www.createjs.com/#!/CreateJS">CreateJS</a> library. This library lets you to draw objects on Canvas instead of directly manipulating pixels by hand. A totally cool JS lib and if you are into game/visual programming using Canvas, you shouldn&#8217;t miss this one.</p>
<p>The final sessions I attended were about using JQuery Deferred instead of inner-nesting callbacks and I18N Wikimedia libraries. Both provided some good information which I&#8217;ll be using in my next projects.</p>
<p>Final session of the day was from Rakesh Pai who demoed his project of Controlling a toy car using Node server. He&#8217;d integrated the toy car with the Raspberry pi computer and ran the node server in it. A cool hardware hack, received great appreciation from the crowd.</p>
<p>With that the first day got over.</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/sWk_bdiwlc8" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=y8DWP1EiPWU:2WXRyWeKW3c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=y8DWP1EiPWU:2WXRyWeKW3c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=y8DWP1EiPWU:2WXRyWeKW3c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=y8DWP1EiPWU:2WXRyWeKW3c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=y8DWP1EiPWU:2WXRyWeKW3c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=y8DWP1EiPWU:2WXRyWeKW3c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=y8DWP1EiPWU:2WXRyWeKW3c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=y8DWP1EiPWU:2WXRyWeKW3c:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/y8DWP1EiPWU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/10/day-one-of-jsfoo/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/10/day-one-of-jsfoo/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/sWk_bdiwlc8/</feedburner:origLink></item>
		<item>
		<title>Eclipse refactoring on steroids</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/jvlWlbXaeBI/</link>
		<comments>http://veerasundar.com/blog/2012/10/eclipse-refactoring-on-steroids/#comments</comments>
		<pubDate>Thu, 18 Oct 2012 08:34:32 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[best-practice]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[ide]]></category>
		<category><![CDATA[refactoring]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3383</guid>
		<description><![CDATA[In my last post about common Java violations, I listed a set of mistakes that java developers tend to make. While refactoring a Java project with the objective to resolve those violations, I used the refactoring features of Eclipse extensively to quickly change the code. Below is the compilation of such refactoring techniques. 1. Adding [...]]]></description>
				<content:encoded><![CDATA[<p>In my last post about <a title="common code violations in Java" href="http://veerasundar.com/blog/2012/09/common-code-violations-in-java/">common Java violations</a>, I listed a set of mistakes that java developers tend to make. While refactoring a Java project with the objective to resolve those violations, I used the refactoring features of Eclipse extensively to quickly change the code. Below is the compilation of such refactoring techniques.</p>
<h2>1. Adding curly braces around block level statements</h2>
<p>It is often a good practice to wrap the block level statements with {curly braces}. But still, if there is only one statement in the block, then some developers prefer not to wrap them with {}. But Checkstyle will complain if you do so.</p>
<p>If you want to change this,</p>
<pre>if(condition) 
    doSomething;</pre>
<p>to this:</p>
<pre>if(condition){
    doSomething();
}</pre>
<p>Eclipse&#8217;s <strong>source cleanup </strong>is there for your help.</p>
<ol>
<li> In <em>Project Explorer, </em>right click on the source folder and select <em>Source -&gt; Clean up&#8230;</em><a href="http://veerasundar.com/blog/wp-content/uploads/2012/10/use-block-statements.png"><img class="alignright size-medium wp-image-3389" title="use-block-statements" src="http://veerasundar.com/blog/wp-content/uploads/2012/10/use-block-statements-300x151.png" alt="using source clean up to add curly braces around block statements" width="300" height="151" /></a></li>
<li>Choose <em>Use custom profile </em>and then click <em>configure </em>next to the custom profile section.</li>
<li>By default, clean up action is configured to do multiple cleanup task. Since we are focused only on adding curly braces, we will disable all other cleanup tasks. To do this, navigate to all the tabs in the <em>Custom Clean ups </em>window and deselect all the cleanups.</li>
<li>Then in the <em>Code Style </em>tab, select the <em>Use blocks in if/while/for/do statements </em>option and click <em>OK.</em></li>
<li>Then in <em>Clean Up </em>dialog, click <em>Next </em>and the refactoring will occur. You&#8217;ll be presented with a review page with the changes made.</li>
</ol>
<h2>2. Joining to if statements into one</h2>
<p>Lets say, you have a code like this:</p>
<pre>if(isLoggedIn){
  if(isAdmin){
    doSecretStuff();
  }
}</pre>
<p>It is safe to combine the two <em>if</em> statements into one, unless you have some other code in between the two <em>if </em>statements. Of course, you can manually edit the code to remove the second if and move the condition to up. But wait, when Eclipse can do this for us, why should we do it ourselves?<img class="alignright size-full wp-image-3400" title="join-if-statements" src="http://veerasundar.com/blog/wp-content/uploads/2012/10/join-if-statements.png" alt="Join inner if statement with outer if statements" width="294" height="107" /></p>
<ol>
<li>Place your cursor on the <em>if </em>keyword of the inner <em>if </em>statement.</li>
<li>Press <em>Ctrl + 1 </em>which will open a context menu.</li>
<li>Select the option <em>Join &#8216;if&#8217; statement with outer &#8216;if&#8217; statement</em>.</li>
<li>Voila! the two if statements are now combined into one.</li>
</ol>
<p>You&#8217;ll get:</p>
<pre>if(isLoggedIn &amp;&amp; isAdmin){
  doSecretStuff();
}</pre>
<h2>3. Renaming a filed and its getter / setter methods</h2>
<p>According to a <a title="Eclipse: Most useful refactorings" href="http://stackoverflow.com/a/1858592/42372" target="_blank">this</a>, renaming an element is the mostly used refactoring in Eclipse. So, when you rename a field which has setter/getter methods, you&#8217;d manually rename those method names. But Eclipse can help here to simplify this.<a href="http://veerasundar.com/blog/wp-content/uploads/2012/10/rename-field-getter-setter.png"><img class="alignright size-medium wp-image-3407" title="rename-field-getter-setter" src="http://veerasundar.com/blog/wp-content/uploads/2012/10/rename-field-getter-setter-300x157.png" alt="" width="300" height="157" /></a></p>
<ol>
<li>Place your cursor on the field name that you want to rename.</li>
<li>Press <em>Ctrl + Shift </em>and then press <em>R key </em>two times continuously which will open the &#8216;<em>Rename Field&#8217; </em>dialog box.</li>
<li>Check the options &#8216;Rename getter&#8217; and &#8216;<em>Rename setter&#8217;</em> while providing a new name to your field.</li>
<li>On clicking OK, this will rename the field as well as its getter/setter methods.</li>
</ol>
<h2>4. Inverting <em>if </em>statement</h2>
<p>Suppose you have a code like this:</p>
<pre>if(!isLoggedIn){
  // ask to login
}else{
  // allow access
}</pre>
<p>Above code is 100% valid. But code quality tools such as Checkstyle might complain, because we are using a negativity check in the first condition (i.e. <em>!isLoggedIn</em>). When you have only one case (just the if block), then we can&#8217;t do much about it. But when you have both <em>if </em>and <em>else</em>, then you can just invert the conditions to avoid this scenario.</p>
<ol>
<li>Place your cursor on the first <em>if </em>keyword.</li>
<li>Press <em>Ctrl + 1 </em>and then select <em>Invert &#8216;if&#8217; statement</em>.</li>
<li>Eclipse will invert the conditions and the corresponding blocks.</li>
<li>Finally you&#8217;ll get:
<pre>if(isLoggedIn){
  // allow access
}else{
  // ask to login
}</pre>
</li>
</ol>
<p>Helps to improve the readability of the code.</p>
<h2>Conclusion:</h2>
<p>Of course, the above are just the tip of the iceberg. Eclipse is capable of doing much-more advanced refactoring. So, what are <strong>your</strong> secret refactoring techniques?</p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/xH5xrDp75m0" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=jvlWlbXaeBI:P0yvVJVpRMg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=jvlWlbXaeBI:P0yvVJVpRMg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=jvlWlbXaeBI:P0yvVJVpRMg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=jvlWlbXaeBI:P0yvVJVpRMg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=jvlWlbXaeBI:P0yvVJVpRMg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=jvlWlbXaeBI:P0yvVJVpRMg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=jvlWlbXaeBI:P0yvVJVpRMg:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=jvlWlbXaeBI:P0yvVJVpRMg:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/jvlWlbXaeBI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/10/eclipse-refactoring-on-steroids/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/10/eclipse-refactoring-on-steroids/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/xH5xrDp75m0/</feedburner:origLink></item>
		<item>
		<title>Walking from Pier 39 to Golden Gate bridge – photos</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/_GX_Xf-hdaQ/</link>
		<comments>http://veerasundar.com/blog/2012/09/walking-from-pier-39-to-golden-gate-bridge-photos/#comments</comments>
		<pubDate>Thu, 27 Sep 2012 05:26:01 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[bridge]]></category>
		<category><![CDATA[golden-gate]]></category>
		<category><![CDATA[pier-39]]></category>
		<category><![CDATA[pier39]]></category>
		<category><![CDATA[san-francisco]]></category>
		<category><![CDATA[sanfrancisco]]></category>
		<category><![CDATA[sfo]]></category>
		<category><![CDATA[trail]]></category>
		<category><![CDATA[usa]]></category>
		<category><![CDATA[walk]]></category>
		<category><![CDATA[walking]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3243</guid>
		<description><![CDATA[I have visited the Golden Gate bridge a few times before. One time, we rode the open top city tour bus which took us around the golden gate. And then in another time, we drove a car and crossed the bridge to see the city from the other shore. Though the bridge was astonishing every [...]]]></description>
				<content:encoded><![CDATA[<p>I have visited the Golden Gate bridge a few times before. One time, we rode the open top city tour bus which took us around the golden gate. And then in another time, we drove a car and crossed the bridge to see the city from the other shore. Though the bridge was astonishing every time, it was also getting too-usual.</p>
<p>I wanted to experience a whole different view. So, I decided to walk along the San Francisco bay to reach the bridge instead of taking a bus/car ride. And to my surprise, there&#8217;s a well maintained walking trail that goes from Pier 39 to Golden Gate bridge. On a fine Sunday morning, I started at Fisherman&#8217;s wharf and walked towards the golden gate, on this route:</p>
<p style="text-align: center;"><img class="aligncenter  wp-image-3244" title="pier39-golden-gate-route" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/pier39-golden-gate-route.png" alt="walking route from Pier 39 to Golden gate bridge" width="645" height="202" />.</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/008.jpg"><img class="size-medium wp-image-3249 alignleft" title="Ghirardelli" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/008-300x168.jpg" alt="Ghirardelli at pier 39" width="300" height="168" /></a></p>
<p>Just after crossing the heavily crowded market area, I reached <strong>Ghirardelli</strong>. If you like chocolates, then you don&#8217;t wanna miss this place. I have seen few of my friends who specifically came to SFO to buy chocolates from this place.</p>
<p>But anyway, I&#8217;m not a big fan of chocolate, so I continued my walk along the marina bay.</p>
<p>On the right hand side, opposite to the Hyde street pier, there were group of very old sailing ships stationed in the sea. These ships are used for transportation, commerce and war during the old times of San Francisco. For a small ticket fee, people go inside the ships and see the inner architecture of the ship. But, too bad they are not letting you to sail the ship anymore!</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/009.jpg"><img class="alignright size-medium wp-image-3256" title="old ship stationed in pier 39" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/009-300x201.jpg" alt="old ship stationed in pier 39" width="300" height="201" /></a></p>
<p>Anyway, if you are lucky, sometimes you get to see the street artists staging plays near the ship area. The theme of the play is mostly about how it is used to be in the olden days.</p>
<p>After crossing the <strong>Hyde street pier</strong> and walking past the <strong>Maritime museum</strong>, the journey became tougher. Because there&#8217;s a small hill/forest area that I have to cross in order to continue on the trail. At first I thought I lost my way. Because the place looked like a privately owned area. But then I saw people walking in the direction. So, I followed them.</p>
<p>That is one golden rule I follow if I lost in a unknown location &#8211; <a title="6 ways to never lost in a city again" href="http://www.bbc.co.uk/news/magazine-15125287" target="_blank">follow the flow of people</a>. Works every time unless you are the only one in that place. In that case, you are totally lost and good luck getting back. <img src='http://veerasundar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Jokes aside, I continued to walk and after crossing the steep road, the Golden Gate bridge came into my view along with the distance that I still had to cover. You can also see the <strong>Fort Mason center </strong>in the front.</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/fort-mason.jpg"><img class="aligncenter size-full wp-image-3264" title="fort-mason" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/fort-mason.jpg" alt="" width="800" height="450" /></a></p>
<p>Now I had few two different possible directions to choose: either go down the hill via Fort mason center or continue walking through the recreation area. I chose the later path as the road was easy to walk.</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/0231.jpg"><img class="alignleft size-medium wp-image-3306" title="SFO Skyline" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/0231-300x168.jpg" alt="sfo skyline" width="300" height="168" /></a>And it was a really good view to see the San Francisco skylines from the park. There was a statue of a man in the park whom I couldn&#8217;t identify from the distance. Also, there&#8217;s a weirdest tree in the park which I would name it as the <em>retarded tree!</em>. Seriously, the tree looked like a melted and frozen plastic material without using any molds. <img src='http://veerasundar.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/027.jpg"><img class="alignright size-medium wp-image-3309" title="Retarded tree!" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/027-300x168.jpg" alt="Retarded tree!" width="300" height="168" /></a></p>
<p>Anyway, I continued to walk towards the Golden Gate. After sometime, I reached the <strong>San Francisco Exploratorium</strong>. From the outside, the building looked like an ancient Greek palace. Being an techie, I was tempted to go inside the building. But, I didn&#8217;t have much time to spend there, as my goal was to reach Golden Gate as early as possible. But to explore the Exploratorium, one need at least a one full day. May be another time..</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/040.jpg"><img class="aligncenter size-full wp-image-3311" title="San Francisco Exploratorium" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/040.jpg" alt="San Francisco Exploratorium" width="800" height="450" /></a></p>
<p>After the exploratorium, the walking trail went very close to the beach. I could see people jogging, walking, riding all the way in the pathway.  Looking back from there, I could see the bay bridge in the distance.</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/053.jpg"><img class="aligncenter size-full wp-image-3312" title="golden gate walking trail" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/053.jpg" alt="golden gate walking trail" width="800" height="449" /></a></p>
<p>From there, the Golden Gate was just a few minutes walk away (well, the &#8216;<em>few&#8217;</em> stands for 30, though). I continued to walk on and it was real good view of the bridge which I&#8217;d never seen in my previous visits.</p>
<p>As I (and the others) were nearing the bridge,</p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/065.jpg"><img class="aligncenter size-full wp-image-3315" title="Walking towards the golden gate bridge" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/065.jpg" alt="Walking towards the golden gate bridge" width="800" height="535" /></a></p>
<p>And, finally I got the <strong>photo of the day </strong>which totally worth the <strong>One and half hour walk.</strong></p>
<p><a href="http://veerasundar.com/blog/wp-content/uploads/2012/09/071.jpg"><img class="aligncenter size-full wp-image-3316" title="The golden gate bridge" src="http://veerasundar.com/blog/wp-content/uploads/2012/09/071.jpg" alt="The golden gate bridge" width="800" height="450" /></a></p>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/PkvC1d9JWj0" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=_GX_Xf-hdaQ:6rDz_mBOS2c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=_GX_Xf-hdaQ:6rDz_mBOS2c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=_GX_Xf-hdaQ:6rDz_mBOS2c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=_GX_Xf-hdaQ:6rDz_mBOS2c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=_GX_Xf-hdaQ:6rDz_mBOS2c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=_GX_Xf-hdaQ:6rDz_mBOS2c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=_GX_Xf-hdaQ:6rDz_mBOS2c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=_GX_Xf-hdaQ:6rDz_mBOS2c:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/_GX_Xf-hdaQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/09/walking-from-pier-39-to-golden-gate-bridge-photos/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/09/walking-from-pier-39-to-golden-gate-bridge-photos/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/PkvC1d9JWj0/</feedburner:origLink></item>
		<item>
		<title>Common code violations in Java</title>
		<link>http://feedproxy.google.com/~r/veerasundar/dreamz/~3/WYeAM6UK_1w/</link>
		<comments>http://veerasundar.com/blog/2012/09/common-code-violations-in-java/#comments</comments>
		<pubDate>Fri, 07 Sep 2012 18:21:33 +0000</pubDate>
		<dc:creator>Veera</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[best-practice]]></category>
		<category><![CDATA[checkstyle]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[findbug]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[pmd]]></category>
		<category><![CDATA[practice]]></category>
		<category><![CDATA[quality]]></category>
		<category><![CDATA[test]]></category>
		<category><![CDATA[violation]]></category>
		<category><![CDATA[violations]]></category>

		<guid isPermaLink="false">http://veerasundar.com/blog/?p=3236</guid>
		<description><![CDATA[At work, recently I did a code cleanup of an existing Java project. After that exercise, I could see a common set of code violations that occur again and again in the code. So, I came up with a list of such common violations and shared it with my peers so that an awareness would [...]]]></description>
				<content:encoded><![CDATA[<p>At work, recently I did a code cleanup of an existing Java project. After that exercise, I could see a common set of code violations that occur again and again in the code. So, I came up with a list of such common violations and shared it with my peers so that an awareness would help to improve the code quality and maintainability. I&#8217;m sharing the list here to a bigger audience.</p>
<p>The list is not in any particular order and all derived from the rules enforced by code quality tools such as <a title="Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard" href="http://checkstyle.sourceforge.net/" target="_blank">CheckStyle</a>, <a title="Find bugs in java program" href="http://findbugs.sourceforge.net/" target="_blank">FindBugs</a> and <a title=" source code analyzer" href="http://pmd.sourceforge.net/" target="_blank">PMD</a>.</p>
<p>Here we go!</p>
<h2>Format source code and Organize imports in Eclipse:</h2>
<p>Eclipse provides the option to auto-format the source code and organize the imports (thereby removing unused ones). You can use the following shortcut keys to invoke these functions.</p>
<ul>
<li><strong>Ctrl + Shift + F</strong> &#8211; Formats the source code.</li>
<li><strong>Ctrl + Shift + O</strong> &#8211; Organizes the imports and removes the unused ones.</li>
</ul>
<p>Instead of you manually invoking these two functions, you can tell Eclipse to auto-format and auto-organize whenever you save a file. To do this, in Eclipse, go to <strong>Window -&gt; Preferences -&gt; Java -&gt; Editor -&gt; Save Actions</strong> and then enable <strong>Perform the selected actions on save</strong> and check <strong>Format source code</strong> + <strong>Organize imports</strong>.</p>
<h2>Avoid multiple returns (exit points) in methods:</h2>
<p>In your methods, make sure that you have only <strong>one exit point</strong>. Do not use returns in more than one places in a method body.</p>
<p>For example, the below code is <strong>NOT RECOMMENDED</strong> because it has more then one exit points (return statements).</p>
<pre>private boolean isEligible(int age){
  if(age &gt; 18){
    return true;
  }else{
    return false;
  }
}</pre>
<p>The above code can be rewritten like this (of course, the below code can be still improved, but that&#8217;ll be later).</p>
<pre>private boolean isEligible(int age){
  boolean result;
  if(age &gt; 18){
    result = true;
  }else{
    result = false;
  }
  return result;
}</pre>
<h2>Simplify if-else methods:</h2>
<p>We write several utility methods that takes a parameter, checks for some conditions and returns a value based on the condition. For example, consider the <strong>isEligible</strong> method that you just saw in the previous point.</p>
<pre>private boolean isEligible(int age){
  boolean result;
  if(age &gt; 18){
    result = true;
  }else{
    result = false;
  }
  return result;
}</pre>
<p>The entire method can be re-written as a <strong>single return</strong> statement as below.</p>
<pre>private boolean isEligible(int age){
  return age &gt; 18;
}</pre>
<h2>Do not create new instances of Boolean, Integer or String:</h2>
<p>Avoid creating new instances of Boolean, Integer, String etc. For example, instead of using <code>new Boolean(true)</code>, use <code>Boolean.valueOf(true)</code>. The later statement has the same effect of the former one but it has improved performance.</p>
<h2>Use curly braces around block statements.</h2>
<p>Never forget to use curly braces around block level statements such as <em>if</em>, <em>for</em>, <em>while</em>. This reduces the ambiguity of your code and avoids the chances of introducing a new bug when you modify the block level statement.</p>
<p><strong>NOT RECOMMENDED</strong></p>
<pre>if(age &gt; 18)
  result = true;
else
  result = false;</pre>
<p><strong>RECOMMENDED</strong></p>
<pre>if(age &gt; 18){
  result = true;
}else{
  result = false;
}</pre>
<h2>Mark method parameters as final, wherever applicable:</h2>
<p>Always mark the method parameters as <em>final</em> wherever applicable. If you do so, when you accidentally modify the value of the parameter, you&#8217;ll get a compiler warning. Also, it makes the compiler to optimize the byte code in a better way.</p>
<p><strong>RECOMMENDED</strong></p>
<pre>private boolean isEligible(final int age){ ... }</pre>
<h2>Name <em>public static final</em> fields in UPPERCASE:</h2>
<p>Always name the <em>public static final</em> fields (also known as <em>Constants</em>) in UPPERCASE. This lets you to easily differentiate constant fields from the local variables.</p>
<p><strong>NOT RECOMMENDED</strong></p>
<p><code>public static final String testAccountNo = "12345678";</code></p>
<p><strong>RECOMMENDED</strong></p>
<p><code>public static final String TEST_ACCOUNT_NO = "12345678";</code>,</p>
<h2>Combine multiple <em>if</em> statements into one:</h2>
<p>Wherever possible, try to combine multiple <em>if</em> statements into single one.</p>
<p>For example, the below code;</p>
<pre>if(age &gt; 18){
  if( voted == false){
    // eligible to vote.
  }
}</pre>
<p>can be combined into single <em>if</em> statements, as:</p>
<pre>if(age &gt; 18 &amp;&amp; !voted){
  // eligible to vote
}</pre>
<h2><em>switch</em> should have <em>default</em>:</h2>
<p>Always add a <em>default</em> case for the <em>switch</em> statements.</p>
<h2>Avoid duplicate string literals, instead create a constant:</h2>
<p>If you have to use a string in several places, avoid using it as a literal. Instead create a String constant and use it.</p>
<p>For example, from the below code,</p>
<pre>private void someMethod(){
  logger.log("My Application" + e);
  ....
  ....
  logger.log("My Application" + f);
}</pre>
<p>The string literal &#8220;My Application&#8221; can be made as an Constant and used in the code.</p>
<pre>public static final String MY_APP = "My Application";

private void someMethod(){
  logger.log(MY_APP + e);
  ....
  ....
  logger.log(MY_APP + f);
}</pre>
<h2>Additional Resources:</h2>
<ul>
<li>A collection of <a href="http://www.javapractices.com/home/HomeAction.do" target="_top">Java best practices</a>.</li>
<li>List of available <a href="http://checkstyle.sourceforge.net/availablechecks.html" target="_top">Checkstyle checks</a>.</li>
<li>List of <a href="http://pmd.sourceforge.net/rules/index.html" target="_top">PMD Rule sets</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/VeeraSundar/~4/eCltlaXWunY" height="1" width="1"/><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=WYeAM6UK_1w:GntNoTeal1c:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=WYeAM6UK_1w:GntNoTeal1c:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=WYeAM6UK_1w:GntNoTeal1c:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=WYeAM6UK_1w:GntNoTeal1c:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=WYeAM6UK_1w:GntNoTeal1c:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=WYeAM6UK_1w:GntNoTeal1c:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/veerasundar/dreamz?a=WYeAM6UK_1w:GntNoTeal1c:gIN9vFwOqvQ"><img src="http://feeds.feedburner.com/~ff/veerasundar/dreamz?i=WYeAM6UK_1w:GntNoTeal1c:gIN9vFwOqvQ" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/veerasundar/dreamz/~4/WYeAM6UK_1w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://veerasundar.com/blog/2012/09/common-code-violations-in-java/feed/</wfw:commentRss>
		<slash:comments>25</slash:comments>
		<feedburner:origLink>http://veerasundar.com/blog/2012/09/common-code-violations-in-java/</feedburner:origLink><feedburner:origLink>http://feedproxy.google.com/~r/VeeraSundar/~3/eCltlaXWunY/</feedburner:origLink></item>
	</channel>
</rss>
