Wednesday, February 28, 2007

Copyright Myths and Misunderstandings

I first learnt about copyright the "hard" way. I was on the verge of releasing a program, and that entailed that I learn as much as possible on copyright and software licensing --- I'm one of those guys who actually reads the license agreements! As a pleasant side effect, I learnt about "copyleft", the GNU GPL and Free Software, which eventually led me to stop considering licenses for my software: my software is usually in the public domain (i.e. no copyright) or is GPLed (i.e. copylefted).

Here are some things you should know about copyright:
  1. Copyright registration is not required. It's very useful if you ever expect to go to court, but as a friend pointed out, just e-mailing the source to yourself at some public e-mail service, such as Gmail, would probably establish that you did it earlier. And you can keep your work secret too.
  2. Copyright is assigned automatically to you. There is absolutely no need to even say "Copyright (c) Year, Author". At least after 198x, I think.
  3. Copyright is available for all works, regardless of quality. It protects both your kindergarten drawings and Escher's complicated and beautiful works equally.
  4. Copyright covers only distribution. That should be evident from the name, but a lot of people put restrictions on use and ascribe them to "copyright". If you intend to distribute the work, for profit or otherwise, you need permission from the author. Note that if your use of the material falls under "fair-use", permission might not be required. However, fair-use is never defined explicitly, it's upto the courts to decide what exactly is fair-use.
  5. Copyright is limited. It expires. However, current copyright time limits are so generous that you may have to wait for a very long time for any part of current culture to fall into the public domain.
  6. The public domain, as a legal expression, means that there is no copyright asserted. A public domain work belongs to all, and everybody is free to do whatsoever he/she desires with it. Copyright and public-domain are mutually exclusive. You can put your works in the public domain by stating so, without having to wait for the expiry of your copyright.
Note that I'm not a lawyer, and the US Copyright Office's Copyright FAQ page has lot more information.

Wednesday, February 14, 2007

I'm Kewler than You Think (!)

Behold! My new SHE-F18P MP3 Music player!


This little baby brings me into that hallowed land of people who possess hardware digital audio players! Well, these days that's about almost everybody, and so nothing "kewl" about it, but who goes for technicalities anyway?

It's a 1GB player with MP3/WAV support. Unfortunately. Why did I get this? Well, it was gifted to me, and I couldn't refuse a freebie. I had my eyes on the Cowon iAudio family of players, which would have set me back a couple of thousand bucks, but no price can beat FREE when it comes to a poor student :)

Removable LiIon battery, with both wall and USB-based charging, support for about a dozen languages---it started up in Traditional Chinese! (This is probably why I got it!) I concentrated and hit the right buttons, and there was the French interface! Soon after there was the English interface. Some fumbling on part, Japanese followed by German/Deutsch and then finally English. I bet I can now do this in my sleep now.

In other notable features, supports LRC (Lyric files), can display text files as well, easy USB transfer mechanism (though seems very very slow on the download path). Notable anti-features: MP3-only support (no OGG!), doesn't seem to support M3U playlists (haven't tried PLS), no FM radio (though the manual does hint at FM support, I can't read Chinese!) and tacky buttons.

Amarok seems pretty happy with it, though it does seem to have it's own individual ideas of how to place files (configurable, of course), though the player doesn't seem to mind. But I do want playlist support.

As another sweet thing, I also got that old 256MB player that I lugged around once or twice in Jan 2006 (remember?), which means I can get down to reverse engineering it. My folks were kind enough to send rechargeable batteries and a charger too!

It does have firmware upgrade support, but I doubt the manufacturer has released anything at all. Retails for 199 Yuan (around 1200 rupees) in Walmart China I suppose.

Now I can get down to practising for Marathon 2008!

Update: It does play OGG! I've never been so happy to be wrong! Can't seem to read the metadata, but who cares (for now)! Note that the OGG support isn't advertised anywhere, it justed started playing the files! Whoo-hoo!

[Photo courtesy: NP]

Tuesday, February 13, 2007

Open your Data!

[Warning: Long long rant]

I'm scratching a rather irritating itch. I'd like to travel around in Bangalore, but I don't have the money to move around in rickshaws, nor can read Kannada to figure out where a particular bus goes (No dual language boards here!). After having been pampered by BEST, the BMTC is getting to be a royal pain.

I've bought maps, guide books, route maps, time tables, but they've all been "designed" without even consideration for the most common use-case. Just know the stop names? You're out of luck. No source lists stop names, only stage names (which is what the BEST also does, BTW).

Well, not exactly no source, for there is one source that has stop-level granularity. The superbly detailed large-format BMTC route map (50 bucks!) is that only source, but nobody intended it to be used that way. In fact, it's a mystery to me how people are supposed to use this thing. Only a laborious search through the entire map will reveal the locations of the stops, and once that is done, correlating that information to route numbers is next to impossible. In fact, the map wastes precious space on "segment numbers" (which I guess actually constitute routes), but that information in its present format is only intelligible to somebody on the inside--it's not used by any other information on the map.

Well, this is Bangalore, the IT capital of India, and so the BMTC provides a web-based interface to search. Except that it sucks big time. There are two versions, (and I'm guessing here) a "professional" JSP edition, and a "final-year project" PHP version. Forget the technical mistakes---using POST for idempotent data---the UI design is horrid. It's what most UI designers would say is the perfect example of the programmer-designed interface. Letting the UI reflect your code, and not the opposite. Both the "search engines" present drop-downs, presenting stage-to-stage information. Wow. I imagine that everybody travels from stage to stage only.

So what do I do? I do what I do best. I'm now writing a search engine for finding information about buses. Its called busfinder, and will initially provide "similar" functionality to the existing "search engines". Except, of course, it won't be tied down to the BMTC. I intend it to be used by any bus service. It will be small, fast, and featureful. It'll be written with the traveller in mind, and not the backend database structure. I've got a little experience doing this sorta thing, and hoping this will also clear up some of my programming blues.

Which brings me to the real topic of this post. Which is data. Everyone who's spent some time in this industry knows that programs are a dime a dozen. It's your data that's actually valuable. That's why vendors prefer to use proprietary data formats--once locked in, they know you'll be at their mercy forever. And that's why there exists even a data conversion sector.

But for my search engine, I need data. The BMTC could do me a wonderful service by giving me access to their data in a machine-readable form (maybe they will, if I ask, but I haven't and won't). But for now, I had to scrap their HTML pages. And as I have found, their data sucks. There are missing routes, incorrect stop names, and inconsistent information that all stink to heaven of five-buck-an-hour typists and even cheaper database architects (normalization, anyone?).

And then I had this idea inspired by their application to make their route maps available via Google Maps (which now has street-level data for Bangalore, but not yet searchable, aargh!), but there seem to be no public-domain (or even freely-licensed) geo-referenced information available for Bangalore. The info exists--see http://traffic.mapunity.org (functionally similar to busfinder, but with the same UI problems)and http://www.janaagraha.org/jmap/, but no data is available for download. It's all locked up behind the respective applications. No APIs either, so no mash-ups possible.

Which is why I make this appeal. Free your data! Make your data available in machine-readable format with liberal licenses for use by the general public. If you're a government institution or somebody who doesn't necessarily have computer expertise---tap the internet! Release your data and see how the brilliant minds of the 'Net breath life into your data. Remember, there is always a better program. But you may have the best data.

Monday, February 12, 2007

G'bye Windows Support

With Windows Vista, it's now two windows versions that I've never seriously used. I stopped using Windows when XP was released about 5 years ago, and have never looked back. I moved to Red Hat Linux, then to Ubuntu, using Debian along the way. This has meant that I'm really out of touch with the "mainstream" computing world.

That is not so bad. Imagine the tons of support requests I'd get, which I now decline with "Sorry I don't use Windows". And I'm not lying either.

Thursday, February 08, 2007

Wirefree!

I received a Jabra BT135 Bluetooth Headset, courtesy HP, a couple of days ago. Funny thing is that they import it to a place that's ten minutes from the Institute, but I had to wait for two months for it!

My primary purpose for this new toy was to use it with Bonszai, rather than with a mobile phone. Yes, it's mono and not stereo, but going wireless with audio would be fun! Turns out Linux does support these headsets out of the box, with the snd-bt-sco driver. Essentially, this driver supports bluetooth headsets by appearing as another sound card to all applications. This page has more details.

Unfortunately, nothing ever works out of the box for me. Turns out that because I'd re-compiled ALSA separately from the rest of the kernel, the snd-bt-sco driver refused to load, citing lots of missing (and version mismatched) symbols. Either I could recompile the entire kernel or go back to the older version of ALSA (and lose the normal headphone support!). I decided instead to upgrade to kernel 2.6.20 which I knew would have the latest ALSA. The only thing that would break would be the nvidia drivers.

So there I was, snd-bt-sco loaded, btsco running, and trying to get a song to play using aplay or mpg123. Except it just wouldn't play! The headset would pair up, authenticate, send messages to the computer whenever I pressed buttons, emit a ringtone when I commanded it from the computer, doing everything short of playing a song. All the music playing apps would just freeze. Others had encountered this situation too, but nobody seemed to have found a solution to it. Just bugreport after bugreport. I struggled for a long day, before giving up.

Today, I found this bluetooth-alsa page and this thread that documented a fix to exactly the same problem. The solution was simple: use the force_scofix argument to the hci_usb module (when you load it the first time), especially if you're running a Broadcom adapter.

Voila! It worked! Sound is not that great, but it is convenient to listen to music about 5 meters wire-free away!

I hate Broadcom. What's wrong with them? First wireless adapters, now Bluetooth adapters. Sigh.