Dugan Chen's Homepage

Various Things


Using PyQt4 to download images from Last.fm

The following is code that I’m planning to roll almost directly into Quetzalcoatl. It asynchronously downloads an image from Last.fm and loads it into a widget. The image then scales with its containing widget, using maximum amount of space while keeping its aspect ratio. Keep in mind that it’s example code, not production code, and […]

Playing SDL_mixer games with soundfonts

Here’s a post for people who use Linux and still like to play games. As almost everyone above a certain age is aware, DOS was a popular gaming platform. Because most DOS games were made before the advent of CD-ROMs, they stored their music in MIDI format, which is extremely space-efficient. A MIDI file is […]

Django with Yahoo’s Geoplanet Database

Most web applications eventually need to provide the following user experience: select your country select your “administrative division” from a list appropriate for your country Where administrative division could be state, city, province, prefecture, or something else appropriate to your country. It goes without saying that to pull this off, you need a populated backend […]

The MPD Client Library Begins

This is a follow-up from a post made a couple of days ago: I’m starting to write a reactive MPD client library for PyQt. Well, I’ve started. There has been some soul-searching since then about just how far I would like to go with this. Do I want to limited it to idle() calls (which […]

I’m starting to write a reactive MPD client library for PyQt.

The Music Player Daemon commonly known as MPD targets Linux, runs as a daemon, requires you to set a port number, and allows clients to connect to it and send it commands. The commands are plain text: you can connect to the daemon via telnet and send it commands from there. Now, if you have […]

Progressively Enhancing Upload Forms

This is how you progressively enhance an upload form. Start with your average run-of-the-mill upload form. The following example takes a file whose maximum size is two placekittens: We can use this form in page like the following, where the user is expected to upload an image. After the form is submitted, the server-side code […]

3D accelerated with Flash. And NVidia. And Issues.

The Linux version of Adobe’s Flash player is at 11 beta 2. My tests have shown that its 32-bit and 64-bit versions perform identically. That is to say, identically badly. It is very unlikely that you’ll be able to watch full-screen HD videos with a default install. For starters, Flash is notoriously CPU-intensive. If you’re […]

Building Python 2.5 on Slackware64

There are reasons why you might want to install Python 2.5. One of those reasons is to develop Google App Engine apps. Unfortunately, Python 2.5 was never released for the 64-bit version of Slackware. By the time Slackware64 was released, it was already shipping Python 2.6. I could get from an old version of Bluewhite64 […]

Single Page Web App Architecture Done Right

The holy grail of web application architecture is not the single-page application. It is the single-page application that works as a multi-page application if you don’t have Javascript enabled. Here’s the right way to write one. It’s simple to describe. You first make it work as a multi-page application, preferably without Javascript. Then you enhance […]

Installing Adobe Air Apps (like Balsamiq Mockups) on Slackware64 13.37

Installing Adobe Air apps on Slackware64 13.37 is not painful if you know how to do it. Start with a standard multilib setup. First, remove Seamonkey and install GConf and ORBit2 from extra/google-chrome. Then install mozilla-nss and gnome-keyring from SlackBuilds.org. Taking dependencies into account, you get the following list of packages to build and install […]


« Previous PageNext Page »