Archis's Blog

February 24, 2007

MSR’s Innovations: Photosynth – totally awesome!

Filed under: Uncategorized — Tags: — archisgore @ 8:13 am

Take a look at Photosynth.

Microsoft’s photosynth seems to be completely groundbreaking technology. Another excellent example of what Microsoft Research is upto in those underground labs back in Redmond and right here in Banglore.

I really don’t know how to explain this in words. Afterall, the name itself suggests something visual. So without further ado, I’ll just point you to a video that shows you.

As they say, actions speak louder than words. Actions with words (known in contemporary society as ‘video’), speak even louder:

Video: Photosynth Microsoft Research

Compare this with Flickr or any other photo sharing. Now when this comes out, naturally there’ll be a big debate on how Microsoft replicated current ideas and made them “slightly” better. But let’s hope yahoo 360′s timestamping is reliable enough to help me provide proof against that in the future.

Photosynth can be found here http://labs.live.com/photosynth/ as a technology Preview.

February 20, 2007

Microsoft Virtual Labs India

Filed under: Uncategorized — Tags: — archisgore @ 9:37 am

Most of you who’ve wanted to try out Microsoft products but didn’t want to install them or didn’t get access to them so far, can check out the cool new Microsoft Virtual Labs. Virtual Labs are a sort of a remote desktop shell-interface into machines within the Microsoft network.

You can run and see a wide variety of applications and test out all your cool ideas or crazy theories on them. You can see if ASP.Net is really worth the hype that’s created around it, or whether it’s just that – pure hype. You can use VS.Net Team Suite. You can how-to’s and actually do them online.

All in all, a totally awesome project and a nice way to allow users to test Microsoft software.

The speed is a bit of a problem – even from within MS IDC where I tested it, it’s quite slow. So don’t attemtp this unless you’ve got broadband.

February 17, 2007

Writing a Managed IE Plugin

Filed under: Uncategorized — Tags: — archisgore @ 9:06 am

Alright, I admit this page formatting looks a bit dorky, but there really isn’t much I can say because it was formatted using the latest brand new Office 2007. Unfortunately, Yahoo 360 doesn’t support the most excellent Windows Live Writer for blogging due to which such mishaps occur. Live Writer has the ability to download your blog’s default CSS and allow you to compose entries just the way you’d see them.

Anyways, the article below has been shortened due to Yahoo’s limits on my blog length. So I had to cut out some code samples that were included inline in the article, so please bear with any broken sentences or paragraphs that make no apparent sense in context. Blame yahoo for everything!

Anyways, the entire Visual Studio Solution used to write this article is provided here on my homepage: http://www.geocities.com/archisgore/projects/bin/SamplePlugin.zip

Just download it and hopefully you should be writing your plugins within a few hours. I’ve provided most of the skeleton code you’d need, so you won’t have to spend time on COM interoperability and stuff.

Motivation and Audience:

I was working with IE7 recently, and saw that the IE7 homepage is encouraging developers to contribute plug-ins for IE to make it cooler. I also found a bunch of people who wanted to write IE plugins but didn’t know how. Moreover, all information available on writing an IE plugin is available for COM-aware people. For someone who’s been a Java/C guy all his life, I realized that the documentation on writing an Internet Explorer plugin was very limited – and since there was quite a demand for a working skeleton code, in interests of self-popularization, I decided to write this (while also expecting a smartphone from Microsoft). Took me a week of sleepless nights to get it working, but once you know how to do it, it’s actually one of the simplest things to be done (if you don’t care about why and how it works – so long as it works, I’m happy). In fact, after this experience, I plan to write quite a bit of plugins for IE in the near future. The actual problem is only on getting the skeleton code running and getting it compiled and registered. Once this is done, the further functioning is really simple.

I’m writing this article keeping in mind IE7 running on Vista, so many steps regarding running stuff as “administrator” may not make sense to you unless you’re running the super-secure Vista.

Almost all of my code is stolen from various sources which I’ve listed at the end of this article so there’s no originality or any sort of breakthrough contribution of mine here. All I’ve done is merge together code from different people who’ve solved different parts of the overall problem and packaged it in one piece. The toolbar example is based on the famous BandObject example from www.codeproject.com. I suggest you first read that article before you read this one. This article is simply a mashup of that original article with modifications based on some code and replies on the talk-back forums.

However, at the end of the day, I feel that most of you want to simply get some skeleton code and begin contributing plugins to IE, so this article should ideally help you do that.

Plugin Basics:

Internet Explorer has plugins known as Browser Helper Objects. Actually, there are many more types of plugins like Custom Download Managers and stuff, but we’ll just focus on BHO’s since they’re what most people would be looking for. Besides, although many people differentiate between a toolbar and a BHO, I personally feel that a toolbar implemented as a BHO is easier to deal with, and anyways, most of the times, you’ll actually be implementing a BHO even though you call it “just a toolbar”.

Also, I shall show you how to write a toolbar and a BHO separately and get them to communicate while execution.

Browser Helper Object:

A Browser Helper Object is literally any .Net class that is visible to COM (registered for COM Interop) and that implements the IObjectWithSite interface (I know the name of the interface sounds geeky – like most other things in COM). I shall also demonstrate some tricks which need to be implemented to ensure our stuff works with the new tabs in IE7. Finally, I’ve included sample code at the end which should hopefully compile smoothly and work out of the box.

I recommend you go through the reference articles listed at the bottom of this page before you actually implement anything.

Creating the Project:

Assuming you’re using VS 2005, this is what you’d do to create your project.

Download the BandObject project contributed by Pavel Zolnikov which is cited below. It should come in handy when you attempt to create a toolbar. For a pure BHO, this shouldn’t matter much.

Create a standard “Class Library” project under any of the Managed Code languages (take your pick out of anyone of them like C#, VB.Net, etc.)

Add a class called SampleBHO (or whatever you prefer)

Above this class definition, but within the namespace, reference the IObjectWithSite interface. In short, just insert the code below:

[ComVisible(true)]

[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]

[
Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")]

public interface IObjectWithSite

{

[PreserveSig]

int SetSite([MarshalAs(UnmanagedType.IUnknown)]object site);

[PreserveSig]

int GetSite(ref Guid guid, out IntPtr ppvSite);

}

And then make sure your class implements this interface. This can be done simply by first adding a ‘: IObjectWithSite’ in front of your class’s declaration but before it’s body. And then right-click on the interface name and you’ll get an option in the context-menu saying “Implement Interface”. Just click on the appropriate option to generate stubs for the interface’s methods.

Essentially, you should end up with a class that looks like this:

[ClassInterface(ClassInterfaceType.None)]

[ComVisible(true)]

[Guid("41DBDDF3-423B-4c61-93D5-1D19291CD655")]

[ProgIdAttribute("SamplePlugin.SampleBHO")]

public class SampleBHO : IObjectWithSite

{

Let’s walk through what each of these functions do:

The SetSite and GetSite functions were copied by me verbatim from other sample code, so I really am not the authority to explain what they do. Suffice it to say that after SetSite is executed, the webBrowser field of this class will be populated with a reference to the instance of the WebBrowser that this BHO is supposed to service.

The RegisterFunction and UnregisterFunction are also pretty standard things picked up from other articles. These functions simply register this class as a BHO at the right parts of the registry where IE will look for when it loads, and unregister this class when this assembly is uninstalled from the target machine, so that IE doesn’t keep loading it even if it doesn’t exist.

Creating the toolbar:

To create our toolbar, first add the BandObjectLib project to your current solution and reference it. A very important thing to remember is that a toolbar needs to be strong-name signed. This is particularly easy in VS 2005. Simply go to “Project->Properties” and you should find a “Signing” tab. On this tab, select the checkbox labeled “Sign the assembly”. And then either select “New” in the “Choose Strong Name file” option.

After this, create a class called “SampleToolbar” and inherit it from “ExplorerBarForm”

There’s one catch when adding references to this project. If you’ve referenced the “SHDocVw.dll” from the standard system directory, you’ll have to delete it. Instead when adding the reference, manually browse, and go to the “bin/Debug” folder of BandObjectLib and select the “Interop.SHDocVw.dll” file located there. This is necessary since SHDocVw.dll is a COM library which doesn’t come with it’s own Strong name signing. Hence, whenever VS finds such an assembly, it strong-name sign’s it’s interop wrapper that is generated. The catch is that if you reference it from two projects, viz. “BandObjectLib”, and “SamplePlugin” then you end up with two wrappers each with it’s different Strong-name signing. So you’ve gotta reference either one of the wrappers from both the projects to make sure your code will compile.

Here again, the class should now look something like this:

[Guid("0D34AA37-F614-424c-A996-CC0CB78D8143")]

[ClassInterface(ClassInterfaceType.None)]

[ProgIdAttribute("SamplePlugin.SampleToolbar")]

[BandObject("Sample Toolbar", BandObjectStyle.Horizontal | BandObjectStyle.ExplorerToolbar, HelpText = "Brings the internet experience to life!")]

public class SampleToolbar : ExplorerBarForm

{

If you notice, this class doesn’t have all the complex GetSite and SetSite stuff, since the BandObjectLib does that for us already.

Hopefully, with any luck, both the above classes should compile with relative ease (apart from some trouble you might have with adding the appropriate references, but I’ve given the project zipped along with this article to help you avoid that to some extent).

Getting colors right:

Now to make the background of the BandObject Transparent so that it sort of inherits IE’s default color scheme (though this isn’t the recommended way of doing things, it was the only way I could find out at such short notice). This one was again contributed by a forum member on the codeproject forums.

To do this, simply make the ExplorerBar object’s background color Transparent, and add the following code the ExplorerBar:

[DllImport("uxtheme", ExactSpelling = true)]

public extern static Int32 DrawThemeParentBackground(IntPtr hWnd, IntPtr hdc, ref Rectangle pRect);

protected override void OnPaint(PaintEventArgs e)

{

if (this.BackColor == Color.Transparent) {

IntPtr hdc = e.Graphics.GetHdc();

Rectangle rec = new Rectangle(e.ClipRectangle.Left, e.ClipRectangle.Top, e.ClipRectangle.Width, e.ClipRectangle.Height);

DrawThemeParentBackground(this.Handle, hdc, ref rec);

e.Graphics.ReleaseHdc(hdc);

} else base.OnPaint(e);

}

Though in my own implementation, I have commented the condition of transparency, so I draw my toolbar transparently regardless of what the setting is. This is done because I generally don’t care for a lot of extensibility, but you should be careful of it in case you want to make sure your users can change these settings once the code has been deployed.

Handling DOM events:

Finally, one quirk of handling events of the DOM objects within the document is that once you’ve registered handlers for them, they won’t respond to keyboard events or mouse clicks. The solution for this is very simple. Add the following code to your namespace (I prefer adding it in a separate file to remember where it came from).

// The delegate:

public delegate void DHTMLEvent(IHTMLEventObj e);

///

/// Generic Event handler for HTML DOM objects.

/// Handles a basic event object which receives an IHTMLEventObj which

/// applies to all document events raised.

///

[ComVisible(true)]

public class DHTMLEventHandler

{

public DHTMLEvent Handler;

HTMLDocument Document;

public DHTMLEventHandler(mshtml.HTMLDocument doc)

{

this.Document = doc;

}

[DispId(0)]

public void Call()

{

Handler(Docu
ment.parentWindow.@event);

}

}

And then instead of doing:

HTMLWindowEvents_Event temp = (HTMLWindowEvents_Event)document.parentWindow.onresize;

temp.onresize+=new HTMLWindowEvents_onresizeEventHandler(d_onresize);

You should add a handler like this:

DHTMLEventHandler Handler = new DHTMLEventHandler(doc);

Handler.Handler += new DHTMLEvent(DocumentWindow_onresize);

document.parentWindow.onresize = Handler;

And it should work just fine.

Connecting the Toolbar and BHO:

This is something that puzzled me quite a while and then I realized what an elegantly simple solution there was staring me in the face.

The IWebBrowser2 interface has GetProperty and PutProperty methods which allow you to submit objects to the WebBrowser’s PropertyBag alongwith a string tag to identify them.

When either, the toolbar or BHO’s SetSite method is called, we simply need to put the current instance ‘this’ of the respective object in the webbrowser’s PropertyBag.

Then all you have to do is to track the PropertyChanged event of the browser in both the Toolbar and BHO. Then you simply detect if that property was either that of the toolbar or the BHO. It’s obvious both objects won’t be loaded simultaneously. One object will follow the other. Whichever object got loaded first, can detect the second one’s PutProperty invocation through PropertyChanged, and can get the other’s reference.

Once we have the reference, we simply implement a setBHO method in the Toolbar and a setToolbar in the BHO. This way, the first object that got the reference, can pass on it’s own instance reference to the second object. We detect if the receiving object already had a reference to avoid a circular loop.

The property change events in the above code samples demonstrate how this is achieved.

Changes for IE7:

The following changes were applied by me to enable IE7’s tabs to be handled appropriately. If you notice, we capture an event webBrowser.WindowStateChanged which is fired every time the window state of the browser changes. This event is fired when a user toggles through tabs. We particularly care about this because a separate instance of your BHO will be loaded for each and every tab in IE7. Hence, if the tab which we’re supposed to service is hidden, we have to disable our services, lest they should interfere with completely irrelevant operations the user may be performing in another tab.

Other Minor changes:

I suggest you use the BandObjectLib implementation provided by me below since I’ve incorporated quite a few suggestions and recommendations based on mailing-list replies to certain problems in the original. They’re mostly minor tweaks that make the Toolbar movable and draggable across the Toolband in IE.

The dwModeFlags of the DESKBANDINFO structure in the original are incorrect, and based on some replies on the forums (I sincerely hate myself for having lost the link – sorry about not being able to give credit to the guy who figured this out), I’ve modified them and it’s working perfectly.

Also remember to use VS 2005 with SP1 for Vista, if you’re running on Vista, and while running VS, always run it as Administrator (if you’ve installed SP1, it will prompt you with this message every time you invoke VS).

Ending notes:

That ends my mashup of how to write a BHO/Toolbar for IE7 and handle all the quirks associated with it. Hopefully all your problems should have been solved with this article. As always, feedback, suggestions, and criticism will be appreciated.

I’m sorry for not being able to credit all the people whose contributions went into this article, but I hope that most of your common problems will not be solved through this one article instead of having to hunt on the net as I had to. And feel free to edit/modify the code provided.

Finally, you’ll need to register these assemblies that you create. For each DLL, you’ll need to call “regasm” from a command-prompt opened in Administrator mode, or ask VS to register it.

Also, for assemblies containing a Toolbar, they need to be registered in the Global Assembly Cache (hence the strong-name signing we had to do). For this, use gacutil, whose use is well documented on MSDN. The simplest invocation is ‘gacutil /if ’

Sometimes, you’ll need to close all instances of iexplorer.exe (IE) restart the “explorer.exe” shell process too in order to ensure that the DLL’s are not in use if you get errors while compiling or registering them.

Once this skeleton is done, you can deal with managed code most of the time, unless you need to interface with obscure parts of the platform. In general, all your managed UI objects from WinForms should work just fine with a BHO.

Read the following articles for reference:

1. Read the BHO articles:

a. http://www.15seconds.com/issue/040331.htm

b. http://simonguest.com/blogs/smguest/archive/2006/11/19/Building-Browser-Helper-Objects-using-Managed-Code.aspx

c. http://weblogs.asp.net/stevencohn/articles/60948.aspx

2. This article shows the same thing through unmanaged code: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/IETechCol/cols/dnexpie/expie_hello_bho.asp

3. Read the BandObject article: http://www.codeproject.com/csharp/dotnetbandobjects.asp

4. If you face any problems while following this procedure, here’s an excellent place where you might find answers already, or would get an answer real fast: http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=924&SiteID=1

I walked through the ladies’ hostel gate!

Filed under: Uncategorized — Tags: — archisgore @ 6:01 am

This happened about a month ago, but I forgot to brag about it – which I should have.

I’m not claiming that anything particular will result out of this, so don’t get your hopes up. But I’m possibly one of the very rare guys at Fergusson who’ve gone through the ladies’ hostel gate – to and fro. Even non-hostelite girls are not allowed through that gate.

It’s just the challenge of doing it which is fun. So don’t try to read between the lines. (not that I would care if you did )

February 11, 2007

The Zune Zucked!

Filed under: Uncategorized — Tags: — archisgore @ 3:07 pm

It’s official! The Zune was a complete flop. It totally sucked, I’m told – from all the news articles I’ve been reading. Still waiting for a few friends to give me first-hand reviews, which seems unlikely as they’d be totally stupid to buy one.

Well, the Zune did have some issues such as:

1. It needed critical mass to actually work – how the hell would you share songs with your neighbours unless they had a Zune? I guess Microsoft was banking on the fact that people would buy so many Zunes before they realised that they all had one and music-sharing was now the big thing that the iPod guys couldn’t do. This move backfired in the sense that nobody was ready to buy a Zune unless the other guy they knew was sure to buy one.

2. The iPod DRM doesn’t work with Zune. This is a no-brainer. There were some rumors on Wikipedia that Microsoft would provide a replacement for each iTunes song through the Zune’s DRM format for free. Doesn’t seem like this move went across.

3. The iPod was more popular for being an ‘iPod’ rather than an MP3 player. Come on, be frank. How many of you iPod owners actually bought the iPod as a utility music-player probably something you could get for a lot lower price on ebay from a competitor? And how many of you bought it so you could show it around amongst friends? The Zune looked like a brick and just didn’t have enough “Jazz” (or as I like to call it “Jhang-Pang”) to make it the ultimate loser’s tool to pick up chicks at college! (I know people who have phones with MP3 players that they actually use for playing songs, and own an iPod to pick up chicks). With the kind of hell I have to go through every time some UI people review my software, I’d have expected something a lot more impressive.

4. Everyone had too many expectations from the Zune. Let’s be honest. If it had been the common man’s commodity music player with cool features, I’d have bought one. I just bought a bunch of 1 gig mp3 players for approx Rs. 1000 on ebay, and can afford to throw one every year and buy a new one, which is why I don’t buy a Rs. 10,000 iPod which I know will get outdated in an year anyway. Everyone loves a commodity low-cost full-featured music player. The Zune was projected to be an “iPod killer”. Now when you make such a claim, people expect something very direct and intense. The Zune turned out to be “just another pretty good iPod, maybe a bit better”.

I don’t think we’ve heard the last of the Zune though. Remember Microsoft’s 3rd version success? Microsoft gets the third version right. Let’s hope this is the case with the Zune too. The company certainly has the money to invest and take a beating for a couple of times. What really worries me most is that it’s doing the same thing on too many fronts. Just at IDC, I’ve got so many friends working on so many different things, it’s mind-boggling. Not sure if Microsoft can afford multiple hits in multiple areas simultaneously. But so long as the Windows+Office powerbase is intact, Microsoft has nothing much to worry about.

Personally, it’s fun to work here. When everyone in the world is your enemy, there’s a different thrill to what you do. If we were just working on Windows+Office, I don’t think our sales would have decreased, and we’d also not have all those over-zealous Linux guys working as hard as they are just to kick Microsoft’s ass. But this tendency to take over the world on every technology front – right down to a computer keyboard, makes Microsoft too big a target for too many people. This should be a good battle to watch. Especially from the inside. Literally everyone I can think of is hating us at this moment – Google, Symantec, Yahoo, Linux, OpenOffice, Sun, Apple, Sony, and the list goes on…….

Linux pays a LOT more than Microsoft – got proof!

Filed under: Uncategorized — Tags: — archisgore @ 2:40 pm

Now this is something Pune’s FOSS community can use as a case study. While visiting a friend in Delhi, I got into a conversation regarding the how difficult installing Linux is. The very perceived fear created by these so-called FOSS-guru’s is to blame. Even today, people whom I call my friends have a tendency to make Linux sound difficult and complicated, just so they can get an ego-kick out of showing how intelligent they are. This fear can allow you to make a lot more money than Microsoft, if used wisely – as I learnt the hard way. As it happens, someone frightened my friend using hocus-pocus tactics that would put Microsoft’s marketting team to shame (which I am told is the best in the business), and managed to wriggle out Rs. 1500 for an installation of Fedora.

If you’ve been under the impression that open source doesn’t make money, and moreover, you’ve gotta actually be able to write code to make money from open-source, you’re seriously a HUGE loser (as I am regretfully realising now). After having given talks on how I make money at Microsoft and spent futile hours actually developing for open source without getting a single dime, this case study has opened my eyes. If only I had not insisted on development and innovation, and rather focussed my energies on 60-minute installs, I’d be a rich and happy man today.

After putting in loads of hard work and racking my brains day and night and figuring out solutions to some mighty tricky problems, my average daily pay at Microsoft comes out to be lower than Rs. 1500. If one gets Rs. 1500 for a relatively automated process of 60 minutes and a few clicks here and there, then the whole purpose of all those “business model” talks LinuxAsia and FOSS.in and the IITB Techfest is defeated. I don’t think there’s anything left to be convince about.

Point conceded!

February 6, 2007

Microsoft\’s response to orkut: Wallop

Filed under: Uncategorized — Tags: — @ 4:02 pm
src=\”http://archisgore.files.wordpress.com/2009/06/1170806553-hr-911.jpg\”

Hey all, I hadn\’t planned on blogging so soon before I had saturated out my previous entry which is one of my controversial ones. I suggest you do take the time to read the previous one if you\’ve not already. Anyways, my blog is averaging on 100 hits per day and last week I managed a whooping 800 hits even while I was travelling and wasn\’t able to connect in an entire week (the number of mails I simply deleted without reading was mind-boggling). So do keep the hits coming…….

Anyways, as you are already aware, we at Microsoft mostly spend our time on orkut and complaining to our boss how bad the situation is on campus with absolutely no girls around. So during one of our periods of extreme hard work, Mohamed Reza, the friend of mine from the evangelists\’ team shows up. He told us about Wallop.

Most of you are really frustrated and angry at me that I cannot tell you what kind of stuff Microsoft research actually does – 90% because I don\’t know shit about what they do, and 10% because I\’m not allowed to. But this is something I\’d proudly say. Wallop is one of the best examples for the outsiders to see what stuff MSR comes up with. And being one who frequently defies Microsoft by proclaiming how great competitor products are compared to some of our own, I am being exceptionally fair when I say this, \”Wallop kicks orkut ass.\” For those of you who\’ve been thinking of what kind of \”innovative\” GUI\’s Microsoft works on, should get your sights on this thing. MyWallop is just a prototype and Wallop is supposed to be even better. I currently am in the process of getting invited to wallop.com, and till then I\’m using mywallop which itself is awesome. Before you begin commenting on how Microsoft arrived late, wallop has been in development for four years.

To check out the cool thingy, just visit www.mywallop.com and send a mail to the address listed at the bottom to get yourself invited. Right now, I\’ve run out of invites. But it totally rocks! The UI is awesome! And with a touch screen, it could be even more amazing. Just check it out. You\’re gonna be blown out of your seats!

To join the final Beta for Wallop, just visit www.wallop.com and fill up the invitation form. Invitation is very exclusive. But it also provides a better control over who can view what – all those apprehensions girls have of their pictures being misused can (hopefully) be laid to rest.

And don\’t forget to comment on what you think about it.

Microsoft\’s response to orkut: Wallop

Filed under: Uncategorized — Tags: — archisgore @ 4:02 pm
src=\”http://archisgore.files.wordpress.com/2009/06/1170806553-hr-91.jpg\”

Hey all, I hadn\’t planned on blogging so soon before I had saturated out my previous entry which is one of my controversial ones. I suggest you do take the time to read the previous one if you\’ve not already. Anyways, my blog is averaging on 100 hits per day and last week I managed a whooping 800 hits even while I was travelling and wasn\’t able to connect in an entire week (the number of mails I simply deleted without reading was mind-boggling). So do keep the hits coming…….

Anyways, as you are already aware, we at Microsoft mostly spend our time on orkut and complaining to our boss how bad the situation is on campus with absolutely no girls around. So during one of our periods of extreme hard work, Mohamed Reza, the friend of mine from the evangelists\’ team shows up. He told us about Wallop.

Most of you are really frustrated and angry at me that I cannot tell you what kind of stuff Microsoft research actually does – 90% because I don\’t know shit about what they do, and 10% because I\’m not allowed to. But this is something I\’d proudly say. Wallop is one of the best examples for the outsiders to see what stuff MSR comes up with. And being one who frequently defies Microsoft by proclaiming how great competitor products are compared to some of our own, I am being exceptionally fair when I say this, \”Wallop kicks orkut ass.\” For those of you who\’ve been thinking of what kind of \”innovative\” GUI\’s Microsoft works on, should get your sights on this thing. MyWallop is just a prototype and Wallop is supposed to be even better. I currently am in the process of getting invited to wallop.com, and till then I\’m using mywallop which itself is awesome. Before you begin commenting on how Microsoft arrived late, wallop has been in development for four years.

To check out the cool thingy, just visit www.mywallop.com and send a mail to the address listed at the bottom to get yourself invited. Right now, I\’ve run out of invites. But it totally rocks! The UI is awesome! And with a touch screen, it could be even more amazing. Just check it out. You\’re gonna be blown out of your seats!

To join the final Beta for Wallop, just visit www.wallop.com and fill up the invitation form. Invitation is very exclusive. But it also provides a better control over who can view what – all those apprehensions girls have of their pictures being misused can (hopefully) be laid to rest.

And don\’t forget to comment on what you think about it.

February 4, 2007

What really qualifies as “Open Source”?

Filed under: Uncategorized — Tags: — archisgore @ 1:20 am

As you all know, I was at LinuxAsia this week for a couple of days. The event was quite boring compared to last year, and it seems many people did not show up because Microsoft was one of the sponsors. Reminded me of Bernard Shaw’s “Major Barbara”. It’s interesting how people give the “I give you an apple….” analogy of Bernard Shaw but fail to read _all_ his stuff before making comments. Well, it’s a free country and they’re free to do what they want. As always, I am a supporter for freedom of Humans before I start a campaign for freedom of software.

During discussions of why Linux fails, it was very frustrating to see people comment of literally everything right from astrology to luck, but not once did they address issues that I raised – technical issues. Not one person is ready to accept that a few lines of programming could make Linux the majority OS in the world. I guess the reason it’s still on only 10% machines in the world is simply because of this attitude to not listen to anyone who doesn’t first prove he knows a million vi commands. Then we have the sour-grapes syndrome where they claim it’s not about success. Well, if it’s not about success, then why be abusive to Windows users? :-D You be unsuccessful and be satisfied and let Windows users be.

I thought I’d blog about my own interpretations and if anyone really cares about success maybe they could incorporate some of my suggesstions. The good thing about working at Microsoft is that I can say whatever I want so long as I don’t disclose any of my work.

First, let us define “Source”. Windows source code is all available as binary code, and with a disassembler, one could get assembly language code easily. Then is it “open source”. Lets forget the license for now. Suppose I could get Microsoft to sign an agreement that would allow anyone who buys Windows to modify it and redistribute it? (Again, people tend to not have scientific thinking ability so I won’t press the point. This is a hypothetical assumption. If you cannot understand the math behind predicate logic, you’d better learn it before you learn complex vi-crap, since that would help you a lot more).

In the above case, freeware would also be open source, since the code is all there – it would only be assembly-language code. And whoever is able to understand assembly would be the hotshot. However, you claim that “Source Code” is a representation that others should understand. Now comes the subjectivity of who these “others” are, and what they are able to “understand”. I’ll tackle your comments about “Source Code” being the original code before it is compiled and hence ‘C’ code comforms to Source Code, and if someone actually writes a kernel in assembly, then assembly code would also be called Open Source.

You see, our brain is a compiler also. When you look at a configuration file, we process it in terms of _effects_ of a state of the config file would have on the software it represents. Hence, we compile these rules in our brain and only give out the “object code” which is the complex configuration file found in /etc/ But if we do not allow others to understand this original abstract source code, it is _NOT_ Open Source.

And that’s where the problem begins. Many people give out Source Code that’s just about as simple they can understand and modify themselves but not others, but they don’t define anything that’s more complicated then their ability to understand it as “Open Source”. This is to a large extent hypocricy, and the common man understands if very well, but is not able to verbalise it clearly. That is the precise reason people don’t accept Linux but are unable to give concrete reasons in technical terms. I would like comments from those who’ve rejected Linux as being “overly complicated” on whether my analysis is correct, so I may learn from it.

Abstractions are the power of computer science. A true computer scientist doesn’t care about making software that works but more about making software that others should be able to get to work really fast. We wrote assembly code 20 years ago. Then we created C when assembly code grew to thousands of lines. Now that C code has grown to hundreds of lines, it’s time to think of “Source Code” as more than C. We need to think in terms of APIs. APIs are the new language of higher abstraction that allow us to use other pieces of code easily and atomically. They reduce redundancy, and encourage a clean, componentized programming model.

I know for a fact that many Linux-freaks hate me for my constant comments that vi-not-make-one-great, and that unless a newbie understands source code, we have failed. Just look at the local Linux events. In 2002, we had “Install Fest”s, in 2003, the same. 2004, 2005, 2006, 2007…… and we still teach people how to install Linux. Why the hell doesn’t someone write a goddamn installer? (Before you comment why don’t I do it myself, I’ll tell you that I _am_ doing it myself as we speak ;) ) I really got frustrated with this stuff after a while and these days don’t visit a single event where so-called geeks teach how to install Linux. A geek should be spending his time on making easier installers.

As a programmer, I consider it a personal insult if people keep on teaching how to install my software for a whole decade. And before I go around giving out my knowledge of how I can use vi and understand all conf files in /etc, I’d rather make an installer and solve the problem. That’s what real programmers do.

Now what really is open? Something that others can add value to. Now the number of people that you can include in this “others” set is what defines the success of software. It’s not luck, it’s not astrology, and it’s definately not an insatiable urge to simply make Microsoft rich (such arguments may be acceptable in the 10% circle that use Linux, but the world simply doesn’t care about making Microsoft rich, they want software that they can add value to). Look at every software success in history, and also every failure.

Windows: With tools like VB and ease of deployment by “Tools->Package->self-installing EXE”, you could make programs that did useful stuff and be assured they’d work on all friends machines so long as they used Windows.

Wiki: Anyone can add value to it without knowing vi and C and conf files and makefiles.

Eclipse: Anyone can write a plugin and send it across to hundreds of people and be assured it works. You don’t need “distributions” of eclipse to get a certain feature. You can mix and match.

Firefox: Hundreds of people can write plugins due to a clean and stable API and hence can add their own value.

Java/.Net: Again, a clean, stable API, that provides access to the same stuff regardless of implementation details. You can use and reuse components with the click of a mouse, literally!

In short, if you give source code which others can connect to through a clean abstracted API, an API that does not depend on implementation, then you allow others to add value to it. If someone wants to see the C code and improve it, they _can_ do it, but are not _forced_ to do it. This is real freedom. Freedom to learn, but not a compulsion.

The main problem with Linux, is incompatibility of distros. Softpanorama.org calls it the “same but multiple OS syndrome”. I had asked a question on a mailing list regarding Tamil Nadu’s use of FOSS. Assuming they’re Distro X, and developing custom governance software on it, how easy would it be to port this software to Distro Y, if Distro X increases their rates for providing support? How different is it from any other kind of proprietary lock-in?

Adding value also means being able to change its behaviour. While GUI’s may be a bad word for non-computer-science people, in computer science, if you can come up with an abstract language to do something that could only be done with a low-level language before, then you’re eligible for the Turing prize. Computer scientists take pride in being able to define elegant abstractions. Blaming Windows for having a GUI may be great when showing
off in front of newbies, but you also imply to the intelligent people that Microsoft has some great computer scientists who can abstract software elegantly. Being able to change software’s behaviour without knowing C or vi or /etc is a big achievement. That’s what Java did, that’s what Windows did, that’s what Firefox did, and that’s what Eclipse did. And all of them are deadly successful. Even today, I’d much rather use Eclipse than Visual Studio if I were doing something on my own. The reason is that I use Eclipse to write stuff that I use to brag and show-off with. I don’t use my ability to use Eclipse itself as a means to show-off and brag about.

The real problem with Linux is in the mediocre people in between. The super-elite are totally unthreatened. Torvalds, Stallman, Knopper, Shuttleworth, Behlendorf, etc. _want_ software to be simple. They show off by doing great software, and solving people’s problems _through_ software. The mediocres solve people’s problems _with_ software (as in, the problems they have with their software). Hence, they depend heavily on its being inaccessible, incompatible, non-standardised and problematic. That’s when they come to the rescue and become heroes.

This blog is meant for both the bigshots and newbies. For the bigshots, I appeal you to make it clear to newbies that complexity is a failure of the developer and nothing to be proud of but rather something to be ashamed of. So if anyone goes to them telling them why something’s great because it’s complex, then by the very definition of optimality in computer science, it’s a total failure. For the newbies, I’m telling you not to fall prey to these hotshots. They don’t represent Open Source, and they don’t represent any kind of openness whatsoever. Software should allow you to learn, but if you find yourself being forced to learn, they’re not only unethical, they’re positively lying to you and taking advantage of you. Give no respect whatsoever to such people.

If you hear comments like, “You can’t use Open Source unless you learn C, or vi, or /etc, or automake/autoconf”, then purge such people from your circle. They are the real people who attempt a “lock-in”. If they don’t provide clean, standard and structured APIs, then they not only attempt lock-in but they’re also very utterly bad programmers and should go back to school and learn programming and software engineering. They’re NOT smart. They’re NOT intelligent. Don’t encourage them by arguing or opposing them or attempting to tell them why software should be easy. These guys are attention-starved and would like nothing better than to get into an argument with you about why software should not be easy. Simply ignore them and find someone who makes people’s lives easier and more productive through software. He may not be always open source, but at least he’s a computer scientist.

I shall present my own opinion on what makes Microsoft popular. It’s in the very closed-sourceness of its products. If you’ve watched the movie, “The Incredibles”, you will find the main villain commenting, “I want to make gadgets to give superpowers to all kids in the world. It will make everybody special. And when everybody’s special, nobody is.” You may have an IQ of 80 or an IQ of 200. You can’t mess with Microsoft products and you can’t brag about it. Microsoft levels the playing field for everyone. By giving development tools like VB, it makes sure that the real algorist or the real mathematician can write code and give compelling solutions to the world. Those who depend on complexity, have no power on Windows. Windows makes everybody special. And hence nobody is. That’s why some people emotionally hate Microsoft so much. Be wary of such people. Stallman repeatedly keeps saying that he’s not opposing Microsoft but promoting open source. In fact, his very beginning is to make software open so that everybody remains special. It’s a pity that unfortunately only some people are “special” today.

This is a true open source promoter with a suggesstion for everyone, when you write software, make sure everybody is a superhero on it. If you don’t then either you’re not a good programmer in which case stop bragging about how great open source programs asymtotically are, or you’re deliberately attempting a lockin under the guise of philosophy, which is a million times worse than attempting a lockin for the very open fact of making money as others clearly state.

Blog at WordPress.com.