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 [211]  | 
 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]  | 
 Monday, July 05, 2004

My Collected Articles

I decided to collect urls of some of my longer entries here, things I think are of lasting significance and have put them up with some of my other articles. Some of the blog entries need a little more polish before they can be considered as standalone articles though. If there is something that you are looking for, chances are that you may find it here:

http://www.thinkingms.com/pensieve/homepage/articles/articles_tech.htm

 

JRuby

I didn’t know that this beast existed. This is a Ruby port to the JVM.

http://jruby.sourceforge.net

JRuby is a pure Java implementation of the Ruby interpreter, being developed by the JRuby team.

JRuby is free software released under a dual GPL/LGPL license.

JRuby is tightly integrated with Java to allow both to script any Java class and to embed the interpreter into any Java application.

 

A Little Ruby, A Lot of Objects

This is good fun to take a look at. This also talks a bit about Ruby’s meta-class hackery :-)

http://web.archive.org/web/20030618203059/visibleworkings.com/little-ruby/

This is a draft book titled A Little Ruby, A Lot of Objects. It's in the style of Friedman and Felleisen's wonderful The Little Lisper (now called The Little Schemer), but on a different topic. From the preface:

 

Welcome to my little book. In it, my goal is to teach you a way to think about computation, to show you how far you can take a simple idea: that all computation consists of sending messages to objects. Object-oriented programming is no longer unusual, but taking it to the extreme - making everything an object - is still supported by only a few programming languages.

 

Can I justify this book in practical terms? Will reading it make you a better programmer, even if you never use "call with current continuation" or indulge in "metaclass hackery"? I think it might, but perhaps only if you're the sort of person who would read this sort of book even if it had no practical value.

 

The real reason for reading this book is that the ideas in it are neat. There's an intellectual heritage here, a history of people building idea upon idea. It's an academic heritage, but not in the fussy sense. It's more a joyous heritage of tinkerers, of people buttonholing their friends and saying, "You know, if I take that and think about it like this, look what I can do!"

 

Schemers.org

A website about Scheme

http://www.schemers.org

 

Another American Pie Spoof : Bye Bye Mr CIO Guy

This is titled “Bye Bye Mr CIO guy” and is performed by Pat Helland, David Chappell and Don Box at the Europe TechEd. This is just hilarious. I highly recommend this for your free time.

http://channel9.msdn.com/ShowPost.aspx?PostID=11950

Monday, July 05, 2004 2:14:30 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  | 
 Sunday, July 04, 2004

Are you the sort who finds these automated download installers irritating? I like them in spirit that they let you download only the files that you need, instead of downloading a huge installer upfront. However if the downloader + installer combo is there so that it prevents you from physically acessing the installation files, then it is rather irritating.

 

MS has released the Visual Studio 2005 express editions. These are betas of lightweight versions of Visual Studio. I had a look at one of these at a friend’s desk it was pretty amazing. They seem much more developer friendly than previous version of VS. They have a certain limited support for refactoring as well.

 

However the issue is that the express editions have an installer than does the downloads the installation files, does the installation and deleted the files. You need to provide you passport id to the website to be able to download the installer. My guess is that MS wants to know who all are actually evaluating their product. Which is all fair – but the issue is that after this installer automatically downloads the files required, I have no way of actually accessing them – the installation is automated.

 

This has been really irritating me and for a genuine reason - I would like to install the express edition and play with it at my home machine. However, I don’t have the sort of bandwidth required to download it at home. At office I do have the  bandwidth required, however I don’t want to clutter my work machine with beta-ware.

 

I would like to download the actual installation files at office and take them home somehow.
That is what this post is about.

 

Examining the Installation Process

 

A little peeking at the installer showed that it runs as a process called ‘setup.exe’. That is good.
Setup.exe goes on to display two progress bars, one for downloading some files and one for instllaing them.

 

After a careful look you realize that is downloading the .Net Framework 2.0 using the BITS api of windows. The BITS api is the Background Intelligent Transfer Services api that windows uses for downloading things like patches, in such a way that it uses only unused bandwidth of your system and does not hog bandwidth from any other running applications.

 

The funny thing is that when I am watching the download happening I notice that there is this folder created called

C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP

It is here that the framework is being downloaded. The download file is shown as “bit< something>.tmp“. The funny thing is that filemon does not show the setup.exe as the process that is writing to this file. My guess is that work done by the BITS api is not tracked as IO done by the process that made the request to the API.

 

However, this should be the part that is of interest – The framework 2.0 installation is downloaded into the folder

C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP\wcu\dotnetframework

It would be named dotnetfx.exe. So that is one file that you need to save.

 

The other file that should be saved is vcssetup.exe in the folder

C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP\

 

Both these files will appear when the BITS api has completed. Ie is when the first progress bar has completed. The second progress on the same page is the one that tracks the progress of the framework installation. At this time the installation files are ready copy out.

vcssetup.exe – 28.9 mb

dotnetfx.exe – 24 mb

 

The framework installation is spawned with the following command line switches –

dotnetfx.exe /q:a /c:"install.exe /q /watsongenman=gencomp18.txt"

 

I figured that out courtesy of the log file maintained by setup.exe which is called dd_vsinstall80.txt. It can be found in the folder

C:\Documents and Settings\< user name>\Local Settings\Temp\

 

One thing that was puzzling me was that two exes appeared after the progress bar completed. The progress bar only said that that the framework is being downloaded. The second exe is called vcssetup.exe. I don’t know when it downloaded vcssetup.exe.
Files are
C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP\wcu\dotnetframework\dotnetfx.exe

C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP\vcssetup.exe

Anyway the framework installation requires a reboot. After the reboot I noticed that both files have been deleted. The installer starts again and then the BITS api runs a second time. This time the file that appears in the download folder is again called vcssetup.exe !! The folder name is same as before :
C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP\

I have two copies of this file now and I think I need to do a file comparison to see what the difference is. I expect the first one to be a dud.

 

I think with these dotnetfx.exe and vcssetup.exe files, it should be possible to install the express editions and be able to copy the installation files around. I am afraid that they may not work if the original setup.exe had created some registry entries that these installers check for before running. If that is the case then I may have to go through this whole process again, but this time with regmon running. That will be a pain.

 

The vcssetup.exe was run by the installer with the command line args –

C:\DOCUME~1\< user name>\LOCALS~1\Temp\VSESETUP\.\vcssetup.exe "C:\DOCUME~1\< user name>\LOCALS~1\Temp\VSESETUP\.\vcssetup.exe" /q:a /c:"install.exe /q /watsongenman=vs_setup.dll.txt /msipassthru MSI_ARGS_FILENAME_BEGINC:\DOCUME~1\< user name>\LOCALS~1\Temp\tmp21.tmpMSI_ARGS_FILENAME_END"

 

I am not sure what any of that means right now, but I might need that to do another installation with the installer.

 

Ok I just ran windiff on the two versions of the vcssetup.exe file.. surprise surprise.. they are both the same. But how can that be? Does the installer actually the download the same ~30mb size file twice?

 

While the file was being downloaded the second time I did do a ‘ipconfig /release’ and the download did not seem to progress, so it does seem like they are actually doing a download a second time. (Damn I should have started a packet sniffer to check).

 

Trying to do the install with the Installer files

vcssetup.exe – 28.9 mb

dotnetfx.exe – 24 mb

 

I ran vcssetup.exe on a machine where I already had .Net 2.0 installed (the version that came along with Monad) and the installer refused to run saying that .Net 2.0 is not installed. I am guessing that this is a later build of .Net framework 2.0.

 

Ran the framework installer and it complained that an incompatible version of itself is already installed. Fair enough (considering that 2.0 is sill under development).

 

And bingo it works.

 

To Summarize

 

If you want to install VS 2005 express editions on a system where you down have a fast enough internet connection, this is what you need to do to get the installation files –

 

Start the installer program that does the download for you. At the point in the installation where it says that the download has completed and that the installation process is starting you should copy out the contents of the folder

C:\Documents and Settings\< user name>\Local Settings\Temp\VSESETUP

 

Specifically, you should find 2 files

vcssetup.exe – 28.9 mb

dotnetfx.exe – 24 mb

 

These should let you install the VS on any other machine of your choice. This entire process is applicable for VC# installation – however I would expect that similar approach exists for the other parts as well.

 

The information provided in this blog is for informative purposes only and is intended to help people who are facing a genuine issue. I am not responsible for any misuse of this information.

Sunday, July 04, 2004 1:14:02 AM (Eastern Standard Time, UTC-05:00)  #    Comments [2]  | 
 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]  | 
 Monday, June 28, 2004

I have been putting more of my free time into digesting Scheme. I am now working on XEmacs. After several stops and starts with emacs in the past, I am finally using it (might I add - productively) to write scheme code. I figured that even if emacs is of no use to me for most of my work, I could atleast use it to write scheme code. It should be good for that for sure.

 

Don’t misunderstand me when I say this, because you may have different opinion, especially if you have lived in Unix for a long time – which I haven’t. XEmacs still leaves me feeling like I am taking piano classes. I use Scite and Visual Studio for most of my day to day work.  Of course, if I am writing a document, then it is Word. I also have a love-hate relationship with Rob Pike’s Sam editor.

 

For a long time I used the old Turbo C++ IDE in DOS (yes I am not ashamed to confess) and it served me rather well. After which it was Visual Studio 5... it was a pain to use in some cases, but with this plug-in called ‘Whole Tomato’ that I used, it was a killer.

 

When I got started on Linux, editing was a real pain – it was like I had to learn to type all over again. That was major put-off. As a matter of fact I figured that I could not suffer the ‘miserable’ editors they have there and so decided to write my own editor. (Yes, I was crazy enough to try and write an editor instead of learning arcane key combinations…) Of course, since I could edit code on Linux, I decided to write my editor in a portable way in DOS and then figure out how to take it to Linux.

 

As most DOS code was written those days, I wrote interesting text mode menu libraries and such other things that assumed that I had access to VGA text buffer to access. Finally when I actually had something going, I decided to make the big switch – Prot to Linux. Almost immediately, I hit a blank wall.

 

The entire style of programming, with direct access to video memory that was used to write large Text-UI based apps on DOS, was simply non-existent in Linux. That, I still remember, was such a major put off that I was going around cursing Linux to anyone who would listen to me. The only alternatives that I was left with, was to use some editors that did old Word-Star like CTRL-K based key combinations, which was rather irritating. I also spent half a day looking at the ncurses lib that time, hoping for a way out. All I got was buggy behavior and one buggy lib after the other and numerous dependencies on some .so or the other which I had to go and find on the net .

 

Finally my entire work on the editor on Linux got scratched and I decided to turn it into a DOS only thing – which I used for much after that as file viewer. The thing was distributed as w.exe to my friends and the default config file used to display multicolor menu and the title “The Zen Masters Workbench”. In w.exe was viewer that could be given C like structures and could read data out of binary files to match the structures. That became the original basis for the implementation of my DDL language.

 

 

 

I don’t know why I typed all that down… anyway here is the little bit of scheme code that implements a for-loop as a macro. I know it is not much, but its good fun.

 

(require (lib "defmacro.ss"))

 

(define-macro for

  (lambda (init  cond  step  code)

    (let ((loop (gensym)))

      `(let ,loop ,init

             (if ,cond

                 (begin

                   ,code

                   (,loop ,step)))))))

 

;see nested for loops

(for ((i 1)) (< i 10) (+ i 1)

     (begin

       (for ((j i)) (< j 10) (+ j 1)

                (begin

                  (display i)

                  (display j)

                  (display " ")))

       (newline)))

 

Of course, written entirely in xemacs. One reason to use xemacs over Scite is that it gives me this really nice syntax driven indentation. The syntax high-lighting, for what I have seen, is pretty corny though. But on the whole, good enough to write scheme code for now. :-)

 

If you are starting out on Scheme and already know how to program, I recommend Dorai Sitaram’s “Teach Yourself Scheme in Fixnum Days” as a starter. The SICP is a lovely text as well and full of ideas, but if you don’t have lots or free time on your hands and are not the sort who likes letting an idea go without giving it its due thought, then I wouldn’t recommend SICP. It will be a while before you get down to scheme-ing. Also Prof Kent Dybvig’s book on Scheme is good, but again if you are the impatient sort, the DS book is the better choice.

 

In a few weeks I should get my copy of the Little Schemer, I intend to be ready for it by then :-)

Monday, June 28, 2004 6:19:28 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |