Archive

Archive for March, 2010

Protected: Dollar Peg: Bad Business For China

March 18th, 2010
Enter your password to view comments

This post is password protected. To view it please enter your password below:

ryan China (中国), Economics (经济学)

The Internet Bubble – Popped – 10 Years Ago Today

March 14th, 2010

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.

ryan Economics (经济学)

Run WordPress Locally. No need to modify the DataBase!

March 13th, 2010

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.

ryan Geeking Out(奇客通道)

Safari Session Management

March 8th, 2010

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

ryan Geeking Out(奇客通道)