Older blog entries for rmathew (starting at number 66)

SRM-235
This morning I took part in my second TopCoder Single Round Match (SRM) - "SRM-235". Because of my rating from the previous match, I got to compete in Division 1 this time, which translated to tougher problems and competitors. Alas, I did pathetically in this match with my final score being zero!

Once again, the two problems that I had a chance to try out were not that difficult, but sloppy coding and muddled thinking made sure that my submissions would fail. The 300-point problem was to find out the minimum positive or negative steps needed by a stepping motor to reach any of the given target positions from a given current position. On this problem, integer overflow and underflow proved to be my undoing.

The 400-point problem was to find out the centre of gravity of a perforated rectangular sheet with rectangular holes. Here my solution just did not come close enough to the official solutions and I kept tweaking the multiplications and casts in my solution to match the results. After some time I even converted my solution over to fixed-point instead of floating-point, but it was still a bit off the mark. Such fiddling around ensured that I could not submit the solution in time, let alone attempt the 900-point problem.

My rating has dropped after this match, but still not enough to get me out of the darn Division 1. I look forward to being mauled once again in the next SRM on April 2.

GCJ on Slashdot
GCJ was discussed on Slashdot recently and this time around there were so many positive comments! This comment in particular made my day - it was referring to PR 20312. As Tom remarked earlier, the number of bugs that have been filed against GCJ have increased dramatically in the recent months, indicating that more and more people are trying it out and are hopeful enough about it to bother to report bugs.
SRM-234
This morning I took part in my first TopCoder Single Round Match (SRM) - "SRM-234". I liked the experience and would like to take part in more of these, time permitting.

The 250-point problem was a simple "find the length of the longest contiguous string of either As or Bs in the input". The 500-point problem was to find the sequence of unit fractions ("1/n") in descending order that add together to yield the given fraction "x/y". The 1000-point problem was to find the derivations needed to get to the input string given the productions of a simple non-left-recursive grammar.

The problems (as I have also noticed in the practice rooms) were not difficult per se, but had to be solved "correctly enough" within the given 75-minutes - much less if you also want to get a good score and ranking. It does not really matter if your code or design is elegant as long as it manages to pass all system tests as well as the challenges that other coders might throw at it. The permissible input is also severely restrained so that you do not usually have to worry about validating it.

One thing I noticed is that there were not many Indians among the toppers, while there were quite a few people from Poland. This is quite weird as I have met quite a few good Indian coders. Perhaps the lack of awareness, the lack of an enthusiasm for such competitions, the lack of decent net connections, the weird timings of the matches when converted to IST, etc. play a role. If you are an Indian coder reading this, please do consider taking part in these matches and letting your friends know about it.

C++ is Evil
As if sane people needed a proof showing how extraordinarily convoluted the language is - what kind of a language meant for sane coders needs indefinite lookahead and semantic disambiguation in a compiler so that it can parse source code written in that language?
Miscellaneous
RMS has a blog too!

Congratulations to Tom for getting GCJX to generate code!

GCJ, Eclipse, Glade
While reading the user comments on an OSNews story about "Escape the Java Trap!", I came across this wonderful Flash demo by Andrew Overholt showing off Eclipse running with GCJ and using Glade! It's a different thing to read about this in the mailing lists but an entirely different thing to actually see it in action! Cool!
GCC v/s ext3fs
I build and test the ever bloating mainline GCC at home on a 2GB ext3 partition (that used to contain the whole of my Linux installation in days gone by). It contains GCC CVS sources, a stripped snapshot of the sources to play with and the GCC build folder. Today the bootstrap of GCC failed complaining that there was no space left on the device for the final libgcj.so - a df -k showed that 93% of the space was being used. A dumpe2fs showed me that 5% of the filesystem was reserved for the super-user and the block size was 4K - I moved the data out, reformatted the partition to use 1K blocks and 0% reserved for the super-user and moved the data back in. Now the GCC bootstrap has succeeded and df -k still only shows 70% usage. Pick your lesson to learn from this incident.

By the way, the nVidia 6629 drivers installed and worked perfectly with kernel 2.6.10 and X.org server 6.8.2 - the mistake I made the last time was to not have /usr/include/linux/autoconf.h when I had copied over the kernel headers after building glibc. This gets built when you do a make menuconfig and configure the kernel.

this.ego( ).puncture( )
Intrigued by Sunitha's comments, I checked out a couple of problems in one of the practice rooms in TopCoder. I performed abyssmally - I only got 179 points on a 250 points problem, 242 on a 500 points problem and couldn't even finish a 1000 points problem!

The problems were not difficult per se, but 8 years of "enterprise" software development have blunted whatever little ability I used to have to solve such problems. On the two problems that I did manage to finish, I was stuck for a while with my mind drawing a complete blank on how to solve them - just jammed. Only after a while did my mind clear up a bit and I could code the solutions, but by then I had lost precious time that cost me points.

On the other hand, these are the sort of problems that someone who has absorbed R. G. Dromey's excellent book "How to Solve It by Computer" will find easy to approach and solve well in time. That book seems utterly underrated, as does the classic problem-solving book that was its inspiration, "How to Solve It" by G. Polya. The problems also had guaranteed "good" inputs, so that one does not have to worry about input validation or boundary conditions.

Trouble in QEMU Land
QEMU is a superb (fast and reasonably accurate) emulator for x86 and other architectures and a viable alternative to VMWare. Fabrice Bellard, the extremely talented author of the program, has now written the QEMU Accelerator Module which apparently drastically improves x86-on-x86 performance. Unfortunately, this is provided as a binary-only module and under a proprietary (non-Free) license. He says he would open up the sources only if some company sponsors the effort or he is somehow compensated for the loss in revenue. This has led to flames, "understanding" posts, etc. on the QEMU mailing list.

GCJ and OpenGL
Thomas Fitzsimmons implemented JAWT for GCJ and Anthony Green built on that work to let JOGL run with GCJ! This is sweet - could GCJ become a viable platform some day to write cross-platform 3D games?

57 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!