Check Google PageRank

PageRank is a link analysis algorithm, named after Larry Page and used by the Google web search engine, that assigns a numerical weighting to each element of a hyperlinked set of documents in the World Wide Web, with the purpose of “measuring” its relative importance. The values can range from 0 till 10.

You can add this Check Google PageRank tool to your page by adding the following html code:

It will look similar to this:

If you want to link the PageRank image, just copy this code

Downloading Stock Prices into Google Spreadsheet

This is a sister post for “Downloading Stock Prices into Excel Spreadsheet”

Google Spreadsheet used to be a joke in the spreadsheet arena – it’s slow, unreliable and not that feature rich. However, Google Spreadsheet has now come of age; it has become a bad concept done well! Nowadays, if you want to do heavy numerical crunching, the natural choice would be to use Excel. OTOH, if you’ve structured data which you want to share and collaborate with colleagues or friends, GS is an excellent choice.

GS has means to retrieve stock/ETF/mutual funds data into the spreadsheet. I shall introduce 2 approaches. If your investments are all USA based, you can import it from Google Finance. For example typing =GoogleFinance(“GOOG”; “price”) in a cell will retrieve the price of the ticker ‘goog’ into the cell. Typing =GoogleFinance(“GOOG”; “volume”) will likewise import the volume of Google. You can view the documentation from Google here

If you’ve foreign (outside USA) investments such as Singapore stocks, you can import them from Yahoo! Finance. Try typing in the string =ImportData(“”). The cells will import the ticker, stock name, date, last trade price, dividend yield and PE ratio for the symbols XOM, BBDb.TO, JNJ and MSFT. The structure of the data is encoded in the string ‘snd1l1yr’. As for the symbol list, your can check with Yahoo! Finance at . The documentation of the stock quotation URL is listed here .

On some browsers, you might discover that the cells contain stale data upon subsequent reloads. A quick and dirty fix is to change the URL in the function, e.g. to =ImportData(“”) where the string ‘var’ is a random number or text. You can automate the process of changing the random string by referencing the random string in the URL to another cell and change the content of that cell. GS will be smart enough to detect the change and update the quotes accordingly.

If you want to import historical quotes into your spreadsheet, try the following instead, i.e. =ImportData(“”).

  • s=MSFT specifies the symbol MSFT
  • a=0 specifies the start month (0 for Jan, 1 for Feb, 2 for Mar, etc.)
  • b=1 specifies the start day of the month (1st of the day in this case)
  • c=2010 specifies the start year
  • d=0 specifies the end month (0 for Jan, 1 for Feb, etc.)
  • e=1 specifies the end day of the month (1st of the day in this case)
  • f=2013 specifies the end year
  • g=w specifies the granularity of the data (d for daily, m for monthly, w for weekly)

Enjoy managing your finance!

NB: It seems like WordPress/Word mangled the double quotes. Please replace the “ as shown in the post with ” on your keyboard.  Even though they look the same, they are really of different character set.

Downloading Stock Prices into Excel Spreadsheet

With the advent of fast and affordable computing power on the one hand and the availability of powerful, feature-complete spreadsheet on the other hand, financial calculation and modeling have increasingly been performed on Microsoft Excel, the industry-leading spreadsheet of choice.

Investors and investment professionals alike now massage investment-related information on Excel. A function of Excel is to import stock information. There are chiefly 2 ways to retrieve stock/ETF/mutual fund prices into your spreadsheet. One way is via MSN MoneyCentral database connection. The other is through Yahoo! Finance Excel macro.

You can view the MSN MoneyCentral way through this hyperlink.

However, the MSN MoneyCentral approach might not be suitable for some people as it doesn’t list a number of foreign stocks outside USA. For example, Singapore stocks are not included by MSN MoneyCentral. Fortunately, Yahoo! Finance has most of such data and thus the Yahoo! Finance Excel macro is my preferred tool to import stock quotes. You can download the sample Excel spreadsheet here (if you’ve MS Office 2007 or above, get this spreadsheet instead).

The spreadsheet contains sample macros and stock tickers which you can modify to suit your needs. You’ve to remember to enable macros in Excel in order for it to work. As the data source is from Yahoo! Finance, you’ve to check with Yahoo! Finance for the stock ticker information, it might differ from MSN MoneyCentral. For advance users, the Yahoo! Finance Excel macro is the preferred way as Excel macro in infinitely customisable.

You can browse the author’s documentation page at this link.

If you want to import historical quotes, you can download a sample Excel macro spreadsheet for viewing here (if you’ve MS Office 2007 or above, get this spreadsheet instead).  As always, remember to enable the macros.  This particular macro uses Yahoo! Finance symbols and data.

Optimising WordPress for Scalable Performance

There’re several popular blogging software packages on the Internet.  Examples of blogging software are Blogger (hosted by Google), WordPress and Moveable Type.  Out of all the blogging software available, WordPress is perhaps the most quintessential platform of them all. If you’ve a domain name and a web hosting account, most likely you would install WordPress if you do choose to blog. It’s now a robust, bug-free and feature-rich tool which boasts millions of users around the world. For some, the WordPress used is hosted by which reduces the need to configure the software for optimum performance on the part of the users. However, this article is not targeted at this group of users; this article is about optimising WordPress for DIY users with our own installations.

While WordPress is a great piece of work per se, the default installation has a huge weakness, i.e. it’s not scalable to a large number of concurrent users.  Even if you are a small-time blogger, you still have to cater to the small chance that your blog might just suddenly get popular.  Consider this scenario, what if your tiny space on the web should of all likelihood have its URL appear on the front page of The Straits Times or a popular web site such as Digg or Slashdot. Hundreds and possibly thousands of netizen could concurrently land on your web site simultaneously slamming on your WordPress engine hard and fast. Although WordPress is widely installed, the default setup couldn’t withstand such load. Your web site might crash and become inaccessible. The crux of it is, your blog fails to load just when it’s most need and read. If hosted on a shared web host, it could bring down other web sites as well. Depending on the circumstances and the policy of the web hosting company, the company might request you the webmaster to leave or perhaps buy a more powerful hosting package.

The culprit of the matter is that WordPress dynamically generates its pages. Every time someone loads a page from your website, WordPress has to regenerate the page by fetching the contents from the database. While this approach has its merits, it’s computationally expensive. In contrast to WordPress, 2 other less popular software packages – Blogger and Moveable Type create static pages, i.e. the pages are prepared in advance during creation and are served as is without much calculation. It’s of no coincidence that popular websites such as and would choose software such as Moveable Type.

However, all is not lost, I would like to recommend 2 approaches, one hardware-, one software-based solutions to enhance the scalability of WordPress. With proper setup, WordPress can be as fast and scalable as Blogger or Moveable Type.

When it comes to hardware, I’m not recommending moving from shared hosting to an expensive VPS (virtual private server) or dedicated hosting although that is certainly possible. The main hinderer of this approach is cost – you pay something for nothing. Most of the time, your blog sits idle on an expensive machine doing nothing much. This is not a viable approach unless you already own a popular WordPress blog. There’s no point providing capacity for perhaps the most remote spike in traffic.

A better approach is to use a shared web host that is scalable and can expand its capacity in an elastic way to accommodate sudden increase in volume. Alas, time has changed and technology has improved – cloud computing has come to the rescue of WordPress bloggers and other compute bound applications. In cloud computing, clusters of servers are load balanced and work together to form a logical unit to serve your web sites. That way, your shared hosting account together with other hosting accounts live on aggregate a much larger computing unit spread across many computers. If there is a sudden increase in demand of computation power, the increase will be spread over many servers instead of overloading a single PC.

As of this writing, there are several cloud-computing shared web hosts. 2 of American web hosts are and . These hosting solutions offer scalable hosting with only a slight premium on cost. If you prefer something closer home (I mean Singapore), there’s .

Besides the hardware solution, there’s the software way. The software-based approach is to use WordPress caching. A WordPress cache will store static files on disk that is derived from the web pages and then serve future page requests from the static files on the disk. This makes the system much faster and more responsive to the users. From the user perspective, there’s no change in the feature of the WordPress blog other than a speed improvement. The blog still behaves like it’s dynamic – new posts and comments still get updated as and when they’re posted to the website.

Currently, to enable WordPress caching, you need to install a plugin that does just that. 2 popular plugins are WP Super Cache and W3 Total Cache. With proper configuration, the plugins should increase your website’s capacity several times. A share-hosting account with caching properly configured should perform just as well as a dedicated machine with no caching. Installation is pretty simple and straightforward. Just follow the installation guide gotten from the web and you’re done with it.

The 2 broad approaches toward optimising WordPress are ways to improve the scalability by an order of magnitude. Although you might find other means to improve performance of your blog, these tend to be incremental. Do attempt the 2 approaches if you have a WordPress blog!