個人檔案Walter's Space相片部落格清單更多 工具 說明
9月3日

Mercedes-Benz GL320 BlueTec: I lost the chance to buy an SUV that I couldn't afford

The Mercedes-Benz GL320 BlueTec is a 7-passenger luxury SUV that runs on diesel.  The cool thing is that its fuel economy never drops below low 20's (and can be high-20's for highway).  Plus it has monstrous torque. 

In August 2009, Mercedes-Benz was offering a $10,000 dealer incentive to clear out the 2009 model.  In addition, through the Fleet Employee Program (FEP) that Microsoft is part of, there was an additional $2000 discount for any GL model.  Meaning, after you negotiate your best offer with a M-B dealer, show your FEP paperwork, and M-B will add the discount.

With the GL320 going for slightly below invoice, that meant:

•    MSRP:  $58,200
•    Invoice:  $54,126
•    M-B Incentive:  -$10,000
•    FEP:  -$2000

The base GL320 could be had for about $42,000.  That's $12,000 below invoice.  That was such an incredible price.  There weren't any GL320's for us even to test drive at our local M-B dealer.  But alas...I didn't have the $$$ to buy it.  Unfortunately, I don't think we'll ever see a deal like that again.

Update:  FEP is now at $1000, and there appears to be about a $4000 incentive going on.  But it's hard to swallow that knowing what could be had...



10月17日

How to cut in line and almost get away with it...

On 10/15/2008 we went to the California Academy of Sciences.  It was a free day (regular admission is $24.95), and the crowd was huge!  It opened at 9:30; we got there at 10:30 and waited in line.  We are Chinese, and this Chinese lady snuck in right behind us and sat down on the concrete seating area where we were waiting.  My wife asked her to not cut in line, but the lady ignored all conversation.  By the time I notified the security personnel, the line had moved some more, and the lady was still sitting there.

I asked her if she cut in line.  She said her leg was hurting; she needed to sit down; her party was farther back; and she was waiting for them to catch up to her.  Unfortunately for her, the rest of her family arrived, presumably to cut in line.  An argument ensued; they started getting indignant and self-righteous; they accused me and my wife of shouting at them, they told me to mind my own business, etc.  But by that time, they were arguing with the security guy (who knew exactly what was going on).  The security guy asked the lady to sit further away out of the line until the rest of the...ahem...party made it up to where she was.  By that time, there was quite a scene, and they all walked away angrily.  The original lady hung around (under our watchful eye) and finally left.  I'm sure they didn't get in back of line...by that time, it would've been at least a 2-hr wait.  They got what they deserved.

Their ruse showed that they were obviously prepared for their line-cutting strategy.  So I've distilled it into "Line-Cutting 101":
  1. Requirements:  need to be female and have exceedingly thick skin.  [Reason:  men may feel less inclined to confront a woman, ppl may not be inclined to get into women-women arguments]
  2. Seek out a party of the same ethnicity waiting in line...not too close to the front.  [Reason:  others around you will think the line cutter is with the same ethnic party]
  3. Discreetly come in behind the party and just sit down  [Reason:  see strategy #5,6]
  4. If asked anything, ignore.  Or speak/mumble in your own language.  [Reason:  don't interact and draw attention]
  5. Wait for the line to move.  [Reason:  ppl may not care if somebody cuts behind them.  Also, people further behind may not have seen what happened, and will assume that the lady was already ahead of them]
  6. When a few groups of people have passed by, signal your party to cut in line.  Ppl around my grumble, but they can plainly see that you were in line already.
  7. When truly confronted:
    1. Claim some physical ailment for sitting down
    2. Claim your party is farther back, and you are waiting for them to catch up.
  8. If your cover is blown:
    1. Accuse other people of getting angry, raising their voice
    2. Tell people to mind their own business
    3. Accuse people of picking on your disability/ailment

Line cutting is all about "me first"...but when you combine that with self-righteousness and self-entitlement, then it really goes downhill.



10月10日

Why I hate VISA gift cards

Recently when I signed up for a new cellphone plan for myself and my wife, I got the cheapest phones and $50 rebate.  The rebate came in the form of 2 $50 VISA check cards.  It seemed easy enough to activate and use them.  I'm sure like many people, I was expecting to be able to go to a restaurant and use these cards to offset the cost of a good meal.  The card was declined (hm...maybe I didn't activate properly?).  So I called the 800 number to talk to a representative.  Here's why I hate VISA gift cards:
  • Legally, it isn't a gift card, so they can expire (In California, gift card expiry is illegal)
  • In a restaurant establishment, you can only charge 80% of the value of the card due to tip anticipation holdback.
  • At gas stations, you have to have the attendant charge exactly the amount you want before the gas purchase can be authorized.
If you get these, do what I did:  hurry to Target, Walmart, Whole Foods, Best Buy, or whatever shopping establishment and buy bona-fide gift cards.  With in-store gift cards, you can easily charge the cards, easily check the balance, and split purchases across gift cards and regular payments.  How inconvenient it would be to be limited to 80% of the card value or having to call a 800 number to check the balance so you know exactly how much you can spend, or having to spend it before a certain date?  I'm sure all of these restrictions make it a lot harder to spend the exact amount.

9月26日

Latency in Ads Loading

 

Lately, I've gotten fed up with msnbc.com ads loading.  I literally can't navigate to various pages because of some ad that's loading that doesn't return or takes a long time to load...this blocks the page critical render path.  When I am able to navigate, the page is slow to load.

 

Just for experimentation purposes, I decided to trace the # of ads calls for one msnbc.com page:  http://www.msnbc.msn.com/id/20908040/.  These are the ads/tracking calls that I can figure out.

 

http://ads1.msn.com/library/dap.js

http://c.live.com/c.gif?NC=1180&NA=1154&PS=73547&PI=7329&DI=305&TP=http%3a%2f%2fmsnbc.msn.com%2fid%2f20908040%2f&RedC=c.msn.com&MXFR=5F32F3A5A34B40E48EB2FDF5AF165D2A

http://c.msn.com/c.gif?NC=1180&NA=1154&PS=73547&PI=7329&DI=305&TP=http%3a%2f%2fmsnbc.msn.com%2fid%2f20908040%2f&MUID=1573C590AF614B208DA25D84307D4C64&ANON=A=0A698E2AA7E0013276472F74FFFFFFFF%26E=602%26W=3&NAP=V=1.6%26E=5a8%26C=4_Hja6rIhQfMuBvcJq_lttS3EyZFvtHPeA6ES3sHcBOcXk29ZVk2hA%26W=3http://msnbcom.112.2o7.net/b/ss/msnbcom/1/G.9-Pd-R/s92285868180372?[AQB]&ndh=1&t=24/8/2007%2022%3A57%3A41%201%20420&pageName=Story%7CBusiness%7CForbes.com%7C20908040%7CDocking%20the%20yacht%3A%20Cribs%20of%20billionaires%7C&g=http%3A//www.msnbc.msn.com/id/20908040/&r=http%3A//www.msnbc.msn.com/id/3032072/&ch=Business&c3=Matt%20Woolsey&c4=Business&c5=Forbes.com&c7=hmedium&c8=N&c15=20908040&c16=Story&c18=14&c26=Forbes&c39=ON&c41=1.5%7C60&s=1280x800&c=32&j=1.3&v=Y&k=Y&bw=1600&bh=756&ct=modem&hp=N&[AQE]

http://rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBC9DK&AP=1390

http://c.msn.com/c.gif?NC=1180&NA=1154&PS=73547&PI=7329&DI=305&TP=http%3a%2f%2fmsnbc.msn.com%2fid%2f20908040%2f&MUID=1573C590AF614B208DA25D84307D4C64&ANON=A=0A698E2AA7E0013276472F74FFFFFFFF%26E=602%26W=3&NAP=V=1.6%26E=5a8%26C=4_Hja6rIhQfMuBvcJq_lttS3EyZFvtHPeA6ES3sHcBOcXk29ZVk2hA%26W=3

http://ad.doubleclick.net/adj/N2992.MSN.com__/B2117819.12;abr=!ie;dcadv=1281487;sz=728x90;ord=589955861?

http://ad.doubleclick.net/adi/N2992.MSN.com__/B2117819.12;dcadv=1281487;sz=728x90;ord=589955861?

http://m1.2mdn.net/879366/flashwrite_1_2.js

http://m1.2mdn.net/1281487/indexing_costcalc_728x90_18k_032907.gif

http://a.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCLB1&AP=1071

http://b.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCNB1&AP=1071

http://rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCLB2&AP=1025

http://a.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCBB3&AP=1023

http://b.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCB01&AP=1025

http://rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBC2F2&AP=1025

http://a.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCTB1&AP=1025

http://b.ads1.msn.com/ads/11586/0000011586_000000000000000304421.gif

http://a.ads1.msn.com/ads/52962/0000052962_000000000000000317206.gif

http://ads1.msn.com/ads/309/0000000309_000000000000000432487.gif

http://a.ads1.msn.com/ads/3669/0000003669_000000000000000384164.gif

http://b.ads1.msn.com/ads/1/0000000001_000000000000000482644.jpg

http://ads1.msn.com/ads/1/0000000001_000000000000000430107.gif

http://global.msads.net/defaultads/ads/defaultads/1025.gif?C=P&E=10&N=F04

http://b.rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=0&PG=NBCMSB&AP=1089

http://ad.doubleclick.net/adj/N4518.MSNREGULAR/B2478583.8;abr=!ie;sz=300x250;ord=405406142?

http://ad.doubleclick.net/adi/N4518.MSNREGULAR/B2478583.8;sz=300x250;ord=405406142?

http://m1.2mdn.net/879366/flashwrite_1_2.js

http://m1.2mdn.net/1522752/UTour_Best_300x250.jpg

http://context3.kanoodle.com/cgi-bin/context.cgi?id=78053631&db=context&query=*general_network&cgroup=biz&format=table&numresults=5&width=459&bordercolor=7788AA&fillcolor=FFFFFF&title=1&signup=1&newtarget=1&fontsize=10px

http://context3.kanoodle.com/cgi-bin/context.cgi?id=78053631&db=context&query=*general_network:premium&cgroup=d_businessforbes&format=sky&numresults=5&width=160&bordercolor=7788AA&fillcolor=FFFFFF&title=1&signup=1&newtarget=1&fontsize=10px&titlecolor=0000ff&linkcolor=0000ff

http://business.msnbc.us.intellitxt.com/intellitxt/front.asp?ipid=7540

http://business.msnbc.us.intellitxt.com/v3/door.jsp?ts=1190699864812&pagecl=7471&ias=5a415f643cfd47a8b70b6cb0db1a0f79&ipid=7540&refurl=http://www.msnbc.msn.com/id/20908040/

http://images.intellitxt.com/ast/js/vm/func_200709182130.js

http://business.msnbc.us.intellitxt.com/al.asp?ipid=7540&di=4126929,4126928,3970782&syid=0,0,0&adid=201922,201922,201922&cc=us&rcc=us&hk=1&ts=20070925055745&so=0&mh=188c63522807304a86e08bb4603147c9&pvu=0254f4f8b19d4efa8839952a21155000&pvm=01a1d62cd407cbdb52df33fa3f13de3c&ias=5a415f643cfd47a8b70b6cb0db1a0f79

 

For...uh..."experimentation" purposes, I added the following domains to IE's restricted sites:  (*.207.net, *.2mdn.net, *.advertising.com, *.atdmt.com, *.atwola.com, *.doubleclick.net, *.intellitxt.com, *.kanoodle.com, c.live.com, *.msads.net, *.ads1.msn.com, *.rad.msn.com, ads1.msn.com, c.msn.com, rad.msn.com, *.pointroll.com, *.revsci.net, *.llnwd.net, *.ugamsolutions.com, *.zedo.com).  I am utterly amazed at the phenomenal improvement of the msnbc.com webUI experience (likewise, I was amazed that I put up with such a bad experience for so long).  The site loads reliably and loads starkly faster than before...ads are now static images and load deferred, but at least they do not block the page from rendering.  As an added bonus, the Flash-heavy ads are gone...and IE doesn't freeze anymore due to inerrant Flash ads.

6月29日

Gotchas with System.Uri

System.Uri is a class that has several caveats with usage.  Three methods deserve scrutiny:
  • Uri.ToString()
  • Uri.EscapeUriString()
  • Uri.AbsoluteUri

The first two functions should be banned from usage because they lead to several unintended behaviors.  Demonstration: take a nice, pretty url like below.  It has double-url-encoding to preserve the rru parameter (highlighted)

http://mail.live.com/mail/mail.aspx?=&rru=getmsg%3fcurmbox%3d00000000%252d0000%252d0000%252d0000%252d000000000001%26a%3dc7913ec40534cbf9582851359b6128a9404dbea8a6f7faec4d100a9f1499b1c5%26msg%3d9BC88EF5-0A29-4D7A-B0D3-5607DF3635C3%26start%3d0%26len%3d380290%26msgread%3d1&wa=wsignin1.0


Output of Uri.AbsoluteUri.  This is correct.

http://mail.live.com/mail/mail.aspx?=&rru=getmsg?curmbox=00000000%252d0000%252d0000%252d0000%252d000000000001&a=c7913ec40534cbf9582851359b6128a9404dbea8a6f7faec4d100a9f1499b1c5&msg=9BC88EF5-0A29-4D7A-B0D3-5607DF3635C3&start=0&len=380290&msgread=1&wa=wsignin1.0


Output of Uri.ToString().  You'll notice that the double-url-encoding is removed (highlighted).  This breaks the original encoded parameter; rru will no longer be parseable.  You would think Uri.ToString() is safe, but no it isn't .  Windows Live Mail had to take a hotfix because click thrus from Messenger, http://www.live.com, http://my.msn.com, and http://www.msn.com were broken.

http://mail.live.com/mail/mail.aspx?=&rru=getmsg?curmbox=00000000%252d0000%252d0000%252d0000%252d000000000001&a=c7913ec40534cbf9582851359b6128a9404dbea8a6f7faec4d100a9f1499b1c5&msg=9BC88EF5-0A29-4D7A-B0D3-5607DF3635C3&start=0&len=380290&msgread=1&wa=wsignin1.0


Output of Uri.EscapeUriString(Uri.ToString()).  This is just completely messed up.  In addition to the url decoding, there is an additional encoding of % into %25 (highlighted)

http://mail.live.com/mail/mail.aspx?=&rru=getmsg?curmbox=00000000%25252d0000%25252d0000%25252d0000%25252d000000000001&a=c7913ec40534cbf9582851359b6128a9404dbea8a6f7faec4d100a9f1499b1c5&msg=9BC88EF5-0A29-4D7A-B0D3-5607DF3635C3&start=0&len=380290&msgread=1&wa=wsignin1.0

 

In conclusion, the method you really want to use is Uri.AbsoluteUri.

11月26日

My Marvelous Discovery: "Marriage Entropy"

I've discovered that marriage is a life-long process of understanding and appropriately working through issues that have no resolution and problems that have no solution. 
 
I've discovered that marriage is a life-long process of pouring in energy, effort, and determination to combat "Marriage Entropy"...basically the natural tendency (due to individuality, selfishness, sinful nature, etc.) to grow apart or walk the earth along parallel lines instead of closer together.
 
For those who would elevate marriage above singleness:  both are different situations and represent different problem domains...and thus subjectively difficult to equate & quantify.  They also should be mutually exclusive (if they're not...let's not go there).
 
I have now managed to combine a blog entry with two recurring topics crossing work and marriage:  entropy and trading problems.
11月6日

Investment Strategies

This is my recommended order of retirement investment.  It's what I follow.  Comments welcome.  The ordering is by precedence:
  1. 401K:  Contribute percentage-wise up to your employer match.  The match is free money.
  2. Roth IRA:  contribute $4000/year, $8000/year if you are married (you'll need to open two accounts, one for each spouse).  If you are at or near the Roth cutoff, you should contribute to a traditional non-deductable IRA and recharacterize immediately as a Roth IRA.  You can do this indefinitely (due to the Pension Relief Act of 2006, the Dec 31, 2010 deadline for recharacterization is eliminated, ensuring that anybody can create a tax-free income pool via Roth recharacterization.
  3. 401K:  contribute up to the maximum amount ($15,000 for 2006) per spouse.  If your company has a Roth 401K investment choice, choose that.
  4. Everything else.  That includes investment life insurance (eg VUL), regular savings, stock, etc.  Remember that long-term capital gains are taxed at 15% max, making it a strategic choice.
Financially prudent investors know that the most tax-advantaged income streams ("tax diversification") are, in order of most preferrable to least preferrable:
  1. tax-free income (eg Roth IRA, Roth 401K, real estate capital gains for your primary property that meet certain criteria)
  2. tax-deferred income (eg 401K)
  3. taxable income (eg regular income, capital gains taxes)

I'm a big believer in building the tax-free income pool.  It's an enormous financial hit to save using after-tax dollars instead of pre-tax dollars, but I think it's worth it.  You've already paid taxes on it; you never have to worry about it or taking the tax hit (real and psychological) when you withdraw money.

10月22日

Windows Live Mail under FireFox

Windows Live Mail (WLM) runs very well under FireFox (FF).  The JavaScript engine is performant and low in CPU usage.  We were always pretty sure that WLM could run under FF with a minor amount of work, but it was really the efforts of one of our developers who proactively made it happen.  The framework which we use ("Live.com JavaScript framework") has a browser equalization layer that pretty much allows you to target a single browser platform.

The places where we branched browser logic were with attachment upload (in IE, you can click() a form) and textRange support.

Now that IE7 has shipped (and even during its beta), FF support for WLM has allowed us to evaluate both browser "Web 2.0" platforms.  FF is a great browser, and I know that it has raised the bar for IE7 and beyond (I've been in conversations with the IE team).  When running WLM (and Outlook Web Access), you'll want to turn off Anti-Phishing (AP).  AP does a ton of stuff behind the scenes...there's no way getting around it...if you want the increased security features of AP, it will cost you in terms of CPU resources and browser slowdown. 

But the general comparisons are left as an exercise to the reader:  run WLM under IE7 and also under FF. 

10月5日

Do you really need a VUL?

A large investment/insurance company that I am personally a client of (who shall remain nameless) is very bullish on pushing their VUL (Variable Universal Life) life insurance policies as the sound, sensible, and patently obvious thing to invest in.  Having bought such a policy, it is my strong opinion that 99% of people do not need a VUL.
 
The big pitches of a VUL (and the rebuttals):
  • the package deal:  life insurance + portfolio investments.  [rebuttal] I believe it wise to separate out investments from insurance.  Eg, combine the two and you get an extra layer of management fees (1).  Eg, locking into a VUL portfolio means you have to deal with complications and the confines of the VUL.
  • investments grow tax free!  [rebuttal] technically yes, but there are too many gotchas, IMHO (2).  Read on...
The sneaky stuff:
  • VULs have huge up-front commissions for the financial advisor.  1 year's premium as a commission is typical, so I hear.  So there's a huge economic incentive for them to sell VULs.  The conflict of interest is enough incentive for me to stay away.
  • Conflict of interest?  Would you believe that my financial advisor recommends investing in VUL ahead of 401K, Roth IRA, Traditional IRA + recharacterization?  That's beyond my comprehension.
  • VULs are a cash cow for the investment/insurance firms. 
  • You need to maintain your policy premiums if you expect to withdraw money "tax free" (2).
  • If your policy lapses, be prepared for a "taxable event" (2).
  • Your payments go towards up-front commissions (mine is 5%), investment portfolio account fees (1)...oh yah...and insurance protection.
  • Let's not forget that your investments in the portfolio (eg, mutual funds) can have their own management fees.
  • Second thoughts and want out?  How about a 50% surrender penalty?  How about waiting 10 years before the penalty goes away?
Here's a much better means to save for retirement:
  • Maximize your 401K.  Double it if you are married.
  • If your company offers a Roth 401K (R401K), invest in this.  Should you choose R401K over 401K?  Absolutely.  It is strategically advantageous to build up your tax-free income pool ("tax diversification").  R401K is after-tax dollars, so be prepared for the larger income hit.
  • Max out your Roth IRA.  And do the point below as well.
  • If your income is too high for Roth IRA, invest the maximum $2000/$4000 in regular non-deductible IRA and recharacterize into a Roth IRA right away.  The Dec 31, 2010 deadline to recharacterize is eliminated, but do it right away because recharacterization is a "taxable event".
  • Other things to consider (I'm not an expert):  index funds, ETFs, TMMF (tax-managed mutual funds).
If you've done all that and have $$$ to spare, how about:
  • Look at 30-year term-life or whole life policies.
  • Invest in 529 plans for your children.
  • Invest in whole-life policy for your children.
  • Pay off your mortgage?  Other debt?  Invest in real estate? 
 
Do you really have more $$$ to spare?  Ok, maybe after all this, the VUL is something you can look into.
9月25日

Dev Entropy

Some law of thermodynamics that I learned way, way back in an educational institution states that a system always tends towards lower entropy.  Software and software developers are like that as well...I call it "dev entropy".  It's best described by example:
 
  • laziness around code reviews, design processes, engineering processes.
  • bandage fixes
  • non-uniform indenting, formatting, casing
  • multiple implementations of similar code (eg parsers, string classes)
  • cut & paste code, then modify it (instead of rearchitecting & reuse)

Dev entropy creeps up on you...and the vigilant software developer must always be cognizant of it.  Suppose you are under a tight deadline, you've spent considerable time investigating a bug, found the source (in someone else's code), and have already determined an immediate fix, but ideally would spend time rewriting a bit more code.  Would you:

  1. make the quick fix, check in the code
  2. make the quick fix, have the original developer code review
  3. tell the original developer the issue and proposed fix
  4. spend the extra time to redesign
  5. ...

How many times has it been #1?  The problem I see is that the cost-benefit analysis leans towards #1, which is why dev entropy is hard to resist.

9月18日

A Quote from "The American President"

I am guilty just like President Andrew Sheppard:  "I was too busy doing my job that I forgot to do my job".  No we haven't abandoned Windows Live Mail , we're still around, and I will be posting regular (weekly) blog updates concerning Windows Live Mail.
3月9日

WLM's best practices for AJAX applications, Part I

What have we learned so far?

As part of our Ajax-like application, we built upon a JavaScript platform/runtime that provides component reuse, object inheritance, lifecycle mgmt, a rich eventing infrastructure, and the ability to bind JavaScript to CSS classes (separates JS from the HTML, cross-browser equivalent of DHTML behavior).  In conjunction with this, we created FireAnt, a JavaScript remoting architecture that forms the basis of our xmlhttp communications to WindowsLive Mail server.

 

Here are some of our informal best practices for AJAX-style development:

  • SOAP is ok for simple apps, but bad for complex applications…you don’t want to use SOAP on the client too much because of:
    • SOAP protocol wire transfer overhead (SOAP is typically 7x-21x larger than our JSON-like protocol).
    • SOAP server serialization overhead
    • Client-side xmldom (a parsed DOM is typically 5x-20x memory footprint of the original xml string)
    • Very loose typing/coupling.
    • selectSingleNode, selectNodes interface is error-prone, especially as you iterate on node structure changes.
    • Want to use SOAP but avoid xmldom?  I do not recommend building an XML parser in JavaScript.  You could write a generic parser and turn an XMLDOM into a set of nested objects & associative arrays, but you'll run into memory/CPU issues for complex object.  We bring down our whole addressbook in order to do AddressBook AutoComplete and have no problems with 200+ entries (tested to 1000+ entries).  Try that with an xmldom or JS xml parser.

 

  • Optimize the “perceived” user experience.  It’s all about perception.  Make it seem fast via delay-load, take advantage of parallel script download, avoid postback, etc.

 

  • Make smart problem trade-offs.  Browser application design is a great engineering problem about client vs. server tradeoffs…where do you build the app?  Lots of engineering problems seem to be trading one problem for another.
    • Move expensive RegEx to client?  Does your client have the CPU resources for this?  Typically, yes.
    • Bring down pre-rendered HTML to the client?  Or build a rendering function in JavaScript via “str=str+…” or createElement() segments.

 

  • Understand the single-threaded nature of JavaScript and learn to live with its limitations:
    • Leverage window.setTimeOut and associated callback functions
    • Understand JavaScript race conditions:  eg, can I click so fast that I trigger xyz before my callback gets executed?  Should I really be worried about this?

 

  • There are some fundamental differences in what is possible between a browser application and a Win32 application…understand browser platform limitations.  Don’t try to build a Win32 application in the browser.  Build a good browser application.
    • For example, everybody wants to cut & paste attachments into the DHTML RichEdit control and expect attachments to appear inline in the text (especially photomail).  The recurring ask is, "Outlook can do this, why can't we have this feature in Windows Live Mail?"  Answer is, sure, no problem, but we need an ActiveX control to do it.

 

  • Simple procedural JavaScript design will get you pretty far, but to build a complex JavaScript/AJAX application, at some point, you’ll really want an OO framework.

 

  • Have a good set of JavaScript script tools.  We have:
    • Logging
    •  Tracing, including timing of AJAX calls (across caller-callback of an xmlhttp)
    • Global window.onerror handler
    • JavaScript stack walker (used to generate JavaScript stack traces).

 

  • Learn and use advanced JavaScript constructs (closures, object namespaces, local function scoping, prototyping).

Windows Live Mail interviewed by CNET

A CNET writer was at our offices 3/8/2006 doing a report on Windows Live Mail.  As a member of the development team, I spoke mainly about the technical decisions that were made along the process and my views of the webmail landscape.  I will update with links to the article when it appears.
2月10日

The Economics of buying a car from GM (General Motors)

Quoting http://money.cnn.com/magazines/fortune/fortune_archive/2006/02/20/8369111/index.htm [02/06/2006]

"...GM's retiree health burden, a mountain that at year-end totaled an unfunded $64 billion and that, in annual effect on the bottom line, adds about $1,300 to the cost of every car and truck GM makes in the U.S."

This is unfortunate for the following reasons and conclusions:
  1. Spoken another way, a GM vehicle should cost $1300 less than MSRP, dealer invoice, and whatever super-secret price dealers actually pay. Basically, it should be $1300 less throughout the entire cost chain.
  2. GM has a $1300 price premium on each car it sells. Price premium on what? See #4.
  3. This statement dilutes the value of a GM car.
  4. There seems to be negative value proposition in buying a GM car. I would think most people would consider paying a premium on a car if it had better technology, better fuel economy, a better warranty, lower maintenance costs, etc. Or if that premium went to R&D, manufacturing, and making the car "a better car". But what value does the customer get from paying this $1300 premium? How does paying this extra $1300 add marginal utility to a GM car?
I think GM has some extraordinary challenges to overcome because I tried to be completely objective and stick purely to economics and numbers. When discerning and informed customers buy cars, I would think they would be looking for the car that delivers the best value.

Hiring strategy in Silicon Valley: The offer you can't refuse

The scenario: Company A and Company B (competitors) are both trying to recruit Bob the superstar. A & B make comparable offers that are very close, but ultimately Bob accepts A's offer. Bob tells B that he declines.

One week later, B decides "I'm going to make [Bob] an offer he can't refuse" and calls Bob out of the blue. "We'll give you $$$ and X,Y,&Z if you decide right now in this phone conversation to join us and (legally) agree not to join A". The offer is outlandish enough to overcome all lost opportunity cost. Bob reneges on Company A and informs A about the cancellation.


Why "The offer you can't refuse" is ruthlessly brilliant:

1) Company B gets Bob the superstar.

2) Company B can rest easy knowing that Bob has permanently closed the door on Company A. B has effectively locked A out of any future possibility of hiring Bob: would Bob ever consider A? No way. Embarrassing & awkward; as well, Bob burned bridges by reneging.

3) B's upping of the offer gets them a superstar and buys extra insurance that Bob won't jump ship to A (B's competitor) in the future. That's a small premium to pay to kill 2 birds with one stone.
1月11日

Issues with .NET Frameworks 2.0

Our team is tackling the scale issues, delving deep into the CLR and understanding its behavior.  We've identified at least two issues in .NET Frameworks 2.0 that are "low-hanging fruit", and are hunting for more.

1a)  Regular Expressions can be very expensive.  Certain (unintended and intended) strings may cause RegExes to exhibit exponential behavior.  We've taken several hotfixes for this.  RegExes are so handy, but devs really need to understand how they work; we've gotten bitten by them.

1b)  Designing an AJAX-style browser application (like most engineering problems) involves trading one problem for another.  We can choose to shift the application burden from the client onto the server.  In the case of RegExes, it might make sense to move them to the client (where CPU can be freely used) instead of having them run on the server (where you have to share).  WindowsLive Mail made this tradeoff in one case.

2)  Managed Thread Local Storage (TLS) is expensive.  There is a global lock in the Whidbey RTM implementation of Thread.GetData/Thread.SetData which causes scalability issues.  Recommendation is to use the [ThreadStatic] attribute on static class variables.  Our RPS went up, our CPU % went down, context switches dropped by 50%, and lock contentions dropped by over 80%.  Good stuff.

Paternity Leave and the Shark Theory

I'm on paternity leave now.  While there are other challenges to face at home, WindowsLive Mail continues to undergo development.

We are sharks.  Sharks need to keep moving so that oxygenated water can pass over their gills.  When sharks get caught in fishing nets, they can drown.  We are like sharks...we have to keep moving, we have to keep making fwd progress.  Otherwise, we will sink and fade away in irrelevance.  This is true when we look at us vs. competitors, and also me on paternity leave.

 

The former:  Microsoft vs. Competitors

It's hard dealing with a free competitor, such as Linux and open source.  How can you make a case that your product is cheaper?  TCO?  Depends on who you ask.  How about better?  Better for how long?  There are highly motivated people writing software and giving it away for free.  There are publically traded companies funding open-source development (I'd be curious to know how they explain the ROI of that venture to shareholders).  So I suppose the best we can do is say "our product is better".  But for how long?  We have to swim faster than our competitors.

 

The latter:  me on paternity leave

Paternity leave is great, but the world keeps moving fwd.  Last year when I took a 1-month vacation (to get married), I came back to work feeling like a new employee (slightly exaggerated).  But the truth is, things keep moving fwd...grunt work, milestones, and those strategic opportunities that you keep your eyes out for.  Things keep moving fwd...and from the other frame of reference, if you stay still, it looks like you are going backwards

Stanfordalumni Job Fair

I just got back from http://soe.stanford.edu/ajf.  The quality of candidates was below expectations.  Microsoft had tough competition:  Yahoo!, Google, and smaller start-ups vied for the scarce number of quality candidates.  As expected, the Google booth drew the largest crowds all throughout the event, and people went there first.  Regardless, I am optimistic about the handful of potential candidates that we talked to.
9月15日

Blog creation, Hotmail, and PDC 2005

This is Walter's personal blog space.  I finally got around to creating it.  I wil be updating it regularly with personal thoughts & observations, as well as snapshots of my profession.  I am a development lead at Microsoft, tasked with overseeing the design and implementation of Microsoft's successor to Hotmail.  My team blog is at http://spaces.msn.com/members/mailcall/.
 
I am a speaker at Microsoft's Professional Developer Conference (PDC2005, held 9/12-9/16).  More information on PDC2005 can be found at http://msdn.microsoft.com/events/pdc/.  Here is my PDC bio:
 

-----

Walter Hsueh is a development lead in the Hotmail Web Application team. He is the architect of Hotmail's AJAX platform technology and is driving the design and implementation of the next generation of the Hotmail web application and service. In his 5 years at Microsoft, he has previously worked on Hotmail email service delivery, MSN Calendar web service and backend components, and integration strategies with other MSN web properties.

-----