I know the answer (it's 42)

A blog on coding, .NET, .NET Compact Framework and life in general....

May, 2006

  • I know the answer (it's 42)

    Most users do not read documentation


    This was something our User-Experience folks keep telling us. Frameworks and UI needs to be designed such that they fall into the pattern that'll be assumed by the user.

    Recently I got bitten by this. I was writing some verification code which needed to get the pixel color from a location on desktop and match it against a known color. I used the following code

    int hwnd = Native.GetDesktopWindow();
    int desktopDC = Native.GetWindowDC(hwnd);
    uint pixel = Native.GetPixel(desktopDC, x, y);
    Native.ReleaseDC(hwnd, desktopDC);
    Color realCol = Color.FromArgb((int)pixel);

    Then I was comparing the RGB components of realCol with my expectedColor. Funnily the test was failing each time. Then I dug a bit into the documentation and to my utter disbelief found that the following code was yielding me ABGR and not ARGB.

    GetPixel returns COLORREF who's documentation states that the color is stored in 0x00bbggrr. This resulted in this.

  • I know the answer (it's 42)

    Everyone working in Microsoft are millionaires


    24 hours and 5 movies later I finally landed in Seattle. Journey was uneventful other than the fact that the security in Amsterdam had some doubt about my passport :) As usual my Microsoft blue badge did the trick. They seemed to be more convinced by the blue badge than my passport, I guess the computer in front of them running Windows helped me a bit :)

    I was in the immigration check queue and the officer there asked me how much cash I was carrying. I gave him the 3 digit number (see I'm being discreet here) and he gave me a shocked look and said "I thought everyone working for Microsoft are millionaires, and you are carrying just that much cash!!!".

    I didn't get into a detailed discussion about the merits of credit cards or the current price of MS stocks, just gave a little smile and proceeded to get into US....

  • I know the answer (it's 42)

    I'm coming to Redmond


    You feel super-weird when you pack jackets and woolens when it's 107 degrees outside. But that's what I'm doing right now as I'm getting ready to travel to Redmond Saturday morning. Weather.com tells me that its likely to hit as low as 40 degrees in the next week. So if you happen to be in Redmond and see someone frozen on the side walk, you know who it is :)

    Sriram's complaints about the weather reminded me of my folly last year. I traveled to Redmond, sometime in March and was happily traveling in shorts and T-shirt. When I came out of the Seattle airport I almost got frozen.

    So this year I plan not to make the same mistakes I did last year. So I'll try to take the following precautions 

    1. No offense to StarBucks but I'm carrying my own coffee.
    2. Carry warm clothes in my shoulder bag so that I can avoid the freezing part when I get out of the airport in Seattle
    3. There's a switch you need to hit to cross streets
    4. Never complain about the rain.
    5. Remember to drive on the right side of the road. This is the most difficult part. Here in India we drive (mostly :) ) on the left side of the road. All the car controls are exactly on the opposite side.
    6. Restaurants close by 9:00.




  • I know the answer (it's 42)

    TFS prank: Scare your developer with a bug created by the CEO


    Raymond Chen in one of his posts jokingly wished that if he could use an alter-ego to update bugs in the bug-repository it'd be great. Actually there is a neat feature in Team Foundation Server's Work-Item tracking (WIT) client using which you can do just that. See the screen shot below. Looks like Mr.Ceo made some changes to the bug.

    The feature is that the history tab where you enter comments support rich text. So I copied a bit of the history text, pasted it and then changed the text. So this exactly looks and feels (the + buttons are expandable as well) like another history item. Next time the dev checks the bug, he'd not be very happy about it.

    I'll let you into another secret. I did make a change like this in an actual bug. A reward awaits for the dev/test in our tem who finds it......



  • I know the answer (it's 42)

    Moving on


    Team Foundation Server v1.0 has shipped and I'm almost done with the MQ work. This makes it the perfect time for moving on to newer waters. Next week I'll start working in a new team. I'll still be under the umbrella of Visual Studio Team System (VSTS) but working on new things and a new domain. What exactly? Hmm... I cannot talk about that right now ;)

    I'll still be involved in a lot of UI oriented programming and I'll still be coding in .NET/C# so the posts shouldn't change much. I'm super excited about the new work. Onto creating the next earth shattering software....

Page 1 of 1 (5 items)