Saturday Apr 19, 2008

Make the Mecurial Web Interface More Useful

I've made some enhancements to the web view of Mercurial.

Change tag and branch names into links

For you guys using mq, when you request a web review, you send out the URL of the changeset generated by qpush, something like:
before the reviewer is finished with the task, you do some qpop/qpush/qrefresh, and the URL for the changeset changes to something else:
After apply this patch, the yellow tag labels links to a URL which is permanent for the patch, and take the format of:

Add file status tag in changeset

Simple enhancement to the changeset view, where you can see symbols before the file names meaning +(Added), -(Removed), !(Modified), r(Renamed)

Toggle view of full contents and diff only

For those (possibly mq users) who sends out the changeset URL for web review, your reviewer may prefer the webrev format more because it contains more information. This patch may not provide as many as info like webrev, but it does show a "Toggle Full Codes Display" link on the changeset and filediff page, click on it and you read all the contents of the old and new files. Plus now it shows 2 columns of line numbers for the old version and the new one respectively.

Normal view:

After you press the link:

Friday Apr 11, 2008

My First Google App

Comic Translation

Using the app, you can input a URL of any comic, and translate the words on it into another language. I've included an English to Chinese example of the latest Dilbert. It's a bug fun!

Possible todo:

  • One URL can be translated into mulriple languages
  • Author, date, title support
  • Better UI.
  • Comment inside translation
  • Deal with background color, tough!
  • ...
For now, I'm not so eager to do any of these.

Tuesday Mar 11, 2008


Thursday Mar 06, 2008

Evince does not show images in some SafariBooksOnline books

This is Adobe Reader:

and this is evince:

Wednesday Feb 27, 2008

Closing guests on VirtualBox

I find out that the guests inside VirtualBox on my Windows 2003 R2 on amd64 cannot be closed cleanly. Using either of the 3 options in close (power off, reset, pause), the guest all goes into a frozen state: window not closed, process not terminated (still using CPU highly). The process even can not be killed from Task Manager. Normally I would log off the logon user to force killing all the processes running by the user. This time, I even cannot logout.

So I have to restart the host system. I've done this 2 times for the last 2 days.

Finally I find a solution, using the command line VBOXManager.exe controlvm. All 3 closing styles work, still very fast and smooth. Shall I write my own GUI upon it?

Tuesday Feb 26, 2008

Japex and Google Chart API

I'm about to do some profiling on JSSE and Sean recommends me this Japex tool. It uses JFreeChart for graph and an X11 env is needed. However, I'd like to run it on my Linux from remote, and I don't like exporting those DISPLAY things. So, it's a very nice chance to practice the Google Chart API.

After some coding, I can successfully output the graph I needed (2 bar charts) without JFreeChart and X11. The Google chart looks a little ugly, no 3D mode. Maybe it can be beautified but I think it's enough now, and I'm lazy to support other types of chart at the moment.

Here's a comparison, first the original JFreeChart output, and then the Google Chart one (clickable):

Update: find another reason to keep away from JFreeChart. I'm using Landon Fuller's SoyLatte headlessly.

Monday Feb 25, 2008

VMWare to VirtualBox

I have already started using VirtualBox at home on my Mac for some time (Yes, long before the Sun acquisition of innotek), and I like it a lot. AFAI can fell, It's faster than VMWare. Maybe that's because I haven't used VMWare's top tier softwares, all I've been using are Workstation and Server.

OK, so today I decide to move the Virtual Windows Lab I've played with for a long time (~ 2 years) at work to VirtualBox also. The current lab includes 3 Windows servers and 3 clients, all connected into one domain, and I use it to check my codes on Kerberos and SPNEGO etc etc. The whole thing uses 70GB on an amd64 machine.

I spend half a day's time to reconstruct the virtual lab, and it's very successful. Now there're 4 machines inside: a KDC (2k3), an IIS (2k3), an XP, and a Vista. It's quite enough for common experiments now. BTW, the other OS in my previous lab are a Win2K (for interop) and a German XP (as a general foreign OS). There are one thing to note anyway:

VirtualBox's NAT style of network is different from VMWare's. For VMWare, it's a single network inside the host that's not touchable by the outside, but all guests on it can communicate with one another. For VirtualBox, this is not true. If you install several NAT guests, each of them are isolated in their own private network (all with IP assigned). In order for them to talk to each other, you use a different style of network setting, called "Internal Network", which you can created multiple instances, each with a different name. In order to access the world, just add a second NIC to the guest with NAT style.

After the domain is established, I install MSVC and MKS and Java quickly, now everything is OK. The first batch of log files are already on its way... very fast and smooth!

Monday Feb 18, 2008


Moving furniture recently, with these puzzles. I wonder from which one I should start replaying them again.

Saturday Feb 09, 2008

Damned runauto..

Let's curse Windows again.

Recently I had my external hard disk connected to someone else's Windows PC, and when it's back, I see several files in the root folder with names like autorun.exe and autorun.inf etc. I've never been afraid of these files since I don't think they should do any harm to my Mac. The only thing I need to do is removing them and inform the PC user that there's something wrong with his/her computer.

Well, this time, it's a little tougher.

There's a file called "runauto.." that can never be removed, it even cannot be viewed. If I click it in Finder, it disappears, but when I open the folder again, it re-appears again. I try to remove it in a console, the system answers there's no such file or folder. Try Disk Utility to repair the disk, the tools says no error.

So I find a PC from my wife and boot it with the Ubuntu CD-ROM. Connect the hard disk and try all the same steps, and the result is pretty the same. It must be an illegal entry. Since it's only a FAT formatted disk, I'm thinking about starting the ancient Norton Utility DISKEDIT tool to manually rewrite the FAT table. Oh, haven't done that for ...err... 15 years? That's thrill.

But how can I boot a DOS 6?


Finally it's removed by running "rm runaut~1" in a Mac console. I find this solution from

Thursday Jan 31, 2008

My First Python Experience

In order to call some Mercurial functions more speedy, I write my first Python program today. It's not too difficult, and the code layout looks quite ...err... clean. Sometimes I cannot help typing a semicolon at the end of one line. I've tried to create most materials using Perl first and feed the semi output into this Python script, so it really hasn't done much.

Sometimes gluing really costs a lot.

Wednesday Jan 16, 2008

Sun Acquires MySQL AB

First, this is stunning news.

Second, expect from earning commercial support money, I have no idea why this must be done. Adding database software to our whole products portfolio? But it's already open sourced and we can always use it, enhance it, and contribute our enhancements back. We don't need to buy Perl, Python,... Right?

Tuesday Jan 15, 2008

More Mecurial

I'm continuing with the previous post on Message Queue.

Using message queue to cope with multiple bug fixes is great. The final step is to commit the patches and finally push them back to the gate, and we're faced with our old friend: conflict and merge.

There are 2 places when you will see a conflict:

  1. If you want to commit a patch that's not the first one. I've written a script to detect if a patch has any conflict with those before it. If yes, you cannot just reorder the series file. You can still just reorder it, but must re-apply the patches in the new order to see if there's anything unusual and fix them. Another method is to use the flipdiff tool. You still need to review the output.
  2. If the source repo has updates. Yes I also have a script to compare the incoming patch from source with the local ones. If there's a conflict, remember it. Yes, currently I only remember them. I'll pop all the patches and do a fetch. The hard part comes, I'll just push the patches onto the new qbase. Since I know there's conflicts, I'll push them one by one. Any time there's a reject, fix it.

Thursday Jan 10, 2008

Dear Slashdot

Ever since there's RSS and then RSS aggregator in Thunderbird, and then Bloglines and finally Google Reader, I seldom go to those real websites for news and blogs. Everything is read from a single place. Some feed only shows partial content, just remove it. Some has images that cannot be viewed from Google Reader, just ignore it.

But there's still ONE site that I do not read in Google Reader, and that's the almighty Slashdot. For me, the comments on each piece there are the real precious goodies, whether they are Funny, Interesting, Informative or Insightful.

One or two years ago I've read somewhere that Digg is more popular than Slashdot. OK, maybe it's more "popular", but Slashdot is still the only website that I'm willing to go through the long comments pages and happily reading them.

Tuesday Jan 08, 2008

Still Haven't Got Fedora 8 OK

This morning I tried to install Fedora 8 using the DVD (tried burning CD, never succeeds in Ubuntu, the CD drive just get lost after starting the burning process, but the save drive burns DVD+R nicely). The installation is very smooth, and I cannot help myself digging into the detailed package customization. After restarting, it asks me how do I like to log on, and I choose NIS and tell it the domain name and server.

But then I find NIS does not start because ypbind fails. Take a look at the yp.conf file and change it to the format I like (as in Ubuntu), ypbind completes and ypwhich returns the correct domain name. However, when I log out of the local user account and want to log on with the NIS name, the log on screen never shows, only the cursor with swirling rain drops spinning forever. After I disable the ypbind service, the logon screen appears, but I cannot work with that.

I've tried logging in console mode with my NIS username and it works. Anyway I'm back to Ubuntu now.

I know in Ubuntu you need to add those "+::::" lines at the end of /etc/passwd etc. Don't know if it can cure the Fedora case, maybe have a try later.

Thursday Jan 03, 2008

Flash sound perfect in Ubuntu?

Just upgrade to Ubuntu 8.04, still a very alpha version, but I'm the on-the-edge guy.

The sound for Flash in Firefox finally seems stable. In all old versions, when you starts Firefox, you can hear the sound in a Flash content. But then, after a while, for no reason, probably due to running another native program using the audio interface, it suddenly stops and never makes any sound until Firefox is restarted. I'm not a hardware geek, after several failure of different configurations reading from the Net, I give up and don't believe there can be nice sound for Flash in Firefox.

For 8.04, it looks solved. I can listen to and running mplayer at the same time. So, finally I needn't go back to the Meebo window every other minute and can rest assured relying on the ding dong.

Off topic, I've looked at the recently released Fedora 8, with a Live CD-ROM that can be also used as the installation disk. This is just the very reason I choose Ubuntu over Fedora. Maybe I can give it a try some day?

Update: About to go home, I'm now listening to Pandora, YouTube, NetVibes (Java Posse podcast) and mplayer simultaneously, and I can still hear the ding dong in Meebo. Oh, this is not my normal behavior anyway.


This blog has a comments managing system that requires me to approve each comment manually. Please do not re-post and I will reply it (if I have an answer) when I get pinged.


Top Tags
« July 2016