Saturday, May 17, 2008

Been always for the lookout for good games to play on my cellphone on those days where you do not have anything else to do, but had always ended up with sub-par free games or those that require you to cough up dough out of your wallet.

The other day, when I was checking out my long used collection of games, I stumbled upon a few LucasArts DOS based games. Looking up the internet, I found ScummVM, a virtual machine capable of playing LucasArts games which has been ported to almost all different types of OSes like Linux, Windows, Symbian OS etc. So, I had been able to download and install ScummVM and a couple of free games.

You eventually get a mouse pointer which you can control using the directional keys to perform various in-game actions. Though a little cumbersome, if you have time to wile away, ScummVM is work a try.

Free games to try are:
  • Beneath the Steel Sky
  • The flight of the Amazon Queen

Wednesday, May 14, 2008

iPods? Nahhhhh

Ever since the pod hit the market, it had created a big industry of other wannabe players. Agreed that Apple's iPod is not the first of its kind, but the quality and simplicity the product made the world sit up and notice.

As with most of us, I had also been tempted to get a pod of my own, but somehow been unable to justify the need for a music device, at least while at India.

Unless you are jogging during the mornings or commute using a public transport, I do not see a big reason to use an iPod. If you have your own 4 wheel transport (My opinion is, it is unsafe to listen to music on a two wheeler), chances are, they have a port to read in from your music device. But, do you need an expensive music player for that? With the advent of mass storage devices, high capacity flash pen drives, all you need is a medium for storage, not a music player. I just saw at a computer shop at Spencers, creative mass storage harddisks with the capacity of 120+GB (great for lossless FLAC format music files anyone? Hmm... This looks like a good idea for my next article...) available for picking.

While in office, you have your trusty high performance desktop or your laptop to host your music. I'm sure you are not going to listen to music as you walk to your cafeteria. So a desktop or a laptop would do.

The one advantage that I see is, you always carry your cellphone. So, if your music player and your camera and your phone and your PDA and your computer are bundled into one, I would probably take a look as it does not increase the number of devices and dangling pairs of earphones that I have to carry.

Perhaps the deal by AirTel and Vodafone with Apple would allow the availablility of the iPhone into India. I would wait a year or two for the prices to come down to own one.

Sunday, May 04, 2008

Inside a Text Editor

Ever since my college days, after dabbling with vi and a few other editors, I always had an yearning to create my own. Now, I am still stuck with XEmacs and jEdit and had a chance to compile / study the sources and documentation of EMACS and a free editor component called Scintilla.

Until now, I was under the the belief that text editors used a doubly linked list to represent the text in memory. The advantages of this approach being insertions and deletions are much more easier which is just a matter of just un-linking a node off the list. But the shortcomming is that they tend to fragment memory with each node or line take a bit of memory.

The other alternative approach is to have a dynamic array which is a contiguous space of memory and can sometimes be directly written off to a file. The disadvantages are that insertion and deletion are costly and you need to reallocate quite frequently.

While goint throug the source and documentation of text editors, I chanced upon the Buffer Gap algorithm that provides the benefits of a contiguous space and yet minimizes the impact of insertions or deletions.

The algorithm is simple where the text is represented as an array of characters. There is a gap in the array that can be moved or repositioned. Every time a few new characters are inserted, the gap is moved to the location where the characters are to be inserted and it is just a matter of using the gap as a buffer to insert the new set of characters. The end result is, the gap size has reduced. Deletion is a similar affair where the gap is simply extended to include the area that needs to be deleted.

Wikipedia has a short description of the same algorithm.