Archive for October, 2004

Stuff

October 9th 2004

This sucks. I have to go to bed like, now, because my wife is taking the SATs tomorrow, but the lovely people at the College Board decided that the best place for this sort of thing is on the other freaking side of Jacksonville, which is the largest city by land area in the continental United States.

Now I love my wife to death, but she can’t navigate to save her life, so I have to drive her to take the test, which means I have to be up in about 6 and a half hours, assuming I fall asleep as soon as I lay down (I won’t, I’ll toss and turn for a couple of hours. :-( ).

I’ve been spending my free time recently working on abakus. I’ve investigated ANTLR for generating the C++ parser for abakus, but unfortunately it is not only too time consuming to relearn and switch, but I’ve figured out how to make the current form more or less sane without sacrificing a ton of nice code design principles. What I’m doing now is forming a syntax tree for every expression that descends from a common base (incidentally this has let me add user defined function support). The functions used to create the syntax tree are, instead of being global functions, a part of a singleton object, which can emit signals as needed. Once I’ve cleaned everything up it should be really cool.

What I also need to do is see about switching to qmake again. Since I’m compiling everything in C++ mode now that shouldn’t be a problem, although I have the feeling that qmake will somehow barf on the lex/yacc part once again. I wonder if there’s a way in qmake to indicate that some files depend on parser.y or lexer.l, since that would make my job much easier.

It has occurred to me that developing abakus has been a delightfully useful exploration of various techniques that most KDE devs don’t get a chance to practice often, which has been both good and bad. For example, we obviously don’t typically roll our own Makefiles. This hasn’t helped users whose systems were different enough from mine to be a problem, but it has (ironically) made me much more productive, not to mention the incredible speedup in the build process for users where my Makefile did work.

I’ve also been able to play with C/C++ integration, although I wouldn’t recommend that anyone stop what they’re doing and try it. If you have a choice in the matter it is better to simply compile everything you can in C++ mode and use singleton objects or namespaces when you need to use global functions.

Posted by mpyne under Uncategorized | No Comments »

Multiple (incompatible) C++ standard libraries.

October 5th 2004

JuK is one of the few KDE programs that relies on C++ libraries other than Qt and KDE. These libraries include MusicBrainz and libOggFLAC among others, and we seem to get users every so often (especially Gentoo users sadly. I use Gentoo myself, so I know their pain =D) that have managed to install two different standard C++ libraries, so that JuK uses the new ones but JuK’s C++ library dependencies use the old one.

Because this happens so often, I’ve made a Perl script to tell you what libraries JuK depends on that use an incompatible libstdc++, which is an attachment to bug 85889.

Also, I’ve made a new release of abakus, which I won’t comment further on since I know people reading Planet KDE must be tired of hearing about calculators by now.

Posted by mpyne under Uncategorized | No Comments »

Speed testing SpeedCrunch

October 2nd 2004

Ariya Hiyadat has submitted his calculator implementation, giving KDE users a choice of 4 (!) different calculators.

I’ve tested it a little, and I have to say that it’s pretty good work, especially the bit about using pure C++. I was tempted to go that way myself but constructing the appropriate LALR(1) table by hand, but that’s hard to maintain, which is why I’m still using bison/flex.

I like very much how alternate lines have different colors, which seems “better” somehow than inserting separators between different entries like I have mine now. Oh BTW, kcalc2 has since become abakus (and has made it to version 0.52), which was a name suggested on #kde-devel by argonel.

The only things I’ve found that I don’t like with SpeedCrunch are:

  1. 4 * atan 1 is an invalid expression, but 4 * atan (1) is valid. However, the same doesn’t seem to apply to 4 * atan -2 and 4 * atan (-2), as both are valid.
  2. It appears to be possible to truncate an answer with noticing, as SpeedCrunch doesn’t have any horizontal scrollbars, but you can resize the window so that your answer is clipped (and it starts up that small for me, but that’s neither here nor there).

It’s a great effort though, especially since it’ll compile on more systems than mine will =D. It’s a pity that Ariya doesn’t have time to do more with it. I’ll probably tweak abakus some more to try and improve it, as I’ve received some good suggestions of varying difficulty. P.S. Debian users, you may have to tweak the Makefile to change KDE_PREFIX/include to KDE_PREFIX/include/kde, or wait until tomorrow when I remember to post the corrected version.

Bonus points to Ariya for limiting his hospitality to non-alcoholic beverages, I always hate it when people try to push me to drink something alcoholic. ;-)

Posted by mpyne under Uncategorized | No Comments »

« Prev