Tuesday, November 20, 2007

The Office

home_branch_team

Noticed a link to Dunder Mifflin somewhere.

Wonder why I can't find gaydar in the Shop. Oh, I forgot, it's only sold in Sharper Image...

Friday, November 16, 2007

WPF Routed Commands and Focus Scope

Some WPF concepts are not as simple as it might look like. Case in point: Routed Commands. I created the following XAML snippet, and expected the buttons to function out-of-box:

<StackPanel>
    <TextBox/>
    <Button Content="Copy" Command="ApplicationCommands.Copy"/>
    <Button Content="Cut" Command="ApplicationCommands.Cut"/>
    <Button Content="Paste" Command="ApplicationCommands.Paste"/>
 </StackPanel>
It didn't. After a bit of googling, I found the solution here. I.E. The TextBox and Buttons must be put under different containers and the container for the buttons must have FocusManager.IsFocusScope set to true:
<StackPanel>
    <TextBox/>
</StackPanel>
<StackPanel FocusManager.IsFocusScope="True">
    <Button Content="Copy" Command="ApplicationCommands.Copy"/>
    <Button Content="Cut" Command="ApplicationCommands.Cut"/>
    <Button Content="Paste" Command="ApplicationCommands.Paste"/>
</StackPanel>
The post, however, didn't fully explain the connection between Focus Scope and Routed Command. As another bizarre example, when you set the same property on the first StackPanel that contains the TextBox, the buttons fail again.
I couldn't find any official documentation on this behavior. But did manage to dig up this forum reply (the last post on the page) that explains it fairly well. Here is my understanding:
  • By default, Routed Command travels from the source element up the visual tree, from child to parent. In our first example, this involves the button clicked and StackPanel. The text box that contains the command binding never gets a chance to handle the command, hence the buttons were never effective.
  • Setting IsFocusScope creates a separated focus scope that tracks its own focus element. In this case, the routing of command takes a detour: it first bubbles from the button clicked to the StackPanel, which now acts as the root of the newly created focus scope, then it jumps to the focus element of the default visual tree and travel up to its root. Because the focus element in the default visual tree is the text box, it now gets a chance to handle the command.
  • When the stack panel containing the text box is defined as another focus scope, it effectively moves the text box out of the command routing path (because it's no longer in the default visual tree focus scope). Hence the buttons seize to function again. 

Wednesday, November 14, 2007

Ducking the Subprime Hit

MI-AN891_HEARD_20071113230622

 

In today's Journal:

Asked yesterday if the firm would take the sort of significant write-down facing many of its peers, Mr. Blankfein answered with a succinct "No." Given the continued, challenging conditions in the trading of complex mortgage products, "we continue to be net shorting these markets," he told the crowd.

Friday, November 9, 2007

High Grade ABX-HE indices

According to the press release, Morgan Stanley used ABX indices as a reference point for its ABS asset valuations. Looking at the changes in high grade (AAA) ABX-HE index in the last couple days, it seems that there might be more to write down post Oct 31st.

 acde1be9823757d12d6b629d723

Makes me wonder how other "smarter" banks (read: GS and LEH) are holding up in this climate.

"Negative Convexity" at Morgan Stanley

Morgan Stanley reported a $3.7b write down on subprime related exposures. Make no mistake though, Morgan Stanley didn't bet on the wrong side of the market. It started the year with a short position in subprime, a position that earned good profit for the first nine months of 2007. Here is Colm Kelleher, Morgan Stanley CFO's explanation of what happened in the last two months:

We began with a short position in the subprime asset class, which went right through to the first quarter; as the structure of this book had big negative convexity and the markets continued to decline, our risk exposure swung from short to flat to long.

In essence, you can think of Morgan Stanley's trade as a short position in the junior tranche of ABS CDO, with an offsetting long position in the super senior tranche of the same structure.

Initially, as the delinquency ratio in subprime market on the rise, the junior tranche suffers the first loss and declines more in value than the super senior tranche. The overall trade represents a short subprime position.

In the last two months, as the subprime problem continued to worsen, the junior tranche has lost most of its value with losses now bites into the super senior tranche. Since the value of the junior tranche is floored at zero, it now declines in a much slower pace than the value of super senior tranche. As a result, the trade now becomes a long position in subprime, hence the $3.7b paper losses.

Wednesday, November 7, 2007

Handy Tools

  • Windows Live Writer: Just came out of Beta, fresh.
    Finally a decent enough, truly WYSIWYG, free blogging tool. It supports Blogger, Windows Live Space (of course) and a few other blogging site. (I'm using it to write this post right now...) 
  • Videora iPod Converter
    A free iPod video converter that can convert a good deal of different video file formats for iPod. It downloads and converts youTube video too.

Mosaic: Perspectives on Investing

Several chapters of the "Mosaic" book written by investing guru Mohnish Pabrai.

The book has been out of print for a couple years now and is selling for ridiculous prices on ebay. Had you purchased it years ago and selling now, you'd get some 500% return on investment. Not bad...

Monday, November 5, 2007

Supersized Chinese Corporations

From Bloomberg:

PetroChina Co. almost tripled on its first day of trading in Shanghai, becoming the world's first company to be valued at $1 trillion, more than Exxon Mobil Corp. and General Electric Co. combined.

The calculation accounts for the majority non-tradable shares held by the Chinese government. Nonetheless, this is probably going to be the hallmark of the Chinese stock market bubble, after ICBC dwarfed Citigroup to become the largest financial company in the world.

Sunday, November 4, 2007

Bear Mountain

Some pics from my trip to Bear Mountain this past weekend:

Thursday, November 1, 2007

Black Friday, HD DVD Format War

To say the prices of HD DVD players are dropping like a rock is an understatement. Both BestBuy and Walmart are offering Toshiba HD DVD player at $98 even before Black Friday.

If history is of any reference, the coming Balck Friday is going to mark the beginning of the end for the HD format war, with HD DVD gaining much more shelf space, despite Blu-ray being a technically "superier" format.