Month: June 2011

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.

The iPad 2 That Reading Bought

I had thought of getting Jeanne an iPod touch but I’ve pushed back the purchase time and time again. But recently, Michelle and I have been reading ebooks a lot and although it’s reasonable on the iPhone because of its retina display, it’s not exactly ideal on Michelle’s Nokia 5800 where your squint at the small low-resolution display and tapping the not-so-sensitive resistive touchscreen so often. And there’s also Jeanne taking over the iPhone especially when I’m reading. And yet, the display is too small and she ends up hunching over it. So I finally decided to get an iPad. Now Michelle can read on the iPad, Jeanne can play with a bigger screen, and I have the iPhone all to myself. Now that’s a win-win-win situation! :P