Older blog entries for dennissheil (starting at number 3)

My patch was committed to jEdit, cool.

I was looking through the source code for the latest version (23.0) of Crafty recently. It is a CPU and time sensitive program, so I ran gprof on it to see what it spent its time on. About 85% of the time was spent calling ValidatePosition(), which didn't seem to be doing anything of importance. I looked around a little bit and saw this was happening because the Makefile's -DDEBUG flag was on by default for a make linux, and that this was not well documented (it's not there by default for 22.9). I suspect that the flag was left in there by error before it was packaged for release. Anyhow, I sent them off a note.

1 Aug 2009 (updated 2 Aug 2009 at 16:44 UTC) »

I have been taking a Java class recently, but thus far had not really taken the step of rolling up my sleeves and doing some real coding other than the standard Hello world, Hanoi towers, Fibonacci sequence stuff. I finally settled on trying to take a wack at a bug in jEdit. Much of the problem was solved by the people posting in the thread, especially Denis Dzenskevich. This combined with a little bit of digging in Sun documents on the Pattern and Matcher classes and a good Javaworld article by Cristian Mocanu on regular expressions in Java pointed to the problem. First, I converted the long in-the-wild file this was freezing on to a simple and legal five line Perl program. After doing this, I saw the problem. jEdit was using a greedy quantifier in the regular expression where it should have been using a reluctant quantifier. I sent in a patch, notified the original bug poster and he mailed me that it fixes the jEdit freezing problem for him.

The problem still exists if the Perl code has malformed backslashes in the second field of a tr statement using curly brackets. However, the fixed bug is rare enough that it wasn't discovered until June, and unimportant enough that my patch hasn't been committed over the past week, so this rarer case is an even lower priority to look at. Which brings to mind a jEdit bug "FindBugs" brought to light - two uses of "Math.abs(new Random().nextInt())". Now on the 1 in 4 billion chance the random number is the absolute minimum possible, will Math.abs return a positive number? The answer is no (I tested it). Again, the odds of this happening are low enough that a patch is low priority.

My patch (#1556112) made it into the latest release of GOCR, cool.

Lately I have been working a few things. One of them is chess-related programs. I wrote a PHP program that takes a chess FEN and displays a chessboard based on it.

Right now I am working on a program, with a PHP frontend and MySQL backend, which instructs how to run through the opening properly. It will also have a section showing how often I have played this move.

I also have another program which will use a chess engine (Gnuchess, Crafty or the like) to annotate games, and then on the moves where I blunder (or miss an opportunity), it will save that move. Then it will display all the places I blunder, so that I can look at them and learn what the proper thing to do is.

5 Oct 2008 (updated 28 Aug 2009 at 02:06 UTC) »

Doing Perl programming. I am usually in a rush to do what I want so my usual practice is to throw everything together and just get it working, and then do cleanup later. Sometimes the cleanup is necessitated by things breaking, like it is now. This code interacts on the Internet, and as remote servers are always changing, I have to expect that my code will change due to that. Currently I am giving variables meaningful names and inserting comments. There is also duplicate code which is bothering me, although not hindering anything other than me having to make changes twice. Also, some of my functions are too long and have to be broken up. My C is better than my PERL, so I am more used to doing things in the good "Code Complete" style when programming in C, but my PERL programs are getting long enough, and are changing enough where I have to make sure it is not spaghetti code.

After working as a UNIX admin for ten years, I decided (with a friend's encouragement) two years ago to go to night school to get my bachelors. I took a lot of required courses for art and the like first, but my last two courses and current course are on the Computer Science major track. Aside from getting a cursory knowledge of C++ in my last class, I haven't learned much useful that I can apply yet, although my current class on assembly is supposed to go over processor registers, memory etc. So far we have only been learning addition in binary and the like.

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!