Tuesday, February 19, 2008

I am not a professional photographer. I am pursuing my PhD in theoretical Computer Science and I enjoy photography. Nearly all I what I have to say about photography comes with my experience with my EOS 350d that I have had for about 2 years, at the time of this writing. Hence take my opinions and suggestions with some discretion.

The art of "painting with light" has many ingredients. There are matters of spirit that each person brings - your aesthetics, your sense of beauty, your evaluation of what is worth shooting, etc. And then there are aspects of photography that involve understanding the nature of the machine and laws that govern it. To the latter part, I realized only recently, that I can apply my relatively abundant geekiness, potentially compensating part of my shortcomings in aesthetics. Hence my blog entries about photography.

Of course, some have more skill.

Tuesday, February 19, 2008 8:59:19 AM (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]  | 
 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]  | 
 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 15, 2007

Srikanth Chunduri visited me this weekend. The last time we met was in Hyd 3 years back. These days  Srikanth is up to living the life of a fast paced New Yorker in the financial district. He introduced me to some music from XLRI... enjoy.

 

If you don't understand Hindi, I would advice that you don't go about singing this without having checked the meaning of the lyrics with a friend. Enough said.

Here is another piece, which I would rather not embed on my blog:

http://www.youtube.com/watch?v=y_KT3sMR4CY

Enjoy.

Saturday, September 15, 2007 2:38:43 PM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 Sunday, November 19, 2006

I have been getting my brain fried the past few days trying to relate call-by-need and delimited continuations. Staring vacantly into space I noticed my little flying certificate from Cornwall. Happy memories, hence the post –

 

 

 

Granite cliffs around Land’s End, Cornwall taken from a Cessna 172 that I was flying.

(Yes it’s safe to let go of the controls of a small plane like that for a short while)

 

 

On foot this time.

 

Sunday, November 19, 2006 1:40:22 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Wednesday, August 30, 2006

Since many of my blog entries have ceased being blog entries and have become more beacons of the fact that I am trudging through life, here is another life update.

 

I am back in Bloomington, Indiana after a great summer. After many years have I had a summer that left me with so many memories. I spent the summer in Cambridge, UK and like I was telling one of my friends here at IU (Indiana University) that Cambridge is like a distillation of the essence of several Bloomingtons put together, and then matured over several hundred years – a little like comparing a fine Scottish whisky to beer – maybe a 16year old Glenmorangie in burgundy wood to a Guinness.

 

I made it a point to travel as much as I could this summer – as much as time and finances would allow. And it was great. I look at some slight embarrassment at the rant about Cornwall below. But yes I had a great time at Cornwall. Cornwall aside, took several trips to London, went to Norfolk – Hunstanton, Cromer, Great Yarmouth. London’s a pretty amazing city and I haven’t been to most of the major touristy spots. Spent some time gallivanting around Cambridge – went to Peterborough and Ely – saw the famous cathedrals. Went to Granchester – the little village near Cambridge.

 

However most of the really great travel came towards the end of summer. I had a chance to finally go to Scotland. The trip to Scotland was primarily motivated by a long standing wish to go see Skye – the island of Skye – like in the famous Robert Stevenson poem “over the sea to Skye”. Scotland was amazing in many ways – firstly it was beautiful. But that aspect of it didn’t impress me much initially – in my mind I kept comparing it to the highranges in Kerala and not seeing much more there. But after a while you realize how much grander Scotland is – the deep lochs and the high lands and the people. I got a chance to spend two night at the bank of the Lochness in a little town called Fort Augustus. At Fort Augustus I picked up a liking for good single malt whisky. I never had a liking for hard liquor before – but this is great. Favourites? Hmm… I like a Glenmorangie (esp in Burgundy wood), The Macallan, Dalwhinnie; I like this really interesting whisky liquor called the Glayva…. Scotland was interesting in other ways too – here was a land that was under conflict with the English for many hundred years and they too, much like India tries to hold on fiercely to their traditions. Scotland of today is not much like that, but an Scotsman you meet will be only happy to make clear to you how they are not Englishmen. It was alsoa funny parallel that very often tartan patterns on kilts were like the checked patterns on mundu back in Kerala.

 

After Scotland the next major travel was to Paris and then to Rome. Paris was good, Rome was great. I think aside from a love for whisky another take away from summer is the need to be Italian and to speak Italian – I am so amazed by that language – I have taken an instinctive liking to it. It also partly has to do with a good Italian friend I made this summer (who also happens to be a logician in his free time). More on all that later. Honestly these days there is too much to write about, and so many things to say about every little thing – I need to sort out my time for blogging a little more carefully.

 

HairyCoo1.jpg

Hairy Coo!

Wednesday, August 30, 2006 1:07:18 AM (Eastern Standard Time, UTC-05:00)  #    Comments [6]  | 
 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]  | 
 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, August 05, 2005

Yay! Finally the search bots gave us a honorary indexing. :)
Hopefully most of the damage due to the url change will be undone soon.

Friday, August 05, 2005 12:37:12 PM (Eastern Standard Time, UTC-05:00)  #    Comments [1]  | 
 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]  | 
 Wednesday, July 13, 2005

After several months, and several ISPs, TMS is back up and stable. Which means that our blogs are live again.
Thanks Pandu

:)

Wednesday, July 13, 2005 1:03:15 AM (Eastern Standard Time, UTC-05:00)  #    Comments [9]  | 
 Monday, January 17, 2005

I recently had some C# code that that had to be made localizable. Most articles about localization/internationalization that you find on the web would talk about how nice Visual Studio is for code internationalization and would show nice examples of how many ways the forms-designer would extract code out into a resx file. I am perfectly ok with studio doing all the work for you. However there are very often, strings in your actual code that studio does not externalize to resx files.

 

Strings.rb is a ruby script that will parse your C# code base and identify literal string definitions in the code base and will move them to your resx file. The code was hacked up to fill out a personal need so your mileage on this may vary. The tool certainly isn’t fool proof and there are certain cases that it doesn’t handle too well. If you are however on the smart-scripter side of things then you may find it useful.

 

The script needs to be setup for your specific project. Once done you can run it several times on your code base and it can incrementally catch strings and externalize them for you. This is handy to have while your code is still undergoing changes so new strings can be identified as they pop up and can be moved out.

 

Getting Started

 

Downloads

1) First thing download the script (strings.rb) and put it in your project folder.

 

2) Download and install ruby from here – http://rubyforge.org/frs/?group_id=167, its about 12mb and the installation happens in a snap.

 

3) Download an install REXML library for XML handling in Ruby from here –

http://www.germane-software.com/archives/rexml_3.1.2.zip

http://www.germane-software.com/software/rexml/docs/tutorial.html

 

 

Patching Strings.rb for your project

1) You need to patch the script file to have the correct path to your resx file and the path to your wrapper class that will be used to read strings from your resx file.

 

Open the script file in a text editor. (If you have ruby installed you should find this editor called scite in the ruby installation folder – that’s a nice editor. Alternately you might want to try installing scite - http://scintilla.sourceforge.net/SciTEDownload.html - about 600k).

 

In your project identify your resx file. It will usually be in Properties\Resources.resx.

Change the following line the rb file to reflect the path path to your resx file.

strings.rb:4:$resx_fn = "properties/Resources.resx"

(The actual line number might change a bit)

 

2) Now create a new class in your project called Strings. VS should typically create an empty class definition file that looks like this.

 

#region Using directives

 

using System;

using System.Collections.Generic;

using System.Text;

 

#endregion

 

namespace <Some Namespace>

{

    public class Strings

    {

 

 

    }

}

 

Patch the file with the following additions

- Add a using directive for your ‘Properties’ namespace.

- Add a comment that stays //start and one that says //stop. These ad as delimiters between with the script will generate the string definitions.

 

 

#region Using directives

 

using System;

using System.Collections.Generic;

using System.Text;

using <Some namespace>.Properties;

 

#endregion

 

namespace <Some Namespace>

{

    public class Strings

    {

 

//start

//stop

 

    }

}

 

3) This is the wrapper class into which the script will generate string definitions. You need to patch the script with the path to this class file. Basically patch this line –

strings.rb:5:$stringsclass_fn = "helper/Strings.cs"

 

Done

If you have got this far then your installation is done and you are ready to go.

For sake of completeness let me just list out things again –

1) download the script and put it into the project folder

2) install ruby

3) install the REXML library for Ruby

4) patch the script with the path to the resx file of the project

5) create a empty Strings class and add the namespace directive and comment markers to it

6) patch the script to have the correct path to your Strings.cs file.

 

What does the script do?

The script does a few basic things.

1) it parses your *.cs files in all subdirectories and looks for strings.

2) when it finds a string a it prompts the user for an action

3) if it is a string that should be localized the user can provide a pseudonym for the string. On getting this name the script will -

            1) add the string and the name to the resx file

            2) add a property to the Strings class that will read the string from the rex file

            3) replace the string literal in the code with a call to the property.

 

Running the script

To run the script after all the previous setup, simply go to the command line and type strings.rb

 

Here is a sample run of the Strings.rb script

Let me take up a simple project and show you how the internationalization script works.

 

Here is a project that has only one Program.cs file –

#region Using directives

 

using System;

using System.Collections.Generic;

using System.Text;

 

#endregion

 

namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            string a = "hello world";

            string x = "skip this line";

            string b = "escape sequences  \n\r\t\\\"";

            string c = @"cant handle this one";

        }

    }

}

 

The resx file looks like this –

<?xml version="1.0" encoding="utf-8"?>

<root>

  <resheader name="resmimetype">

    <value>text/microsoft-resx</value>

  </resheader>

  <resheader name="version">

    <value>2.0</value>

  </resheader>

  <resheader name="reader">

    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

  </resheader>

  <resheader name="writer">

    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>

  </resheader>

</root>

(I have removed some unnecessary details from the original resx file here)

 

I created this Strings class –

#region Using directives

 

using System;

using System.Collections.Generic;

using System.Text;

using ConsoleApplication1.Properties;

 

#endregion

 

namespace ConsoleApplication1

{

    public class Strings

    {