No one ever waxes poetic over a cell phone charger. — Marshall Brain in How Electricity Works, http://science.howstuffworks.com/electricity.htm

Archive | March, 2010

Dollar Peg: Bad Business For China

Posted on 18 March 2010 by Erwin

Price is what you pay. Value is what you get.

Warren Buffet

Beijing regularly complains about the “safety of it’s dollar reserves”. This political posturing makes for nice headlines and helps aggregate soft power, but your response should just be to laugh at Beijing’s naiveté and move on to the next story.

Beijing should keep some foreign currency reserves, which help to stabilize the domestic currency and encourage foreign investment. However, if Beijing did not manipulate the value of the Yuan, Beijing’s dollar reserves would not have risen to the ridiculous levels that we see now.

Today, the Chinese economy is structured to do one thing very well: make products for export. Manufacturing is a notoriously cost conscious business, and as costs in China rise, the government doesn’t want to see factories relocate en-masse to Vietnam, the Philippines, or other lower cost regions. Under normal circumstances, currencies trade a lot like stocks, prices go up and down relative to each other every day. However, every day the Chinese Yuan is worth the same amount of US Dollars. For almost 2 years, it’s been pegged at about $1.00 USD = ¥6.83 Yuan.

Trading Dollars for Yuan.

China didn’t pass a law saying that each dollar is worth 6.83 Yuan. Nobody will be tortured, jailed or executed for trading Dollars for Yuan at another rate. Instead, China’s central bank, The People’s Bank of China (PBoC), has created a policy that no matter what, they will sell you ¥6.83 Yuan for each $1.00 USD. The value of the Yuan is less than ¥6.83. Perhaps the value is ¥6.8, perhaps it’s ¥6.0, it might even be ¥5.0 or ¥4.0 for each $1 USD. However, since the PBoC is willing to sell Yuan at such a discounted price, they have a monopoly on the market. There’s no free exchange market for the Yuan, so nobody, including the PBoC can figure out exactly what the value of the Yuan should be, but the price is set by the PBoC.

Trading Yuan for Dollars

Selling Yuan is a little different story. If you have Yuan, and you want to sell them for Dollars, the PBoC doesn’t make life easy for you. Yuan sellers have to register with the PBoC and request foreign exchange. The PBoC has the choice on whether or not the Yuan sale will be permitted. For anyone investing in China, this is a very important fact to be aware of – one that I expect will bite a lot of foreign investors if the Chinese Real-Estate market bubble were to pop.

Since the PBoC is willing to give you such a great price when you sell dollars and buy Yuan, there is automatically an inward flow into Yuan, in spite of the risk that the PBoC may not let you convert Yuan back into dollars when you want to take your money back out.

If you torture the data long enough, it will confess.

Ronald Coase

The Big Pile of Dollars

As long as the PBoC keeps the peg, all of the dollar reserves that are acquired are valued by the PBoC at the price that the PBoC paid, even though the value is less than the price paid. Everybody knows that the PBoC is selling Yuan very cheap, so even more people buy Yuan (or other Chinese assets) with the intention of selling them back as soon as the price of the Yuan rises to match it’s value. Combine this with the fact that the Chinese economy is designed to produce exports, and you’ve got a recipe to up with a lot of dollars.

The PBoC has an account full of dollars corresponding to all of the Yuan, Yuan valued exports, and Yuan assets that China has sold to the rest of the world. This pile of dollars is massive and grows quickly. Since some interest on this money is better than no interest at all, the PBoC lends a lot of these dollars back to the US Federal Government, helping to finance both annual deficits and the overall debt, and pushing down interest rates.

Losses: Real or Realized

If the actual value of the Yuan in dollar terms was ¥6.70, but the PBoC’s currently pegged rate were ¥6.80, then every single time the PBoC trades a Dollar for a Yuan, it would be loosing ¥0.10 Yuan for every dollar traded. The bigger the gap between the rate that the PBoC is willing to pay for Dollars, and the the value of the Yuan, the bigger the loss on each trade. Central Banks are funded by Tax payers, so money loosing policies like this are not unheard of.

Every day for several years, the PBoC has been paying top dollar to buy dollars, even though the Dollar has been going down relative to other currencies (Euro, Yen).

(In case you didn’t notice, the flat line, least changed against the dollar, is the Chinese Yuan)

The PBoC re-values the Yuan, either by allow it’s price to be set by the market, just like the Dollar, the Euro and the Yen, or by raising the price the PBoC sells Yuan (perhaps only 6.0 Yuan for each dollar instead of 6.8 today).

THE CATCH, is that even though the PBoC is loosing money every time it buys dollars, from an accounting perspective it doesn’t look like a loss. It’s not until the price of the Yuan increases, the loss will finally look like a loss, a huge loss, to every accountant on the planet.

After the smoke clears

Someday, the PBoC will stop operating as the discount Yuan seller, thereby slowing down their accumulation of dollars, and correspondingly reducing demand for interest payments on their big pile of dollars. Less demand for dollar interest, means that the price of financing debt is going to go up. You’re not going to have many more chances to get a 30-year fixed mortgage at 5% — it was 12% in 1985.

The rising Yuan could be extremely dangerous for the Chinese economy, because there isn’t any other sector that could replace China’s manufacturing jobs. Though there are many well educated and talented Chinese entrepreneurs, the unpredictable regulatory and legal framework make investment in any R&D very high risk. Without further political reform, China appears to be stuck at the bottom of the value chain, in the Manufacturing department.

Comments (7)

The Internet Bubble – Popped – 10 Years Ago Today

Posted on 14 March 2010 by Erwin

BBC put together an interesting review of Internet stock bubble, that ended on March 10, 2000.

February 2000:

David: If your not a media stock, dot-com stock or a telecom stock, valuations are very low.

BBC: So what you’re saying David is that it’s really the result of this asset bubble. In other words, the actual stock market value of these companies was way out of line, compared to their potential to earn money.

David: Right, and I think that was fairly widely known. In our consciousness, it was just way out of whack. But, every day you heeded it, or you got left behind. These things were going up by the day, they were going up by the rate of warp seed, regardless of whether they had earnings or not.

BBC: Though you though it was all a bit ridiculous, you still felt you had to keep recommending these dot-com shares to your clients.

David: Looks, this seems kinda ridiculous, maybe we should look at pulling back on the aggressiveness of your styles, because they had all of the proof they needed – in their track record. It was fabulous. And it was very difficult to convince them of any other type of approach to what they were doing. I think it was quite difficult to tell clients to pull back, when every month they were making another 5-10%.

The Internet stock bubble was a classic stock market speculative bubble. The 2007 subprime crisis is a bubble in credit and the price of money. The discussions people were having about Internet Stocks in February 2000 sure sound a lot like discussions about the Chinese Real-Estate market.

They had all of the proof they needed – in their track record.

Comments (0)

Run WordPress Locally. No need to modify the DataBase!

Posted on 13 March 2010 by Erwin

Simply add the following lines to your “wp-config.php” and you’ll be able to run your same WordPress code and use your same WordPress database on both your live server and your local development server.

function WP_LOCATION () {
    $script_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']));
    $wp_base_path = realpath(dirname(FILE) . DIRECTORY_SEPARATOR . '..');
    $web_subfolder = substr( $script_path, strlen($wp_base_path)); 
    $wp_path = $web_subfolder ? substr( dirname($_SERVER['SCRIPT_NAME']), 0, -strlen($web_subfolder) ) : dirname($_SERVER['SCRIPT_NAME']) ;
    $retval = 'http' . ($_SERVER['HTTPS'] ? 's' : null) . '://' . $_SERVER['HTTP_HOST'] . $wp_path ;
    return $retval;
}
define('WP_HOME',WP_LOCATION());
define('WP_SITEURL',WP_LOCATION());

If you use BBpress, you can so something very similar, but edit the bb-config.php

function WP_LOCATION () {
    $script_path = realpath(dirname($_SERVER['SCRIPT_FILENAME']));
    $bb_base_path = realpath(dirname(FILE) . DIRECTORY_SEPARATOR . '..');
    $web_subfolder = substr( $script_path, strlen($bb_base_path));
    $retval = 'http' . ($_SERVER['HTTPS'] ? 's' : null) . '://' . $_SERVER['HTTP_HOST'] . $web_subfolder ;
    return $retval;
}
$bb->uri = WP_LOCATION();

I’ve updated the WordPress documentation under Running Development Copy of WordPress to note the discovery.

If manually running SQL updates make you feel happy and productive, then you may prefer running the manual database update on your local development system each time you copy the database off live. For your reference, the SQL command to do the trick is:

SELECT * FROM wp_options WHERE option_name = "home" OR option_name = "siteurl";
UPDATE wp_options SET option_value = "http://localhost/local_folder_name" WHERE option_name = "home" OR option_name = "siteurl";

Don’t forget to change local_folder_name to you’re actual local WordPress path. To make development simpler, I recommend updating your /etc/hosts and adding aliases for your local sites. For example:

127.0.0.1 localhost XYZproject.local PDQproject.local otherProject.local

Then setup separate VirtualHosts for each of your projects, and access them with the alias defined in your hosts file.

Comments (6)

Safari Session Management

Posted on 08 March 2010 by Erwin

Ever since Safari 3, the History Menu added “Reopen Last Closed Window” and “Reopen All Windows from Last Session”. The session information is stored inside ~/Library/Safari/LastSession.plist. When Safari crashes, the crash causing tab will typically be opened again, and Safari will crash again. Download the “LastSession” python script from radiotope to get a list of the Safari sessions that were last active.

For easiest use, download the LastSession python script, make it executable, and save it to your /usr/bin or /usr/local/bin folder:

chmod 755 ~/Downloads/readLastSession..py
sudo mv ~/Downloads/readLastSession..py /usr/bin/lastsession

You can also use the Window/Merge All Windows command followed by Bookmarks “Add Bookmark for These 99 Tabs” to easily save you’re entire workspace.

Mac OS X Hints posted about creating “Time Machine” like Session History for Safari by storing version history of the ~/Library/Safari/LastSession.plist file. Version history can be combined with the “readsession” script to get an even longer list of URLs…

There are currently three session management options for Safari, all of which have been updated to work with Safari v4.0.

  • SAFT: InputManager plugin, SIMBL plugin, or Safari Launcher. $15.

    • Add bookmark folder here and add bookmark here in every bookmark menus
    • Save and load browser windows
  • Safari Stand: SIMBL plugin. Free.

    • Bookmark Shelf for visually managing multiple browsing sessions
    • Restore Last Workspace Window that is 100% crash proof
  • GLIMS: Free.

    • Re-open last session when Safari starts
    • Re-open tabs in single window
    • Undo Close Tab (CMD+Z)
    • Unfortunately, GLIMS “re-open last session” is only updated when Safari exits, so it doesn’t protect you when Safari crashes. GLIMS provides a ton of interesting options, primarily related to the Safari “Search Field”, but doesn’t do much in the way of Session Management.
  • Forget Me Not: SIMBL plugin. Open Source. Free.

    • Reload windows and tabs when you relaunch Safari
    • File / Unclose Window
    • Edit / Undo Close Tab
    • Forget Me Not is about making Safari easier to use, rather than specifically about managing your session in Safari.

Bottom line: The only plugin that really brings Saft session management to the next level is Saft.

To minimize Safari crashes, you can also use the excellent Click To Flash plugin, which has the pleasant side effect of forcing Youtube to play back in QuickTime rather than Flash.

Next project: Synchronize Safari sessions across multiple machines

Comments (0)