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

SQL and XML are not that different

Monday, May 9th, 2005

About a year ago, I had presented my 8th semester presentation on Xen, now called C Omega. It is a language that combines SQL, XML and OOP into one tight language. The paper that proposed this language was named Programming with Circles, Triangles and Rectangles. The circle represents the encapsulation behavior of objects and OOP, the triangle represents the tree structure of the XML and the rectangle represents the tabular structure of databases.

Video of Anders Hejlsberg talking about C# 3.0

I recently came across Anders Hejlsberg’s interview on Channel 9 regarding programming data in C# 3.0 and it looks like C-Omega is going to be ‘merged’ into 3.0. Its amazing that MS has taken this concept (which seemed totally radical to me when I first read about it) to production quality and is actually going to make this a core part of their platform.

Let us consider an example of using C-Omega. Suppose you want to handle books in a program used to manage libraries. Then you could write a book class using C-Omega as

[code] public class book { sequence { string title; choice { sequence{ editor editor; }+; sequence{ author author; }+; } string publisher; int price; } attribute int year; } [/code]

The cool part is that the above same class can be used to store the data either as XML or in a relational database. You can also instantiate an object using XML syntax:

[code] book b = SwaroopC H www.byteofpython.info 250 ; [/code]

Note that this syntax is still static typing. Needless to say, the C-Omega compiler must be one heck of a monster.

The Python connection is that the C-Omega-ish method of access will probably be included into IronPython at some stage. Even if that doesn’t happen, we already have Pythonic ways of doing XML as pointed out long ago by wspace.

If you have ever written a program that uses databases, I highly recommend reading the Circles, Triangles and Rectangles paper. It just might change the way you think about databases and SQL, or even XML for that matter.

You can also download that old presentation of mine on Xen.

Connect the text

Monday, May 9th, 2005

A while ago I was thinking about using a wiki to organize my notes, but I don’t know if even that scenario would be useful for quick note taking because of the conversion from wiki syntax to HTML everytime which causes a lag when saving the notes.

I have found a simple and effective solution (next to paper and pen, which I would always prefer) by using VIM with the Universal Text Linking plugin and the Markdown syntax file.

As the name indicates, the Universal Text Linking (or UTL for short) plugin allows you to create URLs that you can access like real hyperlinks (within VIM) and even opens a browser or media player depending on the type of file you link to.

I like using Markdown syntax because I find it to be the most cleanest and simplest of semantic text markup styles that I have used. So, the Markdown syntax highlighting makes the text even more pleasant to read.

Let me give an example on how I created a plain text wiki:

![13103132][Medium][]

I have one central file which acts like an index to the other documents and this is the first file I always open. I also put in any critically urgent, etc. stuff in this file, so I’m always reminded of it.

I have unimaginatively named this file as ‘plan’ and here are the contents of that file:

  • [ProjectA]
  • [MeetOnSaturday]

From here, I just press \gu on [ProjectA] and it takes me to that file. So, I read or make changes to the notes on my top-secret project and then I just hit Ctrl-O and I’m back to my ‘plan’ file which I started with.

If you run set filetype=mkd for the file, you will get Markdown syntax highlighting. Better yet, just put a modeline such as # vim: filetype=mkd as the last line of the file and VIM will automatically do this for you everytime.

In effect, you have a wiki using just plain text!

I think I must be catching the Wikiphilia.

Sidebar: I have let mapleader="," in my vimrc file, so I press ,gu to open links. I find the comma easier to type than the backslash.

Do you want to Yahoo! ?

Thursday, May 5th, 2005

I have completed nearly one year and one month as a Yahoo i.e. including my internship. I even have a blog post on that on the day I joined.

It’s hard to remember that just one year ago I was just a college kid. Just one year ago, I used to be run to class every morning because I never managed to get up early. Just one year ago, I used to sleep in class and do techie stuff at night with a meagre dialup connection. Just one year ago, friends used to meet just like that and no planning was required (unlike today)…. I guess you know how the story goes :) … but one year in yahoo… what a rush!

When I first joined Yahoo! Bangalore, there were about 60-70 people, we had that nice startup feel going. Now, we have nearly 300 people. There are plans to increase the headcount to 500 by hiring 200 more people by end of next year! That’s right, that statement is straight from the horse’s mouth … err, the Y! Blr CEO’s mouth.

So, if you are interested to come and join the gang here (you would be crazy not to be interested), I will mention five simple requirements from you:

  • You have to have a passion for computing.
  • Go through the bangalore.yahoo.com portal to better understand what we’re really about.
  • You have to know at least one programming language really well.
  • Write a minimal search engine. If you can design, implement and run a simple search engine in 2 hours, then you’re ready for the Y! interviews ;) … think about this question, it is not as hard as it looks. Remember ‘minimal’ means fancy features are not required (but go ahead if you want to), what is required is just something that works well.
  • If you still think that you “have it in you”, send your resume alongwith a small paragraph explaining your skill set and the areas in which you are technically strong.

Update : One of the positions that is open right now is a MySQL-oriented developer position for the 360.yahoo.com :D

Everybody’s a salesman

Wednesday, May 4th, 2005

If you believe Paul Graham when he says that hiring is obsolete, then you should read the ten commandments for entrepreneurs by Alan Morgan.

It just reinforces the fact that everybody’s a salesman.

Update : Paul Graham’s full essay is online now

Messenger Bot

Wednesday, May 4th, 2005

Eva is an online assistant bot that you can access using Yahoo! Messenger.

![12232641][Medium][photo]

It has functionality to help you with dictionary meanings, exchange rate, flight info, phone info, reminders, stock quote, thesaurus, time of any place, weather of any place, as well as feedback to the person who wrote it.

This ends the public service announcement for the day.

Faith and Life

Tuesday, May 3rd, 2005

Last weekend, I had been on a pilgrimage with my family to Rameswaram. I have heard that Rameswaram is supposedly the biggest temple in India, although I haven’t been able to confirm that. The highlight of the pilgrimage was that we had to take bath in, or rather poured a bucket of, water from each of 22 wells in the temple. The other highlight was the Meenakshi temple in Madurai which has 1011 statues.

![11997364][Small][photo] ![12001813][Small][photo] ![12002254][Small][photo]

Rameswaram is an island and is connected to the mainland through the Pamban bridge which is a structure of beauty.

![12006315][Small][photo] ![12007187][Small][photo] ![12007315][Small][photo]

According to the Ramayana, Rama and his followers built a bridge (sethu) from Rameswaram to Sri Lanka using stones, crossed the ocean and then he rescued his wife Sita from the demon king Ravana, Lord of Sri Lanka. On his successful return to Rameswaram, a lingam was installed and Rama worshipped Lord Shiva to absolve himself of the crime of killing Ravana. This lingam is one of the reasons why Rameswaram is considered a holy place for Hindu devotees.

![12014358][Small][photo] ![12017034][Small][photo]

In the long journey between Madurai and Rameswaram, I wrote a poem (if I can call it that):

![12007807][Small][] ![12008130][Small][]

Life is about breaking out… Breaking from the routine Breaking out from what is expected Breaking out from your own expectations Who knows where life’s journey leads to But maybe it doesn’t matter As long as you make your choices And have no regrets.

![12015934][Small][] ![12004055][Small][]

Life is about freedom… Freedom to choose Freedom to live the life you dream of Freedom to help your friends Freedom to keep your family happy Freedom to have a philosophy Freedom to live by your rules.

![12008726][Small][] ![12009783][Small][]

Life is like music… Every song has its appeal So do opportunities Every tune has its rhythm So does our family Every lyrics has its meaning So do our values Every album has its genre Such as our nation Every beat has a pulse Such as each day Every song has a beginning and an end Life is like that What matters is how you feel when the song is ending