General

A Storm of Swords

The Song of Ice and Fire continues. I finished the third book A Storm of Swords yesterday. True to its title, there are battles, skirmishes, and breathtaking sword fights everywhere. In the north (including north of the Wall and even on the Wall itself) , in the South, and even in the East. Yes, Daenerys’ storyline is finally picking up steam (guess it just needed the fire from those dragonlings). Nothing epic like the Battle of the Blackwater at the end of A Clash of Kings but just as well since the book is already long without having to be burdened by a long narrative for a single battle. In fact, sometimes the pacing becomes a bit ponderous and the twists and turns start seeming like a soap opera. But somehow George Martin redeems himself at key sections and kept it compelling enough to turn the next page. Or two. Or chapter. Or book.

The Math of Company Ownership

The Supreme Court is at it again with their whimsical decisions. They have decided to change the rules in the middle of the game. They have decided that ownership is only achieved through common stock and not preferred stock. So with their new formula, PLDT is now 64% foreign owned. And the same goes for more than a few other companies.

How they came to that decision boggles me. A company is the sum of its assets. And assets are purchased with equity and possibly debt.

A = D + E

In accounting both common stock andpreferred stock are owner’s equity.

A = D + (CS + PS)

Debt is borrowed money and is paid off with interest. Equity is owner’s money and shares benefits from earnings via dividends or suffers from losses. And preferred stocks get first dibs at dividends. If you look at it this way, preferred stock is more ownership than common stock.

Now, if the company is to be dissolved and the assets liquidated or sold,

A = D + (PS + CS)

$$$ = D + (PS + CS)

Debtors collect first,

$$$ – D = PS + CS

$$ = PS + CS

followed by preferred stockowners,

$$ – PS = CS

$ = CS

and finally common stock owners.

$ – CS = 0

If you look at it this way, preferred stock is more ownership than common stock. In fact the only thing going for common stock is it’s decision-influencing attribute via stockholder vote.

Flex: Method Invocation By Name

Say you’re done introspecting and you want to invoke a method of the object you introspected. Simply use the ff:

var methodName:String = “doSomething”;
var method:Function = object[methodName] as Function;
var returnValue:* = method.apply(object, [“string1”, “string2”]);  // or method.call(“string1”, “string2”);

Once caveat, if you’re a Java programmer, you would expect getters and setters to be methods. But in Flex, they’re actually accessors and the above method won’t work. Instead, directly access the attribute by name:

var attributeName:String = “doSomething?;
var returnValue:* = object[attributeName];

Flex: Introspecting An Object By Name

Say you have an object reference in your class:

var button1:Button;

How do you introspect it? One way is to use the Introspection API as described in the Flex 3: Performing Object Introspection doc:

var classInfo:XML = describeType(button1);

But what if you want to use the object name, a string, instead of a class reference? Simply use the ff:

var objectName:String = “button1”;
var objectInfo:XML = describeType(this[objectName]);

From there it’s as simple as going through the XML object as described the rest of the Flex 3 doc.

Bonding

Last night, Michelle was off to an office dinner. I took the opportunity to buy an iPad case as well as diapers and water for Jeanne. When I got home around 9:30M,  Jeanne and I played till she got tired and we started watching Brainy Baby. I lay on my side while she leaned back on my tummy. She watched while I slowly fell asleep. I woke up to see that she’d fallen asleep. I lay her down on the bed and went back to sleep. Only Michelle’s arrival awakened us but not for long.