Sunday, August 28, 2005

Capitalized!

I had not blogged for quite sometime now. The reason is that I am now in Delhi (Gurgaon) for a week now and I was busy setting up stuff. We are put up in a hotel in gurgaon. We are here doing 'consulting' (whatever that means) for a client of ours.

This is my team standing in front of our office excepting one who is taking the snap. Will put up nicer snaps when I get the time to shoot. This project seems to be challenging in terms of client facing, communicating, convincing, etc. Lets see how it goes. But one sad thing is that I had to cancel my trip to Leh because of this project. But as long as there is something new to learn,I am for it.

Sunday, August 07, 2005

Face the Music

Most of the people around me listen to music while working. I see them with ear-phones/ headphones, nodding their heads, enjoying their music, and their work. Even I have tried that lots of times, and miserably failed. I have found that if I am in the midst of something serious and interesting, which requires a lot of my concentration, I just can't listen to music. If I am listening to it, I lose the hang of whatever I am doing and my mind gets involved in the music.
The music just takes over the whole of my mind and I sort of lose my context completely.
I don't know. It might be that I am poor at concentration, or it may be that I am more interested in music, or it might also depend on what kind of music I listen to.
But, whatever it is, this is how I am...

Tuesday, August 02, 2005

What is meant by Data?

I saw a very interesting piece of code in the SICP. It took quite sometime for me to understand it completely. In fact, the meaning flashed to me today during my morning jog!

In a programmer's perspective, what exactly is data?
This is a very subtle concept. Very difficult to explain.
Data is something that is constructed and behaves in a particular way. i.e, What data is, is determined by how it behaves.
How do you say this programmatically? - Data is that which is defined by constructors and procedures, together with specified conditions that these procedures must fulfill in order to be a valid representation.

Example: consider the notion of a 'pair' in lisp. A 'pair' is a way of glueing two pieces of data. This is how I will probably explain it:

(define z (cons x y))
(car z) => x
(cdr z) => y

We never actually said what a pair was, only that there are procedures cons, car, and cdr for operating on pairs. But the only thing we need to know about these three operations is that if we glue two objects together using cons we can retrieve the objects using car and cdr.
The interesting thing is that any triple of procedures that satisfies the above condition can be used as the basis for implementing pairs. This is one such triple:

(define (cons x y)
(lambda (m) (m x y)))

(define (car z)
(z (lambda (p q) p)))


(define (cdr z)
(z (lambda (p q) q)))


This point is illustrated strikingly by the fact that we could implement cons, car, and cdr without using any data structures at all but only using procedures. This blurs the distinction between 'procedure' and 'data'. Procedure <---> data. Data <---> procedure. Hmm...I need to think.