Goodbye!
21/2/2007 external link
After 4½ wonderful years here at Microsoft, I have decided it is time for a change, and am going to pursue my career outside the company.
This was a tough decision, since Microsoft is a great company to work for and I have learnt a lot here, had great fun, and best of all, worked with so many smart and passionate people and made so many friends. However, change is a part of life, and after careful evaluation of the pros and cons of leaving, I have decided this shift is the right move for me.
Unfortunately, this means I will be discontinuing this blog on MSDN. I haven't been blogging much recently, but I have enjoyed writing the last 3 years about topics ranging from the .NET Framework and Visual Studio, to Live Search. I will now be taking a break from blogging for a while, but may some day pop up again elsewhere to rejoin the blogosphere.
Till then, thanks for reading and all the encouragement and comments. Good luck and good bye!
LinkFromDomain and tips for authoring Macros
18/10/2006 external link
Andy Edmonds has an excellent post up on the Live Search blog about the new LinkFromDomain operator offered by Live Search, and how you can use it and other search operators to craft interesting and useful Search Macros.
As Andy explains, the LinkFromDomain operator lets you find all the sites that a particular site links to (outgoing links). Conversely, the LinkDomain operator can be used to find all sites that link to a given domain (incoming links). While it is fun to play with these, what's really cool about them, as Andy points out in this post on his blog, is that you can combine them in interesting ways and save them away as Search Macros, in essence creating your own little search engine that you can bookmark and share with others.
For example, here is a macro I just created to search the community around Om Malik's blog: http://search.live.com/macros/rvp/gigaom. Its definition is simply:
linkdomain:gigaom.com | linkfromdomain:gigaom.com | site:gigaom.com
Simple, yet powerful!
Search Macros V2 is Live!
16/9/2006 external link
As some of you must have noticed, the new Live Search shipped a couple of weeks back, and last week, became the service that replaces what used to be MSN Search as well. The new service offers a bunch of improvements and new features over both MSN Search and the earlier beta search experience on Live.com. Read this post on the Live Search blog for a summary of what's new.
I specifically want to highlight one of the features in Live Search - Search Macros. If you haven't heard about search macros before, please read my earlier post on the topic, but essentially, it is a way you, as a user, can create your own custom search engine and share it with other users.
In the earlier incarnation of search on Live.com, we offered a beta version of Search Macros that offered a basic experience to create, share and use macros. In the new Live Search, however, you will notice a whole new, vastly improved user experience for this feature. Here are some of the highlights:
1) First of all, there is an easy to remember start page where you can go to get, um, started. You can also get to this from the Live Search results pages by clicking 'More' on the scope bar and selecting 'Edit Macros'.
2) You can now play with the feature and try to create some macros without first having to sign in (you need to sign in only when you are ready to save the macro). The new, wizard like experience to create macros is also very simple and quick to use.
3) You will notice there are now two modes for creating macros - a basic one and an advanced one. The basic one lets you quickly put together a list of sites that should be part of your macro. If your macro is a simple site filter, the basic experience is for you. If, on the other hand, you want to do more powerful customization and use our advanced search operators, you can use the advanced mode. The advanced mode lets you choose from a list of operators, and has a brief description and example for each one to help you get started with using it.
4) One of the cool new features is the 'Test Search' you will notice at the bottom of the page where you define your macro. This lets you quickly compare results from your macro to regular Live Search to test how your macro performs. You can then iteratively edit the macro definition till you like the results.
5) To save your macro, you need to sign in with a Windows Live ID (Passport) account. When you sign in, you will notice a clean new experience to manage your macros and Creator IDs (or namespaces). A Creator ID is something that associates the macro with you, and you can create multiple of these per passport account. For example, my ID is 'rvp', which stands for my full name.
6) Arguably the coolest new feature is the macro home page. For each macro you create, there is a customizable home page that you can bookmark and point friends and other folks to, to use your search engine. What's more, the home page has an easy to remember URL, based on the name of the macro and the Creator ID associated with it. For example, I wrote a macro suited to developers working on the Microsoft platform to search for documentation, samples etc. Its called 'mscoding' and the url is simply:
http://search.live.com/macros/rvp/mscoding
Simple, easy to remember and small!
7) You can find macros that people have chosen to share at the Windows Live Gallery site. Here you can browse through macros by their tags or search for them directly in the search box. You can also find details of the macro, like its definition and description. Adding your own macro here is also easy, and the creation wizard I mentioned earlier will offer you an opportunity to do so.
8) You can find links to the creation page and the gallery from the Live Search results page under the 'More' scope. Also, when you use a macro (or other scope like Video), it will automatically show up in your scope bar, so you can use it again easily next time. That portion of the scope bar is a dynamic, 'most recently used' scopes list, so it will automatically feature the scopes/macros you use most often.
So try the feature out and let us know what you think! Your feedback will be very useful for future iterations of Search Macros, as we continually improve and incorporate new ideas!
Update: Zachary has posted a nice description of the macros v2 release on the Live Search team blog.
Mike Harsh talks about WPF/E on Channel 9
19/5/2006 external link
If you were at MIX'06 or the last PDC, you have probably heard of WPF/E (or WPF/Everywhere), which is a technology to support rendering a subset of XAML cross-platform and cross-browser. Well, here's your chance to find out more about it - Mike Harsh gives a great overview and then walks through some sample code in this Channel 9 video. BTW, his blog also has a great deal more content related to WPF/E.
Mike, like Joe Stegman and Mark Rideout (also PMs on the WPF/E team), used to work on .Net Client (my previous team) and Mike's office was right opposite mine. I have worked with these guys quite a bit during the VS 2005/ .NET 2.0 product cycle, and I can confidently say WPF/E is in good hands :-)
Mike, good to see you have a window office now!
MIX06 sessions available online
12/5/2006 external link
In case you missed this announcement - videos of all the MIX06 sessions, including Bill Gates' keynote, have been made available online. If you missed the conference, you may find it interesting to view a few of the sessions. Specifically, here is a link to Mez's breakout session on one of my favorite Windows Live Search features, Search Macros.
Busy week for Windows Live!
5/5/2006 external link
Wow, lots of Windows Live related news this week:
1) The live.com team released an update just a few hours ago. Great to see they have addressed some of the top complaints/feature requests! My own favorites are (1) when you issue a search from the toolbar or browser search box, you no longer have to wait for the live.com home page to load (that was annoying!), (2) individual gadgets can now be refreshed and (3) the weather gadget is now a much more reasonable size :-)
2) Microsoft adCenter was officially launched in the US.
3) Windows Live Shopping Beta was launched earlier in the week. You can also search for products through the 'Products' tab in Windows Live Search.
4) Amazon's a9 and Alexa switched to using Windows Live Search as the search provider!
Well, this is the just the beginning of what promises to be an interesting summer for Windows Live!
Visual Studio Express will be free permanently!
21/4/2006 external link
Great news - it was annouced a couple of days back that Visual Studio Express, originally offered free for one year, will now be free permanently!
Haven't heard of Express products before? Read this FAQ.
Not only are the Express products free, they are pretty lightweight and quick to install as well. They are awesome especially for hobbyist and student programmers who want to learn how to code or develop something quickly.
Per the FAQ, SQL Server 2005 Express will continue to be a free download as well.
Using Live.com as a Search Page
4/4/2006 external link
I have always felt there is a fundamental distinction between a 'search page' and a 'home page'. A search page should be very fast, have a prominent search box and no other content to distract me from doing my search. A home page, on the other hand, should have all the various pieces of content I want at a glance, like my stock quotes, weather, news feeds and blogs I like to read, and so on.
Now live.com, since its inception, has functioned as a great home page for me. I sure would like it to load faster (and I know the live.com team has performance as one of their top goals right now), but I am quite happy with the way I can personalize it to include the content that I want and the gadgets that I like. It is the page I visit to view all the information I need at a glance, atleast a couple times a day.
However, my pet gripe was that it didn't really function as a 'search page'. It isn't fast enough to load, and the last thing I want to see when I am just about to search for something is that one of my stocks just tanked. Seeing all that content is very distracting while performing a search, and sometimes one forgets what they were planning to look for!
Now, live.com has always had a 'switch' to turn it into a search page. It is the 'hide' link on the top right hand corner, below the 'sign in/sign out' link. If you click 'hide', all your content is hidden and all of a sudden you have a clean page with just a search box at the top. Perfect! However, there were a couple of problems with it - (1) it appeared to me (I may be wrong here) that all my feeds still loaded even when hidden and the search box didn't seem to be ready to type into till everything was loaded, and (2), the 'hide' setting didn't stick in an intuitive way.
Well, the good news is that this is fixed in the recent live.com update! Now there is a setting called 'always start with pages hidden' which is extremely handy if you want live.com to be a clean search page by default, and only view the gadgets/feeds by clicking the 'show' link. The page also loads very fast now in this mode, since gadgets/feeds no longer load up in the background.
I guess that fixes the search page versus home page issue. But you may find live.com as a home page too to be unacceptably slow to load. Well, as I mentioned earlier, the live.com team is hard at work to improve page load performance - it is their top goal right now. For now, though, you can use the option of having multiple pages to improve performance - for example, move the bulk of your slow loading feeds and gadgets to a secondary page, and keep only a few on the main page.
Anyway, turns out I haven't really felt the need to visit a 'search page' in a long time. All the major search services provide toolbars with search boxes that you can type your query into directly (you can try a beta version of the Windows Live Toolbar here). Browsers like Firefox and IE7 have search boxes by default. As these become more mainstream, the concept of a 'search page' may become irrelevant. Going forward, I think search will be perceived more as a service than a webpage.
Got any cool Search Macro ideas?
28/3/2006 external link
In last Friday's update to Windows Live Search, we released the ability to create and manage your own search macros. Now is your chance to create and show off your own personal search engine!
It is very simple to create a macro (you don't need to be a developer or even a computer geek!). When you do a search on live.com, you will see a 'scope bar' with links like Web, News and Images. Just click the drop down link on the scope bar to access macro functionality and get to the simple create and manage UI (you need to login to a passport account to create macros).
The first time you create a macro, you will need to choose a namespace. A namespace is just a short identifier (like a nickname) that is unique to you and is prepended to your macro names, so that you don't have to compete with everybody else for naming macros.
Once you have created a macro, you will be given an option to share it on Microsoft Gadgets, so other users can discover and use them.
Here are some of the macros I created over the weekend:
rvp.mscoding
rvp.finance
rvp.geeknews
(rvp is my namespace)
A quick search on Technorati suggests some people have already discovered the macro create functionality and started playing with it. Well, if you create any cool ones, do blog about it!
By the way, as part of Friday's update, you may notice that the scroll bar on the live.com web search results page has been changed to a more 'traditional' looking one, familiar to Windows users. Kudos to the UI team on promptly responding to user feedback on that!
Update: Zachary (Search PM) has added a blog entry about Search Macros on the official search team blog.
MIX '06 Day 1
21/3/2006 external link
Bill Gates kicked off the MIX 06 conference today in Las Vegas with his keynote. Some of the goodies announced today were a new build of IE7, the release of Atlas and a new Windows Live developer center.
Well, the conference has just started - look for more announcements and goodies later this week! There are quite a few interesting sessions. Here are a couple of search related ones:
NGW044 - Build Your Own Search Engine
Speaker(s): Jeff Barr (Amazon)
Focus(s): Business Decision Maker, Developer
Session Type(s): Breakout
Amazon subsidiary Alexa.com is leveling the search playing field. For the first time, developers looking to build the next "big thing" in search or an ultra custom search engine have access to the 300 terabytes of Alexa crawl data, along with the utilities to search, process, and publish their own custom subset of the data-all at a reasonable price. Developers no longer need a million dollar budget or to reinvent the wheel designing search algorithms, to be able to build their own search engines or create customized Web services based on data from the Alexa crawl. As a full-service Web analysis and Web service publication platform, the Alexa Web Search Platform should allow any user with an Internet connection to access Web content on a large scale and provide new services or applications to the online community. Jeff Barr provides an overview of the Alexa API and shows developers and designers how to get on the new, leveled search playing field.
NGW056 - Windows Live Search Macros – Build, Share, and Use Your Own Search Engine in Seconds!
Speaker(s): Ramez Naam
Focus(s): Developer
Session Type(s): Breakout
Windows Live Search includes the power of Search Macros - custom search engines that can be created in seconds and that can powerfully alter the search results. Learn how to create these custom search engines, how to use them with a single click from within Windows Live Search, how to share them with others, and how to integrate them with search boxes and search results on your site.
Who is linking to my website?
17/3/2006 external link
It turns out very few people are aware of advanced search operators provided by all the major search engines. Fewer still actually bother to use them.
However, in certain situations, they tend to be very handy.
If I want to find out who is linking to my blog, for example, I just have to use the link: operator. I can ofcourse search within this set of pages by adding search terms to the query.
If I want to see who all are linking to an entire domain, there is the linkdomain: operator.
Want to search the set of pages that provide RSS/Atom feeds? Use the hasfeed: operator.
Then there is ofcourse the site: operator, that lets you restrict a search to a specific site.
There are many more - see this page for a complete list of operators currently supported by MSN / Windows Live Search.
Ofcourse, many people are probably too lazy to type in an operator while searching for something. But sometimes, they help you get the result you are looking for faster, rather than repeating searches with various keyword combinations. There is also the macros feature I wrote about in my last post that lets you save away search modifiers for convenient reuse and sharing with friends.
Windows Live Search - Macros
10/3/2006 external link
The Windows Live Search Beta launch yesterday gives me an opportunity to write my first post on search, since moving to the search team back in November.
This release has many highlights, including a new UI featuring infinite scroll and a snazzy new image search. Speaking of image search, the Image Search Gadget is really cool - it lets you search for images from right within your live.com homepage. (To try it out, just navigate to 'add stuff' -> Windows Live -> Image Search -> 'add' from the live.com homepage.) The reviews on the new UI seem to be mixed - a lot of people liked it in general, but had some issues with the performance, unusual scroll bar behavior etc. Well, I know the UI team is eager to hear your feedback, so if you have any, leave a comment here and I will pass it on. You can also leave your feedback on the team blog.
But the feature I wanted to write about today is something called Search Macros. Macros are search modifiers that can help you perform a more targeted or specific search. In some sense, they let you build your own search engine and share it with others.
In this release, you can chose from a set of existing macros (built by members of the search team and some ETech conference attendees) which you can find here. To try a macro, just click on the 'add to live.com' link/image you will find on its page. You can then pin the macro on your live.com scope bar, alongside the default scopes like web, news and images, to use anytime you do a search in the future.
But why would you want to use a macro? Here are a few scenarios where they can come in handy:
Narrow a search down - How many times did you wish you could restrict a search to only a few specific sites and not the whole web? Search engines provide operators to do this, but it is cumbersome to type a bunch of 'site:' every time. Instead, you could build a macro and use it to do the search whenever you want. The sidebargeek.windowslive macro is an example of this - it restricts the search to all the Windows Live related sites.
Targeted searching - Let's say you are looking for information about a term, say, RAID, as in, RAID disk array. A regular web search for such a common word can give you a lot of unrelated results. What if you could tell the search engine that you are doing a reference search here? Well, the livesearch.reference has some modifiers that do just that. The very first link when you search for 'raid' with this macro is the wikipedia page for RAID! On the other hand, if you are a CS researcher looking to find the latest publications on RAID, you can use the livesearch.csresearch macro instead.
Bring advanced search to the average user - Very few people actually use advanced search operators on search engines. For example, take a look at the livesearch.homepages macro. It uses an ingenious combination of modifiers that let you find people's homepages, but it is highly unlikely an average user is going to build something like that! Well, with macros, they don't have to - they can just use what someone else has built ;-) Imagine the next time your dad asks you for help with a computer problem ("I searched for it but couldn't find anything!"), and you just hand him a macro called, say, john.dadsupport, that is targeted to the set of sites or has the right keywords he can use to find support information!
Make use of community knowledge - Even if you are an expert searcher, I am sure there have been times when you have had to try and retry several combinations of keywords to find what you want. For example, let's say you are a new dad or mom, and want to look up something about a baby's sleeping habits. You could do a regular search, but where do you start and how do you know which results to trust? After all, you don't know which websites are the authorities in parenting. But you know what, someone else probably does! Sure enough, you browse through the gadgets site and find a macro called livesearch.parenting that should be useful. This is generally true of anything you are looking for - someone else probably knows where/how to look for a given topic better than you, since they have been through it or are experts in that area. Macros help to leverage this community knowledge in search. Similarly, it lets you share your expertise with others.
Save away useful search parameters for future use - Lets say you were searching for reviews on digital cameras. I am sure you would have tried a variety of keyword combinations ('digital camera reviews', '"digital camera" review', 'best digital cameras' and so on) before you hit the 'right' one. A few months later, you might try the same search again, but now you have forgotten the right combination - d'oh! With macros, you can just save the query as a macro and use it in future, or share it with friends.
So I think macros are simple, yet powerful tools - try some out and see what you think! We will be adding the ability to create macros very soon, so do check back (I will blog about it as well)!
Lots of people have been talking about this feature in the blogosphere. If you have a comment, feel free to leave it here or better yet, blog about it!
Channel 9 videos are great fun!
10/2/2006 external link
Wow, first post in a long time, and the first in 2006! Since switching teams back in November, I have been settling down into my new team and was then on vacation for a while, so didn't get a chance to post. Well, we have a bunch of cool stuff coming up this year in MSN Search, so I hope to blog about it as and when we launch something exciting! There should be some fun stuff as early as in the next couple of months, as folks who were at Search Champs may already know.
Anyway, I have been really enjoying watching some great videos on Channel 9. Inspite of being on the 'inside' in Microsoft, the company being so large, one rarely knows much about what's going on elsewhere in the division, let alone in other divisions. It is great to get an insight into what's happening around the company, and more importantly, the people behind it all.
Here are some of my favorite picks, the ones I enjoyed the most (and there are so many that I haven't viewed, so maybe there are some I will like even more!):
Any Anders Hejlsberg interview - and there are quite a few of them. It is amazing to follow the thought process of one of Microsoft's most brilliant architects. I really love C# as a programming language for 3 reasons: it is simple, logical and elegant. Anders is the reason for that.
Here is a two part series with Jim Gray, another Microsoft superstar. If you ever wondered what it would be like to engage a Turing award winner in a conversation about his work, this is your chance.
The Going Deep series is fascinating - there is so much to learn and grasp from nearly every video here. Personally, the one I enjoyed the most was this two part series on the Windows driver model. No book explains these concepts and principles (both the WHAT and the WHY) as lucidly as done here.
And its not just technology - for example, this Don Box video is about how to give a great presentation - tips from the master himself.
Missed the PDC? Sure, you can see the official videos, but if you really want to get a feel for what PDC '05 was like, you should check channel 9's coverage. There are also some great 'tour' videos, like this one of the Cambridge research lab.
Finally, when you read blogs and emails regularly from people you have never actually met, have you ever wondered what they look like? Well, Channel 9 lets you find out what Raymond Chen, Larry Osterman, Chris Brumme or Dare Obasanjo look like. Funny how people often turn out quite different from how you mentally pictured them!
Which reminds me, I happened to run into Robert Scoble briefly at Search Champs the other day. For a moment, it felt like running into a colleague or close acquaintance. Then it struck me that I had never actually met him before, nor even exchanged emails for that matter! It is interesting how the blogosphere can bring out a sense of familiarity.
Anyway, thanks Robert, Charles Torre and other folks on Channel 9 for bringing us these awesome videos!
P.S.> By the way, I have made a brief appearance on Channel 9 too :-) And here is a video about MSN Search, my current team.
Client Settings FAQ updated
10/12/2005 external link
I finally got around to updating my FAQ on the settings feature in .NET 2.0. Look for 'Update: 12/10/2005' to identify the new content. The new stuff is mostly some questions frequently asked on forums and internal mailing lists in Microsoft around security, configuration and availability of the settings feature in non-Windows Forms applications.
Saving out a Form's Size and Location using the Application Settings feature
29/11/2005 external link
A very common requirement for Windows Forms applications is the ability to 'remember' the location and size of forms when they are closed, so that the next time they are shown, they can be restored to the former position. The Application Settings feature is .NET 2.0 makes it simple to do this, but unfortunately, it is a little hard to get it 'just right'. This question is asked frequently on internal and external Microsoft forums, so I thought it warranted a blog post.
Now, the Windows Forms designer in Visual Studio 2005 provides a simple UI to data bind properties on controls to application settings. So the first thing that might occur to you is to simply bind the Form's Location and Size properties to settings, add a line of code to save the settings class, and that's it! Unfortunately, this is not the best option for a few reasons:
First of all, you may notice that the Form.Size property is not offered up in the settings binding UI. This is because this property is marked DesignerSerializationVisibility.Hidden, so the designer doesn't know how to serialize it, let alone generate a data binding for it. Instead, for Form, the ClientSize property is the one that gets serialized.
So okay, maybe you can bind Location and ClientSize then? Well, yes, but this has another problem. Try setting it up and then attempt to resize the form from the left or top edge. You will see weird behavior. Why is this? It is beyond the scope of this post to give the full explanation, but it suffices to say that it has to do with how two way data binding works in the context of property sets that mutually affect each other (in the case of Location and ClientSize, both eventually call into a common method, SetBoundsCore()).
This solution does not do the 'right' thing in the situation when the user maximized the form before closing it. In this case, you probably want to remember that the form was maximized, but also keep track of the last location/size before it was maximized, so you can restore it the next time the user hits the Restore button. You may want to handle the minimize case in a similar way too. The simple data binding solution does not do this right.
Data binding to properties like Location and Size is just not efficient. Each time the user moves the form or resizes it, Windows sends hundreds of messages to the form, causing the data binding logic to do a lot of processing, when all you want is just to store the last position and size before the form is closed.
The good news is that this is very easy to do with a few lines of code:
private void Form1_FormClosing(object sender, FormClosingEventArgs e){ Properties.Settings.Default.MyState = this.WindowState;
if (this.WindowState == FormWindowState.Normal)
{
Properties.Settings.Default.MySize = this.Size;
Properties.Settings.Default.MyLoc = this.Location;
}
else
{
Properties.Settings.Default.MySize = this.RestoreBounds.Size;
Properties.Settings.Default.MyLoc = this.RestoreBounds.Location;
}
Properties.Settings.Default.Save();
}
private void Form1_Load(object sender, EventArgs e)
{
this.Size = Properties.Settings.Default.MySize;
this.Location = Properties.Settings.Default.MyLoc;
this.WindowState = Properties.Settings.Default.MyState;
}
By the way, speaking of Windows Forms 2.0, there is a lot of great new content on the WindowsForms.net site. Jessica has been actively blogging on interesting Windows Forms topics too.


