Adarsh welcomes you!

My window to the outside world.

Bizarre Jetty NoClassDefFoundError demystified

Mysterious question

It was the Christmas code freeze of 2013. We had successfully upgraded our production servers to Jetty 9. Us developers were quite content about not having to maintain the app for an extended period of time. However, none of us had anticipated the mysterious errors that would eventually consume the better parts of our holidays.

17 Mar 2015

Too many open files

Too many open files

We had just upgraded our application to the latest version of Grails. Once deployed, our Jetty servers started mysteriously crashing just after a few hours of routine testing, complaining about “Too many open files”.

After some preliminary Google searches we found out that this problem could be alleviated temporarily by…

13 Jan 2015

Why I stopped using Eclipse and switched to IntelliJ IDEA after over a decade?

Eclipse vs IDEA

After having been a hardcore Eclipse fan for over 10 years, I made the switch to IntelliJ IDEA last year. I used to be completely satisfied with Eclipse. Infact, I never imagined I could ever get comfortable with another IDE for the rest of my life.

Come join me as I take you through my journey.

15 Dec 2014

HTML Index Generator Batch Script for Windows

I recently saw that a colleague of mine had written a Java program to generate a simple HTML index of all the sub-directories of a given directory. I felt that the task could be accomplished with even more control if we just had a Windows batch script which does the same, eliminating the need for any JVM.

I've christened this script, indexer.bat so that it's easy to remember.

29 Jun 2008

CF - A fast Java Class Finder

What is it with class finders these days? Everyone seems to have their own version of the tool. From naive programmers creating crude forms to large organizations with fairly sophisticated ones. Through this article, I present my little implementation of the product.

But before you explore further, I have a few claims to make. I have tried my best to bridge the many mutual exclusivities exhibited by similar products in the realm.

22 Jun 2008

Simple Implementation of Wildcard Text Matching using Java

The quick brown fox jumps over the lazy dog

What if you had to implement a text matching logic in Java that would result in an affirmation for search strings such as Th*ick*b*ox*over the*dog, *fox*dog and a negative for ones such as *fox*brown and *abcd*?

I faced a similar challenge few days back as part of another tool I was working on. I wanted a simple solution that not only worked but worked faster. Using a regular expression wasn’t feasible as the search pattern was dynamic and hence, precompiling the expression for faster performance was ruled out.

I thought for a while and arrived at this solution. Hope it helps some hapless programmer like me slogging the night out in some corner of the globe.

13 May 2008

Args Engine - A reusable solution for Command Line Arguments Parsing in Java

Args Engine is a simple command line parsing engine for Java. The library has a single class and can be imported into any project of your choice easily. The only prerequisite, however, is that Java 1.5 or higher is required for the library to work.

This library works for applications which need to parse either (or both) short form (e.g. -h) or long form (e.g. --help) command line options. It also supports parsing valued options with the assumption that the value for an option follows the option itself (as in -out /usr/myhome/result.log).

12 May 2008

RARoScope - Java Library for Scanning RAR Files

Ever faced the challenge of having to be able to scan RAR archives using Java? Wished the API was as simple and easy to use as the ones provided for ZIP and JAR handling in Java? Don't want the hassles of including expensive native code into your Java application?

RARoScope is here to solve all these woes.

17 Mar 2008

Throwing null instead of an Exception in Java

As it's usual these days, I was spending the evening doing some extremely interesting programming in Java. It occurred to me all of a sudden, if we could compile a Java program if it threw nulls instead of exceptions!

11 Mar 2008

Fun with XMPP and Google Talk, Part 2

The second part of the technical article on XMPP, Fun with XMPP and Google Talk that was already published here. If you haven’t yet gone through the first part, I insist you do so before reading this one for the sake of continuity and ease of understanding.

20 Nov 2007

Batch Rename File Extensions on Windows

“Necessity is the mother of invention” turned true to me this weekend as I wrote this script. Consider this. You go on a weekend outing with your friends and end up taking hundreds of snaps using your favourite digital camera.

You come home and download all the pictures to your laptop. Everything is fine about the pictures and all your friends are happy with the image quality. But, you being a perfectionism and systematism freak, somehow don’t like to have those “.JPG” extensions to your files. You wish you could change the extensions of all those files to “.jpeg” in one shot.

03 Nov 2007

Fun with XMPP and Google Talk

Ethereal screenshot

Have you ever wondered when signing into Google Talk, what might be happening under the hood? How can it tell you that your friend is typing just as she has, in fact, started typing? How does it manage to show all that real time presence information?

Well, one day I got really curious and decided to open it up! In this two part article, I share my adventures as I unravel the way Google Talk does what it is best at — Communication.

29 Oct 2007