Monday, March 09, 2009

I recently had this dream, a nightmare if you please, that the chocolate factory is actually run by the Oompa-Loompas. There is no Willy Wonka, or at least not anymore! The Oompa-Loompas run the factory and they have a vague memory of what Willy Wonka was and so they try to be him; though they have to also run the mill and do the impromptu dances. The chocolate factory still makes great profits selling its chocolate, though Grandpa Joe feels that its not as wonderful as he remembers it. But what does Grandpa Joe know, he is an old man. Of course, the tragedy is that Charlie, who is actually Willy Wonka in disguise, is turned away because you actually have to be a Oompa-Loompa to work at Willy Wonka's Chocolate factory.

Fortunately this is all just a nightmare and nothing like this can ever possibly happen in real life. Phew!

Monday, March 09, 2009 12:31:57 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, December 18, 2008

Penguin Logic

I saw this on the door of one of my Professors, Larry Moss, who is a mathematician and a logician. Couldn't help laughing. (I feel it should say "Therefore, Penguins are some old TV shows", anyhow..)

Thursday, December 18, 2008 7:22:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Sunday, April 20, 2008

...for an internship this summer. I found this:

Jorge Cham is always giving away our secrets.

Sunday, April 20, 2008 2:08:02 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4]  | 
 Saturday, March 22, 2008

image

Never underestimate the stupidity of people. Over many years, I believed my bar had fallen sufficiently low enough that not very much surprised me. Then along comes something like this!

ps. Sid, if you are reading, this is your doing: After that link from your blog about PZ Myers, I ended up wasting a major part of my evening browsing around looking at the foolishness. Thanks!

pps. What does the blog title mean? Its the from the banner of the "Landover Baptist Church".

Saturday, March 22, 2008 9:07:27 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4]  | 
 Saturday, March 01, 2008

Many years back I worked full time at Microsoft on one of the many projects related to Vista (or what was then called Longhorn). Last December I was visiting friends in the Redmond area when one of the jokingly observed how the code I had written for Microsoft still hadn't seen light of day, while two and a half years later, I had moved on and completed my Masters and had started on my PhD.

This wasn't a sort of accidental slip, but I remember we were told at that time that if we had any ideas to suggest for Vista, they better be ideas that will be new and interesting 3-4 years later when the OS actually ships. This is a tall order for any sort of idea, much less for the volatile world of "software project" ideas.

While this seemed like very ironic humor at that time, over the past month or so, once in a while I thought about what that meant. After all, I had spent a year writing all that code. A very busy year at that - I had spent 15+ hours a day, I daresay, that was my average day, struggling with the turmoil of the massive engineering effort that was Vista.

I wasn't a *great* programmer by many standards, but I'd like to think that I was better than many I had encountered. 15+ hours of my time for about a year, took a lot of out of my life and it didn't seem to have amounted to anything! Sure I was being paid a handsomely, but one one like to think that one's efforts contribute to the world in some way as well. After all that year was full of deadlines and things being rushed to be completed and such. What came of all of it? If it came to nothing, what a waste of life that was...

A few weeks back, I got a call from Steve who works with Google (who has a fascinating blog btw), about coming back and working with them on some stuff. I casually asked what happened about the last thing I had worked on, when I was there last summer. I had made some extensions to the Rhino compiler, the largest part of which was adding the yield control operator to it. Steve said that they were using it. Somewhere in the back of my mind I said "What?!".

Maybe my programming has matured over the years. Maybe the ~6 hrs a day I spent in office as an intern produced production quality code. I somehow assumed that it wouldn't see any real world use. Was it really that special that it was ready for real world use? Don't get me wrong, it wasn't bad code. But it was code that only written, not "baked" for years.

Maybe there was another reason. Maybe, it wasn't a property of the code at all, but of the fact that there was something radically different about the outlooks of both these companies. There are many thing one can say about this "difference in outlook", positive and negative things things about both. But a shift that causes developers to feel effective by default as opposed to feeling ineffective by default, is an empowering thought. "If I build it for you, what will become of it?"

Maybe mine was an isolated case of wasted engineering effort and this is nitpicking. If that's so, I'll be happy for it.

Saturday, March 01, 2008 12:07:22 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Friday, February 22, 2008

Last week I watched Stanley Kubrick's 1975 classic, Barry Lyndon. What a movie! I haven't seen a movie with as gorgeous realistic photography in a while. Kubrick's composition is perfect, every single shot. The lighting and the story telling is awesome.

Barry Lyndon is the story of the life of a curios Irish character, Redmond Barry, who goes onto become the wealthy 'Barry Lyndon'. It is a 3+ hours epic, that is enjoyable right through. Its a nice tale and the way it is told is excellent. A must watch, with some wine and cheese.

        

As someone with an interest in photography, I am stumped by how Kubrick achieved some of the shots in this movie. The rich colors, the way the light looks... In some ways the film was a bit of a photographer's dream project. Most scenes were shot in natural light - legend has it that the film didn't use much artificial lighting at all. In fact the beautiful candle lit scenes in the movie were shot in actual candle light alone.

Quoting from http://www.visual-memory.co.uk/sk/ac/len/page1.htm:

At the very early stages of his preparation for "BARRY LYNDON", Kubrick scoured the world looking for exotic, ultra-fast lenses, because he knew he would be shooting extremely low light level scenes. It was his objective, incredible as it seemed at the time, to photograph candle-lit scenes in old English castles by only the light of the candles themselves! A former still photographer for Look magazine, Kubrick has become extremely knowledgeable with regard to lenses and, in fact, has taught himself every phase of the technical application of his filming equipment. He called one day to ask me if I thought I could fit a Zeiss lens he had procured, which had a focal length of 50mm and a maximum aperture of f/O.7. He sent me the dimensional specifications, and I reported that it was impossible to fit the lens to his BNC because of its large diameter and also because the rear element came within 4mm of the film plane. Stanley, being the meticulous craftsman that he is, would not take 'No" for an answer and persisted until I reluctantly agreed to take a hard look at the problem.

The lens that is spoken of here is one that the famous lens manufacturer Carl Zeiss made for NASA. Not many of us can get our hands on 0.7 aperture lens today, even for still photography. As a matter of fact I don't know of any that are commercially available. Canon's 50mm prime at f/1.8 is 80$ (USD), the f/1.4 version of the lens is about 300$ and there is a L class f/1.2 lens which is about 1,300$. It stops there it doesn't go any lower. Canon once had a f/1.0 lens, which I believe is now discontinued.

Now that I look around, its 2nd on the "Ten Movies Every Photographer Should See" list. The first is, of course, Baraka.

Friday, February 22, 2008 1:40:04 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, February 11, 2008

I got my new baby this Friday. The Canon 24-105 L:

Friday was a busy day - meeting with Dybvig, Sabry and Michael Adams, followed by attending some of the Preparing Future Faculty conference talks, followed by a talk about "Exploiting Online Games" by Gary McGraw, followed by a talk about "A Theory of Hygienic Macros" by Dave Herman. I rush home after all of this to see the Amazon package at my door. Quickly unpack, eyes gleam, say "my preciousss..." for sometime and then quickly rush out for dinner with some of the PL folk.

Initial impressions - the lens is build like a tank. Its also fairly solidly built. Its thick and relatively short, with a filter diameter of 77mm it dwarfs the camera. In fact, one of the most solidly build lenses I have seen. Had it been not such a crime to the lens, it might even be used as weapon of self defense. "He was bludgeoned to death with a 24-105'. "Quid pro quo Clarice, you indeed do have a maniac on your hands".

This is also the first lens with which I feel I can manually focus with some reliability. The little viewfinder on the 350d is indeed limiting, but a good lens seems to make a lot of difference.

 

All that said, I have been able to play with it much. Bloomington has been real windy this weekend at -8 degrees Celsius. One can dress for the cold, but wind at that temperature is just too much. You hands freeze into numbness in no time. This makes me say "NOESS FAIR!" in lolcat style.

image

Despite this, I manage to take a short walk one day. The pictures below are uploaded full size as they came out of the camera without any sort of out of camera processing. The quality of the images is impressive, take a closer look.

IMG_0670

Sunset over the Dunn meadow, Bloomington, IN.

 

IMG_0633

East wing of Swain Hall, the building that houses the joint Computer Science, Math and Physics library.
Bloomington, IN

Monday, February 11, 2008 6:41:50 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, February 09, 2008

 

Saturday, February 09, 2008 9:23:59 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 

The other night over dinner with folk from the PL group I heard about "Lambda Cats". This is just hilarious.

dumb

Some are a quiet impossible to appreciate unless you know specific people in the PL community. Like this one. Or specific special problems. Like this one. The lambda cats website is inspired by the more general "I Can Has CheezBurger?". There you can even build your own :)

i-can-has-cheezburger

 

And of course, I had to do my own.

callcc 

After you have done one, it gets sort of addictive. I wonder if I can take pictures of my friend's pets (or kids) for the one true cause...

Saturday, February 09, 2008 5:09:45 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Tuesday, February 05, 2008

image

Bloomington punishes and Bloomington heals. Seattle stays squishy. :)

Tuesday, February 05, 2008 12:08:48 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Sunday, January 20, 2008
  Charminar 

One of the things I enjoy about Windows Vista is the slideshow gadget that comes with the OS. I have pointed the slideshow at my external hdd folders where most of my photos live. Hence this keeps playing back randomly selected thumbnails from my rather large photography set. This brings back rather nice memories at times.

Bloomington is rather cold today (its reached -14 degrees Celsius as of now) and I was thinking about warmer places I have lived in. As chance would have it, the slideshow brought up a picture of the Charminar in Hyderabad. I remember squinting to take this picture in the bright afternoon sun.

Charminar

The Charminar, Renovations - March, 2005.

From http://en.wikipedia.org/wiki/Charminar

The monument was built by Muhammad Quli Qutb Shah in 1591 to commemorate the eradication of plague, shortly after he had shifted his capital from Golkonda to what now is known as Hyderabad[1]. Legends has it that the emperor Quli Qutb Shah prayed for the end of plague and took the vow to build a masjid on that very place. He ordered the construction of the masjid which became popular as Charminar because of its four characteristic minarets (possibly depicting the first four khalifs of Islam). The top floor of the four-storeyed structure has a masjid which has 45 covered prayer spaces and some open space to accommodate more people in Friday prayers. Madame Blavatsky reports that each of the floors was meant for a separate branch of learning - before the structure was transformed by the imperial British administration into a warehouse for opium and liqueurs.[2]

True to the legend, the city blossomed into a synthesis of two cultures. In 1591 while laying the foundation of Charminar, Quli prayed: Oh God, bestow unto this city peace and prosperity. Let millions of men of all castes, creeds and religions make it their abode. Like fishes in the water.

Sunday, January 20, 2008 12:37:24 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, January 19, 2008
  Cold days 

I just walked back home from Soma, the local coffee shop. Today is a cold day in Bloomington. I miss Cochin.

temperature

Spent most of the day brooding over over the fact that I have a lot of work to do which I am not doing because I am wasting my time brooding over it. Good ideas behave a lot like fear - in the right environment the fear is real and impossible to ignore. Category theory turns out to be an idea almost that good.

My category theory is acting up: It strikes me that many paradoxes can be explained away by the observation that there is no such thing as equality, the best you can have is isomorphism.

Saturday, January 19, 2008 7:53:31 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, January 18, 2008

There are many profound discoveries that come your way as a phd student. I realized that I recently invented something of great strategic importance. The Junk Food box. Over time I realized that every now and then when I visit a less frequently explored corner of my house I discover junk food that I hadn't eaten. Most of the time, it would be very nearly expiring. Had I known it was there, I would have liked to snack on it. 

The junk food box is a great invention - its this box, a large cardboard box - that sits in my living room that has all my junk food. You should try it sometime - despite how simple it sounds, it works great. Now not only do I know where all my junk food and save me the trouble of searching, I have come to appreciate the fact that I don't waste as much.Also there is a quiet a bit more of variety immediately available. Plus you come up with all sorts of ideas. I recently mixed moong dal, cashews, cheetos and diced some onions in. Ah!

Friday, January 18, 2008 9:42:53 PM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Friday, January 11, 2008

Today evening, over pizza, Dr Hofstadter combined his Poetry class and his Group theory class and explained to the combined audience how Al-Khwarizmi visualized the solution to quadratic equations and how Tartaglia visualized the solutions to cubic equations. Using these simple visual models, he derived the solutions to the general form of the equations. He then went on to explain Tartaglia's 1534 AD poem that details his solution to cubic equations written in terza rima, the style of Dante Alighieri's La Divina Comedia. Needless to say, it was a fun class.

But what caused me to burst out laughing was this conversation I overheard where two students were discussing Group Theory and its application to Physics. Apparently there is a textbook by approximately that title and the university bookstore mislabeled it as "Group Therapy for Physics".

As I burst out laughing, something from my own ignorance struck me. Being somewhat culturally limited, I tend to think of some Chinese foods as "strange". Today morning I was trying to prepare some packaged Chinese food that I had purchased, when I noticed that the instructions on the cover said "Mix in the Soap Powder with constant stirring", and my instinctive reaction was "Oh, that's another strange thing that they'd eat". It was only several moments later that the awkwardness of of thing struck me. I went back and looked carefully at the instructions again. I had misread it, it really said, "Mix in the Soup Powder with constant stirring".

Friday, January 11, 2008 1:30:57 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, December 08, 2007

What a wonderful little tale, meta-circular metaphors! By none other than Raymond Smullyan.

Planet Without Laughter
http://www-cs-faculty.stanford.edu/~knuth/smullyan.html

Once upon a time there was a universe. In this universe there was a planet. On this planet there was virtually no laughter. Nothing like ``humor'' was really known. People never laughed, nor jested, nor kidded, nor joked, nor anything like that. The inhabitants were extremely serious, conscientious, sincere, hard-working, studious, well wishing, and moral. But of humor they knew nothing. All except for a small minority who had some feeling for what humor was. These people occasionally laughed and joked. Their behavior was extremely alarming to everyone else and was regarded as an obviously pathological phenomenon. These few people were called ``laughers,'' and they were promptly hospitalized. What was so alarming about their behavior was not only the strange noises they made and the peculiar facial expressions they bore while ``laughing,'' but the utterly pathological things they said! They seemed to lose all sense of reality. They said things which were totally irrational, indeed sometimes logically self-contradictory. In short, they behaved exactly like anyone else who was deluded or hallucinated, hence they were put into hospitals.

(Hmm... I realized later that this is linked to Donald Knuth's webpage)

Saturday, December 08, 2007 8:31:49 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Sunday, December 02, 2007
  Worklife 

The past weeks I have been dealing with the consequences of my personality disorder - my annoying tendency to get involved in things I find interesting along with the annoying habit of showing up at situations where interesting things are happening.  As a direct consequence most places I show up at these days, I am asked - where's that thing you said you'd do? People with memory... argh!

Its the end of the semester and the mountain of pending work is back breaking, or rather, wrist breaking in my case. RSI is reaching new dimensions and I have been looking around for replacement forearms. If people expect nothing from you, its easy to exceed expectations. Why do I keep forgetting this? Douglas Adams comes to the rescue -

In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move.

I don't believe it. Prove it to me and I still won't believe it.

Things other than my mundane bullshit: The other day we had a talk by Gene Spafford who is professor of computer science at Purdue U at the colloquia. He was talking about the The Value in Questioning what you think you Understand. That simple idea has been one of my major causes of pain this semester, it greatly decreased the number of things I did understand and greatly increased the number of pending things I had to do.

Anyway, 'Spaf' said about thinking 'out of the box', "In your case I don't know where the box is, or how large it is, but I'll help you get outside it". Soundness and Consistency. He seemed to be of the view that the large amount of work we do is engineering as opposed to science - this was rather ego satisfying. It was all nicely summed up by Mike Dunn is the now retired Dean of the department - Since we are human instead of trying to 'evolve' computer science - we should be doing 'intelligent design'. That was a fun talk. He also quoted Douglas Adams.

Reality is frequently inaccurate.

Sunday, December 02, 2007 9:43:03 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, November 29, 2007

I am truly flooded with work these days and things have been getting annoying. I was searching the web for something when I came across this. It considerably cheered me up.

Conway's Law: Any organization that designs a system will produce a design whose structure is a copy of the organization's communication structure.
Or, colloquially: Software is doomed to reflect structure of the organization that produces it.

I cam across this in Michael Feather's blog. That is an enjoyable entry, worth a read

Its a bit shocking that this is indeed true. Having worked on a certain large OS project once, I know this to be true about that system with surprising accuracy. So there is a good and bad side to this. The good is that some part of the org maybe actually functioning very well. The bad is that it may not be.

I recently switched to Vista and things were good for a while until some driver issues started showing up in the past few days. I haven't got a chance to chase it to its death, so I am having to proverbially 'live with it'. The strangest of the issues is this one:

I have been using a simple Logitech USB keyboard with my laptop for several weeks now. Its a normal usb keyboard - no fancy media buttons or anything. Its just plug and play keyboard. It worked fine for a while until, the other day, Vista asked me for a driver! The keyboard didn't come with one - it never needed one on XP. Also it didn't need one on Vista as well until that day. So Vista gives me a bunch of options for finding and installing the driver automagically and such. These cause Vista to search the windows database online and then do some other web search and such. Several minutes of waiting later it gives up and says it cant  find a driver. The keyboard didn't come with a CD and the Logitech website doesn't have a Vista driver for it. After that my keyboard stops working!

This is really stupid because my bios can detect the keyboard. The keyboard works fine till Vista logs on and prompts me for a driver! After some grief with this I learnt that it I simply close the window that prompts me for a driver, everything continues to work just fine. I can use the keyboard with Vista as long as I just ignore its lack of a driver.

I remember remarking to myself "How did they not notice how the keyboard worked before? This reminds of working at MS...".

Thursday, November 29, 2007 10:02:01 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, November 28, 2007

An odd idea from a few days ago:

I watched this video a while back, this is Richard Feynman giving a lecture about discovering laws in physics -

He is talking about laws in physics. (the underlying Philosophy of Science that Feynman describes here is due to Karl Popper)

What Feynman is describing seems fundamentally different from what we do in the formal sciences like math/logic/cs. In the later we usually choose an axiom set that we believe to be right, based on our aesthetics, and then go on to prove other things that are right wrt our axioms.  Only things that are provable are taken to right and things that are right are irrefutably so. The system is inconsistent if we deduce False from the rules that we have. Inconsistent systems are not interesting. All formal methods work like this, in spirit - they keep track of what is right.

In what Feynman is describing, they don’t have a formal notion of right. They have a notion of what is wrong and as long as something cannot be constructively (by experiment) shown to be wrong, they can temporarily accept it to be not-wrong. If you look at this as a formal system, this is one where “what is not wrong yet” is known instead of what is right. Something is not wrong because 1) We don’t know a proof by which we can construct F from it or 2) Given our current inference rules there is no proof for it. But, we may add a new inference rule to the system in the future which may invalidate the belief that something is not wrong. It’s a feels like the opposite of what we do with logics.

Imagine a formal system or a model of computation based on notion like this. We are, in a fundamental sense, giving up the notion of consistency and completeness when we do this. I wonder if there exists a computational model that corresponds to such a “co-logic” of the sort they use in the *real* sciences. Such a system, in spirit, might be able to deal with partially correct data, incorrect assumptions etc. in a natural way. Absolutely correct data (or properties about the data) would be the exception.

(I wonder what this implies for the incompleteness theorem and such. I have been told that the "co-logic" I refer to here is actually co-induction. I see some similarities there, but I am not sure if its exactly that. )

A Tutorial on (Co)Algebras and (Co)Induction - Jacobs, Rutten

A Tutorial on Co-induction and Functional Programming

Wednesday, November 28, 2007 12:03:05 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Sunday, November 11, 2007

Yesterday I went out to the the Union and bought myself a copy of Windows Vista Ultimate. My laptop is a Dell Inspiron, has a 1.7GHz Intel processor, 1 Gb or Ram and several external hard disks. The student license costs me ~20$, roughly the cost of two dinners. Vista roughly rates performance as 3.6 for my machine - the bottleneck being my processor speed.

I had heard several conflicting opinions about the OS, most being negative. I finally decided to try it to find out. I must say that in the past day or so my experience has been mostly pleasant. As a matter of fact the OS is yet to do anything to upset me very much.

Yes it is slightly slower than XP on my machine (my previous 2 year old XP setup had degenerated to crawl, so in cases it is actually faster than XP). Despite being slower it is not too frustrating as they have taken care of a vast number of small details, that makes the system more pleasant to use.  The weather gadget for example means that I don't have to use that piece of bloat from weather.com. Outlook actually seems to start a little more promptly on this OS.

Things like the fact that the OS asks about privilege escalations is rather nice. Even other things, like the fact that they did something as goofy sounding as brining your systems performance down to a single number makes a it rather handy. Most of the time people ask things like, "I have this hardware and this setup... will the following software run on it", now there is some heuristic with which you can come to an answer without relying on your local bullshit-expert. This is all entertaining and daresay, even useful.

I like the Aero look. I like the Win+Tab combination. I like the fact that they don't run the indexer all the time and bog down the system like they do on XP. I like how access control and such is better integrated into the UI. A better file copy interface finally. It also seems like there are some scheduler hacks to better prioritize interactive and foreground processes. Altogether a nice package.

Kudos Microsoft! I was truly skeptical and I had my XP installer handy. Now lets see how all this hold out for a few months.

Sunday, November 11, 2007 7:10:40 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Tuesday, November 06, 2007

This Sunday, Kyle, Michael and I were enjoying a little late morning brunch at the lovely Le Petit Cafe and some light banter about polymorphic lambda calculi. Patrick would occasionally swing with his strange stories, narrated with his uniquely French mannerism. Joie de vivre!

Thus passed a nice Sunday morning when I see a little girl walk up to me. She is short, about 3 foot tall, not quiet opaque and is wearing a bright red cape and hood. She stands by my side, next to our table, and listens to us for a bit. Kyle and Michael were chatting about Kinds and Sorts. Then she says to me "What strange conversations you have Grandma". I say, "The better to understand them with, my dear". I expect her to scamper away, doing whatever it is that she needs to do, but instead she stands there, her large luminous eyes locked in mine. All this starts to get very irritating and I'd wish she would just buzz off when Kyle asks me something. I turn to reply mumbling that maybe I should eat her or something, that way she'd go away. Kyle asks me what I mean. I explain. The two of them suddenly get unnecessarily excited. "You hold him down. I will run for help". Groan...

Thinking back about it, I wonder if the wolf ate her simply because she was so annoying. After all, ignoring rumors, he was trying to get some sleep and there comes this pest asking all these inane questions.

Tuesday, November 06, 2007 1:13:19 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Monday, November 05, 2007

Sometimes you've got to scratch an itch. So here goes:

X-Zylo
http://www.xzylo.com/
http://www.youtube.com/watch?v=-GavWPxAAlY

GyroBall: A Japenese Baseball Pitching technique
http://en.wikipedia.org/wiki/Gyroball

Dyna Flex Gyro Ball Gyroscope
http://www.youtube.com/watch?v=nC5AjM2NI_c

Stirling Engine
http://www.gyroscope.com/catalog.asp?catalog=1014
http://www.youtube.com/watch?v=vM0YmlRIYBI

Gyroscope
http://www.youtube.com/watch?v=9WbbfzMH2to

The Controversy generating Royal Institute talk by Eric Laithwaite
http://www.gyroscopes.org/1974lecture.asp
(Its a bit funny actually)

XStream: Internal Wing Aircraft
http://www.rexresearch.com/carrcoan/carrcoan.htm

Winshurst Machine (Voltage Generator)
http://www.physlink.com/estore/cart/WimshurstMachine.cfm

Maxwell Wheel
http://www.physlink.com/estore/cart/MaxwellsWheel.cfm

Levitron
http://www.youtube.com/watch?v=iv8msBamA3M

Radiometer (Light Mill)
http://www.youtube.com/watch?v=6Zd70sOcYOQ

 

Got more?

Monday, November 05, 2007 11:35:42 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, October 10, 2007

Did I ever mention that I have always been a die hard Star Trek fan? I havent watched any of the Star Trek series as much as the Next Generation, so my admiration of Star Trek is largely limited to the Next Generation. I got up today morning and with some ado I decided to look at the notes for a test I have about Computational Complexity. I hate exams where I actually have to look at the notes for any non-trivial reason. Even worse, I hate subjects that make me need to look at the notes when I really shouldn't have to, had my love for the subject been left undistrubed. Irritating.

This reminded me of the "human equation" from one of my favourite Star Trek episodes, "Hide and Q":

Data: "Sir, how is it that Q can handle time and space so well, and us so badly?"
Picard: "Perhaps one day we will discover that space and time are simpler than the human equation."

Googling for this, I came across Q saying: "Your species is always suffering and dying".

This considerably cheered me up. Ok, back to the notes. (Later addition: if you want to read a nice spoiler about the episode go here. Please read it only for memory sakes, dont read it if you havent watched it already. Ok, now back to my notes).

Wednesday, October 10, 2007 8:46:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Saturday, September 29, 2007

I grew up with a great love for Dylan. Dylan's poetry and the way only he could sing it was something I didnt find an equal to anywhere. Until of late when I started indulging in Ghalib. I daresay, maybe Dylan pales in comparison to Ghalib.

Mirza Asadullah Khan Ghalib, who in my opinion is one of India's greatest poets I have had teh pleasure of knowing about, lived from 1796 to 1869 in Delhi - a very troubled and telling time for that city. He primarily wrote in Urdu and Persian. In the subcontinent it is his Urdu poetry that is more popular.

Some of his poetry is not easy to translate into English. Some words have no equal in English that conveys both the mood and the meaning. Also, there are some usages of words that are striking in one language that lose the their essence when translated to another language. Such is the nature of much of the poetry of Ghalib. I sometimes compare this to the "the dude" in Big Lebowski saying "That's like your opinion man...", so simple a phrase that it looses its effect when translated into some other language.

I recently came across some work by the Persian poet and Sufi master from Shiraz in Iran, Shamsuddin Muhammed Hafiz who lived from 1320 to 1389. I have access to an English translation of Hafiz's work. I dont understand Farsi and so I wonder how the originals sound. Hafiz's poetry has a very different flavor from Ghalib's, some of it is very clearly religious mysticism, some of it falls in that grey area of junoon. In much of the older Urdu poetry, and I am told this is true of Farsi poetry as well, the subject of love is described as a gender neutral "beloved". The beloved could be a man or a woman or god. The translation that I have of Hafiz's work uses God and beloved interchangibly, sometimes losing out on the other possible interpretations of verses.

That's the whole Idea

Fire has a love for itself -
It wants to keep burning.

It is like a woman
Who is atlast making love
To the person she most desires.

Find a Master who is like the Sun.

Go to His House,
In the middle of the night.

Smash a window.
Act like a great burglar -
Jump in.

Now,
Gather all your courage -
Throw yourself into His bed!

He will probably kill you.

Fantastic -
That's the whole idea!

 

Zero

Zero, is where the real fun starts
There is too much counting,
Everywhere else!

 

Manic Screaming

We should make all spiritual talk
Simple today:

God is trying to sell you something,
But you dont want to buy.

That is what your suffering is:

Your fantastic haggling,
Your manic screaming over the price!

Saturday, September 29, 2007 10:49:50 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, December 28, 2006
  New York 

I spent the past two days recovering from a trip to New York. Recovering from the stress of meeting an old friend in whose company, the both of us inevitable live larger than life.

 

Abhijit and Shweta drove me down to NY – a 16 hour drive from Bloomington, Indiana which we covered in two days on the way there.

 

Bad weather

 

NY2.jpg

 

and the general monotone of a long drive in a closed car on a US highway were the dominant aspects.

 

NY3.jpg NY1.jpg

  

Anand is doing his PhD in Social Anthropology at Columbia University.
New York
, with Anand, was great city to visit

 

NY4.jpg

 

with sky scrapers

 

NY5.jpg

 

and statues,

 

NY6.jpg

 

and seagulls,

 

NY7.jpg

 

and interesting cuisine,

 

NY8.jpg

 

and public transport,

 

NY10.jpg

 

and strange dancing light creatures,

 

NY9.jpg

 

and buildings with character.

 

NY11.jpg

 

 

Christmas night was spent over poker with Jose and Shweta, Marilyn and Ashok and Shweta’s sister and her husband. The day after Christmas was spent at a Jazz bar in Harlem which had great music – partly prompted by the fact that the godfather (James Brown) has passed away. All of this punctuated by fairly insane amounts of walking, drinking, late nights running into early mornings and several other things that one can do insane amounts of, in three days.

 

All in all, much to recover from.

 

Here's linking to Anand who has more intense things to say.

Thursday, December 28, 2006 10:01:37 PM (Eastern Standard Time, UTC-05:00)  #    Comments [3]  | 
 Tuesday, October 03, 2006
  Lament 

Functional Programmer’s Lament:

Forgive me Lord, for I have side-effected.

 

Logic Programmer’s Lament:

Forgive me Lord, for I have temporized.

 

System’s Programmer’s Lament:

Forgive me Lord, for it crashed.

 

Hannibal Lecter: First principles, Clarice. Read Marcus Aurelius. Of each particular thing ask: what is it in itself? What is its nature? What does he do, this man you seek?

 

One of my professor's, Dan Friedman, once said in class, "Some people are of the opinion that computer scientists should choose to work on problems that are *useful*, and that working on your pet problem that has no apparent use is not right. I myself am not of that opinion." After about a year, I must say I agree. In this spirit, some people are of the opinion that people who write blogs should choose to write what others would like to read. I myself am not of that opinion. (My apologies to Dan for not quoting him verbatim, but its been a year)

Tuesday, October 03, 2006 12:00:31 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Friday, September 29, 2006

Recently I have been watching Sean Connery’s old James Bond movies. (When I went to Scotland it was interesting to notice that they wasted no time in pointing out that Sean Connery was once a milkman in Edinburgh.) That minor detail aside, I was wondering what I would like to do when I get out of college.

 

And then it struck me – I would love to be a high profile programming language designer. People all over the world who need someone to design their languages for them, will know the right man for the job. “Hello, may I speak with Mr. 00\lambda please?”. “Mr. 00\lambda we have an emergency situation here that needs your immediate attention. We need a domain specific language with the following bisimulation properties…” “No, no, Mr. 00\lambda, the weak barbed congruence for the underlying process calculus must be provable, otherwise all hope is lost…” “Our competitors have the advantage of equational reasoning for their monadic computations.”

 

That would be a good life indeed. “Sorry I am busy today evening, you see I am in Tokyo right now”. “No not tomorrow, tomorrow I am at INRIA in Paris…” “Its the work of a systems programmer! I should have known it…”

 

And when I am leaving for a mission, Q would hand me that parser generator that is disguised so conveniently as a watch, or that POPLMark verifier that fits in the sole of my shoe. “And what’s that Q?”, “That, my dear lambda, is something special – top secret I must add – that our secret new decidability checker… of course, you know the risks of using it”.

 

Anyone out there with a great language design job on your hands, come talk to me.

 

Friday, September 29, 2006 4:50:36 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, June 26, 2006
  Cornwall 

I think it had been baking inside me for a along long time now – this need to travel. The last time I really traveled was with Anand to Hampi, Gulbarga and Bidar many many years back. Of course since then I have traveled much, but nothing that had the sense of rawness that this weekend had.

 

This weekend I traveled to Cornwall. I grew up in Cochin which is a little costal town in Kerala, India. Cochin is a very beautiful place, but it is also, like many places that one grows up in a place that doesn’t let you realize how beautiful it really is until you have left it. Since leaving Cochin I have mainly been living very far away from the sea. So now that I was in England I looked around for the best piece of coastline I could find and decided to visit it. The best piece of coastline I heard of, as recommended to me by many people, was Cornwall. And so sometime mid last week I decided on a whim that I was going to Cornwall. Cornwall is the south eastern tip of England and is famous for its rocky , cliff lined coastlines.

 

The journey to Cornwall would be 12+ hours by bus from Cambridge because I pretty much had to travel all the way across the country. Not caring much for the strain of the journey, I decided that I would leave Friday night arrive on Saturday morning and leave Cornwall on Sunday night and arrive back at Cambridge on Monday morning by 9.00 and then show up for work. Needless to say, I did, though there were many points in the trip at which I felt I wouldn’t make it. And this being Monday evening, I haven’t had any sleep yet and my feet are killing me. But I loved it, every bit of it – even the hard hard parts.

 

If you have got your head messed up when you were really young and have read Bach and Pirsig and kept that sense of aching inside you – and then you watch a movie like the Motorcycle diaries and it stirs up everything – then at some point you just have to let it all go and travel and see if you really have it inside you to do so. I think this trip to Cornwall was a little sampler for me – to see if I have it in me – I think the answer is yes.

 

So this blog entry is a travelogue of sorts of this amazing weekend. Needless to say, I have many many pictures as my witness.

 

This was the plan – board the bus to Penzance, get off at St Erth and catch a local train to St Ives. Start walking to Pendeen from St Ives. That was supposedly 21km according to the guide book I had. I booked a little bed and breakfast at the Radjel Inn at Pendeen. The next day I would catch a bus to Land’s end and walk to Porthcurno. From there I would catch a bus to Penzance where I could cath my long distance bus back to Cambridge. That was the plan.

 

I arrived at St Ives by about 10.30. St Ives is beautiful – the sort of place I regret so much having to rush through. If I ever go back to Cornwall I hope to spend a day or teo just enjoying St Ives. It’s a little rocky coatal town with very scenic winding narrow roads and several beaches and lots and lots of seagulls.

 

 

Seagulls are interesting birds – if you have never had the chance to see lots of them up close before you are in for  treat. It was interesting seeing this one squaking at a sign that said “Don’t feed the seagulls”. Every now and then you would see a fat seagull with the personality of a duck wobbling up to you. I remember asking one of them if it had had any self respect and if it had heard of Jonathan and it left looking rather offended.

 

I sampled some of the traditional “Cornish Pasty”, got myself a sandwich and some bottled dribnk and I was off. Like the guide book (which is titled “Walking in Britain”, and I highly recommend it – expect I think the book is written by athletes of some sort) the walk was rather strenuous. 21km may not sound like much but winding up and down these cliffs by the sea it is really something else.

 

Every hour or so you would see another human being – but that aside all you see are miles of open grasslands and rugged cliffs and a beautiful blue green sea. If you break a leg or sprain your ankle you and pretty much finished unless someone comes by and finds you. I started out only by ~12.00 and sure enough I didn’t make the walk to Pendeen. After almost giving up several times along the way and once getting my feet caught in some bog I made it to Treen. I was out of food and water at it was about 6.45. I was sure I couldn’t manage any more. Treen was this little town which pretty much only had only one street and a dozen or less buildings. Most of the buildings were bed and breakfasts and there was one hotel! All in the is little place. And whats interesting is that the prices were very high! It seemed like it was popular place for people to give up.

 

There was this one person how I had crossed paths with several times during my walk who knew someone locally and managed to get a cab from somewhere. The town itself had no cabs or public transport. Hence I got a lift to Pendeen. I had a shower at the Radjel Inn (a nice place to stay if you are looking for a place to stay at Pendeen) and got myself some tradition Cornish mead and dinner from a local meadery. I slept like a log that night – esp considering the long days walk and the fact that I had got no sleep on the overnight bus.

 

The nest day morning, after a great breakfast I walked ~2miles to the lighthouse at Pendeen. At 9am its foggy and beautiful. There was a middle aged couple there peering intently out at the see – a little later the lady walsk up to me and ask me if I would like to see to a basking shark “Everyone should see a basking shark at some point in their lives” she said. And so I did.

 

I caught one two hourly bus that passes through Pendeen and got off at the Land’s end aerodrome. I heard (got a pamphlet at St Erth  railway station) that said that they sell rides for 29 pounds in a little Cessna. At the aerodrome they said that they need atleast two people for a ride or that I would have to pay for an additional child’s ticket for 15mins in the air. Seemed steep. Then it struck me that I could do something better – and I did – I got myself a  half hour training flight for 69 pounds. So I flew my first Cessna 172 (my first aircraft of any sort) on Sunday the 15th, June, 2006. It was brliiant – we flew all over Cornwall in those 30mins. I got to do most of the takeoff and landing by myself as well with instructions and occasional corrections by the trainer co pilot. I now have a little “Trial Flying Lesson” certificate on my desk that I am very proud off. My instructor was friendly guy named Ben who patiently answered my many questions about the aircraft. It was beautiful – you treat it well and the aircraft flies itself. It even has little landing light which are handy to scare the seagulls J

 

After my flight I caught the next bus to Lands end. Lands end is apparently the most scenic part of Cornwall – rightly so. However the guide book said that the walk from Lands end to Porthcurno is about 3.5 hours (and I remember I could do their walk the previous day). However it turned out that the last bus was two hours away and the bus driver told me that I could make the walk in less that two hours easily. Oh boy! I grueling one and half hours later I back away from the cliffs. This walk was scary – every now and then you are walking along a little much trail (like those in the middle of a paddy field – if you have ever walked through a paddy field you’ll know what I mean, with a steep rocky drop on one side). There were an occasional Jonathan and Fletcher to give me company.

 

After a while I could not keep up the pace and the focus and chickened out. As with all things in life, when you are doing something for an objective instead of the sake of doing it, your fears and difficulties multiply. I started to walk away for the cliff and cut across some fields and ran into some women who had a real map (yes, I didn’t have a real map – yes, I am slightly crazy). I seemed like I was less than half way there to Porthcurno and there was only 25mins to 5 when the last bus was. I hurried along and 15mins later reached a main road that said that Porthcurno is only 1.25 miles away. And I was pulling my last bit of energy together and started getting annoyed with myself for being so attached to the failures of reality and car came along and I had my ride to Porthcurno. A very friendly elderly lady who had been to India and said “At some level I know that some part of me is Indian” – I didn’t know what to say. She drove a little out of her way to drop me at Porthcurno.  I reached there few minutes before 5.00 in time for the bus and by now so thoroughly annoyed with myself for clinging so desperately to safety.

 

So I decided to do the only obvious thing, forget to bus and go sit on the beach. And I did just that and walked to the Porthcurno beach and say there till felt at home with my sense of struggly for having reached the place. And so a half and hour later when I headed back I noticed other troubled people trying to find a cab or some way to get out of there. I wasn’t overly bothered – would I miss my bus back from Penzance? Maybe. But then again maybe not – and sure enough there came the bus that I expected at 5.00 – a little bit of miscalculation and little bit of delay – but it was there just in time to pick me up when I had so conveniently finished with the beach.

 

Again I didn’t sleep to well on the over night bus back and I kept thinking of the ocean and cliffs and the wind. And I thought things I could say to myself when I had been weak at many times in my life and things that I could say to my friends when I had seen them weak. A trip like this is a very real experience, the beauty, the fatigue, the cost of a mistake, the realization if your own mortality are all very real things. This is the sort of trip that cut away many layers of flak that you accumulated on your thinking leaving you fresh and exposed and stronger.

 

Maybe I will do Cornwall again – maybe during this stay in the UK or maybe at some point later in life. Also now I have two places in the world that I would like to live the later years of life away from everything else – both may not happen, but its nice to know they are there – Bidar, Karnataka and Pendeen, Cornwall.

 

26th Monday June 2006.

 

 

Monday, June 26, 2006 2:57:19 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, June 07, 2006

 

A romance with musicals which started with Jesus Christ Super Star a few years back, is coming back. JCSS was brilliant – amazing music, amazing lyrics, very interesting characters – a very interesting shift of perspective. Very cool. I remember watching JCSS completely for the first time at Deepak’s place back at Bangalore – at one of our many of dinner + music sessions where Deepak would treat us to the pleasures of the local vegetarian home delivery service and his beautiful taste in music.

 

If you have not watched JCSS, it is highly recommended –

http://www.imdb.com/title/tt0275434/

 

 

Since coming to Cambridge I have had a chance to sample many interesting things – vintage wines, abstract mathematical models such as pi calculus and category theory, involved pieces of software such as the Glasgow Haskell Compiler, programming paradigms such as STM and monadic yield, London, beautiful medieval cathedrals, beer festivals etc and some musicals.

 

Its the musicals that this entry is about. A few weeks I got to watch Rigoletto the opera – a live performance at the “Cambridge Corn Exchange”. I had originally expecting nothing – only by the mild curiosity that the brochure was and also intending to sample the often heard “stiff upper lip” British formal occasion.

 

What I saw were a lot nicely dressed older people who were very polite and very at-ease. Rigoletto was in Italian with English subtitles displayed on a screen above the stage. As I watched Rigoletto, minor details like there actually nude women on the stage got swept aside and the power of music and metaphors started to take over. I started not to notice the gasps from the audience about the directness of presentation and more on what would be going through these characters in the play, if it was all real.

 

After I left the opera, one of the last pieces “La donna e mobile” played in my mind for days afterwards. This is an English approximation of “La donna e mobile”

 

Woman is unpredictable, like a feather in the wind,

she changes her voice, and her thoughts

Always a sweet, pretty face,

in tears or in laughter, always lying

Woman is unpredictable, like a feather in the wind,

she changes her voice, and her thoughts

and her thoughts, and her thoughts

 

Always miserable, he that trusts in her

who confides in her, his unwary heart!

Yet nobody feels fully happy

who on that bosom doesn't drink love,

Woman is unpredictable, like a feather in the wind,

she changes her voice, and her thoughts

and her thoughts, and her thoughts!

 

This is being sung by an overly licentious Duke who is about to be murdered by an assassin paid by the jester of the Duke’s court. The assassin’s sister who usually woos his victim’s for him such that he can stab them when they are distracted now pleads with him to spare the Duke’s life. The assassin consents on the condition that someone else should come through the door who he will murder instead of the Duke. The jester wanted the Duke killed because he had dishonored his daughter. The jester’s daughter however overhears the conversation between the assassin and his sister and decides to sacrifices herself to save the Duke, despite knowing that he had cheated her. As all this unfolds one can hear the Duke singing in his room awaiting his mistress for the night, the assassin’s sister. Its delicate and is one of those climaxes that’s not easy to forget.

 

Beautiful.

 

Two days back I saw the Phantom of the Opera – honestly I don’t have many ways to describe this other than that it sent me reeling ever so often. Its brilliant, its powerful and it is so exquisitely done. Its one of those things that one has to put on their “to do list before you die”. As you watch the Phantom of the Opera so many layers unfold. It one of those things that awoke many sleeping ghosts in my mind.

 

 

 

In sleep he sang to me,

In dreams he came,

That voice which calls to me,

And speaks my name.

And do I dream again?

For now I find.

The Phantom of the Opera is there-

Inside my mind.

 

This is the version I saw -

http://www.imdb.com/title/tt0293508/

 

Many tracks in the Phantom of the Opera hit you with the raw pathos comparable with Mukesh Chand Mathur (aka Mukesh) singing “Dost dost na raha” in Sangam or “Baharon Phool Barsao” of Mohammed Rafi in Suraj. Brilliant.

 

In short, I am hooked. Any suggestions for what I can watch next? I know that comparing with Verdi’s Rigoletto or Andrew Loyd Weber’s JCSS or Phantom of the Opera is a tall order – I don’t expect it to. I just want to sample some more real music.

Wednesday, June 07, 2006 5:41:07 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, June 05, 2006

Idea Foundry

 

I was trying to explain to someone the other day about what I am doing in computers. I didn’t have a concrete way to explain previously but these days this seems to be a good way -

 

There are people who need to solve some problem and they use a piece of software to solve it for them. For example someone would wish to buy a flight ticket and they buy it through a website. They are usually called users or end-users. We are all end users. Then there are people who write the software they used to solve their problem. For example the people who wrote the website, all of the complex interactions between reserving your ticket and handling the monetary aspects are handled by these folk. They are the people who developed your software. I used to once do that, or something very similar. Then if you think about it, there is yet another layer - the people who wrote the tools using which the developers of the website wrote their website. These people write tools so that other write tools which you as end users use. The chain of people who write tools which are used to build other tools is a pretty long chain. Its like any services industry – one service is consumed by another service and so – providing several levels of users and tool providers.

 

Somewhere high up this chain in computers usage are the people who write the compilers and the languages and other infrastructural things which everyone else uses. This is very close to where I am today, except maybe one level of abstraction beyond that. I am in the business of studying and developing languages and programming paradigms. These are the ideas that are made manifest by the folk who create real languages and write interpreters and compilers for those languages.

 

The business of being in programming languages is a tricky one at best. It is one of trying to create fundamental ideas related to the way people think about writing software. Writing software, designing languages etc are a lot like real languages and cultures. They come with a lot of overhead and inertia and the sort of languages people use tend to affect the way they perceive and express ideas about the world around them. To create new paradigms and approaches for programming usually entails walking upto some very smart people and tell them that you can better the way they think about the world – “See, here is another way, you just have to rewire your brain a bit and it will make perfect sense… “. Tricky business.

 

If I were to add another line or two of abstraction to my work, I would land up in what is well considered to be mathematics. That is not to say that it is all not mathematical in nature already, but it is only slightly more so than the mathematics that can be expressed in any field of life. I remember one of my last days in Hyd at Microsoft, when I was in the process of leaving for university. It was at the canteen at lunchtime that I was having this conversation with friends and I was trying to tell them how I saw computer science as science and that the fact that there was something called software and the software industry only incidental to its true nature.

 

The problem with computer science is that it’s a very very early science, so much so that many people in it don’t think of it as a science. They think of it more as an engineering discipline. Some refer to it as an art. I am more of the opinion that it is a science – the very early stages of a fundamental science about the nature of the universe and the reality of things in it. Computer science is a science of automata, a science of the nature of interaction of simple interacting components and the study of their behavior. Like all good scientists if you asked me for evidence that this was indeed the case, I must shy back. I don’t really have concrete evidence, but instead I must point in the direction of rice’s theorem, the curry-howard isomorphism, church-turing hypothesis, the pi calculus and say that I feel very strongly that this is the start of fundamental things.

 

 

Luton

 

I had been to Luton this weekend to see Jims, my neighbor back at Cochin and an old friend. Luton had a carnival happening that day – good fun! Lots of floats and people dancing and such. If it hadn’t been for the soggy UK weather and the near perfect unpredictability of the rain, it would have been lots of fun indeed.

 

Since I have been saying this to a lot of people, I might as well write it down: I grew up reading lots of Enid Blyton (yes..). The thing about Famous Five and such is that you actually do believe that they had wonderful summers in the UK and there was always lots of great food around. Not so. The weather is terrible – I expected a summer and came to this country without a single warm jacket – and its been rainy wet and cold in a perfectly unpredictable way. Cycling with numb fingers and a frozen face isn’t what nice south Indian boys like me were designed for (hear! Hear!).

 

That aside, back to the topic of Luton. I had to write this entry because Luton was a place different from any I had seen in a while. It has a large Indian and Pakistani community and I was genuinely surprised to see streets with urdu and hindi shop names and streets that could have been some part of India. It was also nice to see women in salwar kameez’s – rather fashionable salwar kameez’s at that.

 

It was all very nice, until it started getting to me. It happened suddenly at a moment when I wasn’t watching – my mind let open a torrent of things which used to disturb me about back home which came screaming back. The mad screaming mediocrity of the place started blocking out everything in my head. Why are these people like this? Why? Suddenly I started seeing the look people’s eyes judging you continuously to see  if you are one of them or one of someone else. The road blocks caused by bad parking and lack of courtesy while driving.  The dirt on the street, the littler, the attitude that I don’t care and it doesn’t matter. The whole overwrought cultural pretentiousness – what was that old phrase “we are like this only”. Indeed. The completely lack of politeness, the constant suspicion at an existential level, the lack of the slightest bit of subtlety. When I was finally in my bus back, part of my head was screaming “No not all Indians are like that, look at me, I am different, I care”. But I don’t think it mattered.

 

I think our country and the people lack subtlety simply because they are constantly hounded by a constant deafening noise at an existential level such that they are almost deaf to everything else. The noise of being hammered by “you have to be like this” “even if you chose to change it is futile” “this is the system, live in its rules” “don’t think” – everyday, all you life – it eats away large parts of you faculties. These things were upsetting.

 


 

Posted late, as usual.

Monday, June 05, 2006 4:27:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, May 05, 2006

After several weeks (running into months) of blog silence, here is a post.

 

I have been busy. Been teaching myself several new things. Life in Bloomington has been good on the whole.

 

Several good things have happened in life. I am on the verge of finishing my first formal paper in computer science. I have been teaching myself how think in formal terms, not just as a programmer, but like a computer scientist. It is an interesting process.

 

My first paper should be about the yield operator – it turned out that what was idle tinkering and curiosity over the past few years actually seems to have given rise to something of theoretical value. The paper has some formalizations of things, reference implementations, comparison with existing operators and such. Looks like I just may have enough material for a follow up paper as well.

 

 

I have an interesting summer job. I am going to be (finally) at Microsoft Research in Cambridge. I am going to be an intern working with Simon Marlow and at this time it looks like I will be working on a parallel garbage collector for Haskell. It should be good fun to get back to writing systems code for a change.

 

I have seen so many things in code that I am unsure of code that I write these days. I keep seeing demons in my code. Most of the time I don’t code. When I do, and I intend to use it, it is usually in some extreme language – ruby being one extreme and Haskell being the other. I am afraid of what code I will actually write, when I get down to it and if I actually think about the code. There is an interesting Phil Wadler paper titled “Imperative Functional Programming” – I am afraid that if you give me C these days code I write maybe better described as Functional Imperative Programming. Maybe not that bad though.. at heart I think I am still an imperative programmer – a little shaken, but I can still see the machine execute in my head.

 

 

I also spent sometime writing a little book. It is incomplete, but I offer it for download here. If you are the sort, do read it for the fun of it and give me feedback. My intention is to add for text and add more machines and make it a more complete “little” book.

 

It is a book about abstract machines – machines that will teach you the essence of programming languages and constructs. It shows you how several constructs work in a concise formal way to the extend that you can take the definitions in the book, apply the syntax of your favorite language to it and create your own interpreters and potentially your own programming languages.

 

The Little Machines

 

Thats all for now. More when time allows.

 

ps. If you have any suggestions about places to visit in the UK and such let me know. I am looking for interesting things to do in the time I can take away from work.

Friday, May 05, 2006 12:01:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, January 20, 2006

Some quotes and thoughtlets collected over the years. Some are my own, though I don’t know which ones exactly – over time it has all got mixed up in my head.

 

From Roshan to language designers of the future, on the topic of programming language types:

If it looks like a duck, and quacks like a duck, we have at least to consider the possibility that we have a small aquatic bird of the family anatidae on our hands.

(adapted from Douglas Adams).

 

I just fixed the last bug!

 

Any sufficiently advanced bug, is indistinguishable from a feature.

-- quoting Prof Andrew Lumsdaine, Advanced Operating Systems (P536)

 

Marvin: "I am at a rough estimate thirty billion times more intelligent than you. Let me give you an example. Think of a number, any number."

Zem: "Er, five."

Marvin: "Wrong. You see?"

The mattress was much impressed by this and realized that it was in the presence of a not unremarkable mind.

-- Douglas Adams, Life, the Universe and Everything

 

Life! Don't talk to me about life.

 

Ok, so what the answer?

Its 5,1,1,3,2…

No, no, no, I don’t like it..

You don’t like it?

It doesn’t mean anything, what does it mean?

Now that’s a different question.

-- solving the universe selection problem, Quantum Programming

 

When all you have is a hammer, every problem looks like a nail.

 

Would you like tea or coffee?

Mathematician: Yes.

-- quoting Michel Salim

 

What do you mean its third party fault? I can’t get my work done and you are partying?

 

It’s an idea so simple, that understanding it messes your mind.

-- adapted from Dan Friedman, Principles of Programming Languages

 

Creating a great language doesn’t involve assuming that your users are less smart than you.

 

The language that you use defines what you can most easily think of. Languages instill patterns of thought. Certain languages make difficult the understanding of certain ideas.

 

A novice was trying to fix a broken lisp machine by turning the power off and on.

Knight, seeing what the student was doing spoke sternly- "You can not fix a machine by just power-cycling it with no understanding of what is going wrong."

Knight turned the machine off and on.

The machine worked.

-- AI Koan

 

Lambda the ultimate.

-- Dan Friedman

 

The only law in physics that we know of that has a direction with respect to time is that of entropy.

-- QP class, B629 Computer Science, Indiana University

 

Accept it. We are Labor.

 

A style makes explicit what a language makes implicit.

-- Dan Friedman

 

What I was coming to is that its something that cant be expressed in the lambda calculus.

But that’s obvious.

-- quoting Amr Sabry

 

Science is a way of trying not to fool yourself. The first principle is that you must not fool yourself, and you are the easiest person to fool.

-- Richard Feynman

 

This is not even wrong.

-- Amr Sabry

 

There exists no formal method to convert an informal argument into a formal one.

-- quoting Amr Sabry

 

There exists no reversible classical function that coverts a quantum superposition into a classical state.

-- above paraphrased by Roshan

 

Misguided rambling from Roshan: Computer Science to Physics and Back Again

There exists no formal method to convert an informal argument into a formal one. This is roughly equivalent to the second law of thermodynamics - the total entropy of any isolated thermodynamic system tends to increase over time, approaching a maximum value. This is also our only formal notion of the quantity called time. Here the law is rephrased as follows and things brings out its directional property with respect time, more clearly - It is not possible for heat to flow from a colder body to a warmer body without any work having been done to accomplish this flow. Energy will not flow spontaneously from a low temperature object to a higher temperature object. This is roughly equivalent to saying that there is not no notion of a partial computation without a notion of sequencing with respect to time – this is the ‘.’ (dot) sequencing operator of the pi calculus. The lambda calculus does not define sequencing. Are all closed systems pi-systems?

 

Don’t worry, we are just playing games.

 

Summary of the known laws of the fictitious universe –

- There exists at least one notion of fundamental duality. Using this all other forms of duality can be derived.

- There exists at least one notion of self referential quantification. Using this all forms of self referential quantification can be derived.

- There exists an order of relationship of things among themselves. There exists an order of relationship of events among themselves. In other words there exists at least one notion of ordering or sequencing.

  

The Tao that can be described in words is not the true Tao

The Name that can be named is not the true Name.  

From non-existence were called Heaven and Earth

From existence all things were born.

In being without desires, you experience the wonder

But by having desires, you experience the journey.

Yet both spring from the same source and differ mostly in name.

This source is called "Mystery"

Mystery upon Mystery,

The womb giving birth to all of being. (1)

- Tao Te Ching, as translated by John R Mabry

 

All consistent axiomatic formulations of number theory include undecidable propositions ...

Gödel showed that provability is a weaker notion than truth, no matter what axiom system is involved ...

- Gödel Escher Bach, Douglas Hofstadter

 

Thirty spokes join together at one hub,

But it is the hole in the center that makes it operable.

Clay is molded into a pot,

But it is the emptiness inside that makes it useful.

Doors and windows are cut to make a room,

It is the empty spaces that we use.

Therefore, existence is what we have,

But non-existence is what we use. (11)

- Tao Te Ching, as translated by John R Mabry

 

The impossible did not bother him unduly. If it could not possibly be done, then it must be done impossibly. The question was how?

-- Long Dark Tea-time of the Soul, Dirk Gently.

 

((lambda (x) (x x)) (lambda (x) (x x)))

 

If you're going to tell a lie, tell a big one (then nobody will believe it's a lie.)

-- Joseph Goebbels

 

Is there a name that describes a situation where all parties involved, despite understanding fully or partly the true nature of the situation, choose to play a role until an outcome of the situation presents itself in such a way that it cannot be held the sole responsibility of any of the parties involved?

 

Why can’t we all just get along?

 

The average celebrity meets, in one year, ten times the amount of people that the average person meets in his entire life.

-- Jack Nicholson.

 

Deep down, I'm pretty superficial.

-- Ava Gardner

 

 “One day an evil magician flew over his house and – “

“Just a minute, “ interrupted the king (who was very practical). ‘I didn’t know that magicians could fly!”

“Most of them don’t,” she replied, “but this one did.”

“But how could he?” asked the king. 

“Because he was a flying magician,“ she replied.

“Oh, that explains it,” he said. “Go on!”

-- Raymond Smullyan

 

I agree with you, its just that I am not willing to admit it.

 

I searched for one of my favorite quotes and found this page. I laughed my guts out for sometime - http://www.corsinet.com/braincandy/explain.html

 

Fortune has me well in hand, armies 'wait my command

My gold lies in a foreign land buried deep beneath the sand

The angels guide my ev'ry tread, my enemies are sick or dead

But all the victories I've led haven't brought you to my bed

You see, everybody loves me, baby, what's the matter with you?

Won'tcha tell me what did I do to offend you?

-- Don McLean, “Everybody Loves me, Baby”

 

Ph.D. Haskell programmer - ate so many bananas that his eyes bugged out, now he needs new lenses!

-- Evolution of a Haskell Programmer

(I nearly died laughing on this one – these days I have been trying to understand monads in the context of computational effects and CPS. If you don’t get the reference look here, Erik Meijer’s classic on the ‘Point Free Style’ - http://citeseer.ist.psu.edu/meijer91functional.html)

 

Friday, January 20, 2006 3:34:06 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, January 13, 2006

I almost made a (potentially) very expensive mistake today. I have been hoping to buy a digital SLR for a while now and in the past few weeks that seems to be the only thing that on my mind. Most people around me are a little wary getting into a conversation with me these days because the only thing I could talk about was the camera I was hoping to buy.

 

After a lot of ruminations between going Canon or Nikon I finally decided to go with the Canon EOS 350d a.k.a. the Canon Digital Rebel XT. Now I cant really afford this stuff, and it a rather tight stretch to get myself one of these considering my present status of un-rich grad student.

 

I am also no novice to using the web and to using computers, so I was so stumped by how I forgot the cardinal rule of doing anything on the web – never believe a webpage. Unless you know the entities behind the webpage and you trust their reputation to serve your purpose – never ever ever trust a webpage.

 

Case in point, this is what you see when you Google for the Digital Rebel XT:

 

I took a walk down to the nearest camera shop and I mentioned to the friendly gentleman there about how the website prices are about 450$ when he is charging me about 800$. Here came the first piece of news – he says that if you have a Canon USA warranty, in other words if something happens and you want Canon to fix it for you, then there is no way that the camera can cost so less. It must be some international warranty which you may have to ship back to the country of origin.

 

So I take a look at the website again and the website says that it has a USA warranty – very explicitly. So I feel considerably relieved. I however wanted to check out one or two of the lenses I was interested in getting and so I visited the shop again and I mentioned this fact to the person there. He stuck by what he said – he said that yes they might offer a warranty to you in the US, but it will not be Canon’s warranty. It will be someone else’s.

 

What? Now I was going to spend what is presently a non trivial amount of money for me so I put things together and I decided to call the online store I was planning to buy from.

 

I was feeling a little pressurized into getting this purchase done because Canon is offering some interesting mail in rebates which multiply when you get multiple items in combination and so I was planning to through in a decent lens with image stabilization and such.

 

So I call the store and I had to hold onto the line for a whole 20+ mins. Hmm hmm… what are these guys an airline booking service? And finally I get a most disinterested sounding guy. I ask about the warranty and yes, the shopkeeper I had been talking to was right. This was not a Canon warranty. ‘If something happens, who will be fixing the camera?’ ‘My technicians will work on it’ and that gets me thinking – gee, if I have to hold so long to just speak to one of them how hard will it be for me to get them to fix something for free? And then he says it – ‘my technicians have been fixing these for the last 50 years’. What??? And then a sentence or two later he hangs up while I was in mid sentence. Nice.

 

So the whole conversation was a little like being hit buy a snowball when you are busy picking your nose. I kind of snapped out of my self hypnotized state of mind and I did what I should have done first – search for reviews on the seller.

 

Every website I could find had people expressing very strong negative opinions about these guys. I search for some of the other sellers offering similar prices – they all had similar comments. What???

 

I remember the shopkeeper I was talking to mention that they cant be authorized Canon dealers because there is no way that they could get the cameras so much cheaper from Canon.

 

So finally, let me point some fingers –

This is the seller I was looking at and the one that I called up –

http://www.infinitiphoto.com/

(Yes they have a reasonably nice looking webpage).

 

Here are some others -

http://www.bestpricecameras.com

http://www.geniuscameras.com

http://www.usaphotonation.com/

 

Here are some seller review pages –

http://www.reviewcentre.com/reviews87615.html

http://forums.photographyreview.com/showthread.php?t=10678

http://www.dcresource.com/forums/archive/index.php/t-7031.html

http://www.dcresource.com/forums/archive/index.php/t-72.html

http://www.price.com/vendor_review_display.html?vid=-2147483120

http://forums.photographyreview.com/showthread.php?t=10918

and so on, there are many pages out there that tell similar stories.

 

Well this was a clincher –

http://www.resellerratings.com/seller9662.html

 

Moral of the story – make sure that you search for the seller when buying online always. If in doubt call them up, maybe even multiple times. This is a handy website that gives you seller information –

http://www.resellerratings.com/

More practically, simply search the web for “review <seller name>”.

 

Ensure that you are not going for opinion bases of 5 or 6 reviews. Averaging over 100s of reviews is decent. Another thing that you could do, is use resellerratings.com or similar to search for the product to see which sellers give you a good price.

 

And before I change the topic, some good information. I have heard good opinions by word of mouth and in terms of reviews about B&H. They are on the average a little higher in cost than the cheapest semi-reputable seller you can find.

http://www.bhphotovideo.com/

I have heard good things about Adorama.com as well.

 

If you are looking for Canon EOS lenses to buy, take a look at this link (thank you Deepak for pointing at this). This is a good starting point for a beginner in digital SLR photography and is a beginners guide to lenses for the Canon EOS series –

http://bobatkins.com/photography/digital/10d300dlenses.html

 

 

Finally, now that I have broken free of my obsession (for a while) I was trying to think of why I got so convinced into buying this, without doubting the seller and other things. The last time I bought a camera online I was very careful. I have two ideas in this regard and they are a little touchy, but here they are –

 

What changed since the last time I bought my Sony P150 that caused me not to scrutinize the seller as much? One answer – Google. See people form an emotional bond with their search engine – it is their bringer of information, of right information, of truth. It is not an intellectual bond, it is bond formed out of the force of habit. So when something shows up ‘on top’ on google – I think that that information is credible (for some values of credible). If any of the shoddy sellers above were ranked first or second on Google, that would be true. But, they were sponsored links and they were right on top on Google.

 

When a link is on top by paying for it, of course its not credible. Of course, Google never does vouch for the credibility of the people who it sells ad space to as well. While all of that is correct, the point is that being on top on Google is a powerful selling force. It can slip past the best of us. The same goes for Google’s Froogle – I don’t think any form of paid advertising is involved there though.

 

Can Google do something about this? Should they check credibility of the ads they host – I don’t think they can if they want to sell ads in bulk the way they do now. I think this is hard for anyone on top – be it Google or MSN or anyone else. But if they don’t, there will be more like me who trust Google ranking and information finding abilities to magically lend credibility to their sponsored links.

 

However, here is an opinion – if you plan to be a popular website on which resellers can rely on to sell their goods, then you need to have a credibility system in place. Something like Amazon’s seller feedback and buyer assurance. How much do you think I am going to value sponsored links on Google in the future? Maybe on the whole, advertising on websites would take a big boost, if there was a credibility system.

 

 

The second point I wanted to make is one that is best described using Ken Thompson’s ‘Trusting Trust’. How can you trust or mistrust one website based on another? What if the review site you are looking at is faking it? What if someone is trying to make one of the above sites look bad by posting fake reviews? Or is someone trying to make their own site look good?

 

There is, in my understanding, no way out of this. One almost always ends up implicitly or explicitly trusting one system to make a judgment about another, like KT demonstrated in his Turing award lecture.

http://www.acm.org/classics/sep95/

 

The only thing you can do is mitigate the possibility of being cheated is by looking at several review sites and by calling up your potential sellers. I can’t think of very much else.

 

 

Finally, if you are from one of the sort sellers this is what I have to say - get smarter. If I were you and I still wanted to defraud an occasional gullible customer, I would minimally do the following –

- Have more fake reviews in my support

- Sound more endearing on the phone

(despite the bad reviews, a good phone conversation and the price would have got me). You see going on top on google gives you a much larger window of opportunity to get at customers than you realize. Think a little bit – there are many many things you can do. Of course, you will eventually get caught or get sued – but I am assuming you are willing to entail that risk considering some of the reviews I read.

 

As of now I am not buying my Rebel XT, it a little outside of my budget. But I guess the prices will come down and my budget will go up, in time.

Friday, January 13, 2006 12:06:38 PM (Eastern Standard Time, UTC-05:00)  #    Comments [8]  | 
 Wednesday, January 11, 2006

I had been to Chicago the last week of 2005. This visit, being my first trip outside of Bloomington to see the ‘the real US’ as some people tell me. Considering that I had pretty much flown into Indianapolis in the middle of the night and that I had stayed at Bloomington all semester I pretty much had not seen any more of the US than most Indians had in the movies.

 

One of the many reasons that I was looking forward to seeing Chicago was that I was looking forward to seeing some of what was considered ‘big’ in American terms. I don’t know if this is easy to understand, but back in India what most people who visit US for the first time tell me is that the thing they notice most is how much larger everything is. Larger stores, larger roads, larger people, larger potatoes etc etc

 

Well Bloomington, didn’t spook me out in that way – it was all too beautiful to be scary. Bloomington seems like it has sprung straight out of an Enid Blyton novel, for those of us who grew up reading Enid Blyton novels (no I didn’t, I just happened to make certain observations about those who did. So there.).

 

Chicago was well, uummhh… large. I was kind of spooky to be surrounded by all there large buildings and one was walking along the streets staring up at a partitioned sky. I also remember noticing how on the average people looked more harangued than folk back at Bloomington. And also how everything was so much more hurried. People seemed also seemed more necessitated to fend for themselves instead of the ‘you first, no you first’ courtesy of Bloomington. I also remember thinking that with buildings like that the only thing that the place lacks is Godzilla to go tearing between – just to complete the picture. Many things were more expensive, or at least it was considerably easier to find yourself more expensive things that it was in Bloomington where most college students would not have much use of finding themselves lots of expensive things. There were also many poor people on the streets, many holding up signs that said something like “I am just Hungry”.

 

But anyway, that’s not what this post is about. This post is about the St Pauli Girl. Chicago can wait, I didn’t know I’d have much to say about it.

 

Of all the pictures I took in Chicago, the one that seemed to catch my attention the most is this random picture I took of a neon sign in a shop window. The St Pauli Girl:

 

 

I don’t know what it is, but that picture held a certain inexplicable appeal. It even stayed my wallpaper for sometime. See, I am not much of beer person, then why? I do have googd friends who really like beer, but not me. Not yet.

 

I finally decided to google for it and sure enough, I found my explanation. Now for the benefit of my below 18 readers who are trying to understand the true nature of all of computer science from reading my blog, I shall not quote these here, instead I shall provide the links here.

 

Scroll down and read the section titled Don't Fear the Reaper

http://www.purpleroom.com/travel/kenn6.htm

 

and

http://beer.emptyfree.com/index.php?p=7

 

Cheers! Hic!

 

Wednesday, January 11, 2006 12:20:54 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, December 21, 2005

It always used to bother me, how mind-bogglingly complex my life was, from a lot of aspects. Sometimes, the complexity was too much to handle and it would affect the way I think and act in totally unconnected aspects of my life. Its strange how no one knew or could know all the pieces at once.

 

I have always found movie characters shallow – they are always clichéd in some way – never seemed to reflect the complexity of real life in any non trivial way. Very rarely could I allow myself to see the connection between movie characters and the way I see the ‘real’ world.

 

I just finished watching Stanley Kubrick’s ‘Eyes Wide Shut’ and I have to pretty much surrender to the genius of this film. Its something that captured an aspect of the complexity of life, in a very real way. I don’t have a word or a phrase to describe that part of life – but it is real for me. And it scared me that someone could express it as clearly as that. Scared and amazed me. It’s a wonderful movie and one that is very hard to appreciate in all its layers.

 

I am beginning to realize that I have developed in myself a healthy though-style in the constructive culture of doubt that we often call science. I can think scientifically – though saying that does not mean very much because there many interpretations of what ‘thinking scientifically’ is. However I cannot think very clearly in terms of people - the way behavior of individuals is affected by interaction with other individuals even though I can presume to understand the individuals in isolation. It always amazes me when someone can do that or at least portray that in a way that I that I find interesting.

 

 

The Christmas break has started and Bloomington is beautiful these days. Snow all around – my first time with snow. I guess saying that Bloomington is beautiful these days is not saying much at all because Bloomington is always beautiful.

 

 

 

I got my copy of Douglas Hofstadter’s ‘Godel Escher Bach’ the other day. I think it is going to say many things that I know intuitively but may never be able to express as beautifully as Hofstadter. And that, in some sense, is the whole point.

 

 

I have also got interested in physics again after many many years. I don’t know if I will have the luxury to study it – but the interest is back. This time however it looks like I may focus more rationally and more thoroughly on quantum mechanics and the quantum field theory.

 

 

I am also beginning to be of the opinion that computer science is a foundational science in the study of the universe as is mathematics and physics. Actually computer science is probably an incorrect description of this foundational science and it should be more of a science of automata – such that it can be described separately from mathematics, though the line is blurry in many places. Its doesn’t really matter – there seems to be little value in the effort of compartmentalizing computer science and mathematics.

 

 

I have also, in the past few days, got interested in this board game called GO. It has simpler rules that chess. However it leads to very complex patterns and different notions of strategy compared to chess or many other board games that I know of.

http://en.wikipedia.org/wiki/Go_board_game 

 

And finally I have an update to my Enc (file encryption program). The last version was buggy because it would drop files sometimes. For some reason I cant seem to write this program well at all. I always end up writing this one badly and keep getting unhappy with it. Even this version isn’t very good. It certainly isn’t good in terms of doing good exception handling and all – but even on other aesthetic levels I don’t like it. I wonder what it is about the nature of this program that causes that. Of course, if you are afraid of using it for protection – it is rather usable, so don’t worry, too much. The protected files that are generated are atleast as strong or weak as the protection that is guaranteed for 128bit Rijndael (AES) encryption.

Download Enc v0.3 (src and binary)

 

 

Marvin: "I am at a rough estimate thirty billion times more intelligent than you. Let me give you an example. Think of a number, any number."

Zem: "Er, five."

Marvin: "Wrong. You see?"

The mattress was much impressed by this and realised that it was in the presence of a not unremarkable mind.

-- Douglas Adams, Life, the Universe and Everything

 

LIFF (n.)

A book, the contents of which are totally belied by its cover. For instance, any book the dust jacket of which bears the words. 'This book will change your life'.

 

Wednesday, December 21, 2005 3:02:18 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Sunday, November 27, 2005

 

First principles, Roshan. Read Marcus Aurelius. Of each particular thing ask this: what is it in itself? What is its nature? What does it do, this matrix you seek?

 

A faceless Marcus Aurelius with the voice of Anthony Hopkins and the intensity of Hannibal Lector kept repeating this to me most of this week.

 

Last Sunday night something interesting happened – I believed I had a solution to something – a problem in quantum computing - a way by which I can take any arbitrary quantum function that takes ‘m’ bits and produces a superposition of ‘n’ bits and construct an equivalent reversible function. The interesting thing that happened was that I realized was wrong – when I started looking at the matrices that my solution generated, I realized it would not work for any function that produced more than one output bit.

 

After some amount of thinking about it, the problem was narrowed down to looking for a matrix that was involuntary, the first row of which was decided by the function I was trying to model. Though the problem could be stated in a simple way, it was surprisingly hard to solve.

 

It kept running in my head everyday, all the time, for a major part of this week and it just didn’t make sense. I could look at the problem from many angles but the matrix kept eluding me. What is the nature of this matrix? it is involuntary. But that did not help me solve the problem.

 

The idea that finally helped me solve it came from a friend, Abhijit Mahabal, one of the smartest people I know in the department. Abhijit got me to look at the involution represented by a matrix as the reflection of a point about an ‘n-1’ dimensional hyper-plane in an ‘n’ dimensional space. I knew that given a function that produces ‘n’ bits, the matrix would be a ‘(2^n)x(2^n)’ square matrix and hence I was looking for the reflection of a point about a ‘(2^n)-1’ dimensional hyper-plane. That was the true nature of the matrix, the fact that it is useful to construct a reversible function was only incidental.

 

Of course, when Abhijit first explained this to me and did the math in 2-dimensional geometry, it was a little too much for me to get my head around. I refrained from this approach for two days since the math seemed too hard. But after looking at the problem in several different ways, I went back to asking myself about the nature of the matrix – then it was simple. I worked out the math for the multi-dimensional geometry and coded it up and ran it - and it worked at the first go. Ah, the pleasure of first principles.

 

Yesterday I had a chance to look at my Professor Amr Sabry’s, approach to the problem and I was stumped. I was used to being stumped by the things he did (after knowing him for about a semester) and I was often reeling from the effects of what a few well thought out lines in Haskell can express. However this time I was stumped because I thought this was something I understood and yet he had a very different solution - one that wasn’t even an involution!

 

For a major part of last night and today it bothered me that I spent all that time trying to solve the wrong problem. It annoyed me a lot – what was the point in putting in all that energy to solve a problem if it was the wrong one?

 

Thinking about this caused me to realize something important – in research, unlike in the commercial software world where I spent the last several years – it is equally important to understand why the problem exists and to question to nature of that which causes the problem to exist, as it is important to solve the problem itself.

 

This should have been obvious, but it was not. The world of commercial software or in general the world that practices software engineering in a way that is not research oriented has certain rules of problem solving that are different  from those of research. The more creative and intellectually challenging of those environments let you take your problems and solve them in any way you want. The lamer environments put too many bounds on how you solve your problems. Very rarely, almost never, in commercial software do we get the freedom to ask the following question in a non-trivial way ‘why is this the problem that we need to solve? why is this its nature?’. If you are not in a position to make decisions about the nature of the business, you are not in a position to question the nature of the problem. 

 

This will be tricky lesson to unlearn when I go back to an environment that doesn’t give me this freedom.

Sunday, November 27, 2005 8:11:52 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4]  | 
 Wednesday, October 12, 2005

Last night I was writing some for OS161 – I was implementing a fork(), execv(), getpid(), waitpid() and exit() for the OS161 kernel. I was using Visual Studio Express VC++ edition beta2 to write the code and I had a little ruby script to upload changed file to my linux (gasp!) box and a little script there that would build the kernel whenever the files changed. That way I get to develop code on an OS that has a notion of a unified clipboard and such pleasantries and get to build it wherever the tools are available. I also got a minimal shell like first process done.

 

Don’t get me wrong when I say this, but I sometimes like to think of myself as a fairly decent imperative programmer – I would be comparably good to many people you might meet. Ever since I came to college functional programming has been rewiring my brain. And its beginning to hurt. And I am enjoying it. And sometimes you need a break.

 

Hence writing missing pieces in a simplistic os kernel is a nice break. And I am going “Ooh! Look I have variables! Ooh! Look I can reassign the value of this thing. Look, I have loops”. And that’s a nice world to be in, if you can think in terms of state well – for those of you imperative programmers don’t know what that is, it means that things have changable values (like x=5 and x ++;) – and those of you who don’t realize you are imperative programmers, here is a simple test: if you are not a Haskell (and similar) programmer Or Scheme programmer (without set!) Or mathematician Or someone who goes from day to day without anything in the world affecting you, you are a imperative programmer of some device.

 

So I was enjoying being imperative for a while and then when I had it all going halfway into the night – I had multiple processes forking and execing and waitpiding and exiting – the whole crashes. And then it crashed again. And this was crazy, because all the of the pieces were things I had tested separately and yet they crashed when they came together. Somewhere in the back of my head there was this little elephant called lambda laughing on the floor ignoring his cons-kit for a bit. But wait a minute, I thought all this functional programming was making me a better programmer – I thought I could think more clearly about composition.

 

After about 2hours of meditation and atleast one or two sets of forays into the debugger as a last recourse, I realized what the problem was that I was not writing things back onto the user space stack in the correct alignment in some cases – and the this was some dword alignment requirement of this machine that was not mentioned anywhere. Lambda and the Turing tape looked down, looking a little sorry. I was in a bad mood by the end of it and that wasn’t fair – that was my little imperative break.

 

All of this, gets me to some of the conversations with some of my professors here. Dan Friedman is one of the kindest gentlest people you can talk to – and pretty much every other sentence some brain mutilating idea, said in the kindest subtlest way possible. So it happened that I needed to prove that something is not possible (it is related to the hypothetical apply-iterator operator I speak of here). Fifiteen minutes after the conversation I am thinking about higher order programming with continuations and my brain is hurting. (do you know what that means? If you don’t you need to go though the experience of hitting upon an idea that changes the way you look at the world. Changes the way you look at the world does not mean that the next time you eat a burger you look at it slightly more from the left, it is a little more encompassing an idea.)

 

An idea isn’t responsible for the people who believe in it.

 

Programming languages are devices to express thought. The fact that you can also create software using them are only secondary to this larger idea. Languages carry ideas of meaning and operation and you can compose these things together to create larger meanings and wider operations, or compose them to narrow down their scope. If you are a starting C programmer or an accomplished C# or Java programmer, it maybe hard to see things this way – but that is ok, you don’t always have to know the full import of what you could be doing. (I will write about Haskell and the wizard called Prof Amr Sabry some other time.)

 

One of the hardest things or like Prof Friedman says it is probably the simplest of all things is the idea of a continuation. It is an idea so simple that it drives you crazy trying to understand it. Imagine that if you did something, anything, it has rippling effects across the rest of all time – now imagine that you can take this ‘rest of all time’ and assign it to a variable and pass it around through all the operations you do, such that at some time you can go back to that rest of the world. That is a continuation. That as a programming device is good way to inflict some brain damage if you try to internalize it.

 

That’s about when I thought I should quit. That I probably should not go functional. All of this was too hard – you start out with something because you feel that there is some beauty and some truth in it. And when that fails you, maybe its time to betray you way of thinking – maybe its time to quit. By this point, you realize, that I might be quiet crazy, and that it might be rubbing off on you since you are still reading this. Betray the temple of Lambda?

 

That’s when Judas’s song from Jesus Christ Super Star (which I have been listening to a lot these days) plays in the back of my mind, when he does to Caiphus to betray Christ -

Now if I help you, it matters that you see

These sordid kinda things are coming hard to me.

It's taken me some time to work out what to do

I weighed the whole thing out before I came to you.

I have no thought at all about my own reward.

I really didn't come here of my own accord.

Just don't say I'm ... damned for all time.

 

I came because I had to; I'm the one who saw.

Jesus can't control it like he did before.

And furthermore I know that Jesus thinks so too.

Jesus wouldn't mind that I was here with you.

I have no thought at all about my own reward.

I really didn't come here of my own accord.

Just don't say I'm ... damned for all time

- Damned for All time, Judas’s Song, JCSS.

 

And then something snapped back in place and I was at it again. Why have such a device as continuations? Why bother? Well we understand little of continuations in my opinion. They are a thinking tool for the future. How can something so mind bogglingly hard be useful?

 

A long time back I remember seeing a beginner book about BASIC programming. That book had an example of the quicksort algorithm in basic written using gotos. It was a only a few lines. I spent a whole evening trying to understand what that was doing. And I didn’t succeed. I could execute the statements in my mind and see how they work, but I could see how such a beast could be created. I couldn’t see the way you would have to think to create something like that. Several years later I saw copper bars by Tylisha C Anderson and it was the same death by gotos. I could not understand it.

 

Many years ago they got together and killed off gotos and created a new-kid-on-the-block called structured programming. They took gotos and created a set of patterns that are sufficiently expressive to do anything that you could do using gotos. And then they killed off goto. The offspring forms the basis of almost all imperative programming today.

 

The real value of something powerful that we cannot tame yet is in what you can derive out of it. That’s when you say, in the conventional sense, that something is sufficiently mature – when people who don’t understand the first thing about it can use it to solve their programs (that’s the sense in which I sometimes say that windows is more mature than linux…). I think I should stop now. As you can see, college has been fun so far.

 

What then to do about this Jesus-mania?

Now how to we deal with a carpenter king?

 

Where do we start with a man who is bigger

Than John was when John did his baptism thing?

- This Jesus must die, Song of the Priests, JCSS

 

I dreamed I met a Galilean;

A most amazing man.

He had that look you very rarely find:

The haunting, hunted kind.

I asked him to say what had happened,

How it all began.

I asked again, he never said a word.

As if he hadn't heard.

                        - Pilate’s Dream, JCSS

Wednesday, October 12, 2005 9:37:40 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, October 05, 2005

Its been a little over a month at IU and the experience has been overwhelming. As has been since when I can remember I have gotten myself involved in more things than I can handle – which is another way of saying that things have been fun, atleast when I am able to keep up with them.

Like Hogwarts, the university is dotted with signs of greatness from antiquity. And every once in a while you come across some one who can do things to your mundane set of ideas that is no lesser than of Gandalf.

iu-4.jpg iu-2.jpg iu-5.jpg 

iu-3.jpg iu-1.jpg
Pictures from around the Indiana University Campus

I have been hit by some hard ideas and fortunately I had been preparing my mind for a while to handle these – had I not and had I tried to absorb them at the same rate now, I might have been in for some hardship.

lindley_hall.jpg
Lindley Hall, Computer Science Dept

 I have formally enrolled for Operating Systems by Andrew Lumsdaine, Programming Languages by Dan Friedman and Quantum Programming by Amr Sabry.

OS is primarily to scratch an old itch – because of that incomplete OS I left behind in college – this course gets to complete is half done os161 kernel – so there is a lots of traditional C programming there.

Programming Languages essentially covers the whole of ‘Essentials of Programming Languages’ with Prof Friedman saying things like ‘I will let you know when you need to think’, on day one. Most of us are thinking pretty hard already. This year the course also covers the new logic system he worked on with Will Byrd and Oleg Kiselyov called Mini-Kanren (source-forge is not as updated as it should be). This also forms the basis for his third ‘little’ book – The Reasoned Schemer.  

Quantum Programming is … well a course about magic – it’s a huge thinking exercise about creating a model of computation for possible ‘quantum machines’. I will not venture to say much more here, except drop a link to an introductory paper.

OS and PL are supposed to be among the hardest courses in the CS department, many people don’t advice taking them both together. To put things in perspective, I am finding QP the hardest simply because of the breadth of the computer science from which the ideas in QP are coming from. The present state of QP is a little like the state of classical computing in the times of Church and Turing.

kirkwood.jpg iu-7.jpg
Kirkwood Hall and the walkway by Lindley

That aside, I am looking into some of these things as of right now (this is not a complete list)
-        join calculus, pi calculus and other process calculi
-        squiggol (Bird and Meertens formalism)
-        quantum circuits
-        grokking functional programming Haskell-style
-        logic programming

imu.jpg

All of this aside, Bloomington is a beautiful place - small university town with lots of charm and a pleasant weather (for now). I am told that this place has bad winters with lots of snow.

bloomington3.jpg bloomington2.jpg

bloomington1.jpg

I have a small single bedroom apartment that is a ~12 min walk from the university.

univ.JPG
The red square is Lindley Hall, the main CS department building and the green square is my apartment.
(Courtesy: Google Earth)

And among other things, I have a new weapon – its called Qubit. Qubit is a Dell Inspiron 9300, UXGA 17” monitor, with 1Gb ram, 256 mb Nvidia Geforce 6800 graphics card and a dual layer Dvd writer. 

iu-6.jpg

Wednesday, October 05, 2005 10:34:17 PM (Eastern Standard Time, UTC-05:00)  #    Comments [9]  | 
 Tuesday, August 09, 2005

cheers!

Tuesday, August 09, 2005 7:11:33 AM (Eastern Standard Time, UTC-05:00)  #    Comments [14]  | 
 Sunday, July 24, 2005

As of 20 July 2004, I no longer work for Microsoft.

 

You are not going to be seeing any leaving Microsoft letters of the sort you may have seen from some ex-microsofties. I am going back to college. Over the years, I figured I don’t understand computer science very well. I figured I lack some fundamental things in my understanding of the way this science works. I love computer science and the only way I am going to be able to good enough to quit the field and probably go sell airplane rides for a living, is if I understand it better. So I am going to college.

 

I am joining Indiana University this fall for my Masters in Computer Science. I am navigating primarily by instinct right now, so I don’t have clear answers to ‘What next Rosh?’

 

I left Microsoft with very good opinions about the company. Easily the best company I worked for – for the quality of the work they do, for the quality of the people, for the culture and the spirit. I wish it was a much braver company with respect to taking risks, and boldly chasing after the next step in the everyday computing. I wish it leveraged its people better, I wish it was more about blood and genius and less about schedules and numbers. But it is easily better than most places that I have had the opportunity of knowing.

 

I am going to be thinking about a different class of problems for the next few years - problems about nature of computation, logic and mathematics.

 

The weekend I left Hyderabad I got to visit Golconda once more –

 golconda1.jpg

Golconda Fort, Hyderabad

 

I am now back at home, in beautiful Cochin –

 

Cruise boats at Marine drive, Cochin

Sunday, July 24, 2005 11:50:11 AM (Eastern Standard Time, UTC-05:00)  #    Comments [6]  | 
 Friday, May 27, 2005

sky5.jpg

"I am not sure I want to be perfect and finished. Talk about boredom..."
"Look at the sky," Don said.
"Well, it is always a perfect sky, Don."
"Are you telling me that even though it's changing every second, the sky is always a perfect sky?"

sky1.jpg

sky3.jpg

sky4.jpg

Friday, May 27, 2005 12:28:11 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Tuesday, February 01, 2005

In the past weeks I have been around Hyderabad a bit – traveling mostly when I can take some time out in the weekends. I have also been playing around with my new Sony P150. I just thought that I should take some time and put out pictures.

 

 

This is a close up breakfast – sausages with lots of veggies – blurred through the steam droplets under the glass lid.

 

 

A shot of the famous Charminar.

 

 

Pigeons fly about one of the minarets of the Mecca Masjid.

 

 

The Mecca Masjid again. Lovely place. Peaceful.

We spent a sunset there this weekend. Sid had been visiting us from Bangalore.

 

 

Speaking of pigeons this is a shot of pigeons flying over one of the old minarets (of which you find several) in the old Hyderabad area.

 

 

 

Microsoft shifted to its new campus in Hyderabad this weekend. I now have a new cubicle. The new campus area is lovely. Open barren land with a few large software shops littering the rocky landscape.

 

 

 

 

The above shots are from the Nagarjun Sagar dam – a 3 hour drive from Hyderabad in one of the AP tourism buses. Had been fun.

 

 

One of the marble lions that are on guard outside the Salarjung museum.

 

Tuesday, February 01, 2005 4:38:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Thursday, January 06, 2005

I now have what is advertised to be one of the world’s smallest 7.2 megapixel cameras – The Sony Cybershot P150

 

 

Reviews –

http://www.dcresource.com/reviews/sony/dsc_p150-review/index.shtml

http://www.dpreview.com/reviews/sonydscp150/

http://www.megapixel.net/reviews/sony-p150/p150-review.html

http://www.imaging-resource.com/PRODS/P150/P15A.HTM

http://www.steves-digicams.com/2004_reviews/p150.html

and even the register - http://www.theregister.co.uk/2004/11/30/review_sony_p150/

 

 

And here is are some humble beginnings –

 

 

 

These are shot at the Microsoft office at Cyber towers, Hitech City.

 

 This should give you an idea of the detail this captures -

 

And some shots from my terrace –

 

 

Thursday, January 06, 2005 12:59:22 AM (Eastern Standard Time, UTC-05:00)  #    Comments [6]  | 
 Monday, December 06, 2004

With unknown consciousness, I possessed in my grip

A magnificent mantelpiece, though its heart being chipped,

Noticing not that I'd already slipped

To a sin of love's false security.

 

From silhouetted anger to manufactured peace,

Answers of emptiness, voice vacancies,

Till the tombstones of damage read me no questions but, "Please,

What's wrong and what's exactly the matter?"

 

And so it did happen like it could have been foreseen,

The timeless explosion of fantasy's dream.

At the peak of the night, the king and the queen

Tumbled all down into pieces.

 

Listening to Dylan again

 

Ah, my friends from the prison, they ask unto me,

"How good, how good does it feel to be free?"

And I answer them most mysteriously,

"Are birds free from the chains of the skyway?"

 

                        Bob Dylan, Ballad in Plain D, 1964

Monday, December 06, 2004 1:17:42 AM (Eastern Standard Time, UTC-05:00)  #    Comments [7]  | 
 Saturday, November 06, 2004

To Neha, a good friend and an amazing singer,

I just loved the way you sang Bobby McGee the other day. It’s playing in my mind right now right now.

From the coalmines of kentucky to the california sun,

Bobby shared the secrets of my soul,

Standin’ right beside me through everythin’ I done,

And every night she kept me from the cold.

The somewhere near salinas, lord, I let her slip away,

She was lookin’ for the love I hope she’ll find,

Well I’d trade all my tomorrows for a single yesterday,

Holdin’ bobby’s body close to mine.

 

Freedom’s just another word for nothin’ left to lose,

And nothin’ left was all she left to me,

Feelin’ good was easy, lord, when bobby sang the blues,

And buddy, that was good enough for me.

Good enough for me and bobby mcgee.

 

 

 

The weather in Hyderabad is great these days. Maybe, the only time of the year when it is as pleasant.

 

I am upto reading 3 books in parallel these days and I wish I wasn’t because they are nice books.

 

One of them is called ‘The Naked Bachelor’ by Darrel Bristow-Bovey a hilarious collection of articles on how to get around. I highly recommend taking a look at this if you ever come across it. This book can always be read in parts and even has a certain Douglas Adams Hitchhikers quality to its humour in parts.

 

The other one is ‘A Homage to Catalonia’ by George Orwell. I am midway through this and the narrative is beginning to change flavor and I am reading it with much trepidation – the last time it was 1984 and it left me feeling that my ancient empty streets to dead for dreaming for a long log time. I still shudder.

 

The third is the eternal Fountainhead by Ayn Rand. (Yes Pooj, I finally picked it up, how could I not). I have just started by I have taken a liking to it already. Maybe I am heaping too large a compliment on myself, after 20 pages, what seems to be Howard Roark’s inherent functional perfection of buildings is seems close at heart to what I feel is the same way good software is built – not so much about UI as much as a comparison with architecture would imply – but about the beauty in which the functional pieces of the software come together inside; like Pirsig’s motorcycle.

 

Reading Fountainhead reminded me so much of A Separate Peace, a book that keeps coming back you to in thoughts in the most unexpected circumstances.

This picture is taken from the Philips Exeter academy’s page about The Separate Peace.

If there is a legal issue about the use of this picture please do drop me mail.

 

Saturday, November 06, 2004 9:25:08 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, November 05, 2004

This is the sort of thing I have avoided writing about and thought I would not be, for a long time to come – I was afraid to too, mostly because I felt I would be able to or would get too involved in warding of the slack I would get for saying this. But reading this article that Sriram had linked to in his blog brought a mountain of stuff tumbling down. (I don’t know why I am so much into this software-ethical-stereotype thing these days, I have work to do you know). Before you go ahead and read the article linked above, here is what I have to say. This is not a long story, but one of those minor incidents that have stuck on to gnaw at my phsyche.

 

Rewind several years back to when I was in my second year of undergraduate studies. I had just got my first computer (yes) and Pooja had got hers. We didn’t really have internet connections those times, though we did have the modem and required hardware. We eventually figured that if we needed to talk to each other, we could use one of those direct modem-to-modem dialup software. After a lot of tinkering with dialup software and modem settings, we had something going that mostly worked for us. I had a copy of some old dos based software – I cant seem to recall its name – that we used to dialup each others computers and basically ‘chat’.

 

The software was the most reasonable one I could find for our purpose, but was however seriously limiting and got rather frustrating after a few weeks of use. God-geek-in-the-making that I believed myself to be those days, I figured that the only way I would get things to happen my way is by writing a modem communication software of my own. (I know what most of you might be thinking, but those days it wasn’t too surprising to see how often this particular approach was the panacea to all my ills).

 

Those days I also got a chance to talk to one of the few men who seemed to know everything, or atleast had a damn good idea about how to get to know the few things that he might have missed. I got a chance to talk to Jayakrishnan K about the modem’s idea that I had on my mind. JK would know about these things – he should because he had written Kerala’s first BBS (bulletin board service) by hand (as a couple of COM files on a DOS machine doing all the multitasking and all). A short discussion later, I had my head full of X-Modem, Y-modem, Z-modem etc and I was reasonably charged up. The error control would be hard, he had warned me, but that was ok.

 

So I got home and start off, eventually I figured that I probably wasn’t as smart as I thought I was. I was using intervue (Ralf Brown’s fabled Interrupt List (Ralf Brown is now Professor at CMU)) for reference. Somehow some things didn’t seem to make too much sense and I needed more information on how to initialize the modem correctly.

 

This is where GPL stepped in. I turned that in the pile of commonly shared source and software in the college students circles I had a piece of software that did modems communication. I wasn’t really sure what the full intent of the software was, but It has what I wanted – it had assembly code to initialize a modem and set all the settings and such. And being assembly code that manages a hardware device there weren’t too many ways about – you had to load some registers, write to some ports, call some interrupts etc in a certain fixed sequence of ways. Well if you are creative, you can think of several ways of accomplishing the equivalent of

Mov AX, 10

But that by itself didn’t mean that the code to initialize the modem would be written very differently by me, once I had seen how it is to be done. It also turned out that the software (as you would be expecting by now) was GPLed.

 

After the excitement of reading the ASM snippet I had a look at ‘COPYING’, the GPL text file. It seemed to me that if I were to use this piece of code from here to write my modems software to talk to Pooja the entirety of the code that I write would have to fall under the GPL license. It would not be my code anymore. Which is to say, that I would not be free to decide what I do with it – weather I sell it or hide it or share it – that choice would not be mine anymore. That was really disturbing for a while, because here I was wanting to write that piece of modems communications software to talk to a friend and I had a solution in hand, but there was nothing I could do about it – without subjecting myself to legal risk, had I written the software and shared it around without giving away my code. That was my first introduction to the viral nature of the GPL, though at that time the only word I could think of was ‘unfair’.

 

Then I figured that I probably needn’t tell anyone and I could write my software anyway. But then I wondered what would happen (with the notion of fame) that I had this famous piece of software and then one day someone realizes that I actually did have this piece of software on my hard-disk and then they would say that I stole this code illegally. This bothered me a lot because I like to think of myself as an ethical person and tend to get reasonably bothered by the converse. Immature as it may seem, I also wondered if no one could ever write modem’s communication software again.

 

And in time the feeling came to pass, and my code never got written and we used the same old piece of software until we bought ourselves internet connections and things blew over. I still wanted to know if there was a way out.

 

Years later when I had my first chance to meet Richard Stallman, founder of the Free Software Foundation and the GNU project and author of the GNU GPL, I wanted to know if there was a way for me. But in the passing time many other things were beginning to affect my thinking and I was beginning to be more bothered about the small programming communities and their spirit of unbounded sharing and coexistence with the commercial world that the rising tide of GPL acceptance seemed to be wiping out. I feared for those communities and I felt I was part of them.

 

When Stallman finally did come, he was visiting model Engineering College to talk about the danger of software patents – on his first ever visit to India. And then there were people there at the talk, who were asking Stallman how they could detect if someone has used GPLed code in their own software, maybe after modifying it. How they could track down these people and bring them to court. And there I was, wanting to ask the exact opposite – about how I could be protected for using GPLed code because there was no other obvious way to do something esp once you have seen one approach that solves the problem. The question about who protects the programmers.

 

My question never got asked.

 

People around me told me that my concern was unfounded. Things like that don’t happen. Nobody is bothered if you take from GPL code they said. Its just there to be a moral standard they said.

 

Last year, for some uncalled for reason, the topic came back again. This time over train ride home to Cochin from Bangalore when I was traveling with Sidharth. He didn’t see the problem and I was going on raving from the Karnataka border to Ernakulam railway station that its getting dangerous that there is so much GPLed code out there just lying around on the web, crawled by search engines and popped up at you without your ever intending. And if you took from these – copy paste from your browser that smart little three line snippet – you are strictly speaking, subjecting yourself to illegal usage of GPL code.

 

Over the years also I have developed this habit in programming when I am stuck I usually search the web for a solution. Maybe a smart little hack or a piece of advice on how to do something and I am chugging along smoothly again. After joining Microsoft two months back a few colleagues here advised me against doing this – you never know the legal implications of what you are doing they said. It seemed a little odd then, but then maybe I had been forgetting where I was coming from. I do use the web a lot – but now with this additional fear factor and layer of caution – and I wished I lived in a world where ‘freedom’ was a different, more real sort of freedom of choice.

 

Then I found this article : http://www.icsharpcode.net/pub/relations/amatterofinspiration.aspx

I do not know who is right and who is wrong in this debate, but I can empathize with the factors that caused it to originate. This is from the group that creates the rather well know .Net IDE called #develop – an alternative to VS and commercial IDEs and is often recommended to students…

 

I had been procrastinating making this post for some days now. Esp Chris Pratley’s words ring so close to my fears I've been a little gun-shy of blogging about Word for fear of being inundated by what are as far as I can tell a gang of "net thugs" who roam the net making...”. Hopefully this will be the last thing I need to have to say about this entire topic for a while. My blog is getting increasingly dedicated to writing stuff that I get dragged into rather than stuff I like getting into.

 

DO NOT hold this in perspective of my employer or any previous employer or any other context - these are purely my OWN OPINIONS done on my own steam and is not nor was ever was part of any job description of mine.

Friday, November 05, 2004 2:02:13 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, November 01, 2004

So quiet frankly, I

1)       am a fraud

2)       am trying to deceive people

3)       am not ‘worth the trouble’

4)        - to say that I am not ‘worth the trouble’ is misleading, because it implies that there is some potential good to be achieved otherwise

5)       am upto doing bad things, pure and simple

6)       am starting phony open source groups

7)       should have evidence collected against me

8)       – you should be organized against me

9)       should be denounced as fraud

10)   should have protests staged against each of my meetings

11)   should have articles written about my deceptions

12)   should be treated as a liar

13)   should not be treated as respected or legitimate

14)   should have universities close down programs because I am a liar

15)   should have this campaign against me renewed each year

 

If I missed something in the above set, I apologize.

You can read it all and more here -

http://mm.gnu.org.in/pipermail/fsf-friends/2004-October/002484.html

 

The reason this applies to me is because I often talk to my juniors at college and to students as well as professional developers about .Net. I do talk about it as an open platform and I believe that they should adopt it, learn from it, use it and develop on it. (A few days back I had come across this)

 

Sriram, now you know why (like Jack Nicholson) says ‘we can’t all get along’. I have tried and fell flat on my face, several times.

 

Noufal, now you know why I don’t think that MIT’s AI labs success has nothing to do with the GPL and think that the FSF is a political agitation/movement more than anything about technology or software. Unfortunately their sphere of influence is around technology.

 

If the things I do warrant that the above apply to me, then I am not ashamed of any of them.

 

 

 

Kids, if any of you in college are reading this, then here is a piece of mindspace – you are in college/university to be learning, not to be religious or have political ideals. Learn the goods and bads of every system – but more fundamentally try to learn about as much as you can about the art of computer science – that is so rare and there seem to be so many fewer people who know about it.

 

 

 

Now, here are some basics, you just need to be able to read and think to understand these. If you know how to use a web search engine, then you could have

Standards

The open/free standard - http://msdn.microsoft.com/net/ecma/

I intentionally use the words above, because there is No definition of the English language use of the above words that is violated in the way they are used above. If word x means y in a certain political ideal, in my personal sense of ethics, followers of y cannot call those who understand x as x to be non-conformant. Your mileage on that may vary.

 

The standards document – the Common Language Infrastructure – which is to say the way the runtime should work.

Its architecture.

Its file formats

Its API

Its opcode / IL / bytecode – whatever you call it

The C# language.

 

The above are also ISO standards under ISO/IEC 23270 (C#), ISO/IEC 23271 (CLI) and ISO/IEC 23272 (CLI TR).

 

Microsoft does not own or run ECMA or ISO.

 

Patents

About the patents, here is a mail by Miguel of the Mono project.

http://www.mail-archive.com/ilugd@lists.linux-delhi.org/msg05784.html

And look at this

http://samgentile.com/blog/archive/2003/02/19/2647.aspx

 

Implementations

 

Microsoft offered the SSCLI source code

http://msdn.microsoft.com/net/sscli/

Works for BSD, Mac and Windows

The BSD bit patched for Linux is here - http://www.macadamian.com/products/sscli/download.html

These are governed by a non-viral not-for-commercial-use license

http://msdn.microsoft.com/MSDN-FILES/027/002/097/ShSourceCLILicense.htm (print it out, it fits on a page)

 

Mono

http://www.mono-project.com/about/index.html

http://www.mono-project.com/about/faq.html read the faq, before you ‘decipher’

 

 

Maybe I am a fraud who is lying about all of the above. Do you love the .Net technology; do you talk to others about it? Do you write commercial/proprietary software? Maybe you are a liar-fraud too.

 

Btw DO NOT hold this in perspective of my employer or any previous employer or any other context – these are purely my OWN OPINIONS done on my own steam and is not nor ever was, part of any job description of mine. Maybe I am writing this hastily, if I am wrong, I will correct myself. Personally, I have an objection to being called unethical.

 

Monday, November 01, 2004 2:56:05 AM (Eastern Standard Time, UTC-05:00)  #    Comments [28]  | 
 Wednesday, October 27, 2004

MSDN Mag

Some things to say – the MSDN magazine has hit news stands in India, that too at an affordable price of 60 rupees a copy. Worth taking a look. Most people simply don’t even know about MSDN mag, so take a look here to get an idea of what it is like:

http://msdn.microsoft.com/msdnmag/

Additionally this is an India edition of the magazine so it has some information about the folk you should be getting in touch with in India, articles from some folk here and the community effort and such, in addition to the regular technical content.

 

Email

A friend forwarded this mail to me and it felt so 1984 like.

> -------- Original Message --------

> Subject: [Fsf-friends] Re: DotNet

> Date: Wed, 27 Oct 2004 06:48:28 -0400

> From: Richard Stallman

> Reply-To: rms@gnu.org

>

>  >Re the request by Microsoft to speak at the Hyderabad usergroup on

> >DotNet,

>

> I am not sure what the "Hyderabad usergroup" means, but anyone who

> advocates freedom should not offer a proprietary software developer a

> platform to present a practical discussion of a proprietary software

> product.

>

> Such discussion focuses on the practical characteristics of the

> software, and therefore makes the implicit assertion that, "There is

> no ethical issue with this software, therefore the interesting things

> about it are its technical capabilities and merits/demerits."  We need

> to reject that assumption, and the best way is not to offer them a

> platform at all.

The context here is that someone at MS offered to speak the local Linux UG at Hyderabad. I don’t know why I bother so much. Somewhere my personal definition of freedom made it a superset of choice.

 

(more) 1984

Speaking of 1984 and I am taking the risk of being politically incorrect here, but someone forwarded this to me: http://observer.guardian.co.uk/magazine/story/0,11913,1323246,00.html

I feel sorry for these people. I personally strongly feel against wrong like this.

 

CEC

Just giving an early heads up to folk who are watching – this is going to be an interesting thing in the future. Something that is going to form the basis of compelling and winning arguments – Microsoft Common Engineering Criteria.

Common Engineering Criteria

While every component of Windows Server System is already very good on its own, they can be better still, both as individual products and as part of an integrated system. Microsoft is establishing a common set of guidelines and requirements that each server must meet. Starting with the Windows Server System product releases for 2005, Microsoft is increasing its focus on improving the servers with common engineering criteria, with a goal of eventually delivering a unified group of products that provide what customers really need to simplify their IT environment.

http://www.microsoft.com/windowsserversystem/overview/commoncriteria.mspx

To throw some ideas in, think of WMI and then think of Monad and then think of WSH and then think of CEC and then use your imagination.

 

Exec Mail from SteveB

This was just released -

Customer Focus: Comparing Windows with Linux and UNIX

http://www.microsoft.com/mscorp/execmail/2004/10-27platformvalue.asp

 

 

 

Wednesday, October 27, 2004 9:06:48 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, October 18, 2004

I got to meet vice presidents S Somasegar and Eric Rudder yesterday. They were at IDC as part of an exec visit to India. Eric struck me as a thoughtful and intelligent person. He was technical advisor to BillG for a while, so that’s saying a lot.

 

While a lot of things cannot be discussed in a public blog, I do like the way Eric responded to one of the questions during the open forum. This question was related to losing market place in the very small business and personal use scenarios due to the often posed ‘good enough’ argument against commercial software. Among other things, Eric said that if ‘good enough’ is good enough, then we deserve to lose.

That’s taking on a much larger commitment that just saying that we will make good products and sell them, I think that that’s saying that in time the quality of what we can do will change what good enough means. That’s a measure of a company and will unlike most others ‘big’ guys in this line.

 

I also spend part of yesterday thinking about the ‘ethical’ argument with which non-commercial software tends to propagate and justify itself. I remember receiving lots of feedback on my talk about the commercial software model at the first anniversary of the Bangalore .net user group.

 

Not a lot, but a significant amount has been said from the perspective of commercial software.

http://www.microsoft.com/resources/sharedsource/Initiative/speeches/mundie_model.mspx

In general look here from time to time, some of it might seem to be a revelation -

http://www.microsoft.com/resources/sharedsource/

This is also an interesting book, with names like Lawrence Lessig an Bradford Smith in there -

http://www.aei.brookings.org/publications/abstract.php?pid=296

 

Also I realized something else, it’s probably an obvious little thing – but a lot of what you hear when you are outside Microsoft, sounds like science fiction: Avalon, Indigo, WinFS … ta da da. I now have having a weird feeling of ‘coming in touch’ right now, because I am downloading one of the builds of one of these pieces to try on my machine – the sort of thing I would not have seen for years otherwise, and it feels good. It also feels like a ghost stepped out of the shadows and then you realize that he was real all along.

 

I know this blog entry is all pithy stuff with no enumerations of ‘facts’; but that’s ok, for this one. I know it will not stand one of my ‘where are your facts?’ rants. But again, that’s ok for this one.

 

Monday, October 18, 2004 5:38:26 AM (Eastern Standard Time, UTC-05:00)  #    Comments [8]  | 
 Thursday, October 14, 2004

I feel like a worm. Not in the slimy sense, but in the coming late sense.

 

Let me explain, there was this one time when my family went driving through the country to drop off an uncle of mine at some relatives’ place. (We weren’t exactly fond of long drives for no particular reason, but that time it just happened.) The family we were visiting had a nice farmhouse. After some walking around, I happened to find my brother sitting at the corner of a balcony looking down at some chickens pecking away in back yard.

 

And for some strangely philosophic moment (I usually don’t associate these things with my brother :-) ), he looks at me and says – Rosh, you know all the things they say about getting up early and all, right? Early to bed and early to rise makes you… and early bird gets the worm and stuff? And I say – yeah. And he says – look at what the worm got for getting up early.

(Duh?) And he continues – so the moral must be that if you are worm, don’t get up early.

 

Well, it did have a sense of reason to it… in a sense. This happened years back and for some reason I was reminded of that, feeling weary as I came in to office near afternoon.

 

The reason I am writing about all this is because all that is going to be changing. < inset background score: time they are a changin’ here >  I am going be a worm no more. Someone at Microsoft is transferring to Singapore and is giving away his cycle at a garage sale – I think I am going to be picking it up. It’s got a nice set of Shimano (shimano.com) gears on it. And when I have a cycle I am going to get up at six and will go cycling in the mornings. So there.

I guess.

 

 

On a different note, I have been looking at various university websites the past few days for interesting research in computer science. I was hoping to find some interesting work in languages research to integrate better data handling models into languages – something along the lines of what COmega tries to do. I was a little disappointed to come up with next to nothing.

 

 

I read this book recently, called the ‘Curious incident of the doing in the Night-time’. It is a curios book written from the perspective of a 15 year old suffering form some form of autism. It starts of with a dog being killed in the neighborhood and the kid trying to play detective to find the killer. I wouldn’t recommend reading it, unless you are in the mood to have something bothering you for a while. The book .. well, I better not say much about it. There was this one thing in the book which has been running in my head for a while now – this book if full of descriptions of how the protagonist sees various things in his life.

 

In this part he remembers himself when he was smaller. His teacher would show him a jar of (lets say cookies) cookies and ask him what was in it. And he would say cookies. She would then turn over the jar and a pencil (or something else) would fall out. And then when she asked him what was in the jar, he would say pencil. Then if the she asked him, what his mother would say if she was asked what was in the jar, he would still answer pencil. He could not understand why that was wrong. For a long time he did not realize or understand that other people had minds, and this was hard for him.

 

In a paradoxical kind of way, that is how many of us behave from time to time. There is point at which we reach the borders of our imagination about how others would react to something, because our perception of how they should react is so strongly biased by what we personally know.

 

On a different note, and this one is about cocktails – I am still nowhere about learning the basics about how drinks mix well.

 

However here is a little tip: cranberry juice and orange juice mix well together and go well with some vodka. There is something missing here in this combination and I can’t really put my finger on it.

Also, maracuja (passion fruit) and vodka topped with 7up or sprite and some ice is a reasonably pleasant drink.

Thursday, October 14, 2004 4:23:29 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Thursday, September 30, 2004
  Mish Mash 

Aah! its good fun to be blogging after a long time now. I had a sort of internal deadline a few days back and life seems generally peaceful since.

 

Which gives me room to write about lots of things that I had been meaning to write about.

 

Hyderabad and life

 

Hyd has so far been a fun place to be in. I stay in a one bed room apartment that is about 3 to 4 kilometers from office. It is a nice locality with few houses that are well distanced from each other. There is a lot of open land and a nice backdrop of rocky terrain.

 

Having done little other that computerese the past few years, it is good fun to be maintaining a house and to be figuring out some cooking. Also one of the newly picked up interests is cocktails. I have not been drinking too many yet, but I am beginning to realize that there is this entire subculture to preparing and inventing cocktails which would be good fun to explore. This blog may well stop being about computing totally and be one about cocktails in the tear future. Like one of teh books I picked up about cocktails said “learning a lot about being the reason why people have a good time“.

 

The thing about making cocktails is that its really hard to get the right ingredients when you are starting out and there is no really easy way to experiment and learn – things start seeming uniformly good or bad after a few drinks.

 

I am also (by my own definitions) beginning to turn into a master chef. I keep having vague sentiments about being a chef or a bartender as an alternate career track. Since I am a relative new comer to drinking alcohol (yes) and to cooking, both of these might take a while – however I am looking forward to evenings with friends and home made cocktails.

 

Microsoft

 

Working at Microsoft is different compared to many places you would work in India. Other than the technology, and the other stuff that I could go on about endlessly - like my manager potentially filing for nearly two dozen patents this year - at Microsoft the senior guys tell you things like “plan things so that none spends the three day weekend at office”. Its nice to be in a place like this. Its highly individualistic, you are given ownership, you are expected to run your own show, accomplish more five fold of what you would do at another place and do it in style – and have time for things like learning to be a bartender. :)

 

More Life

 

I have been having conversation with all sorts of people. Its hard to find people who believe in computers for love of the machine and logic. Its even harder to find believers. Lovers and believers... I am also beginning to realize that talking to people who have a life outside of computers can actually be fun, strangely. :) And in computing I have been some smart folk and some of the prostrate masses as well...

 

I had a conversation with a couple of folk some days back, who believed something to the effect that Windows should not penetrate the academia, because if it does, 'people will not learn anything'. The argument was that since windows is easy to use and that the IDEs and such were fairly complete people would never understand how the underlying things ever worked. The argument was also heavily biased towards the command line and how Windows does not encourage you to use the command line even though the command line is intrinsically better. That kind of talk gets a rather more measured response from me these days that the push-comes-to-shove responses of some time back. Its actually an interesting exercise to see how people can cling onto opinions because they implicitly see a certain safety in having them, as opposed to letting go of them.

 

Today there was conversation about piracy with some other folk. Should Microsoft be cracking down on piracy legally because piracy does actually causes material harm? My stand that was that it shouldn’t as things are right now. I feel that some pieces of software (not just from Microsoft) are actually rather expensive for the Indian-rupee economy. Piracy would be far better handled if prices for certain pieces of software were actually reduced hand in hand with awareness about what offers and alternatives are available. The user groups and the communities can and will play a very large part in this. Once I think the systems are in place, and they are getting in place as we speak – there are offers and options available that people simply don’t know about – then might be a better time to tighten the legal crackdown on piracy.

Can we ever completely eliminate piracy? I don’t think so – but that is not necessarily we are trying to achieve. We can easily make a large portion of the people who are presently not using legal software to start using legal software by making them see value in it. There are simple value propositions like free upgrades and patches for legit systems, possibly vendor provided antivirus packaging, support, merely the fact that you are doing something morally correct which when know would change the minds of many people. Will there always be freeloaders? Yes, but that is not the problem that we are trying to solve here.

 

Learning

 

I spend some time with someone at Microsoft showing how to use the fabled windbg. Really interesting. I guess I am so impressed because I haven’t used a debugger very much at all in the past. Most of the code I have been writing has always been debugged with some variant of the ever useful printf-debugging. I wish I was doing that with Govind Kanshi at Bangalore.

 

Among new pieces of information, there is a new public drop of Monad beta available. Take a look.

 

More Microsoft  

 

Microsoft is full of internal websites about every conceivable things in the org. We have HR, Library, internal resources etc etc lots of the standard stuff. Then the interesting stuff like websites for each group – like one about the debuggers, one about sfu, one (or more) about every conceivable product that you can think of. Its like a whole ecosystem in here comparable to that outside.

 

Microsoft also still has a small company attitude inside in the sense that a lot of decisions and flexibility is left to the choice of those who wield, rather than be dictated randomly by a higher authority.

 

The peace that I mentioned at the start of this post maybe changing – my project is going to be part of Longhorn… what good fun.

Thursday, September 30, 2004 6:25:41 AM (Eastern Standard Time, UTC-05:00)  #    Comments [14]  | 
 Monday, August 30, 2004

Time, wither goest thou.

 

I got my first mail from the great Somasegar today.

http://www.microsoft.com/presspass/exec/somasegar/

 

I also got mail from Jim Allchin today

http://www.microsoft.com/presspass/exec/jim/

 

Neither of these were directly to me, they were to a group alias, but all the same – its one of those feelings to see mails in your inbox from these folk.

 

I also helped get my first piece of code checked into the great windows source tree. Mind blowing! If I break the windows build things could get hot here real quick :-) I also had part of my NEO today (New Employee Orientation).

 

I also have selected a house at Hyderabad. A reasonable two bedroom flat, about a kilometer from office. The weather in Hyd is rather moderate these days. Lots to say, no time :-(

 

Monday, August 30, 2004 10:23:22 AM (Eastern Standard Time, UTC-05:00)  #    Comments [10]  | 
 Thursday, August 26, 2004

So this is my first post after getting into Microsoft.

 

Do you remember that old joke about Wendy? The one where this guy gets a tattoo that says his wife’s name Wendy and then notices someone else’s Wendy tattoo which reads ‘Welcome to Jamaica, have a nice day’. That’s a little like what MS has been like if you shift that metaphor to an intellectual plane.

 

The first two days has been disillusionment of sorts – now the fun is coming back: I am part of a team (I need to check, if I can mention the work on the public network) that is fairly into the thick of things right now. And I am one of three devs who are working out of Hyderabad, with believe a few people in Redmond as well.

 

The sheer amount of stuff that hits you as new is mind boggling; esp in comparison with other places where I have worked where by now nothing would have got off the ground. Here I was hit with a mountain of work. If you are a certain kind of person you would actually enjoy this – I have responsibilities form day 1 and I have a complete set of ownership on the entire code base that that is assigned to me. And its interesting in the sense that it spans over diverse technologies like WMI, COM, MMC, C#, C++, IAS, IIS, various authentication mechanisms (NTLM, Certs, Kerb), RPC, NT Services and on and on. All this and more – and what’s better, I am already writing code. (Of course not all new hires get to code from day 1, but…). And the best part is that its all mine – its my baby to write and create. I compare this with other places where my ownership was limit to a web page or two, or where there is no sense of owner ship and personal style or worse - where you ownership is limited a word doc! Deepak, used to be right – at Microsoft you are flung into the water and expected to swim – and it’s such good fun.

 

I actually have a lot to say, but I am really out of time. I need to go now and I haven’t had much free time, or I would have liked to write more. I also must say that I can also see here parts of that  same Microsoft where Kraig Brockschmidt could have written ‘Mystic Microsoft’ or Adam Barr could have written his ‘Proudly Serving’. Its all that and yet there is so much more… I am only beginning to explore this place that shows signs of terrestrial intelligence. :-)

Thursday, August 26, 2004 9:22:52 AM (Eastern Standard Time, UTC-05:00)  #    Comments [7]  | 
 Saturday, August 21, 2004

Hi Folk, firstly, sorry for not being around in the blogosphere for a while. Life has been changing far too rapidly, with castles building up in the air and floors collapsing beneath my feet rather too often, in the past month or two.

 

Life is settling now and I have things to say -

 

I am joining Microsoft Corporation. I will be working as a developer at the Microsoft India Development Center (IDC) at Hyderabad, on the Windows team, starting Monday Aug 23rd 2004.

 

On a personal note, there is a feeling of peace now. I had too many things I had been keeping up with recently – two user groups in different cities, a lot of community stuff, some insanity related to job shifts, following up frantically on the far corners of technology from design of VMs like Parrot and Scheme interpreters to CLR internals, language design, compilers, distributed systems, SOA and protocol architectures, getting under the hood of more things than I care to mention and a personal life that was spinning round and round. Of course, I was always also trying to keep a day job and a blog as well. All things seem to be settling now, or at least seem to be finding their own relative peace.

 

I am looking forward to the intellectual charm of the high halls of technology. The plan right now is to slow down for a few months, enjoy the company and the work, and to learn. Take a sabbatical from my thought-chataquas, relax on a few things and enjoy the blissful calm and peace of being a developer on a tight project at Microsoft.

 

For a while I might be rather quiet. Then maybe start working up speed towards those nagging ideas that come by and hold my mind and say “Roshan, I am not going to let you go until you have me solved”. I am not sure what they are going to be right now, but I have a feeling that they might have something to do with dynamic languages and a certain runtime…

 

Come gather 'round people

Wherever you roam

And admit that the waters

Around you have grown

And accept it that soon

You'll be drenched to the bone.

If your time to you

Is worth savin'

Then you better start swimmin'

Or you'll sink like a stone

For the times they are a-changin'.

 

...

 

The line it is drawn

The curse it is cast

The slow one now

Will later be fast

As the present now

Will later be past

The order is

Rapidly fadin'.

And the first one now

Will later be last

For the times they are a-changin'.

 

Bob Dylan

The Times they are a Changin’

1963

 

Saturday, August 21, 2004 7:50:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [212]  | 
 Wednesday, July 21, 2004
  Alan Kay 

"The protean nature of the computer is such that it can act like a machine or like a language to be shaped and exploited. It is a medium that can dynamically simulate the details of any other medium, including media that cannot exist physically. It is not a tool, although it can act like many tools. It is the first metamedium, and as such it has degrees of freedom for representation and expression never before encountered and as yet barely investigated."
(Alan Kay, 1984)

 

 

Alan Kay was awarded the ACM Turing Award for 2003 –

http://www.acm.org/awards/taward.html

 

“For pioneering many of the ideas at the root of contemporary object-oriented programming languages, leading the team that developed Smalltalk, and for fundamental contributions to personal computing.”

Wednesday, July 21, 2004 1:42:09 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Thursday, July 01, 2004

In a hole in the ground, there lived a Hobbit. No not a nasty dirty wet hole, nor yet a dry bare sand hole: it was a hobbit hole and that meant comfort.

 

I have a rather Bilbo Baggins like feeling about computing these days. I work in a predominantly .Net shop and am part of the Competency Center or Center of Excellence of a multinational corporation – which is to say that we are the specialists in our technology field. Or so they say… now being from the .Net camp I should be here getting excited about the next set of new features in Whidbey or what ‘cool’ things the next grid control offers or the way WSE 2.0 specs have been supported in VS or… you get the picture.

 

Of late however I have a feeling that Gandalf has coming knocking at my hobbit hole of technology and I have gone off after this great dragon called Scheme that guards his treasure. And people come by my cubicle and say – Rosh! What is that stuff you are working on?

 

And is say – Oh that is emacs and that is scheme

 

“Duh?”

 

“Oh.. Scheme is a dialect of Lisp and emacs was this editor written in the late 70s, popularized by RMS’s GNU version – but I am using a derivative called XEmacs… it itself is designed as lisp interpreter… ”

 

By then their eyes have all glazed over and they peek at my monitor and go “And what good is that… let me see .. car cdr lambda let lambda lambda lambda…whats this nonsense? you are just wasting your time.”

 

“No no, its pretty interesting” I say, “it shows you new ways to think and ….  

“and it lets me write procedure objects and optimizes tail recursion and call-with-current-continuation… “. “… and because scheme supports the imperative style it has a ‘set!’ but it does not have any loops…”

 

And what I hear back is “What?? A language with no loops???”. I wonder where all the other stuff I said went, anyway “Contrived languages!”

 

In hobbit speak this would have amounted to saying… Nasty things these adventures, gets you home late for dinner and that kind of stuff. No respectable hobbit would go on an adventure.

 

And friends say,

“what about your blog Rosh? People don’t come there to read scheme, what about your readers?” (what readers? < sniff />).

 

And I say, “ yeah but scheme is pretty interesting and the point in blogging is that I write what I have running in my mind… “

 

 Anyway, after being at scheme for a bit now, I must say, I am rather enjoying it. I think I am learning to walk-the-walk rather than just talk-the-talk. Its been a couple of days since I have had my head stuck at not being able to write anything non-trivial with call/cc. I think that is beginning to clear up today. It is a good feeling.

 

If I had been braver like I once was, I would have compared myself to Jonathan Seagull talking to the Breakfast Flock, here in the blog entry. Winning call/cc will be like learning how to do a high speed dive onto the wall of ocean surface, and being able to pull out of it gracefully. Or like being able to take the Arkenstone from under the great Smaug, or in this reality - the great Scheme.

 

I am not that brave now. But I think I am enjoying learning to be a little schemer. 

Thursday, July 01, 2004 6:45:25 AM (Eastern Standard Time, UTC-05:00)  #    Comments [12]  | 
 Sunday, June 27, 2004

These are some more pictures from Goa. Its past midnight here and its Saturday night. I am in office, by choice, and was looking at some of the pictures of IAD 2004 at Goa. It was amazing for the people I met. I believe we all felt that way and took away a piece of something that needs to be described by more by photographs and the jokes and the feedback mails and general jing-bang.

 

Something in these pictures reminds me that life is passing me by and I am standing here, watching.

 

If your browser is on full screen and your resolution is at least 1024 * 768 then this page will appear well formatted, else it may not.

 

This is a picture of the beach. In the higher resolution version of this picture that I have you recognize the people so far. I had walk further on that day morning when we had gone for a walk on the beach.

 

This is the top of the Old Goa Bom De Jesus church. Sometimes there are buildings that leave an impression on you. It was the third time I was visiting this place. The first time was with Vikhyath and Anand when we were at Goa for Vicky’s sisters wedding in the summer of 98.

 

This is a picture of JK and me. JK is Jayakrishan K, Director of Xtend Technolgies. JK is probably one of the only real mentors I have had. He is renowned for some of his old time hacks and his rather popular series of anti virus software which was very much in use in south India at a time when the internet was something we heard about only on TV. If you were around at that time, you might remember him for ShellSock.

 

The hands of a potter at the Park Hyatt. I remember how delighted Pooja looked at seeing him work.

 

There is Tracy Chapman’s ‘Fast Car’ playing right now. Sometimes I think I should invest in a digital camera of my own.

 

You got a fast car

But is it fast enough so we can fly away

We gotta make a decision

We leave tonight or live and die this way

 

I remember we were driving driving in your car

The speed so fast I felt like I was drunk

City lights lay out before us

And your arm felt nice wrapped 'round my shoulder

And I had a feeling that I belonged

And I had feeling I could be someone, be someone, be someone

 

Sunday, June 27, 2004 12:52:11 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, June 23, 2004

Almost every macro demonstrates a flaw

in the programming language,

in the program, or in the programmer.

        - Bjarne Stroustrup

 

I find it unbearably restrictive

to program in languages without macros ...

        - Paul Graham

       

It took me some good time today getting my mind around macros in scheme. The discussion in Dorai Sitaram’s book is a not very descriptive. I had a look at Prof Kent Dybvig’s chapter about syntax and figured that that is something I want to look at only later.

 

However after a bit of mucking up I think this would work.

 

(require (lib "defmacro.ss"))

 

(define-macro let* (lambda (args . code)

        (if (null? args)

                `(begin ,@code)

                `(let

                        ,(list (car args))

                        (let*

                                ,(if (null? (cdr args))

                                        ()

                                        (cdr args))

                                ,@code)))))

 

(display

        (let*

                ((a 2)(b (+ a 10)))

                (+ a b)))

               

 

Thinking in scheme needs some getting used to.

 

Wednesday, June 23, 2004 8:44:10 AM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 Monday, June 21, 2004

I have been looking at a bit of scheme in my free time. Not strangely, most of the code I seem to write seems to be very C like.

 

(define rev1 (lambda (ls)

        (let loop ((res ()) (ls ls))

                (if (null? ls) res

                        (begin

                                (set! res (cons (car ls) res))

                                (loop res (cdr ls)))))))

 

(define rev2 (lambda (ls)

        (let loop ((left ls)(right ())(temp ()))

                (cond ((null? left) right)

                        (else

                                (set! temp (cdr left))

                                (set-cdr! left right)

                                (loop temp left ()))))))

       

 

(print (rev2 '(1 2 3 4 5)))

 

I understand that learning the language is very different from learning to program with it. For now I am learning the language from Dorai Sitaram’s “Teach Yourself Scheme in Fixnum Days”

 

Annie’s song is playing right now.

The sky looks gray now, like the color of old memory.

 

Annie's Song

 

You fill up my senses

Like a night in a forest

Like the mountains in springtime

Like a walk in the rain

Like a storm in the desert

Like a sleepy blue ocean

You fill up my senses

Come fill me again

 

Come let me love you

Let me give my life to you

Let me drown in your laughter

Let me die in your arms

Let me lay down beside you

Let me always be with you

Come let me love you

Come love me again

 

You fill up my senses

Like a night in a forest

Like the mountains in springtime

Like a walk in the rain

Like a storm in the desert

Like a sleepy blue ocean

You fill up my senses

Come fill me again

 

John Denver

 

 

Monday, June 21, 2004 3:29:41 AM (Eastern Standard Time, UTC-05:00)  #    Comments [5]  | 
 Tuesday, June 15, 2004

India Advocates Day(s) 2004 happened a few weeks back (29 and 30th May) – MVPs, Microsoft Regional Directors and a select few Student Champs are invited. The event this year was at the luxurious Park Hyatt at Goa.

 

 

  

 

Images from the Park Hyatt - IAD 2004 venue.

 

Pooja at IAD.

 

Me - Self picture at the Hyatt beach

 

 

MVP crowd - also (first from left) Abhishek Kant - India MVP lead and
(fourth from left) Shu-Fen Cally Ko - Regional Director for MVP Program and Community - Asia Pacific and Greater China Region

 

IAD conferencing

 

 

  

Churches of Old Goa - Bom de Jesus

 

Tuesday, June 15, 2004 1:15:31 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, June 14, 2004

I just had to drop these links at the expense of a separate entry, for them.

http://primates.ximian.com/~miguel/archive/2004/Jun-08.html

http://primates.ximian.com/~miguel/archive/2004/May-31.html

(The Marcelo in the last picture on this entry is Marcelo Tosatti – Maintainer of the Linux kernel)

 

There are reasons why many of my friends who work non Linux technologies are generally treat work on Linux as user hostile and generally immature. I personally think that while the majority of the Linux crowd may have their head in the clouds, the serious programmers are the same sort of the free style systems hackers that we idealize – despite the difference in technologies. I appreciate these folk for their spirit and sometimes for sheer smartness.

Monday, June 14, 2004 6:40:54 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, June 12, 2004

Folk, after a few mails we got confirmation from Jeffrey Snover himself, architect of Monad, clearing up any NDA issues. We are free to blog, write articles, talk about it etc etc.

 

Among other things watch out for the next .Net show on MSDN, they are covering Jeffrey Snover talking about Monad. Here is a blog entry by Robert Hess:

http://blogs.msdn.com/theshow/archive/2004/05/19.aspx

 

Also there is a build of Moand that might be made available in July which is more complete in the shell language than the present build is. That’s a lot to look forward to.

 

Meanwhile on a personal front this, gives us the personal freedom to explore Monad and talk about it :-)

Saturday, June 12, 2004 3:06:32 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, June 11, 2004

Since yesterday I have been thinking about NDAs. Yesterday I wrote the entry below about Monad and Pooja wrote hers, and I have been thinking.

 

The reason is this – MVPs before being awarded the title have to sign an NDA that says that certain information that Microsoft may reveal to them may not be publicly disclosed. The NDA is one in good spirit where employee of Microsoft who are part of product teams and doing such other core work may freely interact with MVPs about future products and ideas that are still being tested and such. A lot of MVPs actually give direct feed back to the product teams which reflect on the products that you see tomorrow.

 

The MVP program by its very nature is an award program and the winner of the title doesn’t directly commit anything to Microsoft. So a lot of the feed back from MVPs is neutral and critical in a very constructive sort of way, because MVPs really love their technology.

 

The problem with the NDA is simply that of late most MVPs (at least in the India circuit) don’t have a clear way of saying what is under NDA. We actually get to hear SO much about so many things happening that we are really not sure. So breaches of the NDA do happen simply one did not know that an item is under the NDA.

 

One thing that we were told of is that when in doubt – check with your MVP lead. That happens, but sometimes that is not very feasible. Sometimes you don’t even think of checking about something. Which is when another ‘rule of thumb’ was proposed at the India advocates day, 2004. At IAD it seemed ‘common-sense’ that what ever we can find on the web already is simply not under NDA – if we know something and it is not on the web yet (duh?) then it is under NDA.

 

This makes things a little tricky. Like when writing about Monad, I realize that a lot of information is actually available on the web – admittedly in bits and pieces, but still there. Now that I have access to the stuff as part of the beta program, can I write about it or not? We had a discussion last night with the India MVP lead and the ex India MVP lead and some of the Bangalore MVPs and to my surprise I was hearing that none of the stuff from the beta place could actually be disclosed. Also the above ‘rule of thumb’ stands corrected to ‘anything found on the Microsoft site is not under NDA’. !

 

Now that has some obvious contradictions – how for example do I know that I am talking about confidential information when the information is publicly available in some form? If there is a document that marks it as confidential but I do not have access to the document, does that make me in violation of the NDA? If I do have access to the confidential document, then what happens to conclusions I can draw from public information that is not explicitly stated elsewhere (though deducible) but is present in the document?

 

Some of this got me thinking today morning at the hacker Knight Lightning’s trial a decade back. Knight Lightning was brought to trial by the US secret service for stealing a confidential AT&T technical document that was estimated at 70k dollars or more (forgive my fading memory). The document was the centre of the debate there and in some sense was treated by the prosecution as being too sensitive to show even during the trial. The then newly formed Electronic Frontier Foundation under John Perry Barlow and Mitch Kapor came to Knight Lightning’s aid in the defense. It turned out that the document hardly discussed technical details of a sensitive nature. The cost of the document was a grossly over exaggerated figure, piled up as sheer administrative over head costs (things like the cost of the computer system used to typeset the document were added as the cost of the document). And as a final blow to the case it turned out that AT&T was actually selling documents of a similar but more technically detailed nature for hobbyists and enthusiasts to use (for about 13 dollars?) – which neither the prosecutors nor Knight Lightning knew about.

 

The issue about information being confidential while still being available in some form publicly is a very tricky one.

 

My own first exposure to the term ‘NDA’ was when I heard the recording of a speech by Richard M Stallman (founder of the Free Software Foundation) at Slovenia. RMS was talking about how an NDA imposed by Xerox for the printer driver software hurt the guys at MIT who were trying to fix a faulty laser printer that kept getting jammed. Stallman’s message was that NDAs “do have victims”. He did make several valid points and after listening to RMS several times I was sensitized to the issue of NDAs. So admittedly when I signed my first NDA with the company where I work, I did so after reading the document over several times and did it with shaky hands.

 

The issue about writing about Moand itself is a simple one – I had dropped a mail to the one of the contacts on the Monad team and I got prompt response. A few clarifications are left, but it seems to me that everything is in good faith now. In the case of Monad itself it is not an issue, especially when most of the folk at MS are so approachable and prompt when it comes to an relevant issue. The MVP crowd and the people around the MVP program are also were receptive and quick to respond about any queries.

 

However the general issue about NDAs itself is a relevant and could because serious issues really quickly, if communication between parties is not as transparent as in cases like mine.

 

Add to that I heard this rather recently – you cant reveal that you are under NDA? What? There is a lot I don’t understand. The thing about systems programming is that opinions are fact clearly distinguish each other – at least they are only a compilation away. Matters like this….  :-)

Friday, June 11, 2004 2:06:28 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Sunday, May 23, 2004

How many of us recognize the name of this man?

 

Mitch Kapor was the founder of the Lotus corporation. He was the man who designed the Lotus 1-2-3. If you know you history, Lotus was one of the only large applications companies that was a serious challenger for Microsoft in its early years. There were years spent over the battle for the spreadsheet that was fought on both the old Mac as well as the old DOS machines.

 

Microsoft’s offering those days were called Multiplan. Multiplan was fairly beat by Lotus 123 in almost all fronts. Microsoft eventually thought through their faults and strengths and eventually released Excel – the spreadsheet battle was over.

 

Mitch Kapor himself, is one person I think of as being fairly amazing.

 

He was co founder of the EFF, the Electronic Frontier Foundation along with John Perry Barlow. The EFF was the organization that for the first time stood up for hackers rights and digital rights. This was of significant and epic proportions in the early 90s when hacker arrests and crackdowns were gaining a witch-hunt like momentum.

 

“The EFF is a non-profit civil liberties organization working in the public interest to protect privacy, free expression, and access to public resources and information online, as well as to promote responsibility in new media.”

 

The EFF was the organization that for the first time took the American Secret Service to court over the ruling and prosecution of the ‘hacker’ Knight Lightning. The EFF won and it literally brought the end of an era about how people of ‘hackers’ and the rules for information security.

 

I highly recommend reading this book called the Hacker Crackdown by Bruce Sterling. The book reflects the ethos of a time when the parameters of information security were very different from how we think of them now. Considering the license of the book, what it intends to convey and what I hope it may change about your thinking, I would recommend downloading a softcopy of the book.

 

Today I happened to come across Mitchell Kapor’s website and blog.

Website: http://www.kei.com/homepages/mkapor/

Blog: http://blogs.osafoundation.org/mitch/

 

I found this entry, right on top and I couldn’t help smiling:

 

May 09, 2004

Now I'm Mad

 

Some idiot Atkins Diet spammer just posted 53 bogus comments in this blog. I'm disabling comments (globally) shortly and figuring out if there's any recourse.

 

They don't know it yet, but they picked the wrong person to do this to.

 

 

Sunday, May 23, 2004 8:24:41 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, May 21, 2004

Today I had a rather shocking realization. I realized that C# 2.0 supports closures.

 

It was rather shocking, because here I was running up and down obscure languages looking for features like this and bang C# has it. I was pointed to this blog entry by a good friend of mine at Microsoft: Antonio Cisternino's Blog: Closures in CLR 2.0.

A lot of the content on Mr Cisternino’s blog is rather interesting and I would recommend a visit to

http://rotor.di.unipi.it/cisterni/Lists/My%20Blog/AllItems.aspx

 

The entry on closures is an interesting read. A quick search on google, showed me that the rest of the world seemed to have realized that C# has closures, a long time before I did.

 

 

 

Looking at closures brought back something from hazy old memory from a time when I was more ignorant:

 

Function Objects in C++

 

What is a function object?

 

An object that in some way behaves like a function, of course. Typically, that would mean an object of a class that defines the application operator - operator().

A function object is a more general concept than a function because a function object can have state that persist across several calls (like a static local variable) and can be initialized and examined from outside the object (unlike a static local variable). For example:

 

                class Sum {

                                int val;

                public:

                                Sum(int i) :val(i) { }

                                operator int() const { return val; }                  // extract value

 

                                int operator()(int i) { return val+=i; }           // application

                };

 

                void f(vector<int> v)

                {

                                Sum s = 0;             // initial value 0

                                s = for_each(v.begin(), v.end(), s); // gather the sum of all elements

                                cout << "the sum is " << s << "\n";

                               

                                // or even:

                                cout << "the sum is " << for_each(v.begin(), v.end(), Sum(0)) << "\n";

                }

 

Note that a function object with an inline application operator inlines beautifully because there are no pointers involved that might confuse optimizers. To contrast: current optimizers are rarely (never?) able to inline a call through a pointer to function.

Function objects are extensively used to provide flexibility in the standard library.

 

This is written by none other than Bjarne Stroustrup and you can see the full FAQ here:

http://www.research.att.com/~bs/bs_faq2.html

 

You might relate this to the brief discussion on method instances in the previous entry ‘The Big Deal about Iterators

 

Hopefully I will have a better understanding of how C# does closures, soon enough.

 

Friday, May 21, 2004 4:55:20 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Thursday, May 13, 2004

It’s good to get back to blogging after what seems like a long break. I have been rather busy of late. Life or the lack of one, has been blowing out of proportion to take up the remaining time. I thought I’d write about something different this time than my usual languages hoopla.

 

After much reluctance on my part I have joined the personalized wireless world and have succumbed to adding a tracking device to myself. Now I can be tracked examined and demanded and terrorized. I have a mobile phone (yes people, I haven’t had one before and this is my first). Such are the pleasures of life.

 

 

 

The Samsung C100

Of course buying a Samsung C100 these days, might be considered incredibly caveman-like in certain circles and worlds, but I still belong to an utterly insignificant little blue-green planet (some of) whose ape-descended life forms are so amazingly primitive that they still think digital watches are a pretty neat idea.

 

The Samsung C100 is lovely phone and for its price (which was only a 6.6k for me) is a rather good deal. There are however some things I don’t like too much about the C100. I have been with it only for a short time, so a there’s lot more I need to know. This is what I know of right now – I might be wrong, in which case, expect a comment below in due time. Also, drop me a comment if you know better.

 

Things I Don’t Like

·         There is no MMS support

·         The battery seem to take a long time to charge (fully from near empty) its been plugged in for 2+ hours now. Aaah it’s done.

·         I can’t seem to find an option to add words to the T9 dictionary! I don’t think there is such an option. That’s pretty bad.

·         Cannot find a way to mass transfer content from Phone memory to SIM and vice versa.

·         Since the C100 has only an IrDa port I need a (30+mb) sized software from Samsung to work with it. I am yet to understand what sort of cable can work here.

·         The battery doesn’t last too long – a little over day. I don’t actually blame the phone or the battery too much for this. The phone is very feature ring and has a real good display and sound qualities, both of which I think eat up the battery real fast. To add to that I just cant seem to stop tinkering with it – so that’s where the battery drains out.

 

What’s actually bothering me is that Samsung has stopped making this model (which is what I heard from the dealer) and has moved on to a similar but more expensive X100 phone. Maybe that could mean that the issues are fixed only in the X100 and they are left open issues for the C100.

 

I really wonder what sort of file system structure this device has and if I can programmatically interface to it somehow. There seem to be lots of questions about how to get things working on this phone on sites like this one:

Samsung SGH-C100

http://www.techtree.com/techtree/jsp/showstory.jsp?storyid=3781

 

 

 

WML anyone?

That said, let me come to why I am actually writing this. I was fairly excited about the fact that I can browse on this phone. The phone has a 65k color screen with a 128*128 resolution and a good pixel density making for good viewing.

 

The Hutch corporate connection I am on charges 100 bucks per month for unlimited GPRS access, which seemed pretty neat. The only caveat was that downloads maybe charged according to the web site.

 

I didn’t make much of the ‘downloads can be charged’ stuff and visited hutchworld – which the Hutch GPRS homepage. Hutch world has a collection of goodies, wallpapers, ringtones, games etc. the games were priced at 50 bucks each so that didn’t seem very nice, especially considering that I would be charged whether the  game worked our not.

 

The wallpapers I found interesting. There seemed to be no price mentioned. So I go about trying various wallpapers. Some fit my screen; some were too large and so on. The fun continued till I had downloaded about two dozen of these (after much patience because this is a real slow connection) when I scrolled down till the bottom of the page.

 

There at the very bottom was strategically placed link that says ‘cost’. The cost link said – all wallpapers shall be charged at rupees 10 each. What ????

 

I would have never touched those things by a pole at that price ok. So now I easily owed Hutch about 200 bucks or more for absolutely nothing useful that I can think of. Come to thing of it, these are small 128*128 size (approx) images which are hardly a few kb and most look for corny. Why would anyone want to pay 10 bucks for that?

 

So here is the moral of the story – don’t go about downloading ‘wallpapers’ from the hutch network. Or as I was about to learn – don’t go about downloading content from any website – you’ve got to look very patiently before you notice someplace where they say how much you are being charged.

 

But why were these websites being charging so much for almost meaningless content? Was it such a big deal to be able to dish out content over a GPRS network?

 

I wanted to take a jab at it. Since I had heard of MMIT (the Mobile Internet Toolkit) for ASP.net I figured that it would be rather simple to do my own site that dishes out WML content. But unfortunately I didn’t have any site that hosted MMIT at my disposal so I was stuck.

 

So in infinite wisdom I decided to try doing WAP/WML in plain ASP.net. It was easily done. One of the time consuming parts was in figuring out that I has to set the Content-type HTTP header in the response to be text/vnd.wap.wml. This little fact I did not find documented anywhere.

 

I wrote a single aspx page that contained only C# code that would generate WML content.

I am pasting the code here, because some of you may find it useful and might want to host the code on your own servers. This page can be pointed at one of the one of the folders on your web-server where you want to provide content that can be accessed via your WAP enabled phone. The page lets you view contents on the folder as well as browse through any subfolders.  Similar to the explorer lets you browse folders.

 

(a space has been added after every angular bracket in the code below deliberately – because this blog engine has some issues with tags being displayed).

 

< %@ Page Language="C#" Debug="true" %>

< %

          string wml = @"< ?xml version=""1.0""?> < !DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml"">< wml>< card title=""File Browser"">{0}< /card>< /wml>";

        string up_content = @"< p>< a href=""list.aspx?path={0}"">up< /a>< /p>";

        string dir_content = @"< p>< b>Subfolders< /b>< /p>< p>< i>{0}< /i>< /p>";

          string gif_content = @"< p>< b>Available GIFs< /b>< /p>< p>< i>{0}< /i>< /p>";

          string entry = @"< a href=""{0}"">{1}< /a>< br/>";

          string content="";

         

        string server_path = "content/w/";

        string sub_path = Request.QueryString["path"];

        string new_path = server_path;

        bool up = false;

       

        if(!(sub_path == null || sub_path == ""))

        {

                new_path = server_path + sub_path;

                up = true;

                sub_path="";

        }

 

        //////////////////////////////////////////

        //This builds the GIF specific content

        content = "";

          string[] files = System.IO.Directory.GetFileSystemEntries(Server.MapPath(new_path),"*.gif");

        if(files.Length != 0)

        {

                foreach(string file in files)

                        content += String.Format(entry,

                                new_path+System.IO.Path.GetFileName(file),

                                System.IO.Path.GetFileNameWithoutExtension(file));

                gif_content = String.Format(gif_content, content);

        }

        else

                gif_content = @"< p>No GIFs< /p>";

 

        //////////////////////////////////////////

        //This builds the DIR specific content

        content = "";

          files = System.IO.Directory.GetDirectories(Server.MapPath(new_path));

        if(files.Length != 0)

        {

                foreach(string file in files)

                        content += String.Format(entry,

                                "list.aspx?path="+sub_path+System.IO.Path.GetFileName(file)+"/",

                                System.IO.Path.GetFileName(file));

                dir_content = String.Format(dir_content, content);

        }

        else

                dir_content = "";

       

        ///////////////////////////////////////////////////

        //Up the Dir tree link

        if(up)

        {

                int prev = 0;

                char[] arr = sub_path.ToCharArray();

                for(int i =0;i

                        if(arr[i] == '/')

                                prev=i+1;

                string path = sub_path.Substring(0,prev);

                if (path.Length == 0)

                        up_content = @"< p>< a href=""list.aspx"">up< /a>< /p>";

                else

                        up_content = String.Format(up_content,path);

        }

        else

                up_content = "";

        

        //////////////////////////////////////////

        //Summarise

          string wml_content = up_content + dir_content + gif_content;

          wml = String.Format(wml,wml_content);

 

        //////////////////////////////////////////

        //Write back

          Response.ContentType="text/vnd.wap.wml";

          Response.Charset = "";

          Response.Write(wml);

          Response.End();

%>

 

To deploy this onto your own web-server simply copy this onto some vdir. The server needs to be ASP.Net enabled of-course. You can change the server path (marked in bold above) to point to some folder where you have provided content you want to browse and download from your phone.

 

With a little bit of tinkering I figured that the Samsung C100 accepts images as GIF types. The screen display area for images is about 128*100, so just about any GIF of that dimension should display fine on this phone. I am yet to work out why animated GIFs don’t work and how the animated content on my phone works.

 

Of course all of this may not seem very interesting to someone who has done all this before or has found documentation about this – but if you haven’t then it will save you lots of trial and error time.

 

I could post a link to a URL to a WAP site I have up now, but that has some sensitive content. So I will set up something a little more generic and post a URL here so that people with Samsung C100 phones can pull off some content. (Of course I will figure out a way by which you will have to leave ‘thank you’ comments on my blog per download you make . . . kidding).

 

Having done this much, a thought bothered me – it is understandable how hutch can charge me, I am their customer and it is their network so there must be some easy way to identify who is downloading what. But what about the open network out there? How can people on a random server out there identify me so that they can send a bill that will be added up on my hutch monthly bill?

 

I called up the Hutch customer care line and the lady at the other end of the line had no clue how this happened. All she could say was that ‘all websites know who you are’ and that all download bills will show up on your monthly bill.

 

Hmm… this all ‘websites know who you are’ part didn’t sound too comfy. How could they know who I was? When I visit a website with a browser there is no way they can tell who I am. So how can they know in this case?

 

Which caused me to write this;

 

(a space has been added after every angular bracket in the code below deliberately – because this blog engine has some issues with tags being displayed).

 

< %@ Page Language="C#" Debug="true" %>

< %

          string wml = @"< ?xml version=""1.0""?> < !DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml"">< wml>< card title=""Debug"">{0}< /card>< /wml>";

        string hdr_content = @"< p>< b>Headers< /b>< /p>< p>< i>{0}< /i>< /p>";

          string entry = @"{0} = {1}< br/>";

        string content="";

       

        foreach(string key in Request.Headers.AllKeys)

                content += String.Format(entry,key,Server.HtmlEncode(Request.Headers[key]));

          hdr_content = string.Format(hdr_content,content);

       

        //////////////////////////////////////////

        //Summarise

          wml = String.Format(wml,hdr_content);

 

        //////////////////////////////////////////

        //Write back

          Response.ContentType="text/vnd.wap.wml";

          Response.Charset = "";

          Response.Write(wml);

          Response.End();

%>

 

This code, as would be obvious to ASP.net folk, simply returns all the HTTP headers. I set this up on my site and when I visited this from the phone – surprise! This is what the headers contained:

 

Connection = close

Via = Jataayu CWS Gateway 3.0.0

Accept = text/vnd.wap.wml, text/vnd.wap.wmlscript, image/vnd.wap.wbmp, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlc, application/vnd.wap.wmlscriptc, application/vnd.wap.multipart.related, application/vnd.wap.multipart.mixed, application/x-up-device, application/vnd.phonecom.mmc-wbxml, application/vnd.phonecom.mmc-wbxml, application/vnd.phonecom.im, application/octet-stream, application/vnd.openwave.pp, application/vnd.wap.sic, application/vnd.wap.slc, application/vnd.wap.coc, application/vnd.uplanet.bearer-choice-wbxml, image/vnd.wap.wbmp, image/png, image/gif, application/x-mmc.wallpaper, application/x-mmc.wallpaper, application/x-mmc.picture, application/x-mmc.picture, application/x-mmc.ringtone, text/vnd.sun.j2me.app-descriptor, application/java-archive, application/vnd.smaf, */*

Accept-Charset = utf-8

Accept-Language = en

Host = www.thinkingms.com/pensieve

User-Agent = SEC-SGHC100G/1.0 UP.Browser/5.0.5.1 (GUI)

X-MSISDN = 9198867xxxxx (-- my number was here)

X-Network-Info = UDP, 10.16.2.135

 

While a request from my browser would look like this:

 

Cache-Control = no-cache

Connection = Keep-Alive

Accept = */*

Accept-Encoding = gzip, deflate

Accept-Language = en-us

Cookie = portalroles=C7A51492F7A60F5D8E518..(truncated)
Host = www.thinkingms.com/pensieve

User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

 

The request from the phone actually seems to be sending out a lot of data – most of this data, I would expect, does not originate form the phone (does it?) but could be added by the WAP gateway of Hutch. I really need to read up some more on these standards.

 

The request from the browser (in this case IE 6) sends out no personally identifiable data. Where that from my phone – my phone number is in there!!! (I have edited the actual number in the display) Creeps! so much for privacy in the wireless world. To put this in context – every single website you go to in the wireless world can actually get your personal phone number. I really need to see how this information can be used in regards to other data.

 

Looking at the headers also gives lots of other valuable information such as the model of my phone and its browser. What content type it can accept (this is very interesting) notice the phone can accept GIF as well as PNG (among other things).

 

I will stop this blog entry at that note. Hopefully in the future I will have more to write about my steps into the wireless world and about the C100. If there are reasons why this whole thing is naïve or obvious information – please do point me at the right documentation, I presently have none. I recommend that you take things here with a grain of salt.

 

You can download the aspx files from here.

 

Foot Note:

I just got Pandu, who has a Reliance phone (that runs on the CDMA network), to access the debug aspx page. This is what his headers looked like:

 

Via = Jataayu CWS Gateway

Accept = text/vnd.wap.wml, image/png, image/gif, application/vnd.wap.wmlscript, image/vnd.wap.wbmp, image/bmp

Accept-Charset = iso-8859-1, utf-8

Host = www.thinkingms.com/pensieve

User-Agent = jBrowser/J2ME Profile/MIDP-1.0 Configuration/CLDC-1.0

Proxy-Connection = Close

X-Client-IP = 97.243.29.205

X-Rapmin-Id = 1067263483

 

His IP address seems to be a constant and there seems to be no direct ID available here (wonder what the X-Rapmin-Id is).

 

Thursday, May 13, 2004 7:26:19 PM (Eastern Standard Time, UTC-05:00)  #    Comments [15]  | 
 Friday, May 07, 2004

Hi Folk, Pooja is away on a vacation to Rajasthan.

 

"am leaving for a vacation trip today. Its after 8+ years  that I am going to be traveling to Rajasthan, am quite excited. I am back on 17th May. I am going to Gujarat, from there to Udaipur. On the way back will be visiting Nadwara and Bombay.

 

Will have lots to say when I am back. I wonder how life is going to be without a computer for 2 weeks at a stretch :)). I wish I had a digital cam, that is one of the things I am going to get soon after I am back.

 

Adios!"

 

(abridged from another short opinionated big-nosed man of French descent)

I don't know about other countries, but here in India, we have a ritual we call "LOTAing."

 

When you "LOTA" something, it means that you cover it in toilet paper(umm.... )... wash the floor with a small lota of water. Typically, you would "LOTA" the house of one of your friends for a practical joke, although you might also just "LOTA" the house of the codger down the street who always tells you not to try to chew gum while walking and carrying a loaded machine gun with the safety off at the same time (some people are really uptight).

 

Anyway, Pooja is currently out of town and she does not have access to a computer, which means that her blog is wide-open for a good "LOTAing."

 

I was thinking we could "LOTA" the comments section of this post.

Just so that you don't have any excuse not to, here's a link to the page where you can post your "LOTA" comment (just write something like “LOTA!“ as the comment).

 

Also, you're probably thinking that this is pretty immature.

 

Well, you're bloody-well right. But do it anyway :) It'll be fun... It isn't often that you get a chance to LOTA the comments section of one of The

 

Greats.

cheers!

 

Friday, May 07, 2004 12:56:14 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Tuesday, April 27, 2004

I thought of putting together some of my old mails and user group posting as blog entries, with some patches so that they are’ blogopatible’. They would have ended up on my blog, if I had a blog when I made these posts. I feel some of these are of lasting importance, at least with respect to the impressions they had on me.

 

All of these are personal opinions, probably more relevant in the context that they were originally written.

 

-----Original Message-----

From: James, Roshan

Sent: Friday, December 05, 2003 5:37 PM

To: MVP Mailing List

Subject: An Audience with Miguel

 

 

written in a hurry:

 

An Audience with Miguel

 

Hi, yesterday Pooja and I got to catch a part of Linux Bangalore, the annual Linux convention, and I thought that it would be nice to write to mvplist and share our experiences. We had missed the dates for the event and I was rather shocked at having missed a chance to see Miguel De Icaza in person.

 

Miguel, for those who don't know about him, is the creator of mc (the Midnight commander), Gnome (the rather popular open source desktop) and in recent days the lead for the Mono project. The Mono project is the only other major (when I say major here, it is not that I don’t know of dotGNU and other attempts, it is because I personally feel that Mono is more complete than those) .Net implementation outside of the Microsoft world. Mono runs on Windows as well as on Linux and probably other Unix flavors. This guy has been famous/notorious in the open source community for writing papers like 'Lets make Unix not suck' and has a rather 'misfit' personality for the typical religious ramblings of the free software types. In short this man has written his own windowing systems, his own .Net, his own enterprise servers and was running his own company called Ximian.

 

Ximian has been recently bought by Novell making Novell a major player in the open source world. Novell has also bought Suse - major Linux flavour and Novell seems to be on the path of becoming a significantly important open source company, along the lines of maybe Red Hat and such. However unlike Redhat and many of the 'Linux companies', Novell has a focus on delivering products rather than making Linux distributions and delivering them dirt cheap or free if they have to, to get into the market. So in short Miguel is as much a demi-god as our own Anders Hejlsberg, or Don Box.

 

The above paragraph was to set things in perspective. This is the mono website (http://www.go-mono.com/). Having been rather disappointed to have missed Linux Bangalore dates and missed Miguel, I happened to check their talk schedules by sheer accident around 11.30 yesterday. As fate would have it, there was a talk by Miguel, his last one, scheduled at 12.00. After a ~12km drive and some conversation with the registration counter we were at the IISC Bangalore venue – the last time I was here, I was attending the Microsoft Tech Ed.

 

One thing you notice up front as you enter is a big banner of Abdul Kalam, our president. The poster quotes him saying that it is probably not good to have important national software depending on proprietary solutions as proprietary solutions and highly dependant on the market that the vendors cater to and that sort of unreliability is probably not a good thing. And also that free software would really help a poorer country like ours as prices of commercial software are rather high. At least that was the message in spirit - don't think I have got any of his words right.

 

The crowd, as far as I could say was probably the same caliber as the technical crowd I usually get to interact with at UGs and various .Net technology events. Probably not as good in some respects - but there was this thing in the air that they were all up to 'something important'. Also one other thing that was noticeable was the set of demo computers setup, where people could sit down and try out many of the software that was being talked about in the talks.

 

Miguel's talk was at the main hall of the IISC venue (those who know the place will know what I mean). He was accompanied by Nat Friedman of Novell, a fellow mono-ist. What happened at the talk was something I wasn't prepared for. For those of you who have a mental image of Miguel by now, this guy is young, in his early twenties. He was carrying a digital SLR camera with a hefty lens and flash addons and was dressed in baggy jeans and black t-shirt. So was the other guy Nat. Now these guys hop on stage (literally), sit down on the floor - one of them rolls out a length of cable that he had wrapped around his neck the whole while. They pull out two laptops and they get a network setup between their systems and the presentation starts up.

 

The presentation showed of some parts of C# , web services, GTK# for windowing, GTK + for generating XML markup for the UI (and some jokes about how XAML is a copy of their own 6 year old idea) and more. These guys did the whole presentation sitting or lying down on the floor of the stage, sometimes editing the presentation right there in front of the audience, pulling jokes on each other and writing code the whole time for a full hour - and the whole thing was on their own Mono. Awesome.

 

After the talk Pooja and I met up with Miguel and introduced ourselves as being from the ‘dark side’ (He asked me if I was an ASP.Net developer because of all the questions I was asking from what otherwise seemed to be a relatively .Net ignorant audience. He was interested in the fact that I was an MVP.) and asked him if we could meet him sometime later, maybe over dinner or so. He was fine with that – that however was not to happen as his schedule did not allow him to. Various activities were planned for him for the whole of the next day (today, Friday) and he was going to flying on Saturday. He did promise to talk to our .Net user group the next time he is in India (expected to be in the second quarter of next year). I had to get back to office so I had to leave then; with the intention of returning for Jani's talk a little later in the evening.

 

I managed to sneak out of office again to attend the talk by Mr. Janakiram (I hope you know him - he heads Microsoft India's academic/university relationship program). Along with Jani was Mr. Gaurav Daga (he is a Program Manager of the famous Services for Unix team at Hyderabad; SFU won last years best open source software of the year award). Their venue didn't do any justice to their talk. Their talk was scheduled at one of the smaller halls and the crowd was so packed for the talk that I couldn't get close to the door of the hall. Jani and Gaurav as usual pulled a great show. They were talking about the new 'Unix' being built in windows ;) (Their demo was rather awesome: they took a Unix app ran it on windows literally, they wrote .Net code and exposed it as a web service, they built a proxy around the service and consumed the proxy as a COM component which was used by excel which was used to dump – did I miss anything?)  

 

All the while, from when he finished his talk, Miguel and his gang were there in the main lobby, showing off code or sitting or taking photographs or ready to talk to anyone at all about anything. When he was not doing that he would be sitting around in some corner with Nat typically typing away at a piece of code he was working on.

 

Since I couldn't get to listen to Jani at all due to the crowd and having driven the ~12km stretch in Bangalore traffic for the third time that day, I was walking around looking rather moody. Miguel then walks up to me, 'Microsoft dude', and gets our picture taken together. He kept calling me 'Microsoft dude' and he himself wanted to be called 'The Dude'; it was interesting talking to him.

 

I wanted to introduce Jani and Gaurav to Miguel and Nat after their talk. It was funny because on meeting Jani and Gaurav, Miguel seemed to freeze up a little bit - I think it's that Microsoft-effect. But on the whole they were nice folk. And Jani and Gaurav were good too. Jani mentioned how he wrote a wrapper around the 'Tk' widget library and called it a windows forms assembly and got to run some regular winforms code on Linux’

 

In retrospect, if I wanted to pick faults with the event I could and I could say that the organizing was bad, because the projector was shaky and the stage wasn't setup properly and the food was bad and all that and be complacent about the whole thing. But looking at the good side, you see guys who are probably the gods of their community actually sitting around with the developers showing off their code and laughing and talking rather that running off after a talk or sitting in a separate area. These are probably something's that we could learn from these folk. The number of people who Miguel touched that day and the number of people who will remember him are much more that those who will remember any of the speakers at technology forums where I have had the opportunity to speak or attend.

 

Miguel was different from my vision of the open source advocate. Probably because he was less of an advocate and more of a real programmer.

 

Miguel said that no they don't say that they are going to beat Microsoft or that Microsoft is going away or anything - which is normally common talk for OSI folk I have previously met. There is place for both he said. He said he has friends at Microsoft. He said that Dave Stutz is a good friend. We talked a little about Stallman and Free software. I asked him if he would be joining MS like Don Box offered and he said probably not. He would rather be doing his thing like this and be 'helping out the poorer countries'. He says they will keep on writing software, take good ideas wherever they find them and give it out as dirt cheap or free. There was this time when he said that 'they took out the GC and put in a toy GC in rotor and took out the JIT and put in a toy JIT in rotor - but the GC in Mono is your GC as much as its my GC' and he said that to Jani - 'its your as much as its mine and I would like to keep doing that'. There is this certain element of real sincerity which I find so missing in my work place and often at our technical seminars.

 

Free wheeling aside and sorry for all the typos and bad language in my writing, one thing that I probably miss from speakers and from many of our communities is that people hardly seem to be doing all that for themselves as much as for the community - I haven't seen anyone sit down and give all their time and energy to the community they are trying to foster. I don't see anyone on our side actually be there with the people and spread that sense of what they are doing - most of the audiences at our talks see us as speakers on podiums, rarely as people, we don't usually give them the room for that. I wish we could do that. And I wish that when we work on our user groups we can do it for the sense of community, rather than for the sakes of meeting numbers and budgets and revenue targets and stuff. I wish we all do this because we like our technology first - the Microsoft communities have never been able to do that the way these guys have. (This was probably rant, but reading this months later I feel that a lot of human touch is still missing in the communities. Somewhere the communities are built around a carrot culture and people who do things for carrots. Miguel has his carrots, but the way I saw his carrots were from a kind of passion that I personally feel in speakers I have known, myself being equally at fault. Something about what happened there that day felt like the spirit of those things I have thought about so much – hackerdom, the free hackers, the hacker ethic, mentor’s manifesto. Something is missing here and I am sure we can fix it because we have some extremely smart people who are so passionate about their technology)

 

I hope I have not tipped off any one by writing all this; this is probably something that could use some thought.

 

Cheers

Roshan

 

(Left to Right: Natt Friedman (Ximian/Novell of the Mono Project, cofounder of Ximian), Me, Miguel De Icaza (Ximian/Novell - author of Mono and other great feats of hackerdom, cofounder of Ximian), Gaurav Daga (Program Manager, Microsoft - Services for Unix Team), Pooja Malpani (CTS - programmer, Microsoft MVP .Net). This was taken at Linux Bangalore 2004, the annual Linux convention.)

 

 

(President’s quote put upon a hoarding at Linux Bangalore 2004)

 

 

 

This was recently posted on Miguel’s blog (there is more - go read the entry):
http://primates.ximian.com/~miguel/archive/2004/Apr-24.html

 

Jeff seems to like Cringley's statement of "The central point was that paying too much attention to Microsoft simply allows Microsoft to define the game. And when Microsoft gets to define the game, they ALWAYS win."

 

A nice statement, but nothing more than a nice statement, other than that, its all incorrect.

 

Microsoft has won in the past due to many factors, and none of them related to `Let them define the game', a couple from a list of many:

 

·         They leveraged their monopoly to break into new markets. The most discussed one is when they used brute force and anti-competitive strategies to get their products into new markets, but in some other cases they got fairly good adoption of their products with little or no effort: just bundle it with Windows: MSN messenger, Media Player.

 

·         Competitors were outmaneuvered or were incompetent (See HIgh Stakes No Prisoners).

 

·         People were sleeping at the wheel.

In 1993-1994, Linux had the promise of becoming the best desktop system. We had real multi-tasking, real 32-bit OS. Client and Server in the same system: Linux could be used as a server (file sharing, web serving), we could run DOS applications with dosemu. We had X11: could run applications remotely on a large server, and display on small machine. Linux quickly became a vibrant innovative community, and with virtual-desktops in our window managers, we could do things ten times as fast as Windows users!
TeX
was of course `much better than Windows, since it focuses on the content and the logical layout' and for those who did not like that, there was always the "Andrew" word processor. Tcl/Tk was as good as building apps with QuickBasic.

And then Microsoft released Windows 95.

 

·         A few years later, everyone is talking components: Netscape is putting IIOP on their client and server (ahead of their time, this later became popular as web-services on the browser); Xerox ILU; Bonobo; KParts; the Borland sponsored event to build a small component system that everyone agrees with; language bindings are at their top.

The concensus at that time? Whatever Microsoft is doing is just a thin layer on top of COM/DCOM/Windows DNA which to most of us means `same old, same old, we are innovating!'.

And then Microsoft comes up with .NET.

 

 

Maybe, sometimes, rarely, one man can change the world – or at least make a significant dent.

 

Tuesday, April 27, 2004 1:04:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4]  | 
 Friday, April 23, 2004

There is Dylan playing somewhere in my head, and some things feel crushed:

 

Though I know that evenin's empire has returned into sand,

Vanished from my hand,

Left me blindly here to stand but still not sleeping.

My weariness amazes me, I'm branded on my feet,

I have no one to meet

And the ancient empty street's too dead for dreaming.

(Tambourine Man)

 

Have you ever listened to Dylan? Actually heard the visions of what could have been move by you? Probably not, not many people like to listen.

 

Then take me disappearin' through the smoke rings of my mind,

Down the foggy ruins of time, far past the frozen leaves,

The haunted, frightened trees, out to the windy beach,

Far from the twisted reach of crazy sorrow.

Yes, to dance beneath the diamond sky with one hand waving free,

Silhouetted by the sea, circled by the circus sands,

With all memory and fate driven deep beneath the waves,

Let me forget about today until tomorrow.

 

Hey! Mr. Tambourine Man, play a song for me,

I'm not sleepy and there is no place I'm going to.

Hey! Mr. Tambourine Man, play a song for me,

In the jingle jangle morning I'll come followin' you.

 

Sometimes, the closed world of the bit and baud seems to be the only reality that matters and somewhere it cajoles you into believing in a certain brotherhood of those who seem to understand it. And then again sometimes not.

 

And do you listen to Simon and Garfunkel?

 

When you're down and out, When you're on the street
When evening falls so hard, I will comfort you
I'll take your part, when darkness comes
and pain is all around,
Like a bridge over troubled water, I will lay me down
Like a bridge over troubled water, I will lay me down

(Bridge over Troubled Waters)

Friday, April 23, 2004 2:17:13 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Monday, April 19, 2004

Last night we did it again.

We went for this movie (50 First Dates) and came home feeling a little giddish. I was feeling a little giddish before the movie after nearly having my head ripped off sitting on a Torra Torra, in a fair in Bangalore.

 

So after the movie and the drive back home, what do we decide to do, like the nice normal people we are? We decide that we need to drink coffee at 12am and discuss programming. So we head off to Leela Palace where there is a late night Barista.

 

Something about the way coffee affects my head, when drunk late at night, especially after a movie needs some investigation. Sidharth was my comrade is arms, or rather comrade in coffee. So what do we do? we go there and sit down and drink coffee and I start off on SICP (Structure and Interpretation of Computer Programs) which I have been postponing for several years now.

 

I think part of why I was so adamant about starting out on SICP in the middle of the night is that I feel life (like usual) isn’t going anywhere. It turns out that a lot of smart people at various Universities decided that I was wasn’t smart enough to warrant a formal higher education in Computer Science and the place I want to be the most, doesn’t seem to want me around because of some technicality (for the fifth time). So since life wasn’t going anywhere, I figured I’d just have teach myself the things I want to know, my own way.

 

A little fast-forward in time and what finally ends up happening is that Sidharth and I end up talking about a certain MSDN article.

Implementing Coroutines for .NET by Wrapping the Unmanaged Fiber API

http://msdn.microsoft.com/msdnmag/issues/03/09/CoroutinesinNET/default.aspx

We ended up in a rather (heated) philosophic discussion about how iterators could be implemented, till 4am, which is what this blog entry is about.

 

If you have been reading about iterators in my previous blog entries

Iterators in Ruby (Part - 1)

Warming up to using Iterators (Part 2)

Then the idea is probably growing on you already. What Sidharth and I did is put in some thinking about how iterators could be implemented. This entry is going to break the logical flow of these two articles, but I am letting it be. I will probably have a part 3 post that will bridge the gap between Parts 1 and 2 and what I am going to say here about iterators.

Also, like a lot of things on this blog, I am not an authority on the subject so I am just guessing at how these things actually work.

 

 

Iterators

The thing about iterators is that there are two functions involved that have to maintain execution state at the same time. So example when a function calls another function, the caller is frozen and the callee executes – so the caller maintains execution state during the run time of the callee.

 

def callee

      yield 1

      yield 2

      yield 3

end

 

def caller

      callee { |n|

#parameter block to the iterator

puts n
}

end

 

When the callee is an iterator, the control actual leaves the callee and returns to the caller, when the execution is in the parameter block of the iterator. However we don’t see this sort of behavior in a normal C stack. Why? because when a function on the C stack returns to the caller, the function’s activation record on the stack is destroyed.

 

How do we do this?

The approach in the MSDN article uses an API called the fiber API.

 

Fiber Approach

The fibers can the thought of as threads that don’t have the scheduler attached to them.  So unless a fiber is explicitly passed control it will not be executed, unlike a thread which is invoked by scheduler for a time slice.

 

What Ajai Shankar (the author of the MSDN article) does is use fibers to represent iterators. So in the above snippet, the function callee() would actually execute on a different fiber from  caller. So when control needs to shift to the parameter block, which is to be executed in the caller() function, a fiber is a switch occurs.

 

When the parameter has finished execution a context switch occurs again.

 

What further happens is that the author has wrapped up all this dirty jumping around into a managed C++ class that invokes the OS api. He then goes onto write C# code (really!) that uses yield, almost the same way Ruby would use it.

 

(pasted)

class CorIter {

    public void Next() {

        object[] array = new object[] {1, 2, 3, 4};

        for(int ndx = 0; true; ++ndx)

            Yield(arr[ndx]);

    }

}

 

If you get the general idea, then lets move on.

 

The problems with using the fiber API, among other problems, are

·         Every fiber is like a thread, which means that the more the iterators the more the number of fiber specific stack frames and such that get created – which means  more the code bloat for code like this.

·         Using the fiber api actually makes this a very OS specific solution – other OSes that the CLR may wish to target may not have provisions for building up such an API.

·         Exceptions: exceptions in the windows world are strung to the TLS (Thread Local Storage) of the thread of execution – this may behave rather odd when fibers are mixed into the picture.

 

Let ignore everything and just examine the first problem, the issue of creating separate stack frames per fiber and thus bloating the system – if we could solve this one, then I think (and I might be wrong), would bring more credit to this approach.

 

Wrapping State in a Caller Object

One other approach to supporting iterators is to ensure that one of the two functions (the caller or the callee) maintain state using some mechanism other than the C stack.

 

Lets take a look at the caller:

 

def caller

      callee { |n|

            puts n

      }

end

 

or maybe a C# equivalent.

 

void caller()
{

      foreach(int n in callee())

      {

            Console.WriteLine(n);

      }

}

 

This method can actually be though off as consisting of three parts

 

void caller()
{

     

      foreach(int n in callee())

      {

           

            Console.WriteLine(n);

      }

     

}

 

We could create an object to hold the state of the function that would hold these three parts. Something like this:

 

class caller_object

{

      //declare all local variable so the class as member variables here

      void do_part1()

      {

}

 

void do_codeblock() //part 2

{
}

 

void do_part3()

{

}

}

 

The idea is that we create an object that has member variables that represent the local variable of the caller.  So we execute the caller as three parts

 

void caller()

{

      caller_object co = new caller_object()

      co.do_part1();

      callee(co);

      co.do_part3();

}

 

The caller method now is simply a wrapper around the class that represents the caller function as an object. When the method do_part1() is called on the class, the object will have the same state as the original caller() function when it has just run till the point where the iterator is invoked.

 

Then the callee() is invoked and the object that represents the caller’s state is passed to the callee. The callee then goes on to invoke the object’s do_codeblock() every time a yield is required.

 

Since the callee never returns till it has completed execution it maintains state on the runtime stack, like a normal function. The do_codeblock() has the same code that the code block of the for each loop had and it can also maintain any state changes into the object. Finally when the callee() exits the object’s do_part3() is invoked.

 

This is similar to what the iterators accomplish. Here the state is stored in an object and not on the stack. However, here a full managed type that represents that caller has to be created. I didn’t like that too much.

 

Wrapping State in a Callee Object

This is similar to the above approach, except that roles are reversed. We create an object that can represent the callee. The callee then returns to the caller at every yield statement.

 

The callee state is maintained in the object representing it. There is an excellent write up you can read about a similar approach here:

Coroutines in C

http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html

 

The idea there is that the state of the function is retained in a state variable. The state variable is used to jump back to the point where the function had previously yielded from. Code would look a little like this:

 

(pasted)

int function(void) {

    static int i, state = 0;

    switch (state) {

        case 0: /* start of function */

        for (i = 0; i < 10; i++) {

            state = 1; /* so we will come back to "case 1" */

            return i;

            case 1: /* resume control straight after the return */

        }

    }

}

 

Now this example uses static variables but it is easy to imagine this being extended such that each variable is the member of some object.

 

(pasted)

It's a little bit ugly, because suddenly you have to use ctx->i as a loop counter where you would previously just have used i; virtually all your serious variables become elements of the coroutine context structure. But it removes the problems with re-entrancy, and still hasn't impacted the structure of the routine.

 

(Kudos to Pooja, for coming up with this idea at one sitting).

 

 

 

When C# announced the coming of iterators in the language and a new yield keyword, I was excited. In the mood of the MSN co-routines article, I had expected a CLR level support for iterators.

 

It turns out that the C# teams approach is similar to that of the saving the callee state in an object. (I am not very sure about whether its the caller or the callee, in case I am wrong in assuming that it’s the callee, which seems to be the more logical choice, I will blog about it).

 

In the Co-routines in C article, the author talks of writing macros that wraps up the behavior.  Since the compiler does the temporary object creation and hides all the mess from you, in the case of C#, it seems like a reasonable alternative.

 

 

A modified form of the Fiber API idea

The reason I don’t really like the way C# does iterators right now is because it is a hack. They did not want to change the CLR for a feature that may not catch on. So I guess, they used a less expensive approach. If I am wrong, I would like to be corrected. I would expect that more serious CLR level support will come up for iterators if the idea’s introduced in Whidbey C# become popular.

 

The other reason I don’t really like the approach, the real reason, is that the .Net type system is a fairly comprehensive type system designed to propagate an idea of types as a level playing field for language agnostic components to interact. Introducing a type into the system just to retain a function’s state does not seem consistent with this philosophy.

 

Fiber API on the other hand more naturally lend themselves to the way I would choose to think of iterators – as functions that can be frozen during execution and be continued.

 

Now this might seem like a weak argument, but it seems to better to use the processors abilities to do a context switch to actually freeze execution of a block of code, that write the code as code that manages members of an object (only for the purpose that the object can be used to retain the state of the code).

 

The Fiber API like approach seemed to do this more naturally. I would expect that the CLR in future would internally provide some API similar to that of the OS provided fibers so that it can do iterators and closures and probably even continuations.

 

Some basic requirements would be that implementing such features don’t slow down execution of code that don’t require any of these features. Such features should be reasonably efficient with respect time as well as space.

 

Let me try and discuss the space issues here. In fiber API there would be need for creating totally new independent stack frames for each fiber. This is wasteful.

 

Would it be possible so that we have a modified API, which will behave like fibers, share stack space with the common C stack and can use the processor context switching abilities to freeze function execution, rather than save state as a managed object.

 

A little bit of brainstorming last night and we had this:

 

In the .Net world, we have the luxury of being able to predict the stack usage of a function under execution with IL directives like “.maxstack”. Which is to say - we know how much space the function will use on the managed stack.

 

The stack frame for regular method calls would look like this:

  

 

This is obvious for anyone who understands how methods are laid out on the stack. The only advantage that we have here is that in the .Net world. We know exactly how much stack space a given method will use.

 

Now if the method calls an iterators that has a yield, we create a Fiber, but a special sort that would use the main stack itself as its stack frame. So the newly created method instance (the iterator itself) will reside on the call stack, above the caller.

 

 

Now the usual semantics of stack usage are allowed on this fiber. The fiber behaves like any other thread would behave, owning the stack. To allow methods to keep track of their callee’s we add a reference to the activation record of the callee.

 

  

 

The interesting part, when the iterator needs to yield a value. When it does control is switched back to the original fiber. The activation record of the iterator is still maintained on the stack. Further method calls would however place their activation records above the iterator’s activation and behave as though it was normal C stack.

 

 

Thus I think it is possible to have fiber API like constructs to implement iterators, share stack space have reasonably efficient implementations too. The only real over head introduced here is a level of indirection when activation records are torn down from the stack frame.

 

I feel that this is a more co-routine like approach that the one that involves creating hidden managed objects.

 

I would like to wish that this idea can be extended to implement proper continuations also, that is not very easy. Here the stack management is very easy because as any point a sleeping fiber will contain only one activation record on the stack. A continuation will require that activation objects live and die on the manage stack as though they were proper objects and some sort of garbage collection routine will be required on the stack.

 

I am extremely open to opinions about this entry, because I am treading on many areas that I am not very well versed with. I am hoping that the idea of freezing execution state via fiber like constructs is more efficient that the approach that involves creating full managed objects.

 

Monday, April 19, 2004 7:48:40 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Saturday, April 17, 2004

Yesterday I was taking a talk at the Bangalore User Group. There was this one person in the crowd who I noticed, have noticed before too who was actually listening to the talk. Listening in the sense of trying to understand how things work.

 

At least that is what I hope because somewhere is his/her eyes there was this interest in computer science, not just in knowing what the technology can do for you, but actually caring about technology for sake of the science that it caries.

 

 

I get to talk to a lot of professional programmers though various technical communities and one thing I feel is that there are very few people, in most gatherings none, who really care about computing. There are folk who are passionate about their one patch of grass, some about all the software that Microsoft write, some who will simply hate everything that MS writes simply because it is written by MS. Some who will praise anything that is Java, some who will praise anything that is Linux, some who will praise anything that is GNU, some who will praise anything that is Open Source. And other who will hate the same software simply because of the same reasons that someone likes it.

 

This dichotomy bothers me. You actually feel a little lonely in talks, when you are standing there scanning the eyes of your audience for someone who seems to understand computing, someone who seems to care about computing.

 

And you see that glimmer occasionally in people’s eyes when they pursue something and understand what they mean – but that glimmer dies off very fast for most.

 

And then again occasionally you see someone in the audience who you think is genuinely interested. Not interested for the sake of fitting it into their own value perceptions (though we are all that way at some level), not interested because they want to yes-sir the speaker, but interested because they really care at some level.

 

 

The smart ones argues back for what is right and will completely refine their views if you are right and expect you to if they are. The smart ones.

 

 

And what is good Pheadrus,

And what is not good,

Need we ask anyone to tell us these things?

Saturday, April 17, 2004 4:39:44 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Friday, April 16, 2004

Yesterday Sajith mailed me a this. It is a flash version of the old Prince of Persia game - ver 1.0.
Try it, its fun.

Which reminded me of the version I had done:
http://www.thinkingms.com/pensieve/homepage/old_work/prince_of_persia.htm

There were a couple of neat things my Price did such as have steps, complex net like patterns that the prince could run behind (the original prince could never be covered by any complex surface). I have a couple of screenshots to prove my point.

 

Friday, April 16, 2004 4:54:16 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Thursday, April 15, 2004

Very soon I should have a blogging engine of my own up and working. I got a copy of DasBlog and with a bit of tweaking it seems to suits me rather fine. I would however like to see

·         Hierarchical comments

·         Ability to delete comments without getting into XMLs

·         Enabling description views only on certain aggregate views.

·         Where is the archives feature?

 

The blog should be going up on www.thinkingms.com, a site that is run by Pandu. The only problem is that I don’t seem to be thinking MS all the time :-)

 

Until the blog is formally up I guess you will see me manually predate entries at the end of each entry.

 

(To the tune of Jingle Bells)

blogging site blogging site

blogging all the way,

oh what fun it is to send

an entry on its way ... hey !

Apr 15 2004 Thursday 12-23PM

Thursday, April 15, 2004 1:55:29 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, April 14, 2004

It's been a long time that this has been getting postponed for, but here it goes - this is my first blog entry. Well, it's not a real blog entry, in the sense that I and not typing this into a blogging software but rather am typing this into a word document. In time I will find a blogging engine or write my own and have this up on the net.

I am a computer science graduate from Model Engineering College, Cochin and am currently working with the great Indian software industry at Bangalore. I work with this technology called .Net - if general computing holds an interest for you, then the term might be familiar.

I have a homepage here:
http://www.thinkingms.com/pensieve/homepage
where I have some work that I have done, handful of articles and other stuff related to my general existence and interest around computers and computing.

I indulge (or at least used to) in a certain manic amount of programming. I am not very old in computing, as old as some people I have had the pleasure of knowing. My first real exposure to programming was in the summer of 96, when I started out with programming on Foxpro (yes, believe it).

Strangely as fate would have it then, a lot of Cochin city was running old boxes and 386 machines were a luxury. So it was like I had the chance to grow up in a time warp. And needless to say, most machines ran (the now mythical) DOS.

DOS programming, especially once you start playing around with TSR's and SVGA and writing GUI routines and simulate your own multitasking environments was a very special kind of education. I don't know if any of the future generation will ever have that pleasure and honestly, since I have never seen it any other way, I wonder if they will ever see these things and feel the joy of writing values onto your VGA card's control registers.

It's been a funny trip since then and I presently spend my time of Windows boxes. I spend my time exploring *nix boxes for a while in between, but try as I might they did not hold my fancy very much. Probably I learned things the wrong way, but I used to compare things to what I could do in DOS and that just killed the joy in everything.

In that sense .Net is probably one of the few real pleasures that I have come across. A very sensible mature platform with very good design choices and excellent implementation. Some of my early attention to .Net seemed have got me some attention too (http://www.microsoft.com/india/mvp/indiamvp.aspx#RoshanJames). I also try and stay true to my C/C++/Asm roots. I also have an indulgence in Ruby (the programming language) - Ruby is an excellent dynamic language with support for neat constructs such like closures, iterators, dynamic interfaces, mixins and more. It also brings continuations and some real beasts of programming as well, in addition to being a fully object oriented general purpose interpreted language with a nice libraries and good integration of regular expressions and flexible collection types in the language. One difference with Ruby and other languages, esp Perl (or what little of it I have tried) is that Ruby actually makes you feel happy while writing a code; unlike the sort of happiness you feel when you are glad you have finished coding.

In addition to the 'way of the code' I like music - Bob Dylan, Simon and Garfunkel, U2, Cat Stevens/Yusuf Islam, John Denver, Don McLean

I think I will stop on my first entry now.

Debugging is twice as hard as writing the code in first place. Therefore, if you write code as cleverly as possible, you are, by definition, not smart enough to debug it.
 
- Brian Kernighan

Apr 13 2004 Tuesday 01-18AM

Wednesday, April 14, 2004 9:04:25 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |