• About

    Swaroop C H is 27 years of age. He graduated in B.E. (Computer Science) from PESIT, Bangalore, India. He has previously worked at Yahoo! and Adobe.


    Email: swaroop (at) swaroopch.com

    Read more about him

  • Subscription

    If you want to know when new stories and articles appear on this website, you can subscribe to the RSS feed or have them emailed to you.

  • Want me to write about something?

  • I'm a Wannabe Hacker

    The Glider: A Universal Hacker Emblem

Archive for January, 2005

My sister draws in GIMP

Saturday, January 22nd, 2005

Ladies and gentleman, I present to you a scenery painting by my 7th standard sister Swathi using GIMP !! :)

'The Sea' as imagined by Swathi

Note that I’ve only taught her to use Linux and open GIMP, she learnt how to use GIMP by herself.

I explained her the concept of ‘Undo’ – she says she’ll use it to make better paintings in future!

Python meetup in Bangalore tomorrow

Friday, January 21st, 2005

There’s a Python meetup at Ebony Restaurant, Bangalore tomorrow at 7.30 pm. Please do join if you are interested.

Anand Pillai has taken up the initiative for the gathering. Details of the venue are as follows:

Barton Center is a prominent building on M.G Road a few yards after Higgin Bothams & Indian Coffee House, when you walk from the Brigade road end towards Cubbon Park end. It has a fast food joint at the entrance , which is busy most of the time. In case you come early, please wait there. However do remember to walk up towards Ebony by about 7:15 – 7:30 pm. Ask the hotel staff for the tables reserved by Anand Pillai.

Stuff that’s gonna happen:

  • Member introduction
  • Discussion on experiences with Python.
  • Discussion on planned activities of the group.
  • Discussion on meeting places and fund pooling.
  • Food and drinks :)

8 people (including me) have already RSVPed ; Pradeep and Premshree are coming as well.

This is gonna be a fun evening. See you there!

Choose Python

Thursday, January 20th, 2005

I have printed this ‘Choose Python’ poster (by Tim Lesher) and proudly posted it in my cubicle.

Oh, and as JD commented, I am brainwashing myself to say "Solutions matter. Don’t focus on anything else. Solutions matter."

P.S. My Python category feed was added to PlanetPython. Thanks Ryan! … this will be first post showing up on it, so a big hi from me to all you PlanetPythonistas :)

Evolution on Windows : The Cross Platform Holy Grail

Wednesday, January 19th, 2005

Nat Friedman announced that Tor Lillqvist, of GTK+ on Windows fame, has joined Novell and will soon be working on a port of Evolution to Windows!!

I am not particularly excited at the thought of using Evolution (I prefer Thunderbird) but I am excited because the effort that will be put into the porting will certainly help the GTK port itself, a lot. It means I can seriously consider writing a cross-platform software now.

I’ve been contemplating learning wxWidgets (and wxPython in particular) but I find it to be a moving target most of the time, it’s not stable and I heard the cross-platform feature of wxPython is not really that great. I have detailed this in my post on the byte-of-python mailing list. I really like Qt but, through experience, being able to write cross-platform apps sometimes really does matter.

What experience, you ask? I once wrote a software called Diamond which was a medical laboratory management software. I toiled on it for several months and wrote about 13,000 lines of code for it. It was also my first big GUI project. All the features were great, there were few rough edges but it was reasonably acceptable, it’s only failure was that it didn’t run on Windows. Why? Because I had written it in Qt and I couldn’t afford the Qt licensing fee just for this project. I wasn’t able to convince the doctors to switch to Linux just to use this software. Plus, they used special hardware to scan images (of the patient) and needless to say, they require special device drivers which I am pretty sure wouldn’t be available on Linux.

Also, when I write a GUI chapter in my book, I want to steer clear of licensing issues as much as possible – its simply too confusing for newbies.

This brings me to another irony: Qt is under GPL and GTK is under LGPL, even though GTK is part of the GNU hierarchy who created and promote the GPL. Yet, the LGPL is the only advantage I see that Gtk has over Qt. I see every other advantage in Qt – powerful, simple, lots of useful widgets (the database widgets are really terrific), excellent documentation, C++, no need to worry about freeing memory (Qt takes care of it), upcoming Qt 4 has lots of goodies in it, …. and yet I’m back to square one.

I’ve even looked at wx.NET but I was just not comfortable with it – it looked more like ‘wxWidgets – the latest edition without pointers’ to me.

One good thing abou GTK is the look and feel – it feels nice and polished, sometimes I see the Firefox -> About menu just to click on the dandy ‘Ok’ button.

One bad thing is the new GtkFileChooser, it gets in my way every time – especially if I click on an attachment in my mail and want to change the ‘Open With’ program to something else, I browse to ‘/usr/bin’ and then it hangs since it is trying to list the 2674 files in that directory in the window…. I tried to use the autocompletion in the editing mode that pops up whenever you try to enter text in that dialog but it is completely unnatural for me to use it since the damn thing autocompletes it even before I press a tab! Sigh…. I usually directly enter ‘/usr/bin/kwrite’ in a KDE Open Window.

So for now, I will use KDE and probably will write Gtk apps (i.e. whenever I need to write GUI programs).

Note : I wanted to point to the screenshots of Diamond but my g2swaroop.net domain is down at the moment. I’ll update this post when it comes back online (hopefully in a few days)

P.S. I am trying hard not to make this post a flame bait.

The Road to Gandolfo

Wednesday, January 19th, 2005

I just finished reading ‘The Road to Gandolfo’ by Robert Ludlum.

As expected, Ludlum writes a brilliant story. Although the first half of the book is not that interesting, the latter half totally changes things around. The story is about General Mackenzie Hawkins, a living military legend and a veteran. He defaces an important Chinese memorial as a result of being drugged by a Chinese general. He later gets kicked out of the army. Seeking revenge, he plots one of the most outrageous plans ever – to kidnap the Pope and hold him for ransom of $400 million – one dollar for every Catholic in this world!!

There’s only one person to stop him and that’s Sam Devereaux, an army lawyer who rescues the Hawk from China but subsequently himself gets trapped in the Hawk’s plan.

The story revolves around how the Hawk executes the mission in amazing precision and discipline along with his band of seven provocateurs and the unexpected reaction by the Pope…

Read the book to find out what happens in the end.

Overall rating (out of 10) : 6

Sidebar : Its amazing how I finished this book. I was reading it during breakfast or dinner time only. I finished it in a matter of 4 days!

Note: I have added a page to Wikipedia about this book since it was missing. Feel free to criticize :) .

Why is the computer against me ?

Tuesday, January 18th, 2005

Aargh!! I’m having one of those bad days…

As it is, I’m having major problems with SQL in my work and have a tough time with that …

On an unrelated note, I am trying to install a package and rpm throws up with an error:

$ sudo rpm -qa
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index using db3 -  (-30978)
error: cannot open Packages database in /var/lib/rpm
no packages

$ man rpm

$ sudo rpm --rebuilddb
rpmdb: PANIC: fatal region error detected; run recovery
error: db4 error(-30978) from dbenv->open: DB_RUNRECOVERY: Fatal error, run database recovery
error: cannot open Packages index

And now all Yahoo sites are not opening in my browser – I’ve tried Konqueror as well. I’ve tried flushing the Firefox cache, restarted Firefox….. Nothing’s working. Sigh.

Background music: ‘In The End’ by Linkin’ Park:

What it meant to me / will eventually / be a memory / of a time when I tried so hard And got so far But in the end It doesn’t even matter I had to fall To lose it all But in the end It doesn’t even matter

Update : Even my net connection at home is down due to an incompetent cable-wallah. And of all the things, a reboot fixed the rpm problem!!

$ sudo rpm -qa
tzdata-2003d-2
ethtool-1.8-3.1
libstdc++-3.3.3-7
fedora-release-2-4
pcre-4.5-2
shadow-utils-4.0.3-21
zlib-1.2.1.1-2.1
grep-2.5.1-26
procps-3.2.0-1.1
dev-3.3.13-1
......

Will Yahoo buy Six Apart ?

Tuesday, January 18th, 2005

The Internet Stock Blog predicts that within six months, Yahoo! will buy Six Apart – there are lot of valid arguments and I agree with most of them.

Blogs are going to be the thing in 2005. Well, if you are reading my blog, you know what it’s all about anyway ;)

Also, note that Yahoo! Korea has had a blogs section since quite a while and clicking on blogs.yahoo.com takes you to yahoo groups and not a ‘Not Found’ error page.

We live in interesting times… :)

Btw, I wonder what the LJers think of all this! On a somewhat related note, of interest to LiveJournal users, Premshree has set up a LJ syndication feed for my blog.

Premshree joins Yahoo!

Monday, January 17th, 2005

Premshree Pillai joined Yahoo! today. Welcome to the gang Premshree!

If you didn’t know already, Premshree recently presented a talk on Ruby at Linux Bangalore/2004. You’ll also see many of his recipes in the Python Cookbook. To see his list of publications, see his CV.

Alex Speech

Monday, January 17th, 2005

If you work in the software field, then you must read this speech by Alex Stepenov (Principal Scientist, Adobe Systems) at Adobe India on 30 Nov 2004.

He doesn’t speak about any out-of-this-world concepts, but simple things that we should remember. It could be summarised as ‘Go back to your roots’ , but its still a worthy read.

Tip of the hat to Azmi for sending this to me in the first place.

Read the PDF.

Snakes and stones

Monday, January 17th, 2005

Well, I came across this blog post by ‘PragDave’ where he writes a quick Ruby script that extracts the latest 5 entries from an RSS feed, writes it to a file and FTPs it to a remote box.

Seems simple enough but somehow the script just wasn’t readable to me!!

So, I thought of writing my own quick hack in Python to do a simple comparison and so I wrote the following script in about 8 min. Most of the time was actually simply downloading FeedParser and running sudo python setup.py install :)

Here’s the script:

[python]

!/usr/bin/python

import feedparser, ftplib

d = feedparser.parse('http://www.swaroopch.info/feed/rss2/') entries = min(len(d.entries), 5) # choose minimum entries

tmpfile = file('/tmp/topfive', 'w')

for i in range(0, entries): print >> tmpfile, '''

%s
%s

''' % (d.entries[i].link, d.entries[i].title, d.entries[i].description)

tmpfile.close()

ftp = ftplib.FTP('ftp.swaroopch.info') ftp.login('username', 'password') ftp.cwd('public_html/files/tmp') ftp.storbinary('STOR topfive', file('/tmp/topfive')) ftp.quit()

[/python]

You can also see the output file.

This piece of code is a lot more readable, cleaner and faster for me to write. Also, I have never used the ftplib and feedparser modules before, this is my first time ever. It took just a few minutes for me to start using them both and they’re doing all the hard work in this script.

After this comparison, I don’t think there’s an incentive for me to try Ruby, but of course, Ruby has other stuff going for it. However, as Bruce Eckel puts it, "if Ruby pushes the right buttons for you, great. It’s probably the tool that will make you most productive right now, and that’s what you should use. It doesn’t really matter whether I am a fan (yet)."

Sidenote: I tried to post a comment or trackback to PragDave, but I couldn’t find a way. If somebody can find a way to do that, please let me know.