Software

IE7 never starts/works on my machine!

I have heard this comment many times when people find out that I work for the IE team in Redmond. This is especially true when I visit India. One of the quick checks which help to analyze where the problem lies is to run IE without any addons. To do this, go to Start -> All Programs -> Accessories -> System Tools -> Internet Explorer (No Add-ons). If IE runs properly, then this indicates the problem lies with one of the extensions previously installed which is failing to work properly with the new version of the browser. Now you can use Manage Add-ons to zoom in on the faulty add-on and disable it.
Software

Check out Multi-Login Helper for IE7

MLH is an IE7 addon that helps you to open multiple accounts on a website in the same IE7 broswer. Currently, you cannot access two different account on a website (for example your bank site) from the same IE7 browser, due to the sharing of sessions in the same process. You need to start two browsers to check multiple accounts which render the advantages of tabs useless in such scenarios.

Want to monitor those multiple accounts using tabs in a single IE7 browser? Want to check both yours and your spouse’s bank accounts from a single browser? Then check out Multi-Login Helper. Download the addon from http://digiratii.com

Computers and Internet

Clicking sound in IE

Whenever you are playing streaming music from sites, you might be frustrated with constant clicking sounds from IE. This occurs because some of the websites have flash & frame ads which keep refreshing and hence generating the "Start Navigation" sound turned on by default in Windows. You cannot turn this off from IE, but have to switch it off from Control Panel. Go to Control Panel -> Sounds -> Search for Windows Explorer in the Program list, and disable the "Start Navigation" sound. Now you can enjoy a click-free streaming music 🙂
Software

Select Search in IE

I spend most of my free time on the computer, browsing the www; reading something new and interesting and naturally you would come across something you dont understand. So, what do you do? Run a search! But currently in IE, I dont have an option to just select the text, right-click on it and launch a search. But IE has such superb context menu extensibility, its very easy to hook up a simple menu extension to do this. All you have to do is, follow the instructions in the previous link to create the menu item in IE and point it to a script which does as simple as –

<SCRIPT LANGUAGE="JavaScript">

// get the window from which the call is made
var oWin = external.menuArguments;

// get the document hosted in the window
var oDoc = oWin.document;

// get the selected text in the document
var oSelText = oDoc.selection;

// get the selected text range
var oSelRange = oSelText.createRange();

// get the selection
var queryStr = oSelRange.text;

// launch the query in the search engine
var ie = new ActiveXObject("InternetExplorer.Application");
ie.Navigate("http://www.live.com/?q=" + queryStr);
ie.visible = true;

</SCRIPT>

Check out the SelectSearch utility for IE. To install, just run the selsearchinstall.bat file. If you want to change the search engine used in the tool, just open up c:\selectsearch\selsearch.htm and change the URL in the line "ie.Navigate("http://www.live.com/?q=" + queryStr);" to the one you are interested. Here are few of the top ones –

Google – http://www.google.com/search?hl=en&q=<queryStr>
Yahoo – http://search.yahoo.com/search?p=<queryStr>
Wikipedia – http://en.wikipedia.org/wiki/Special:Search?search=<queryStr>

If I get more free time, I will write a nice little installer for this.

General

Align Interest with Capability

Interesting read regarding aligning interest to capability to get something done correctly and in this instance regarding computer security.
 
After reading this article, can you figure out why prices in stores are never round figures, for example $9.90 instead of $10? (no, there is no complicated financial/tax reasoning behind this, just a simple common sense reason just like the jingle of the cash register).
Programming

Never miss an error value

One of the most frustrating part of debugging is when at a certain point the return value of a call is just a generic error code (eg. E_FAIL) or false without proper last error set. The failure might have happened deep in the call stack and now you have to step into each call to figure out exactly where it failed. This arises most of the times due to the fact your API return type and the return type of something you call doesnt match forcing you to use generic failure code. But most of the times, you can map error codes of one type to another (example). For example, consider a simple example
 
1   HRESULT SomeAPI()
2   {
3       HANDLE hThread = NULL;
4       HRESULT hr = S_OK;
5       hThread = CreateThread(…);
6       if (NULL != hThread)
7       {
8            if (SomeAPI2()) // SomeAPI2 sets the last error code
9            {
10                 hr = SomeAPI3();
11          }
12          else
13          {
14               hr = E_FAIL;
15          }
16     }
17     else
18     {
19          hr = E_FAIL;
20     }
21     return hr;
22  }
 
Now, after calling SomeAPI, if the return value is E_FAIL, I am at loss as to where the failure was. But instead if the programmer was a bit more diligent and changed lines 14, 19 to more meaningful return values using HRESULT_FROM_WIN32(GetLastError()), I would have a better idea as to what failed (an error in creating the thread or failure in SomeAPI2. This I believe greatly helps in debugging issues faster. This also causes the side effect of losing the error value up in the call stack, for example if this code segment did some file-system specific operations (assuming no other calls in the stack did this), if I get to know the error was something related to files (ERROR_FILE_NOT_FOUND), I would instantly know which call/code segment to investigate deeper.