Learning Django by Example(5): Software is hard

Web December 26th, 2007

“Software is hard.” reads the quote from Donald Knuth that opens Scott Rosenberg’s Dreaming in Code. Even the development of Gelman is not smooth as I expected.

Think big, but not fancy

Gelman is a hobby project to scratch personal itch, at the same time it acts as the playground to learn django and dojo. Therefore, it is extremely difficult to resist the temptation for some bling-bling but not essential features, which are called “free feature” in the industry. For example, the fancy django-registration plug-in. It will be cool to integrate a ring-and-whistle registration module, but do I really need this module since I am probably the only user/administrator of this web application, why bother to waste effort in registration?

Deodorize the smell

It is quite annoying to work on a bad structured code base with misleading name convention. Eventually, I decided to re-organize the layout of the source code, and moved out from Google Code to Assembla, since the latter provides the Trac support for online source browser and ticket support.

Some other changes include:

  • Rename library as bookshelf
  • Move the core functionality for book/add to file/add
  • Redesign and develop (in progress) the MassAdd functionality for files in server’s incoming

Find a formal way

What make Gelman stands out is his admin interface, 60% of its functionalities are only available to administrator. When working with admin module, we should play the game of default admin. Eventually, I may have to copy the code from admin module for the sake of security and behavior consistency. In this situation, the Django Book cover what is on the table, but not under the table.

Here is just a snapshot of current progress, the MassAdd.
MassAdd

Migrate to MTP

Desktop, Gentoo December 15th, 2007

About nine months ago, I tried to embrace MTP since Creative Lab does not support their own proprietorial protocol(libnjb is the open source implementation) in Windows Vista, and I was really frustrated by the lame upgrade support.

Here is a chance for me to get a 2nd generation Zune which is powered by MTP. Although libmtp is still in very early stage to bridge the gap, we could predict its future from the history.

Amarok supports MTP if the USE flag mtp is enabled. However, the latest stable version 1.4.7-r2 has a bug when transfer file with CJK characters. The bug happens when interfacing with libmtp:

int ret = LIBMTP_Send_Track_From_File(
-        m_device, bundle.url().path().latin1(), trackmeta,
+        m_device, bundle.url().path().local8Bit(), trackmeta,
         progressCallback, this, parent_id
     );

The bug is fixed in SVN (ticket), but if we take non-utf8-locale users into account, for example, MagicLinux takes GB2312 as the default locale, local8Bit may have more flexibility than hard-coded utf8, and it also worked in the UTF8 environment.

Here is the patch , and as usual, an ebuild for Gentoo users (manual).