Older blog entries for rmathew (starting at number 136)

Confessions of a TAB-hater
I do not like it when people put TAB characters in their source code for indentation. I prefer to use spaces instead of TAB characters to indent my source code. Jamie Zawinski has written a nice document that clearly explains the problem. Note that I am not against using the Tab key as a quick way of indenting, but putting in actual TAB characters (ASCII character #9) in the source code. Different people set tabstops differently, so what looks good to them looks terrible to others. These characters also mess up the indentation in patch diffs.

VIM has an unfortunate optimisation that replaces consecutive spaces with as many TAB characters as possible and if you "set expandtab", then even desirable TAB characters (in Makefiles for example) are replaced by spaces. Yes, I know of using the Ctrl-V + Tab sequence to insert an actual TAB character in this mode, but it is painful. So I have ended up putting the following in my ".vimrc":

set shiftwidth=2
set tabstop=8
inoremap <Tab> <C-V><Tab>
autocmd BufNewFile,BufRead *.java setlocal expandtab
autocmd BufNewFile,BufRead *.c setlocal expandtab
autocmd BufNewFile,BufRead *.cc setlocal expandtab
autocmd BufNewFile,BufRead *.cpp setlocal expandtab
autocmd BufNewFile,BufRead *.h setlocal expandtab
autocmd BufNewFile,BufRead *.hh setlocal expandtab
autocmd BufNewFile,BufRead *.hpp setlocal expandtab
autocmd BufNewFile,BufRead *.xml setlocal expandtab
autocmd BufNewFile,BufRead *.sql setlocal expandtab
If I were to design a programming language, I would seriously consider not allowing TAB characters to be counted as whitespace. It would make source code use up a few extra bytes compared to what it would if consecutive spaces are replaced by as many TAB characters as possible, but I would trade that off for overall sanity.

By the way, I consider it really silly that the authors of make chose to make TAB characters so important, when they are virtually indistuingishable from spaces when you inspect Makefiles. Their mistake has cost the software world the creation of the monstrosity named Ant.

The Etymology of "Foo"
RFC 3092 is devoted to explaining how "foobar" came to be used so much in software code and documentation.

"A Practical Sanskrit Introductory"
Thanks to Anirban Mukherjee, I came across a nice document (2.5MB PDF) written by Charles Wikner containing introductory lessons for the Sanskrit language. Just take a look at the first chapter to see why I personally consider the phonetically precise Devanagari script to be far superior than the utterly challenged and much abused Roman script, even at the risk of appearing jingoistic.

Twenty Years of comp.compilers
comp.compilers has turned twenty. It is one of the few USENET newsgroups that I try to read regularly and whose moderator John R. Levine has done a rather fine job over the years of keeping the signal-to-noise ratio high enough. He is also known to put in editorial remarks, almost always at the end, in many a post that either answer a question outright or contain pointers to useful material or contain quirky and mostly amusing remarks. Kudos to him and the community that sustains this awesome resource.
"The Perils of JavaSchools"
It is not often that I fully agree with an article written by Joel Spolsky, but this one is an exception. As someone who has been interviewing people for his employers for over eight years, I can attest to the steady deterioration in the quality of candidates I talk to and the depressingly continuous lowering of my expectations over the years when I walk into the interview room.

Yumpee pointed me to an old story about a guy who used a BBC Micro monitoring a decaying prawn sandwich to tell the time!

Jockey is a cool user-space program execution recording and replaying library for Linux. It actually scans the code page of a process to recognise system call instructions and rewrites them to jump to a trampoline instead.

By the way, my favourite Free 3D modelling tool Blender has reached version 2.40 featuring tonnes of cool improvements.

Terrorists Strike in Bangalore
Terrorists opened indiscriminate fire and killed at least one person and seriously injured four to six others yesterday. What was particularly appalling was their choice of the Indian Institute of Science (IISc) and researchers attending a conference on Operations Research as the target!
StanChart Sees the Light
Among the financial institutions I deal with and whose online facilities I use regularly, Citibank India, HDFC Bank and ICICI Bank have had great support for Firefox. The only exception was Standard Chartered India who did not seem to want to support anything other than IE or Netscape Communicator 4. I had pointed this out to their Customer Service several times and even pointed out where in their JavaScript code they were making the mistake, but I was always presented with a verbose, albeit nicely written, message asking me to just use the supported browsers and stop ranting. Needless to say, I was irritated and frustrated.

To my pleasant surprise, I discovered last week that they had silently started supporting Firefox as well. Perhaps it came about because a lot of their developers themselves use Firefox; perhaps a lot of customers actually complained; perhaps they saw that by most accounts, Firefox has around 8-10% of the "browser marketshare". Whatever be the reason, I am happy. It is also heartening to note that a lot of sites these days increasingly seem to just work with Firefox instead of requiring IE.

Free Source Code Browsing Tools
I would like to use a tool that would allow me to easily browse large bodies of source code (for example GCC). I do not need an IDE. The tool should:
  • be able to run on a modern Linux system.
  • be free to use and free to modify.
  • support at least C, C++ and Java out-of-the box, with easy extensibility to other languages.
  • be fast (to create indices, to respond to user actions), lean on resources and intuitive.
  • be kept up-to-date and actively maintained.
  • have a graphical user interface (desirable, but not necessary).
I have looked at Exuberant Ctags (for vi), Source Navigator, Hypersrc/Pypersrc, GLOBAL etc., but do not fully like any of them. Source Navigator comes the closest to filling my needs, but has an ugly interface and (more importantly) does not seem to be maintained at all (for example, no one has bothered to fix the usage of "-fwritable-strings", which newer GCCs do not support anymore).

So for people who do not use IDEs, is there no tool that measures up to these requirements?

Planet GCC
I set up a simple Wiki page listing the weblogs of various GCC hackers as a temporary measure till such a time that we have a "Planet GCC" weblog feed aggregator of our own. Please feel free to update it with links to weblogs of GCC hackers that you find missing.

New Software
SeaMonkey is the new avatar of the Mozilla Application Suite, kept alive by people who prefer the old monolithic application approach to the new approach of having standalone browser (Firefox), mail client (Thunderbird), etc. components. SeaMonkey has just released 1.0 Beta. I personally prefer the old approach as well, but have decided for the moment to not switch back from Firefox/Thunderbird simply because I have now become quite used to these applications and have begun to rely on some of the superb extensions created by the community for them.

QEMU 0.8.0 is out (as is VMWare Player 1.0). By the way, QEMU can be easily used to create virtual machine discs for use with VMWare Player. However, I still prefer to use QEMU.

The Battle for Bangalore
Just when I was wondering how ironic it was to have FOSS.in 2005 and Microsoft's developer bash happen within a week of each other in Bangalore and at the same venue (Bangalore Palace), comes this article. Bill Gates also launched a rather "The Apprentice"-like code4bill contest while he was here, apart from promising to invest 1.7 billion dollars into India. The Times of India and NDTV did not shy from calling him a corny "Geek No. 1" (in reference to a series of hit Hindi movies named "Hero No. 1", "Coolie No. 1", etc.).

So which way would the Bangalore hackers sway?

Despite having a very large number of Software Engineers, I come across only a very few here in Bangalore who are even interested in coding and Computer Science and precious few who are willing to hack on FOSS and give back their changes to the community. For all the brouhaha in the general media about India being an IT superpower, it is a depressing scene for someone who actually likes CS.

Preview of the Next Edition of The Dragon Book
Addison Wesley have put up a sneak preview of what is in the long overdue and much anticipated updated edition of The Dragon Book (a.k.a. "Compilers: Principles, Tools and Techniques" by Aho, Ullman and Sethi). For some insane reason, they have decided to use JavaScript, Flash and pop-ups to show these chapters, prompting instant revulsion in yours truly. I'd rather wait for the dead-tree edition than subject myself to such torture.

www.hackgnu.org To Become Available Soon
Ramakrishnan is giving up his domain www.hackgnu.org. Any Free Software hacker who wants to take it over should contact Ramakrishnan before it lands in the hands of domain squatters.
7 Dec 2005 (updated 7 Dec 2005 at 07:37 UTC) »
Google Quiz in FOSS.in 2005
With a little help from the Google search engine (the irony!), I have found the sources of "inspiration" for the questions asked in the "Google Quiz" (GQ) in the recently concluded FOSS.in 2005.

The first problem was the same as #2 in the problem set for the 9th World Puzzle Championship (Qualifying Test) (PDF). The second problem was the same as #2 in the 2002 US Championship Puzzles. The third problem was the same as #1 in the 2000 US Championship Puzzles. The fourth problem was essentially the same (verbatim, except for the actual numbers) as #22 in the problem set for the 10th World Puzzle Championship (Qualifying Test) (PDF).

Not being someone who solves puzzles regularly (except for Sudoku, of course), I was quite impressed by these problems since most of them involved considering multiple alternatives, proceeding with one of the alternatives and then backtracking and proceeding with another if that proved invalid, continuing till one finds a solution. They should also be fun to solve using computer programs. (I know of at least one person who did precisely that.) I had asked some of the people at the Google booth if I could reproduce these puzzles on my web site to share with my friends, but they were not sure of the copyright issues and clearance for publication. Well, now we know where they got the puzzles from and have found some more interesting puzzles to work on!

FOSS.in 2005
FOSS.in 2005 has finally ended. You can find daily reports and impressions on Planet FOSS.in.

Personally for me, it was a mixed event. I could finally meet some of the people whose work I have admired immensely over the years and I also attended a couple of really illuminating sessions. On the other hand, I didn't get to meet as many people as I had hoped to meet and some of the sessions were bad.

Alan Cox was the star of the event as far as I could tell. He was always surrounded by admirers or people just curious to see how he looks. He always had the Red Hat red hat on and talked very nicely to one and all. Like RMS, he seems to have a bit too much of facial hair and has the same habit of frequently twitching as well. I also met Andrew Cowie (java-gnome), Johnathan Corbet (LWN.net), Sirtaj Singh Kang (KDE) and Harald Welte (iptables/netfilter). By the way, I had imagined Harald to be an old person for some reason all this while so I was rather surprised to find a rather boyish looking young man with a lot of enthusiasm and a cool haircut.

I really enjoyed some of the talks, especially on topics that I knew nothing about. Jaya Kumar's talk on how to put together an embedded Linux system, right from selecting the hardware to customising Linux and burning it into the device, was awesome. The guy really knows his stuff and talks with an infectious enthusiasm on a lot of topics. His other talk on GPL and non-GPL kernel modules was also very nice.

Harald's talk on how he figured out what made up his Motorola A780 mobile phone (that runs Linux), hacking his way to getting telnet access to the phone and finally building and uploading updated kernel and applications was also awesome. He followed it up with a live demonstration. The results of his efforts are at OpenEZX.org. By the way, he uses an encrypted filesystem on his laptop to store everything.

There was a talk on hacking the GCC ".md" machine-description files for a quick-and-dirty solution to a code-generation problem and another on using GCJ with SWIG to interface Ruby with Java. However, I felt that these talks were a bit hurried and would have left most of the audience utterly clueless. By the way, the speaker for the former talk, Amber Ved, had recently fractured his left arm and had it in a sling. It was quite evident that it was excruciatingly painful for him but he persisted and managed to finish his talk. All I can say is, "Wow!". However, I still think GCC is severely under-appreciated and I wish I had put together a talk on GCJ or at least GCC. There's so much that has been happening with GCC that people deserve to know.

Another highlight of the event for me was the Google Quiz or "GQ". This was a set of four logic puzzles handed out to whoever they could lay their hands on and if you completed all four, you had a shot at winning an iPod nano. I really enjoyed solving these puzzles and they kept me busy for quite a bit of time.

Unfortunately for me, the schedule of the talks was such that sometimes I had to make a difficult choice of selecting a single talk among three to four very interesting sounding talks and sometimes I wasn't interested in attending a single talk in a given time slot. "You can't please all the people all the time" and all that. But no one can complain that there wasn't enough stuff going on - this surely must have been the biggest FOSS event ever in this part of the world. I am already eagerly looking forward to attending the next year's event. A big THANKS to Atul Chitnis and his gang of volunteers for pulling this off!

"Hello World" Sans Semi-Colons (Java)
Srikanth has a better solution that works with JDK1.5:

public class Sriki
  public static void main( String[] args)
    if( System.out.append( "Hello World!\n") != null)

127 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!