<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BoxySystems Inc.</title>
	<atom:link href="http://boxysystems.com/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://boxysystems.com</link>
	<description>Innovation through creativity...</description>
	<lastBuildDate>Fri, 20 Aug 2010 21:32:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Step by step instructions to install NodeJS on Windows</title>
		<link>http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/</link>
		<comments>http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 21:30:47 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=203</guid>
		<description><![CDATA[I just had NodeJS successfully installed on Windows XP using Cygwin and thought this might be of use to someone who wants to do the same. Pre-requisites: Cygwin with Python &#038; some additional packages (we&#8217;ll go over that in a bit) Double click Cygwin&#8217;s setup.exe and continue till you get to select packages window Select [...]]]></description>
			<content:encoded><![CDATA[<p>I just had <a target="_new" href="http://nodejs.org/">NodeJS</a> successfully installed on Windows XP using <a target="_new" href="http://www.cygwin.com">Cygwin</a> and thought this might be of use to someone who wants to do the same. </p>
<p>Pre-requisites: Cygwin with Python &#038; some additional packages (we&#8217;ll go over that in a bit)</p>
<ol>
<li>Double click Cygwin&#8217;s <a target="_new" href="http://www.cygwin.com/setup.exe">setup.exe</a> and continue till you get to select packages window</li>
<li>Select <b>Python</b></li>
<p><a href="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Python_SelectPackage.jpg"><img src="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Python_SelectPackage-1024x425.jpg" alt="" title="NodeJS_Cygwin_Python_SelectPackage" width="1024" height="425" class="aligncenter size-large wp-image-204" /></a></p>
<li>Select <b>Make</b></li>
<p><a href="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Make_SelectPackage.jpg"><img src="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Make_SelectPackage-1024x425.jpg" alt="" title="NodeJS_Cygwin_Make_SelectPackage" width="1024" height="425" class="aligncenter size-large wp-image-206" /></a></p>
<li>Select <b>G++</b></li>
<p><a href="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_GPlusPlus_SelectPackage.jpg"><img src="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_GPlusPlus_SelectPackage-1024x425.jpg" alt="" title="NodeJS_Cygwin_GPlusPlus_SelectPackage" width="1024" height="425" class="aligncenter size-large wp-image-209" /></a></p>
<li>Select <b>wget</b>(not really required but, good to have for downloading archives &#038; stuffs <img src='http://boxysystems.com/myblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</li>
<p><a href="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Wget_SelectPackage.jpg"><img src="http://boxysystems.com/myblog/wp-content/uploads/2010/08/NodeJS_Cygwin_Wget_SelectPackage-1024x425.jpg" alt="" title="NodeJS_Cygwin_Wget_SelectPackage" width="1024" height="425" class="aligncenter size-large wp-image-210" /></a></p>
<li>Click next and complete the installation</li>
<li>
		From cygwin type the following commands. Note: At the time of this writing v0.2.0 is the current NodeJS version.</p>
<pre class="brush: bash;">
			wget http://nodejs.org/dist/node-v0.2.0.tar.gz
			tar xvf node-v0.2.0.tar.gz
			cd node-v0.2.0/
			./configure
			make
			make install
		</pre>
</li>
<li>
		If all goes well, then you should see NodeJS&#8217;s version when you type the following command. </p>
<pre class="brush: bash;">
		node --version
		v0.2.0
		</pre>
</li>
</ol>
<p>Now its time to crack some code to your heart&#8217;s desire <img src='http://boxysystems.com/myblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/step-by-step-instructions-to-install-nodejs-on-windows/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>StackOverflow, some insights&#8230;</title>
		<link>http://boxysystems.com/index.php/stackoverflow-some-insights/</link>
		<comments>http://boxysystems.com/index.php/stackoverflow-some-insights/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 18:24:58 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=184</guid>
		<description><![CDATA[A while ago I wrote an article on &#8220;how to crash a JVM&#8221;, the purpose of that article is to identify the end limits of JVM, instead it stirred quite some controversy in other areas. If you are interested to know more on that article, you can read it here. This is a follow-up article [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I wrote an article on <a href="http://boxysystems.com/?p=129">&#8220;how to crash a JVM&#8221;</a>, the purpose of that article is to identify the end limits of JVM, instead it stirred quite some controversy in other areas. If you are interested to know more on that article, you can read it <a href="http://boxysystems.com/?p=129">here</a>. This is a follow-up article to that one where I would like to touch on StackOverflow and why &#038; when it occurs.</p>
<p>
As you might know already, the following code snippet throws StackOverflowError.</p>
<pre class="brush: java;">
	public class StackOverflowTest {
		public static void main(String[] args) {
			main(args);
		}
	}
  </pre>
</p>
<p>
If you read the javadoc of <a target="_new" href="http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/api/java/lang/StackOverflowError.html">StackOverflowError</a>, it says that error happens when application <B><I>&#8220;recurses too deeply&#8221;</I></B>. There are two key words to underline here&#8230; <U>&#8220;recurse&#8221;</U> and <U>&#8220;deep&#8221;</U>. The word recursion according to <a target="_new" href="http://www.google.com/search?hl=en&#038;q=recursion&#038;aq=f&#038;aqi=&#038;aql=&#038;oq=&#038;gs_rfai=">google (Did you mean: recursion <img src='http://boxysystems.com/myblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> )</a> &#038; programmers lingo, some method calling itself. So, it&#8217;s very natural to think StackOverflowError happens only when we run into this inifinite recursion scenario. But, thats not entirely true. It could also happen when we have method call chain which is <b>&#8220;too deep&#8221;</b>.
</p>
<p>
So, in order to find out how deep is &#8220;too deep&#8221;, I wrote this code snippet. Obviously, it will vary between different JRE versions, OS etc and you can also increase the stack size limit by setting -XX VM param.<br />
<script src="http://gist.github.com/483285.js"> </script>
</p>
<p>In order to prove the stack overflow in &#8220;non-recursion&#8221; scenario, here is a Java code that will create, compile &#038; run Java code with nested method call chain of limit set to 7000.</p>
<p><script src="http://gist.github.com/483296.js"> </script></p>
<p>
So, if you think this little more <b>deeper</b>, someone like me would wonder.. Is it a limitation that a Java class/application cannot have more than certain number of methods? If yes, how does all the enterprise class software products written in millions of lines of Java code working? The answer to that question is&#8230; Yes, it is a limitation, but in only one thread. So, almost any enterprise/mid range Java project/product cannot be written in such a way that it would run in only one main thread and if it written that way, this is the limit you hit.
</p>
<p>So, if we come back to our original problem and see if we can make it run. Here is how&#8230;</p>
<pre class="brush: java;">
		public class StackOverflowLimitWithThreadTest {
		  private static int recursionLimit = 0;
		  public static void main(final String[] args) {
			new Thread(new Runnable(){
			  public void run() {
				System.out.println("recursionLimit++ = " + recursionLimit++);
				main(args);
			  }
			}).start();
		  }
		}
  </pre></p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/stackoverflow-some-insights/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signing greeting cards in Java</title>
		<link>http://boxysystems.com/index.php/signing-greeting-cards-in-java/</link>
		<comments>http://boxysystems.com/index.php/signing-greeting-cards-in-java/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 15:16:40 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=180</guid>
		<description><![CDATA[Buddy of mine recently had a baby for the first time. He and his wife are Java developers. So, I thought how about signing his congratulations card in a language we speak? Here is the code snippet I came up with. In case if you have something that you like to share, feel free&#8230; public [...]]]></description>
			<content:encoded><![CDATA[<p>Buddy of mine recently had a baby for the first time. He and his wife are Java developers. So, I thought how about signing his congratulations card in a language we speak?</p>
<p>Here is the code snippet I came up with. In case if you have something that you like to share, feel free&#8230;</p>
<pre class="brush: java;">		public class Life {
		  public static void main(final String args[]) {
			boolean havingKids = args.length &gt; 2;
			if (havingKids) {
			  System.out.println("Life is about to change forever...");
			  throw new LifeChangingException("Congratulations, " +
				"you are going to discover yourself.... Have fun along the way!!!");
			}
			main(args); //Sometimes you'll wish you are here
						// inspite of StackOverflow:)
		  }
		}</pre>
<p>What you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/signing-greeting-cards-in-java/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Is Google search getting socialized?</title>
		<link>http://boxysystems.com/index.php/is-google-search-getting-socialized/</link>
		<comments>http://boxysystems.com/index.php/is-google-search-getting-socialized/#comments</comments>
		<pubDate>Fri, 11 Jun 2010 15:16:04 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=172</guid>
		<description><![CDATA[I ran some search on Google and there they are telling me someone in my social circle has the answer for me. They have the disclaimer it&#8217;s a BETA feature. But, I wasn&#8217;t aware this is existing. So, What else is coming Google? Telling me who my real friends &#38; foes are&#8230;:)]]></description>
			<content:encoded><![CDATA[<p>I ran some search on Google and there they are telling me someone in my social circle has the answer for me. They have the disclaimer it&#8217;s a BETA feature. But, I wasn&#8217;t aware this is existing.</p>
<p><a href="http://boxysystems.com/myblog/wp-content/uploads/2010/06/GoogleSearchSocializedCropped.gif"><img class="alignleft size-full wp-image-173" title="GoogleSearchSocializedCropped" src="http://boxysystems.com/myblog/wp-content/uploads/2010/06/GoogleSearchSocializedCropped.gif" alt="" width="699" height="310" /></a></p>
<p>So, What else is coming Google? Telling me who my real friends &amp; foes are&#8230;:)</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/is-google-search-getting-socialized/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to crash a JVM easily?</title>
		<link>http://boxysystems.com/index.php/how-to-crash-a-jvm/</link>
		<comments>http://boxysystems.com/index.php/how-to-crash-a-jvm/#comments</comments>
		<pubDate>Thu, 20 May 2010 21:40:55 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=129</guid>
		<description><![CDATA[The intent of this article is to crash a JVM either &#8220;gracefully&#8221; or &#8220;non-gracefully&#8221;. It does not only mean JVM dying due to fatal errors. If you can make it, then you should know how to break it. I think its more applicable to software systems than anything else. Being Java developers, we occasionally see [...]]]></description>
			<content:encoded><![CDATA[<p><P><I>The intent of this article is to crash a JVM either &#8220;gracefully&#8221; or &#8220;non-gracefully&#8221;. It does not only mean JVM dying due to fatal errors.</I></P></p>
<p>If you can make it, then you should know how to break it. I think its more applicable to software systems than anything else. Being Java developers, we occasionally see JVM crashing either because we do something really silly or probably due to system&#8217;s limitation(bug, memory, threads etc.). But I was wondering, if I want to crash a JVM deliberately, what is the easiest way? In other words, with less line of code. </p>
<p>How <b>&#8220;easy&#8221;</b> is to crash a JVM? I am not talking about killing the process from Task Manager or running <I>kill</I> command in Unix <img src='http://boxysystems.com/myblog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>Here are some of the options I came up with. If anyone can think of more &#8220;<b>creative</b>&#8221; ways, feel free to share it on the comments.</p>
<p>
  1.) JVM crash due to StackOverflow.
 </p>
<pre class="brush: java;">
	public class JVMCrashTest {
		public static void main(String[] args) {
			main(args);
		}
	}
  </pre>
<p>
  <b>Exception in thread &#8220;main&#8221; java.lang.StackOverflowError</b>
  </p>
<p>
  2.) This one will fail due to memory not being enough. We can use the same technique with data types other than Integer.
 </p>
<pre class="brush: java;">
	public class JVMCrashTest {
		public static void main(String[] args) {
			Integer integers[] = new Integer[Integer.MAX_VALUE];
		}
	}
	</pre>
<p>
  <b>Exception in thread &#8220;main&#8221; java.lang.OutOfMemoryError: Requested array size exceeds VM limit</b>
 </p>
<p>
  3.) This technique is very similar to the second one. Again, this approach can be tried with other data structures also.
 </p>
<pre class="brush: java;">
	import java.util.*;
	public class JVMCrashTest {
		public static void main(String[] args) {
			ArrayList list = new ArrayList();
			for (int i = 0; i < Integer.MAX_VALUE; i++) {
				list.add(new Object());
			}
		}
	}
	</pre>
<p>
  <b>Exception in thread "main" java.lang.OutOfMemoryError: Java heap space</b>
 </p>
<p>
  We constructively crashed the JVM, so now what?. Let's talk little bit about these approaches. Option 1 is very simple(less code) and my <b>most</b> favorite. It got into my thinking little more than how JVM can be crashed, possibly hinting some limitations which I never thought of before. But, I am going to save that discussion for a separate topic of its own.
</p>
<p>Option 2 &#038; 3 are very similar which may be fixed by adding more memory. In the meanwhile, if anyone can add more to this list, it will be great.
  </p>
<p><I>Note: The above code was run using JDK 1.6.0_18's JVM with the default memory settings.</I></p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/how-to-crash-a-jvm/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Good bye Mephisto, Hello WordPress!</title>
		<link>http://boxysystems.com/index.php/good-bye-mephisto-hello-wordpress/</link>
		<comments>http://boxysystems.com/index.php/good-bye-mephisto-hello-wordpress/#comments</comments>
		<pubDate>Thu, 20 May 2010 21:30:14 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=126</guid>
		<description><![CDATA[Mephisto has been my blogging/CMS platform for almost 3 years. Overall I was satisfied with it until recently when my hosting company started doing Ruby &#038; RoR upgrades. Since Mephisto is not supported by anybody at this time and I&#8217;ve had a hard time getting it to work with the latest Ruby &#038; RoR versions, [...]]]></description>
			<content:encoded><![CDATA[<p>Mephisto has been my blogging/CMS platform for almost 3 years. Overall I was satisfied with it until recently when my hosting company started doing Ruby &#038; RoR upgrades. Since Mephisto is not supported by anybody at this time and I&#8217;ve had a hard time getting it to work with the latest <a target="_new" href="http://www.ruby-lang.org/en/">Ruby</a> &#038; <a target="_new" href="http://rubyonrails.org/">RoR</a> versions, I thought its a good time to look for alternatives. So, the first choice came to mind was <a target="_new" href="http://wordpress.org/">WordPress</a>.</p>
<p>I should admit WordPress installation was a breeze and I am quite impressed with its UI &#038; overall design. Needless to say, it has whole bunch of themes &#038; plugins if you want to do more with it. In my opinion, RoR doesn&#8217;t seem to be a stable or robust platform compared to <a target="_new" href="http://php.net">PHP</a> based frameworks.</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/good-bye-mephisto-hello-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy Chrome browser settings from Machine X to Machine Y (Windows &amp; Linux)</title>
		<link>http://boxysystems.com/index.php/copy-chrome-browser-settings-from-machine-x-to-machine-y/</link>
		<comments>http://boxysystems.com/index.php/copy-chrome-browser-settings-from-machine-x-to-machine-y/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 16:58:59 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=98</guid>
		<description><![CDATA[If you are a Chrome user and would like to clone your settings (like bookmarks, extensions, cookies etc.) from Machine X to Machine Y, here is a tip for you. Close the browser in both the machines Backup C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data to C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data_Backup in Machine Y Copy [...]]]></description>
			<content:encoded><![CDATA[<p>If you are a Chrome user and would like to clone your settings (like bookmarks, extensions, cookies etc.) from Machine X to Machine Y, here is a tip for you.</p>
<ol>
<li>Close the browser in both the machines</li>
<li>Backup <strong><em>C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data</em></strong> to <strong><em>C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data_Backup</em></strong> in Machine Y</li>
<li>Copy <strong><em>C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data</em></strong> from Machine X to <strong><em>C:\Documents and Settings\your_user_id\Local Settings\Application Data\Google\Chrome\User Data</em></strong> in Machine Y</li>
<li> Boom&#8230; Open chrome in Machine Y &amp; make sure you have everything that you had in Machine X.</li>
</ol>
<p>FYI &#8211; I have tested this in Windows XP Chrome Dev Channel 5.0 versions. </p>
<p>
Update:  I have tried this in Ubuntu machines and also between Windows XP &#038; Ubuntu 9.10 and it worked fine. Replace the above folders with this one for Linux machines &#8211; <I>/home/your_user_id/.config/google-chrome/Default </I>
</p>
<p>Right there I see some opportunity for developing a Chrome extension. If I get sometime and Google or anyone else didn&#8217;t come up with something for this, I might crack up some extension to do this automatically.</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/copy-chrome-browser-settings-from-machine-x-to-machine-y/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backup your backups</title>
		<link>http://boxysystems.com/index.php/backup-your-backups/</link>
		<comments>http://boxysystems.com/index.php/backup-your-backups/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:58:24 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=95</guid>
		<description><![CDATA[Yes, that is the lesson I learned after my recent 1 TB external hard drive crash. I bought this Seagate FreeAgent Pro external drive couple of years back thinking that I am buying &#8220;peace of mind&#8221; for my personal data storage &#038; backups. I guess I was totally wrong. Lately I started seeing some hiccups [...]]]></description>
			<content:encoded><![CDATA[<p>
Yes, that is the lesson I learned after my recent 1 TB external hard drive crash. I bought this Seagate FreeAgent Pro external drive couple of years back thinking that I am buying &#8220;peace of mind&#8221;  for my personal data storage &#038; backups. I guess I was totally wrong. Lately I started seeing some hiccups on this drive and it finally crashed with bad sectors.
</p>
<p>
I have 5 years warranty on this drive. I called the manufacturer and talked to them about my case. They are ready to replace the drive, obviously not the data. So, what is gonna happen to my almost 1 TB worth of data? I started looking up online to see how I can rescue data from this drive. I tried many of Windows &#038; Linux based tools. But, none of them helped me recover any data at all. I guess, the drive is damaged heavily and none of the recovery tools could do any good.
</p>
<p>
Here are some of the things to consider&#8230;
</p>
<p>
If I am going to have a backup/external drive, I would go for <a target="_new" href="http://en.wikipedia.org/wiki/RAID">RAID</a> based drives, preferably with RAID 1 or RAID 5 settings. And, I need to pro-actively perform periodic health checks on the external drives just to make sure its not gonna have heart attack or brain damage soon. May be it&#8217;s not a good idea to go for a huge capacity like >= 2 TB in a single drive, because of limitations on hardware storage machanism working within a confined physical limits.
</p>
<p>
In this digital world of inexpensive electronics &#038; technologies, we trust so much on them in our day to day life. At some point in time, what we have in those are worth much more than 1&#8242;s and 0&#8242;s to us, personally.</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/backup-your-backups/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s do some command line JavaScripting&#8230;</title>
		<link>http://boxysystems.com/index.php/lets-do-some-command-line-javascripting/</link>
		<comments>http://boxysystems.com/index.php/lets-do-some-command-line-javascripting/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 16:57:43 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=92</guid>
		<description><![CDATA[I know JavaScript is a client side browser-buddy language. But, just for kicks I wanted to try out JavaScript on command line. Here is the story&#8230; I was working on a codebase in Windows machine where we have very very long file names. As you may know, Windows XP don&#8217;t support file names longer than [...]]]></description>
			<content:encoded><![CDATA[<p>
I know JavaScript is a client side browser-buddy language. But, just for kicks I wanted to try out JavaScript on command line. Here is the story&#8230;
</p>
<p>
I was working on a codebase in Windows machine where we have very very long file names. As you may know, <a target="_new" href="http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath">Windows XP</a> don&#8217;t support file names longer than 260 characters. It was very annoying when a maven build fails due to the file name length limitation. So, I wanted to write a script which can recursively loop through the project codebase and list out the files which exceeds certain length limit, so I can work on shortening their names. I could write that script in different ways like batch script, shell script, groovy script etc. But, I just wanted to write it in plain simple JavaScript and see how it plays.
</p>
<p>
If you want to try out the script. Copy the following code block in a JS file (For ex. <I>FileNameLengthChecker.js</I>).
</p>
<pre>
/*
 Simple utility script to look for file names exceeding certain length restriction.
 (esp. for Windows XP - http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath).

 If you want to run check for a folder other than the current folder, change the value of
 rootDir variable.
 */

var filenameLengthThreshold = 260;
var headerPrinted = false;
var totalFilesFound = 0;

function runFileNameLengthCheck() {
    var rootDir = new java.io.File(".");
    echo("Checking file name length check in '" + rootDir.getCanonicalPath() + "' for threshold limit = " + filenameLengthThreshold + " ...");

    checkFilePathRecursively(rootDir);

    if (!headerPrinted) {
        echo("\n----------------------------------------------------");
        echo("No files found with the given threshold limit !!!");
        echo("---------------------------------------------------");
    }
    else {
        echo("Total files found = " + totalFilesFound);
    }

}

function printHeader() {
    if (!headerPrinted) {
        echo("\n------------------------------------------------");
        echo("Following files exceeded the file name length check...");
        echo("------------------------------------------------");
        headerPrinted = true;
    }
}

function checkFilePathRecursively(currentFolder) {
    var files = currentFolder.listFiles();
    for (var i = 0; i < files.length; i++) {
        if (files[i].isDirectory()) {
            checkFilePathRecursively(files[i])
        }
        else {
            var path = files[i].getCanonicalPath();
            if (path.length() > filenameLengthThreshold) {
                printHeader();
                echo("Filename = '" + path + "', length = " + new java.lang.Integer(path.length()));
                totalFilesFound++;
            }
        }
    }
}

runFileNameLengthCheck();
</pre>
<p>
The simplest way to run the script file from a command line is through <I>jrunscript</I> tool bundled within JDK. </p>
<pre>
	C:\ProjectCodeBase\jrunscript FileNameLengthChecker.js
</pre>
</p>
<p>
If you use <a target="_new" href="http://www.jetbrains.com/idea/">IntelliJ IDE</a> and <a target="_new" href="http://plugins.intellij.net/plugin/?id=3674">Script Monkey plugin</a> installed, you can directly run the script from IDE.
</p>
<p>
This is just a trivial example, but the possibilities of what we can do using the same technique is endless. Thoughts? Comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/lets-do-some-command-line-javascripting/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why Open-source software?</title>
		<link>http://boxysystems.com/index.php/why-open-source-software/</link>
		<comments>http://boxysystems.com/index.php/why-open-source-software/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 16:57:00 +0000</pubDate>
		<dc:creator>Siddique</dc:creator>
				<category><![CDATA[Blogs]]></category>

		<guid isPermaLink="false">http://boxysystems.com/?p=89</guid>
		<description><![CDATA[If you are an open-source fan like myself, then you will love this awesome article &#8211; The meaning of open Often times, I tend to have heated discussions with my friends &#038; colleagues regarding open-source software and how it changed the software development industry &#038; information technology overall. I try explaining the evolution &#038; significance [...]]]></description>
			<content:encoded><![CDATA[<p>If you are an open-source fan like myself, then you will love this awesome article &#8211; <a href="http://googleblog.blogspot.com/2009/12/meaning-of-open.html">The meaning of open</a>
</p>
<p>
Often times, I tend to have heated discussions with my friends &#038; colleagues regarding open-source software and how it changed the software development industry &#038; information technology overall. I try explaining the evolution &#038; significance of open-source community, standards &#038; software and without which we wouldn&#8217;t have been in a place, where we are in the information technology today. There are tons of examples to quote ranging from Linux, Apache, Java etc. etc.
</p>
<p>
But, unfortunately not every big companies realise the importance of open-source sofware, atleast not from a giving-end perspective. It&#8217;s a cliche to say that every companies will be using open-source software either directly or indirectly. But, how many of them would be actively participating or contributing to the open-source community. I think that should grow.
</p>
<p>
Open source is not altruism, it is a culture to drive innovation and promote better competition. I am glad that article discusses breadth &#038; depth of open-source both from technical &#038; business perspective.</p>
]]></content:encoded>
			<wfw:commentRss>http://boxysystems.com/index.php/why-open-source-software/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
