• 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 March, 2005

Search for the Commons

Thursday, March 24th, 2005

You can now search for Creative Commons-licensed content using Yahoo! Search at search.yahoo.com/cc!

If you did not know already, Creative Commons is a nonprofit that offers a flexible copyright for creative work. Basically, if you made a creative work of art such as images/photography, audio/music, text/books or stories or blogs, video/movies, education/tutorials and you want to share it with the world, then choose a license type that you like and open it up for the world to admire. For example, you get to decide if you want to allow someone to make commercial use of it or if you want to allow someone to build upon the work by modifying or enhancing it, etc. My book is licensed under a Creative Commons license as well.

It is good to know that we are moving towards a more free-er and open world with open source software, open content, open knowledge and even open music. This is turning out to be an information age for the people, by the people and of the people.

One thing I like to see open up is Microsoft’s wallet. Ok, ok, I’m just kidding :lol: And no, Google does not do CC search. In case you have forgotten, Yahoo! is pretty innovative as well. Almost forgot, the search api now supports CC-only search as well.

More information on the Yahoo! CC Search is in the Yahoo! Search blog, the Creative Commons blog and the Yahoo! Search API blog.

Update: With the Wikalong Firefox extension, you can have an open wiki-led way to surf the internet as well! Wow.

Reading H2G2

Wednesday, March 23rd, 2005

Yeah, I’m finally reading Douglas Adams’s The Hitchhiker’s Guide to the Galaxy. I’m reading the “Four parts of a trilogy” all-in-one book…. finished part 1 and part 2 (“The Restaurant at the End of the Universe”) and now reading part 3 “Life, the Universe and Everything”.

I wanted to read this book since quite a while because I’ve heard a lot about it and I mean a lot. The other reason is I wanted to know what was the answer to life, the universe and everything. Yes, it’s 42.

The book is quite humorous and I was enjoying the first part. Now, I’m just reading to finish it off. Yeah, there are some funny passages like this one:

The Hitch Hiker’s Guide to the Galaxy has a few things to say on the subject of towels.

A towel, it says is about the mast massively useful thing an interstellar hitch hiker can have. Partly it has great practical value – you can wrap it around you for warmth as you bound across the cold moons of Jaglan Beta; you can lie on it on the brilliant marble-sanded beaches of Santraginus V, inhaling the heady sea vapours; you can sleep under it beneath the stars which shine so redly on the desert world of Kafrakoon; use it to sail a mini raft down the slow heavy river Moth; wet it for use in hand-to-hand combat; wrap it round your head to ward off noxious fumes or avoid the gaze of the Ravenous Bugblatter Beast of Traal; you can wave your towel in emergencies as a distress signal, and of course dry yourself off with it if it still seems to be clean enough.

More importantly, a towel has immense psychological value. For some reason, if a strag (strag: non-hitch hiker) discovers that a hitch hiker has his towel with him, he will automatically assume that he is also in possession of a toothbrush, face flannel, soap, tin of biscuits, flask, compass, map, ball of string, gnat spray, wet weather gear, space suit, etc. , etc. Furthermore, the strag will then happily lend the hitch hiker any of these or a dozen other items that the hitch hiker might accidentally have ‘lost’. What the strag will think is that any man who can hitch the length and breadth of the galaxy, rough it, slum it, struggle against terrible odds, win through, and still know where his towel is is clearly a man to be reckoned with.

… but still what’s the big deal about this book? My only guess is that I might find out once I finish it or I am just wasting my time. Maybe only Deep Thought can answer that one.

Thout Bytes

Tuesday, March 22nd, 2005

OSoft, Inc. have released my book ‘A Byte of Python’ in Thout format. There are two aspects of Thout – one is that the Thout format is based on XHTML and second, the Thout reader software (similar to Windows .chm Help Viewer) is available for all the major platforms. I am excited about this because Thout provides some very cool functionality – for example, users will soon be able to "upload/download public notes that are placed at the point in the documentation the comment refers to".

There are currently three Python books in Thout format at the OSoft website – the official Python documentation, my book and ‘Dive Into Python’. There are lots of books in the other categories as well.

Btw, Thout software is OSI-certified open source, so it’s good to know that the Thout format itself is implicitly open as well.

iPod!

Monday, March 21st, 2005

My manager went to our Sunnyvale office recently and came back today. I had asked him to get an iPod Mini for me… when he gave it to me in the morning, I was grinning away to glory. I am not much of a gadget guy, but I was craving for an iPod being such a music buff. I forced myself not to open up the package in the morning (otherwise I wouldn’t get any work done). So, when I came back home in the evening, I tore open the package and went total gaga over it.

Packaging of My iPod! Packaging of My iPod!

First of all, it is so compact, I wonder how Apple managed to squeeze so much into something so small… this is the 4 GB version, so I can store approximately 1000 songs on this baby! Oh, and I can use it as a huge floppy drive as well ;)

Coming to life!

The first song I copied to it and listened was the instrumental version of the title track of Roja. For me, there is simply no other song that is as good as that one…

Listening to Roja See how really cute it is!

Just compare the sizes of the iPod Mini and my watch in the last snap above… :)

Now, I just have to find enough good songs to fill it….

P.S. The reason I had to get it ‘imported’ was that it costs $200 == 9 grand rupees that way whereas it costs 18 grand rupees in the Apple store in Forum, Koramangala, Bangalore.

So why not a blog mela

Friday, March 18th, 2005

I’m trying to play catch up with the blogosphere.. but it is difficult when I have 221 feeds in Bloglines. Actually, there were more but I’m trying to trim down my folders to a more manageable size.

I got bored of simply reading, so I decided to host my own blog mela :D , so here we go…

Tech-related
People-related

I think I better stop for tonight. Hopefully, I haven’t violated any blog mela norms.

GCC and the ABI

Friday, March 18th, 2005

From the Autopackage Developer Quickstart:

Important note to C++ developers

If your software uses Qt/kdelibs, or just rely on many (large) C++ libraries, then you must be careful. This is because of C++ ABI (Application Binary Interface) issues: GCC 3.4 broke C++ ABI (again), so software compiled with GCC 3.4 can mysteriously crash on GCC 3.2/3.3 systems, and vice versa. Because of this, we cannot guarantee that your software will run on all (or even most) systems. At the time of writing, most distributions still use GCC 3.2, but GCC 3.4 distributions are coming and GCC 3.2 distributions are not going to disappear any time soon.

Can we have ever have a write-once compile-once run-anywhere system on Linux/BSD?

I guess that’s a stupid question.

Sidebar:

  • Autopackage 1.0 final to be (hopefully) released within a month. Yay!

  • Autopackage basically makes software installation on Linux easier. For more details, read the FAQ.

  • The Autopackage website is very well designed. I’m impressed.

Yahoo 360!

Wednesday, March 16th, 2005

It’s official. Yahoo! has entered the blogosphere. Soon, you’ll be blogging at 360.Yahoo.com :D . The integration is simply awesome. Having played with it, I think Blogger.com will face some real competition now.

Bazaar-NG

Monday, March 14th, 2005

Canonical, the guys behind Ubuntu Linux, seem to be creating a “next-generation distributed version control system” called Bazaar-NG. It’s written in Python and is primarily tested on Ubuntu. I haven’t played with it but it seems it is already self-hosting, that demonstrates a bit of its capabilities. They have excellent documentation already. Although, I am wondering how they are going to handle the ‘distributed’ part.

(via creosote)

Update : The lead guy on Bazaar-NG is also the person who wrote DistCC. So, I guess he knows what he’s doing ;)

Ruby-India First Meetup

Saturday, March 12th, 2005

Today was the first meetup of the Ruby-India group (I wanted to announce this on my blog yesterday but the net connection was down at home :| , <sarcasm>all hail Sify</sarcasm>). I wanted to attend the intro Ruby talk basically because Premshree yaks about Ruby so much, I realized it was better that I understood a bit of Ruby before I lost my sanity. Just kidding!

The meetup was at 4 pm at Avik’s office (Itellix) on Residency Road. First, we had the initial introductions from everyone – there were about 15 of us from many different companies. Yogi, from Thoughtworks, conducted the first session on coding in Ruby. He was mainly writing a program that works like the find program in Unix and in the process, was demonstrating the syntax and features in Ruby. I didn’t understand some stuff like the use of :, @, @@ as prefixes to identifiers but I did get a brief understanding of the language. It sort of helped that I have a Python background but IMHO, a more formal first session that goes through the basics (like my ‘Slither away with Python’ presentation) would have been better for the newbies like me.

Ruby India Meetup Martin and the guys at the back Premshree and the guys in the front

In-between Yogi’s session, lots of guys started coming in. Soon, there were about 30 people jampacked into the small room! I officially declared that we have achieved ‘closure’. Heh. When Martin came in, I looked at him, then turned to Premshree and then to Bret and thought “What’s with Ruby and guys with long hair ?!”… Oh well. Then, my colleagues Rajaram, Tahir and Suhas came in. Then, I realized there were 7 Yahoos in the room!

Next up was Bret’s talk on Watir and Selenium. Bret is also from Thoughtworks and is one of the guys working on the Watir and Selenium projects. Watir is an Internet Explorer-based tool written in Ruby for automated testing of websites. Selenium is a Thoughtworks-sponsored project also about web-testing, but it works across browsers and platforms (yes, it works on Firefox on Linux). Bret explained about how both of these software work and how they are designed. I was pretty impressed with their ease of use and the comprehensive testing that can be done.

Bret Pettichord explaining Selenium Bret explaining Ruby India Meetup Selenium Selenium

The only drawback to Selenium is that it works best only when the websites are written with testing in mind. It won’t work for existing websites. Selenium is actually not Ruby-specific – it is more of an architecture and you can write programs for it in Python, Ruby, Java, .NET and other languages as well. Their website should have more details on that.

On the way back home, I kept thinking that I wasn’t convinced yet about Ruby. Most of the stuff I came across could have been done easily in Python. However, I believe in Alan Perlis’s statement “A language that doesn’t affect the way you think about programming, is not worth knowing.” So I wanted to know more about Ruby and try to ‘think in Ruby’ before actually thinking about its pros and cons and stuff.

Earlier, Prem had suggested that the Pragmatic Programmer’s Guide to Ruby was probably a good place for me to start. So, I opened it up and started reading. I wanted to try out the interactive prompt that was used to showcase Ruby all evening. As explained in the book, I used eval.rb :

[code] $ locate eval.rb /usr/share/doc/ruby-1.8.1/sample/eval.rb

$ ruby /usr/share/doc/ruby-1.8.1/sample/eval.rb ruby> a = 'Hello, world!' "Hello, world!" ruby> puts a ERR: undefined local variable or method `a' for main:Object [/code]

Yikes! I don’t understand what I’m doing wrong here. I hope the ruby-ers can help me out here? I haven’t even got past the preface of the book! I don’t know if this info is useful but I am using Fedora Core 3. Also, I don’t have irb installed on my system.

Maybe Ruby doesn’t like me. Maybe snakes are friendlier than stones. Maybe ….

Update: After a yum install irb, which also upgraded Ruby to 1.8.2, I have the ‘Hello World’ program running using irb (short for __i__nteractive __r__u__b__y).

Walk the tree

Saturday, March 12th, 2005

In the second round of Google India Code Jam 2005, there were 3 problems to be solved in 1 hour. The first question was easy. The second question was also kind of easy, but I mucked up due to bad handling of corner cases, however I finally managed to get all the 5 examples working. I didn’t have enough time to solve the third problem.

My second solution failed in the system testing. I was kind of irritated about that but was too lazy to find out where it went wrong. One of my colleagues did a post-mortem for me and told me that in one of the loops, I had i < 10 instead of i <= 10 … Arrrggggh….

Anyway, the third problem was kind of baffling for me: “Given a sequence, figure out the minimum number of moves required to convert it into an arithmetic progression” (this is a simplification of the longer original problem).

I first thought of using differences between consecutive numbers and so on, but quickly realized that wasn’t the solution. Then, I thought this problem must have something to do with dynamic programming or some sort of tree-walking to compute the proper sequences. However, I was too lazy to try it myself and got caught up in work anyway. So, I sent the problem to few of my colleagues and got them to scratch their heads.

When I bumped into Avinash in the evening, I told him about this problem, he immediately said that this has got to do with game theory and all you have to do is tree walking. I didn’t understand his solution at first. So, he said “I’ll write it in Python and send it to you in half an hour”, and he did! Next thing I know, Gopal and Avinash are optimizing it – the time taken came down from 1 min 15 seconds to about 7.8 seconds! Avinash explains it in more detail in his writeup about it. As expected, after seeing his solution, I have that ‘Duh’ kind of feeling…