• Java time resolution

    Posted on: Sat, 02/09/2008 - 20:21 By: Huahai

    I am writing a Java program to run psychology experiments. Since this is a generic program that may be configured for running some reaction time (RT) experiments, I am worried about the time resolution of Java. It turns out that I don't need to worry too much, except on Windows. On Linux, one millisecond time resolution can be consistently achieved using either System.currentTimeMillis() or System.nanoTime() call.

  • A Simple GTD List Solution: Desktop, Web and Possibly Mobile

    Posted on: Mon, 12/10/2007 - 04:25 By: Huahai

    I have been searching for a lightweight list solution since I started trying out the Getting Things Done (GTD) approach a few days ago. Unlike calendar events, list items (projects and actions) do not associate with a particular time and date, therefore, using a calender for them is not appropriate. According to David Allen, for lists, we should "just go for simplicity, speed, and fun". Here I operationalize that into these properties:

    • Simple, but can still do these:
      • Handle lists for "project", "next-action", "waiting-for" and "maybe"*
      • Be able to tag an item with "context", and organize items by context
      • Support sub-list
  • Editing Web Textarea with Desktop Editor

    Posted on: Fri, 12/07/2007 - 07:17 By: Huahai

    Nowadays we do a lot of text input on the Web, like posting on forums, filling out a support request form, commenting on someone's blog, etc. Although Web forms often offer a variety of so-called rich text editing capabilities, nothing beats the good old desktop editors. For a vim person, a plain Web textarea simply is not the place for text editing. Fortunately, for Firefox users, this pain can be eased. There are a few Firefox addons that allow people to use external editors for editing textarea.

  • Firefox Hangs

    Posted on: Thu, 12/06/2007 - 10:52 By: Huahai

    Although Firefox is considered very safe and stable, it sometimes hangs. In the past, when it hung, my solution was to remove the whole ~/.mozilla/firefox directory. It worked every time (reinstalling Firefox doesn't help). Of course, I would always backup my bookmarks.html and other files under the chrome sub-directory first. Then I had to reinstall the add-ons when I got a working firefox. It turned out I shouldn't have taken such a drastic action.

  • An Mac Look for my KDE Desktop

    Posted on: Wed, 12/05/2007 - 10:04 By: Huahai

    Although I have never laid my hands on an Apple computer, I have seen people going crazy about them. I remember seeing some kids shouting hysterically in front of Apple store on the release day of Tiger a few years ago. The user interface of Apple's OS is said to be one of the selling points. So when I was feeling tired of Mepis Linux's default look last night, I decided to try an OS X look for a change. It turned out to be relatively easy to do.

    KDE widget Basically, getting an OS X Tiger look and feel on KDE involves installing a theme that imitates its look and feel. There is a KDE theme called Baghirathat does just that. It's so popular that Debian sid has it in the pool, so

  • Use Vim as Info Page Browser

    Posted on: Thu, 11/29/2007 - 07:56 By: Huahai

    In this post, I set up vim as a manual page viewer, using ManPageView plugin. It turned out that the same plugin can be used to view info pages as well. All one needs to to is to add ".i" suffix to the command that you are seeking help on. For example, ":Man sed.i" will show the info page for sed. With this information, we can set up vim as info page browser, just add these lines in ~/.bashrc:

  • Reverse/Forward Search with Latex-Suite in Vim

    Posted on: Thu, 11/22/2007 - 17:19 By: Huahai

    When editing a long Latex document, it is beneficial to be able to point from current location in DVI back to Tex, and vice visa. This is what called reverse/forward search between DVI and Latex. With Latex-Suite in Vim, this functionality is already implemented, and there's no need to specify "\usepackage scrltx" in the Tex file. However, it's not fully configured by default. Forward search with "\ls" works, but inverse search by "Ctrl-Left click" in xdiv is not enabled.

  • kmail hangs due to missing loopback interface

    Posted on: Thu, 11/22/2007 - 01:50 By: Huahai

    My /etc/network/interfaces got deleted when I removed mepis-network package. Everything was fine, except that kmail would hang since IP address 127.0.0.1 doesn't exist. It took me half an hour to figure it out. Had to create the file with these lines in it:

    auto lo
    iface lo inet loopback

    Now things went back to normal.

Subscribe to Huahai's Blog