Clarence Dang's Blog

Sunday, August 26, 2007

I was doing KDE programming on a 3 year old Celeron 2.2GHz laptop late Thursday night. I finished and turned it off -- nothing out of the ordinary.

The next evening I tried turning it on. The "on" light lit up and the fan started spinning. All was good until 5 seconds later: it just shut off - the light went off and the fan stopped. A few seconds later it turned on again. It kept looping in this cycle.

If anyone has an idea of what this is or whether this can be fixed, I'd be very grateful. I have lots of uncommitted code sitting there so if the laptop's dead, I'll have to move the hard disk to another (less powerful) laptop, at least to get my code off.

Nothing is displayed on the screen so it's not even getting to the POST tests. There's no beeping whatsoever. And there's no smoke :)

I opened up the laptop today hoping to find something loose or abnormal but I can't see anything wrong with it.

This laptop has had a habit of getting up to 90-91 (ninety to ninety-one) degrees celcius during compiles (before Linux shut it down), if I didn't prop it up to give it more ventilation, so maybe it finally fried?

Thursday, May 31, 2007

With today's announcement of Google Gears - "an open source browser extension that lets developers create web applications that can run offline" - I'd like to make a somewhat obvious prediction that GMail will feature a disconnected mode within, say, 2 years.

I still cannot figure out how I managed to do that. As far as I can see, I was only using OpenOffice.org Writer, viewing webpages and had compiled KDE4 earlier in the day. The machine had not even been up for 10hrs.

If KDE4 mimetypes aren't working, type "kbuildsycoca4" instead of "kbuildsycoca". I believe this change allows for KDE3 and KDE4 apps to coexist. I thought I'd share this since it took me an embarrassingly long amount of time to figure it out :)

I also recall someone saying that the "shared-mime-info" package had to be a certain version. So I found a Fedora RPM for 0.17 and upgraded to that (I know that RPM is old but it was the only one I could find quickly). Not sure if it was required though.

Monday, April 23, 2007

Update (2007-04-24):I've been told (see the comments) that the Linux support works out-of-the-box these days with newer distros. Also, I've got nothing against hplip - it's just that hpoj was the first one I got working with such an old distro. I ran into numerous difficulties setting up this scanner because of conflicting information on the internet and also instructions that just didn't seem to work for my setup.

The HP PSC 1315 stands for "Hewlett-Packard (all-in-one) Printer-Scanner-(photo)Copier". It's a USB colour inkjet and was dirt cheap considering all the functionality - less than $100, years ago. I do not recommend this hardware (see bottom of post).

Now I was interested in getting scanning to work under my old Fedora Core 4 system. The scanner supports 600 DPI and this is more than I need. After much googling and conflicting information, a search string of hp psc fedora got me to these working instructions. This uses the obsolete "hpoj" driver, instead of hplip's "hpaio" driver, but I don't mind since kooka and xsane both work now. Thanks very much to "zparihar" on linuxquestions.org for that useful post.

I can think of only 2 things that I have found harder to install under Linux: support for the Aetheros WPA wireless and an analog joystick. I won't even attempt to set up the printing for the time being since I don't need that capability.

By the way, I initially found this HOWTO Install a USB Scanner guide on the Gentoo wiki, which looks like it could be useful for other scanner models. I gave up on it since it looked too complicated by the time it asked me to add a 03f0:3f11 line (printer USB ID given by lsusb) to /etc/hotplug/usb/libsane.usermap.

I strongly recommend against buying this printer given that Linux support was not out-of-the-box and also given that HP's driver for Windows is horrendous. Regarding the latter, sometimes print jobs go nowhere and deleting them from the print queue does nothing, blocking all future print jobs. Unplugging the USB cable is another sure way of preventing one from deleting print jobs even after reattaching the cable. Some combination of rebooting, reinstalling the printer under a different USB port etc. (I still haven't found a reliable way) is required to delete the stuck print jobs. To make things worse, the "HP Director" application would quit silently after the IE7 upgrade and after applying a patch from HP, it now starts but the buttons don't work.

Thursday, March 08, 2007

Update:We came equal 44th out of 88. While it's generally invalid to draw certain comparisons in such competitions (since you can jump a large of number of rankings by debugging just an extra problem), I'll draw one anyway: we equalled CMU and beat Harvard :) However, pretty much all of the other unis I listed below beat us easily. The University of Auckland is a deserving South Pacific Champion with a Bronze Medal.

Overall, I'm happy that we made it this far and I'm happy with this year's performance against an elite set of world class competitors. On the non-technical side of things, we had a great time in Tokyo and at the Disney Sea theme park, paid for by IBM. It is on this high note and after nearly 10 years of contests, that I'm retiring from programming competitions.

It will be interesting to see how we'll fare against the Chinese, Russians and MIT, CMU, Harvard, Waterloo etc. considering that their teams were presumably picked from a multi-tiered qualification process (and reportedly, the Chinese education system also has high schools - not just universities - dedicated to programming!), while the qualification process for the South Pacific consists of a single competition :) In any case, we hope to improve on the performance of recent South Pacific teams.

Anyway, after all this craziness / intense competition is over, I hope to finally, finally, finally get back to opensource programming (although, consistently, every year, I seem to find a different distraction). So in a sense, I wish the competition was over more quickly :)

Monday, December 25, 2006

However, a problem is that binary files, like .ODT, don't work well with revision control systems.

Firstly, they aren't diff-able so you have to also keep a .TXT file, in the repository, in sync with the .ODT. This is error-prone and the .TXT diffs don't reflect formatting changes.

Secondly, because OpenOffice.org files are compressed (.ZIP format), the binary deltas that revision control systems (e.g. SVN) use to save space fall apart for even the tiniest of changes to documents, due to the characteristics of compression.

But thanks to the second anonymous commenter on that blog post, I came up with a new way of revision-controlling OpenOffice.org documents:

What I now do is keep the unzipped OpenOffice.org document in revision control, not the binary .ODT file. This means that I can diff the content.xml between revisions, not bother keeping a .TXT file in sync and avoid SVN's space-inefficient binary deltas since I'm really only keeping text files in the repository (more on this later).

If you checkout such an unzipped OpenOffice.org document from SVN, you can use my magic Makefile to reconstruct the .ODT from these unzipped contents by typing make. It's just like adding water to milk powder.

And every time you make a change to the .ODT file, the samemake command works the other way and updates the unzipped contents to match the changed .ODT. Then you can svn commit a new revision.

Caveats:

* Warning:svn status will not report changes to the .ODT, until you type make. Be careful or you might think that your checkout has no local changes and you decide to delete the checkout to "save space"! A "foolproof" way to get around this problem is to skip the svn propedit svn:ignore . [and type kolourpaint-developer-guide.odt] step.

* It actually does store a binary file in revision control, namely Thumbnails/thumbnail.png. I haven't dared try to work around this though, for fear that OpenOffice.org won't like me playing with it.

* Some files such as layout-cache and settings.xml, while not binary unlike Thumbnails/thumbnail.png, change on every save and probably shouldn't be revision controlled either.

* You can't have 2 people working on the same document as merging two content.xml files is asking for trouble. But at least you can diff between revisions.

* A lot of lines in content.xml may change in response to even a small layout change due to lots of tags changing control numbers.

If you try this scheme, please let me know how it goes.

BTW, in the end, my thesis turned out to be 192 pages (probably, about 100 pages too long :)). It was on porting the L4 microkernel to processors without virtual memory, specifically the Blackfin processor. It was written in a rush so apologies for the awful number of spelling and grammatical errors!

1. I actually thought Keramik was stunning during the early builds of KDE 3.1 - it was the perfect balance between good eye candy and not being so noticeable that it got in the way. Unfortunately, I believe it changed in the final KDE 3.1 (please correct me if I'm wrong) and the gradients became too striking.

I liked it in combination with KDE 3.1's bluish icon set, which was sadly replaced in KDE 3.2.

I still use Keramik with the KDE 2 colour scheme and I like it better than Plastik (which is still a very good theme).

2. The window colour changing on focus switches in KDE 4 is a feature of the style, I believe. It is really slow indeed on my old graphics cards as well and for a while I thought it was a palette bug, until I realised that it was supposed to be highlighting the focused window.

I'm sure this will be fixed eventually but I'd still expect KDE 4 to be a tad slower than KDE 3 because of Qt4's automatic double buffering. But I think this is a reasonable price to pay for less flicker.

On a side note, for those of you who are wondering, that automatic double buffering is actually done per top-level window, rather than per widget (I looked inside the Qt code for this and it's actually quite clever).