Wednesday, November 29, 2006

May I know the time please?

I got bored by reading papers so was going through iitb.h to get some refreshment :-) and here is what i found
-------------


Young Man: Sir, may I know the time, please?

Old Man: Certainly not.

Young Man: Sir, but why? What are you going to lose,if

you tell me the time?

Old Man: Yes, I may lose something if I tell you the

time.

Young Man: But Sir, can you tell me how?

Old Man : See, if I tell you the time you will

definitely thank me and may be tomorrow again you will

ask me the time.

Young Man: Quite possible.

Old Man: May be we meet two three times more and you will

ask my name and address.

Young Man: Quite possible.

Old Man: One day you may come to my house saying you were

just passing by and came into wish me.

Then as a courtsey, I will offer you a cup of tea.

After my courteous approach you will try to come

again.This time you will appreciate tea and ask who has

made it.?

Young Man: Possible

Old Man: Then I will tell you that my daughter has

and I will then have to introduce my young and pretty

daughter to you & you will admire my daughter.

Young Man: Smiles. ;)

Old Man: Now onwards you will try to meet my daughter

again and again. You will offer her to go out for a movie together and a

date with you.

Young Man: Smiles

Old Man: My daughter may start liking you and start

waiting for you. After meeting regularly you will fall in

love with her and propose her for marriage.

Young Man: Smiles

Old Man: One day both of you will come to me and tell me

about your love and ask for my permission.

Young Man: Oh Yes! And smiles

Old Man: (Angrily) Young man, I will never marry my

daughter to a person like you who does not even own a
watch.

Monday, November 27, 2006

Unique Role of Java in Programming Language Innovation

I was lucky to attend IBM IRL workshop on Next Generation Programming languages and Environments on 20-21st of Nov at India Internatinal Centre. Writing below some details of the first talk. Though, there were many talks in the workshop. I am able to recall only a few so wont be able to write about all the talks in my posts.

Unique Role of Java in Programming Language Innovation
------------------------------------------------------

Dr Bob Blainey of IBM Software group being a distinguished engineer and chief java technologist was no doubt the right person to talk about role of java in driving next generation programming languages and environments. He said that at least three mejor extension of java coming up to aid different programming need.

X10
--

X10 is a java extension which is designed to address the need for
concurent programming. One can not ignore the major shift towards
exploiting parallelism as much as possible. Next generation
programming languages can not ignore this shift and they have to
provide programmers construct which make use of underlying
parallelism.


There are a few constructs added in java, some of which I am listing
below.

Place :- This is a logical construct which can be mapped to physical
place in a sense that a place could be mapped to different processor
or a different machine altogether. The X10 framework assumes
distributed memory model and gives control to program in a GALS (
Globally Asynchronous Locally Synchronous ) environment.

Activity :- Activity resembles classical java threads. An activity can
access or modify only those objects which resides in the local place (
place in which the activity is residing ). So if an activity wants to
access a remote object, it has to first create an activity at the
remote place and then have to communicate with that newly created
activity to get the desired result. BadPlaceException is thrown in
case an activity tries to access a remote object.

Clock :- Those who are familiar with typical multi threading/multi
programming environments would say that this object acts as a barrier.
Different activities can register themselves with clocks and use it
for the purpose of synchronization. A place can have multiple clocks
and different activities can register for more than one clocks as
well. There is no global clock in the framework which makes it
globally asynchronous.


A container (e.g. array ) can be distributed across places. For
example programmer can decide to distribute array in such a way so
that an array of size 10 ( 0..9) its elements A[0] A[5] A[6] belong to place1
and
A[2] A[8] A[9] belong to place2. This distribution makes it difficult
to construct a simple for loop which will go through all the array
elements and update it because there is a possibility of a
BadPlaceException. To take care of this situation a projection
operator is introduced. For example,

for( point [i] : A | here )
where "here" refers to the place associated with the given scope just
like "this" refers to the object. This way one can iterate through all
the points ( elements ) of array A only residing within current place.

async( place ) { //some code } - This construct allows programmer to
execute a certain task at a remote place. It is not like a remote
procedure call in a sense that the calling module will not be blocked.
In fact, the code will run as an independent thread which may or may
not communicate back to the calling module after the invocation. In
other words, an asynchronous thread of execution is created at a
remote place to execute certain piece of code.


Many more constructs were described but unfortunately I am not able
to remember other details :-(.


XJ
--

XJ is an augmentation of Java is designed to address need for XML &
Web services. It extends Java syntax as well as semantics. One example
may look like :

Article A = new ( <>
<> getTitle() < /article_title >
getArticleBody()
< /article > );

I am not able to recall the exact syntax but it looked much like the
code I mentioned above.

Metronome
--------
Java with a real-time flavour. Major feature is handling garbage
collection with real-time constraints. I really wonder what kind of
algorithms would it take to perform garbage collection with such
constraints. What happens when the GC is halfway through marking the
live nodes and it has to relinquish control to another thread to
satisfy the constraints? Or what is GC is halfway through the
compaction ? I would really like to know the underlying details which
handles these intricacies.

I would like to end this post by a quote which Dr Bob Blainey
mentioned during his talk.

"Claiming that Java is easier than C++ is like saying that K2 is
shorter than everest" -- Larry O' Brian

Friday, November 17, 2006

Few Jokes

Hi,
Posting a few jokes from iitb.h
-------------------------------------
Tourist: Whose skeleton is that?
Santa: Tipu's skeleton.
Tourist: Whose that smaller skeleton next to it?
Santa: That was Tipu's skeleton when he was child
-----------------------------------------
� Gabbar: Kitne admi they?
Sambha: Sardar 2
Gabbar: Mujhe ginti nahin aati, 2 kitne hote hain?
Samba: Sardar 2, 1 ke baad aata hai
Gabbar: Aur 2 ke pehle?
Samba: 2 k pehle 1 aata hai.
Gabbar: To beech mein kaun ata hai?
Samba: Beech mein koi nahi aata>
Gabbar:: To phir dono ek saath kyun nahin aate?
Samba: 1 k baad hi 2 aa sakta hai, kyun ki 2, 1 se bada hai.
Gabar: 2, 1 se kitna bada hai?
Samba: 2, 1 se 1 bada hai.
Gabbar: Agar 2, 1 se 1 bada hai to 1, 1 se kitna bada hai?
Samnba: Sardar maine aapka namak khaya hai, mujhe goli maar do
------------------------------------------------
What is the height of Flirting?
It's When your love letter starts with: TO WHOMSOEVER IT MAY CONCERN
------------------------------------------------
Ganguly�s Son: Yeh Kya, Daddy Sixer pe Sixer maare jaa rahe hain Hain?
Ganguly�s Wife: Arey beta, yeh toh ADVERTISEMENT Hai !

� U luv sumone... u marry sumone else. The one u marry becomes ur wife
or husband & the one u loved becomes the password of your emai id...!

-----
� Ab tak meri life ek khuli botal thi, jis mein se sab perfume ki tarah
ud jata tha. Par aap ke aane se sab kuch ruk gaya. Bhagwan kare aap
jaisa DHAKKAN sabko miley

� Baniye ki wife bimaar thi, light na hone ki wajah se usne candle jala
di aur bola: Doc ko lene jaa raha hun, agar tumhe lage ki tum nahin
bachogi to plz candle bujha dena
----------------------------------------
Teacher to class: A for?
Class: Apple
Teacher: Jor Se Bolo
Class: Jai Mata Di
----------------------------

Tuesday, November 14, 2006

Godel's incompleteness theorem

Yesterday I was opportune to watch Dr Raja elucidate the proof of Godel 's
incompleteness theorem .

I still do not know much details of the theorem so I writing it down here in an informal manner.

Basically, what is states is " A statements can be constructed in an axiomatic system which is true but can not be proved or disproved using the axioms of the given axiomatic system ". Or the other statement goes like "No consistent axiomatic system can be complete".

The example that Dr Raja explained goes something like this.

Let there be an alphabet sigma = { (, ), P , N , ~ }

Let there be expression X \in sigma^*

Let us define N(X) to be X(X) called the norm of X

There are four kind of sentences in this language


P(X) - P(X) is true iff X is printable
~P(X) - ~P(X) is true iff X is not printable
PN(X) - PN(X) is true iff N(X) is printable
~PN(X) - ~PN(X) is true iff N(X) is not printable


Let us also have a machine which prints only true sentences. ( in other words only true sentences are printable by the machine )

So now, if X is printable, so is P(X)

Given that a machine prints X then P(X) is true but will the machine print it??

or in other words, is the machine able to print all the true sentences???

The answer to this question is NO

Can you form a sentence which is true in the system discribed above but still won't be printed by the machine?

Hint : Because this is a self referential system, one can think of a sentence which tries to make statement about its own printability.

If you can not think of such a sentence...dont worry as I also was not able think of that then.

The answer is ~PN ( ~PN ) the sentence is true and yet it is not printable. the negation of the sentece is PN ( ~PN ) is false hence won't be printed by the machine.

For axiomatic system one can try to substitute the concept of printability to provability and can derive similar example as well as conclusion.

I have written down whatever I have understood from the talk and whatever I could remember. The information may not be precise or some incosistency may have been introduced because of the long path of information transfer :D

I wish I get such opportunities frequently :-) I am looking forward to IRL workshop for that.