Praveen Kumar

Eternal Quest for Incremental Improvement

Making GNU Emacs Detect Custom Error Messages - a Maven Example

Comments

GNU Emacs’s compilation mode is capable of detecting error messages from various standard compilers and build tools. However, it is fairy common for one to run into a format of error message that Emacs can’t handle by default.

As you know, Emacs is highly extensible and it provides compilation-error-regexp-alist for accomplishing this. I have done this a couple of times earlier and I had to do it one more time lately for adding regular expression for Maven error messages. Construction of these regular expressions is not fun for everyone. However, regexp-builder makes it easier to construct the regular expression interactively.

Apache Software Foundation

Comments

Recently, I started playing with a lot of Open Source products from Apache Software Foundation. It all started with Hadoop, HBase and Cassandra. Day after day, I am getting my hands dirty on more Apache Foundation’s products like Ant, Maven, Archiva and Thrift.

When trying to build HBase from source, I noticed that the project was using Subversion for version control. I found it quite odd to see a modern project like HBase not using a distributed version control tool like Mercurial or Git. Soon, I realized that all Apache projects’ source code were maintained in Subversion. Then, I made a comment to my co-worker that, “Maybe Apache Foundation took over Subversion too!”, soon to realize that it was true. We learned that Subversion became an Apache Incubator project in 2009 and became an Apache top-level project in 2010.

I am really amazed by the number of projects that are now part of the Apache Software Foundation. Go Apache!

Halford/Foothill/Arastradero 30 Mile Loop

Comments

Today, I went for a longer bicycle ride with one of my friends from college, Ravi Shankar. I have picked the following loop based on Ed Rak’s advice. We took 2 hours and 15 minutes to do this one.

There were a lot of bicyclists on Foothill Expressway! Apart from some climbing at Arasterado, the ride was very smooth. Alpine is a downhill rideI really enjoyed this ride.

Last night, I created a rough map by hand. After returning from the ride, I spent some time on MapMyRide.com and created a detailed map for this loop.

Introduction to Test-Driven Development in C++ Using Boost Test Library

Comments

I have been following Test-Driven Development for a few years now. Even though TDD is widespread, often I come across a few friends who aren’t very familiar with TDD approach. It took a while for me to really appreciate TDD since I was introduced to it. When I demonstrated TDD in action, I got a few of my friends interested.

We have our own test framework that we use in our project which was primarily developed by David Carlton. It works very well for our needs. However, for my personal projects, I wanted to try something that is more widely used in the industry. I started using CppUnit for a while until I found Boost Test Library coming a long way. Now, I use Boost Test Library for all my personal projects. It is very easy to setup tests and I really like it.

Simple GNU Emacs Keyboard Macro Demonstration

Comments

My obsession for GNU Emacs has grown over years to an extent where I managed to get a significant amount of users to adopt Emacs. In the past 10 years, I have learned a lot of nice tricks that I can do on Emacs to improve my productivity. So, I have decided to create a series of screencasts demonstrating some of those.

I will start with a very simple one, macros. Quoting from Emacs documentation, “A keyboard macro is a command defined by an Emacs user to stand for another sequence of keys. For example, if you discover that you are about to type C-n M-d C-d forty times, you can speed your work by defining a keyboard macro to do C-n M-d C-d, and then executing it 39 more times.

Mozilla Thunderbird 3 and Google Contacts Addon Issue

Comments

Yesterday, I upgraded my Ubuntu 9.10 to Ubuntu 10.04 beta 1 (Lucid Lynx). Lucid comes with Thunderbird 3. After upgrading, using Thunderbird 3 once and rebooting, Thunderbird started up with empty profile and showed the account creation window. When I looked into the home directory, I noticed that my .thunderbird is moved to .thunderbird.upstream and the new .thunderbird is created with an empty profile. Moving the .thunderbird.upstream back to .thunderbird will work fine the first time and on the next startup, Thunderbird will repeat the same and start with an empty profile.

After banging my head against this issue for a while and some help from #ubuntu-mozillateam, I figured out that Google Contacts addon is causing this problem. When Thunderbird starts up, Google Contacts addon creates a .mozilla-thunderbird directory which is the directory for Thunderbird 2. Thunderbird 3 doesn’t like this directory and it does all this renaming stuff. Uninstalling the Google Contacts addon fixed this issue for me.

The lesson that I learned from this experience is to start Thunderbird in safe mode, thunderbird --safe-mode that will help you to isolate issues that are caused by faulty extensions.

Getting Untruncated Command Line Options Passed to a Solaris Process

Comments

If you have ever wanted to get the command line options that were passed to a running Solaris process, you might have noticed that the output of command line arguments from ps is truncated to 80 characters. Looking into /usr/include/sys/procfs.h will reveal the reason why! This is because of the restriction in struct psinfo. Here are the relevant fields from the definition of struct psinfo.

/usr/include/sys/procfs.h
1
2
3
4
5
6
7
8
9
#define    PRFNSZ      16  /* Maximum size of execed filename */
#define  PRARGSZ     80  /* number of chars of arguments */

typedef struct psinfo {
         /* Fields omitted */
         char pr_fname[PRFNSZ];    /* name of exec'ed file */
         char pr_psargs[PRARGSZ];  /* initial characters of arg list */
         /* Fields omitted */
} psinfo_t;