Wednesday, April 30, 2008

Linux Kernel Books 2.6


A number of good dead tree books are available, covering Linux 2.4 and Linux 2.6, as well as particular kernel subsystems. There also exist a number of generic programming references which are particularly useful from a kernel programming viewpoint. This page contains references to these and other texts along with their corresponding ISBN and publisher details. Click on a book for reader feedback and reviews.

Up-to-date books

  • Linux Kernel in a Nutshell by Greg Kroah-Hartman,, online: html

    • about configuring, building, installing, upgrading the kernel
  • Linux Device Drivers 3rd Edition, 2005, by Jonathan Corbet, Alessandro Rubini, and Greg Kroah-Hartman, O'Reilly Reference, online: pdf ,html

    • This book is a must read for device driver writing, and more generally, a good understanding of the Linux kernel subsystems involved with device driver writing. Topics such as building modules, debugging techniques, character device drivers, block device drivers, network device drivers, PCI subsystem, USB subsystem, concurrency and race conditions, time and memory management are covered by this book.

  • Linux Kernel Development 2nd Edition, by Robert Love (Novell Press, ISBN : 0-672-32720-1) see Novell Press Reference

    • This book is more general than Linux Device Drivers, and covers more parts of the kernel: scheduling, virtual memory management, etc.

  • Understanding The Linux Kernel 3rd Edition (O'Reilly and associates. ISBN: 0-596-00565-2)

    • This book is more general than Linux Device Drivers, and covers more parts of the kernel: scheduling, virtual memory management, etc.

  • Understanding The Linux Virtual Memory Manager, by Mel Gorman (Prentice Hall, ISBN 0131453483)

    • available online, see Understand The Linux Virtual Memory Manager, online

    • This book is specifically dedicated to the virtual memory manager of the Linux kernel, and so goes into deep details about the internals of this important but complex subsystem of the kernel. It clearly is a must read for the ones interested in memory management.
  • Porting device drivers to 2.6, by Jonathan Corbet

    • available online, see Driver Porting, on LWN

    • Not really a book, but it is so complete and interesting that it can be considered as such.
  • Understanding Linux Network Internals 1st Edition, 2005 (O'Reilly, ISBN 0-596-00255-6)

  • The Linux Kernel Primer: A Top-Down Approach for x86 and PowerPC Architectures, by Claudia Salzberg Rodriguez, Gordon Fischer, Steven Smolski (Prentice Hall PTR, 2005/7/19)

    • Covers 2.6 with a focus on i386 and PPC architectures
    • Code walkthrough
  • Linux kernel poster

Sunday, April 27, 2008

Zen-Cart template

文件路径 注释
index.php 主文件
includes/templates/[custom template folder]/common/html_header.php 页面的head部分
includes/templates/[custom template folder]/common/tpl_main_page.php 页面的body部分
includes/templates/[custom template folder]/common/tpl_header.php 所有页面的页眉
(column left)  
includes/templates/[custom template folder]/common/main_template_vars.php 决定页面的内容部分,缺省为 'tmp_index_default.php'
首页 - 缺省
includes/templates/[custom template folder]/templates/tmp_index_default.php 首页模板文件
首页 - 显示分类
includes/templates/[custom template folder]/templates/tpl_index_categories.php 首页上显示分类时的模板文件
includes/modules/[custom template folder]/pages/index/category_row.php 选择要显示的分类
includes/templates/[custom template folder]/templates/tpl_index_category_row.php 显示分类
首页 - 显示指定分类
includes/templates/[custom template folder]/templates/tpl_index_product_list.php 首页上显示指定的分类时采用的模板文件
includes/modules/[custom template folder]/product_listing.php 将商品数据添加到数组
includes/templates/[custom template folder]/templates/tpl_modules_product_listing.php 显示商品数量和商品导航菜单
includes/templates/[custom template folder]/common/tpl_list_box_content.php 显示商品数组
includes/templates/[custom template folder]/templates/tpl_product_info_display.php 显示单件商品信息
includes/templates/[custom template folder]/templates/tpl_shopping_cart_default.php 购物车页面
(column right)  
includes/templates/[custom template folder]/common/tpl_footer.php 所有页面的页脚

Saturday, April 26, 2008

SMTP configuration for google application tips

Configuring POP and IMAP Access


Configuring POP or IMAP access for your email account is very similar to configuring POP or IMAP access in Gmail. Here's what you need to know:

If this didn't help, please visit the Gmail Help Center for POP troubleshooting and IMAP troubleshooting.

If you're receiving repeated prompts for your password, you may need to clear a captcha for your email account:

How to clear a captcha

  1. Disable all POP clients you're using to read mail. If you use one at work and one at home, please disable both.
  2. From the computer on which your POP logins are failing, visit Be sure to replace '' with your domain name.
  3. Enter your email username and password, and the letters in the distorted picture.
  4. Once you have successfully signed in, restart your mail client and try to download your mail.

To verify that the necessary ports for POP access aren't blocked, please perform the following test on your computer:

How to check port access

  1. Open the Start menu, and select Run.
  2. Enter command in the 'Open:' field, and click OK.
  3. Enter telnet 995 in the new prompt window, and hit Enter.
  4. Repeat steps for telnet 465.

If the information in the prompt windows clear, the ports are not blocked. If you receive an error message, the problem you've experienced is a result of your network servers and/or security firewall. We recommend contacting your local network administrator or Internet Service Provider (ISP) for more information.

Monday, April 21, 2008

skilled migration eligibility link

Age Points
18 to 29 years 30

Level of English Points
Proficient 25
Competent 15

Skill Points Requirements
For most occupations where training is specific to the occupation 60 In most cases you will have a qualification (such as a degree or trade qualification) and experience which meets the relevant Australian standards. In some cases, experience without formal qualifications may be acceptable.

Occupation / work experience Points

If your nominated occupation is:

  • worth 60 points
  • you have been employed in your nominated occupation, or a closely related occupation listed on the SOL, for at least three (3) of the four (4) years before the day of your application.
Occupation Points
If all the following apply:
  • your nominated occupation is on the MODL
  • you have been employed in your nominated skilled occupation, or a closely related skilled occupation for a period totalling at least one (1) year in the four (4) years immediately before you make your application
  • you have a job offer for full time employment in Australia in your nominated occupation from an organisation that has employed at least ten (10) people on a full time basis for the two (2) years immediately before you make your application.
If all the following apply:
  • your nominated occupation is in demand on the MODL
  • you have been employed in your nominated skilled occupation or a closely related skilled occupation for a period totalling at least one (1) year in the four (4) years immediately before you make your application.

Sunday, April 20, 2008

Virtual Hosting Using Apache on Ubuntu

Virtual Hosting allow web servers to host more than one website on a sing machine. This is how sharing hosting works. I become pretty handy as well while develloping different web project on the same machine and allows you to access to your local repository using addresses such as instead of http://localhost/~myuser/myproject/ :) .
This tutorial is based on a machine runnning ubuntu/linux but should be the same on any debian based distribution and almost the same on other distributions.

First of all, you need an apache server ready to run on your machine, if it is not yet install, open a terminal and type

$sudo apt-get install apache2-utils apache2-common

Once the server is installed, it is time to get into apache 2 configuration.
Let's open apache's main configuration file, name /etc/apache2/apache2.conf. A search for the word virtual bring us to the following line:

Include /etc/apache2/sites-enabled/[^.#]*

This mean that when starting apache, it will look for files in /etc/apache2/sites-enabled/.
Lets go there and see what is in.

$cd /etc/apache2/sites-enabled/

$ls -l

total 1

lrwxrwxrwx 1 root root 36 2005-12-27 01:42 000-default -> /etc/apache2/sites-available/default

Well, this only links to the file in directory /etc/apache2/sites-available/ . You might wonder what is the point in doing such. Well, this simply allows you, mainly when you are using your box as a web server, to:

  1. Have a simple main configuration file
  2. Do be able to edit or create a new host by creating/editing a file from /etc/apache2/sites-available/
  3. In case your web server doesn't restart because of misconfiguration, you can simply remove the link from the file in /etc/apache2/sites-enabled/ pointing to the malformed file in /etc/apache2/sites-available/

Now let say you want to be able to map the domain name to you local machine, using the code file in /home/myuser/public_html/
While in /etc/apache2/sites-available, create a new file (let say

$sudo vi

Now add the following lines:

ServerAdmin webmaster@localhost
#We want to be able to access the web site using or
DocumentRoot /home/myuser/public_html/
#if using awstats
ScriptAlias /awstats/ /usr/lib/cgi-bin/
#we want specific log file for this server
CustomLog /var/log/apache2/ combined

Note:People who don't want to bother knowing how the site enabling system works might just jump to the end of the article to find debian built-in command syntax. If you want to know how it works, or do not use a debian based distro, carry on.

Now, we specified a new host to apache but it is not yet linked to the repertory where apache actually look for virtual hosts. Let go to:

$cd /etc/apache2/sites-enabled/

and create a link to the file we just created:

$sudo ln -s /etc/apache2/sites-available/

Now apache is almost ready to restart, but before doing so, we must inform our linux system that and are not to be looked for on the net, but on the local machine instead.
To do so, simply edit /etc/hosts and add the new host names at the end of the line beginning by, which is localhost.
In the end, your file should look like: localhost.localdomain localhost

And now we are done, simply reload apache:

sudo /etc/init.d/apache2 reload

Open your web browser and enter the following address Magic, it runs the same as when you were using http://localhost/~myuser/ but it is far more usefull when devellopping a web service and want to be able to develop applications on your machine just like it is where the real web site.

Edit: As you can see from the comments, many people pointed out that you can use a debian specific command (so if you are not using a debian based system, don't expect to find that command :) ).
to enable a new virtual host simply type:

sudo a2ensite mysiteavailable-site

to disable a virtual host:

sudo a2dissite mysiteavailable-site

where mysiteavailable-site is the name of the virtual hos you want to enable/disable, so in out example:

Hope this helped.

Virtual Web Domain Host with Linux

Virtual hosts are used to run more than one web site on a single machine. Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site, or "name-based", meaning that you have multiple names running on each IP address. You can also run your web pages on different ports like 8080 or 8090. The fact that they are running on the same physical server is not apparent to the end user. This workshop describes the different setups based on an OpenSuse 10.2 server.

I want to say first, that this is not the only way of setting up an Apache server. There are many ways of achieving this goal but this is the way I have taken. I do not issue any guarantee that this will work for your server or distribution.
We'll setup all together four different web pages in separate locations (directories) and will use different start pages (index.html) to proof the concept.

The workshop setup could look like this:

Step 1: Creating the index pages

Like already mentioned before, we have to create subdirectory and page index files first. Suse normaly stores the web pages in the following directory:


We will use the same directory but will create a subdirectory for every virtual host.

mkdir /srv/www/htdocs/server_port80 mkdir /srv/www/htdocs/server_port8090 mkdir /srv/www/htdocs/server_www mkdir /srv/www/htdocs/server_www1

You can later store you content in this directories. Let's just create a single file called index.html that contains a message about the type of the server. An example file could look like this:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title></title> </head> <body> <div style="text-align: center;"><span style="font-weight: bold;">This is my webserver working on Port 80.<br> <a href=""></a></span></div> </body> </html>

Please change the content to your needs and save a modified index file in every subdirectory.

Step 2: Setup IP based virtual host
Suse stores the vhost configuration files in the following directory:

During the start-up process, Apache will automatically use all files located in this directory for the final configuration.

You can easily create new vhost configuration files by using the template like this:

cd /etc/apache2/vhosts.d/ cp vhost.template vhost-port80.conf

This will copy the default template and will create a configuration file that we will later use for our IP-based virtual host running on port 80. I recommend using vi to edit the file. Please open it like this:

vi vhost-port80.conf

As you can see, the file has everything you need to setup a virtual host, but also includes a lot of explanations and comments. To get a slim file please delete it.

Here are the lines you should change for your Apache configuration:

VirtualHost – set IP address and port here
ServerAdmin - your webmaster's email adress
DocumentRoot – path to your web page contend (see step1)
ErrorLog - path to the error log file
CustomLog - path to the access log file
UseCanonicalName - leave it to off in this case
ScriptAlias – if you like to run cgi scripts on your web page, this is the location.

The file could look like this:

<VirtualHost> ServerAdmin webmaster@myserver.comThis email address is being protected from spam bots, you need Javascript enabled to view it ServerName DocumentRoot /srv/www/htdocs/server_port80 ErrorLog /var/log/apache2/server_port80.log CustomLog /var/log/apache2/access_port80.log combined HostnameLookups Off UseCanonicalName Off ServerSignature On ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port80/cgi-bin/" <Directory "/srv/www/htdocs/server_port80/cgi-bin"> AllowOverride None Options +ExecCGI -Includes Order allow,deny Allow from all </Directory> <Directory "/srv/www/htdocs/server_port80"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>

If you like to run you web page on a different port, please use the following configuration file:

<VirtualHost> ServerAdmin webmaster@myserver.comThis email address is being protected from spam bots, you need Javascript enabled to view it ServerName DocumentRoot /srv/www/htdocs/server_port8090 ErrorLog /var/log/apache2/server_port8090.log CustomLog /var/log/apache2/access_port8090.log combined HostnameLookups Off UseCanonicalName Off ServerSignature On ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_port8090/cgi-bin/" <Directory "/srv/www/htdocs/server_port8090/cgi-bin"> AllowOverride None Options +ExecCGI -Includes Order allow,deny Allow from all </Directory> <Directory "/srv/www/htdocs/server_port8090"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>

A web server normally listens on port 80. If you like to change this or to add port 8090, you have to hack the listen.conf file. Please see step 4 for more information.

Step 3: Setup a name-based virtual host

Create a new file using the default template similar to step2:

cd /etc/apache2/vhosts.d cp vhost.template vhost-www.conf

Here are the important hacks you have to make:
ServerName – use name you would like to see in the URL
UseCanonicalName On

With UseCanonicalName on Apache will use the ServerName and Port directives to construct the canonical name for the server. This name is used in
all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.

If you have more IP addresses for your server or if you like to use different ports, please change the following line:


The file could look like this:

<VirtualHost> ServerAdmin webmaster@myserver.comThis email address is being protected from spam bots, you need Javascript enabled to view it ServerName DocumentRoot /srv/www/htdocs/server_www ErrorLog /var/log/apache2/server_www.log CustomLog /var/log/apache2/access_www.log combined HostnameLookups Off UseCanonicalName On ServerSignature On ScriptAlias /cgi-bin/ "/srv/www/htdocs/server_www/cgi-bin/" <Directory "/srv/www/htdocs/server_www/cgi-bin"> AllowOverride None Options +ExecCGI -Includes Order allow,deny Allow from all </Directory> <Directory "/srv/www/htdocs/server_www"> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> </VirtualHost>

Step 4: Hack the listen.conf file

The following file allows you to bind Apache to specific IP addresses and/or ports.

Please change the following lines here:

Listen - add the port or ports on which you would like to run you web pages
NameVirtualHost - this directive tells Apache on which IP address and, optionally, which port to listen for requests by clients containing the domain name in the HTTP header. The first argument can be a fully qualified domain name, but it is recommended to use the IP address. The second argument is the port and is optional. By default, port 80 is used and is configured via the Listen directive.

The file could look like this:

Listen 80 Listen 8090 <IfDefine SSL> <IfDefine !NOSSL> <IfModule mod_ssl.c> Listen 443 </IfModule> </IfDefine> </IfDefine> NameVirtualHost

To trouble shot you configuration, you should run the following command from the linux console:

tail –f /var/log/messages

Please do not forget the restart Apache after changing the configuration using the following commands (watch for errors):

service apache2 restart


/etc/init.d/apache2 restart

Download the example files here.

Saturday, April 19, 2008

how to unstuff bits of given memory

there is a macro to get unstuff bits of given memory. given memory should be the type of unsigned int * and the size shall not greater than 32 and the result is stored in result variable . this macro is originally from mmc/sd driver source code of linux kernel.

1. for the case of given memory is address increasing

#define UNSTUFF_BITS(resp, start, size, result)             \
  {                      \
     const int __size = size;            \
     const unsigned int __mask = (__size < 32 ? 1 << __size : 0) - 1;   \
     const int __off = ((start) / 32);        \
     const int __shft = (start) & 31;       \
     unsigned int __res;                 \
     __res = resp[__off] >> __shft;            \
     if (__size + __shft > 32)           \
        __res |= resp[__off+1] << ((32 - __shft) % 32); \
     result = __res & __mask;                  \

2. address decreasing (not tested)
#define UNSTUFF_BITS(resp, start, size, result)             \
  {                      \
     const int __size = size;            \
     const unsigned int __mask = (__size < 32 ? 1 << __size : 0) - 1;   \
     const int __off = 3 - ((start) / 32);        \
     const int __shft = (start) & 31;       \
     unsigned int __res;                 \
     __res = resp[__off] >> __shft;            \
     if (__size + __shft > 32)           \
        __res |= resp[__off-1] << ((32 - __shft) % 32); \
     result = __res & __mask;                  \

3 testing code:
int main(void)
        unsigned temp = 0;
        unsigned int test[2];
        test[0] = 0x76543210;
        test[1] = 0xfedcba98;
        UNSTUFF_BITS(test, 24, 16, temp);
        printf("test 24,16 : %x\r\n", temp);
        return 0;
harry@harry-ubuntu:~/workspace/c$ ./a.out
test 24,16 : 9876

VIM syntax highlight

4. Color Syntax init files

4.1 Auto source-in method

This section below is obtained from gvim session by typing 'help syntax' -

bash$ gvim some_test
:help syntax

Click on the menu Window=>Close_Others to close other Window. And then do CTRL+] on 'Syntax Loading Procedure' menu which will take you there. (Use CTRL+T to rewind and go back).

If a file type you want to use is not detected, then there are two ways to add it. Method 1: You can modify the $VIMRUNTIME/filetype.vim file, but this is not recommended as it will be overwritten when you install a new version of Vim.

Method 2: Create a file in $HOME/vim/myfiletypes.vim and put these lines in it -

" Filename : $HOME/vim/myfiletypes.vim
" See the document by typing :help autocmd within vim session
" see also the doc at /usr/share/vim/doc/autocmd.txt
" This file will setup the autocommands for new filetypes
" using the existing syntax-filetypes.
" For example when you open foo.prc it will use syntax of plsql
" Basically does :set filetype=prc inside vim
" Add a line in $HOME/.gvimrc as below:
" so $HOME/vim/myfiletypes.vim

augroup filetype
au! BufRead,BufNewFile *.phc set filetype=php
au! BufRead,BufNewFile *.mine set filetype=mine
au! BufRead,BufNewFile *.xyz set filetype=drawing
au! BufRead,BufNewFile *.prc set filetype=plsql
augroup END

Then add a line in your $HOME/.vimrc and $HOME/.gvimrc file to source in the file "myfiletypes.vim". (CAUTION: You MUST put this in both vimrc and gvimrc files in order for this to work) Example:
        so $HOME/vim/myfiletypes.vim

NOTE: Make sure that you set "so myfiletypes.vim" before switching on file type detection. This is must be before any ":filetype on" or ":syntax on" command.

See the documentation on autocommand at -

  • :help autocmd (within a vim editing session)
  • See also the doc at /usr/share/vim/doc/autocmd.txt

Your file will then be sourced in after the default FileType autocommands have been installed. This allows you to overrule any of the defaults, by using ":au!" to remove any existing FileType autocommands for the same pattern. Only the autocommand to source the scripts.vim file is given later. This makes sure that your autocommands in "myfiletypes.vim" are used before checking the contents of the file.

4.2 Manual method

Instead of using "Syntax" menu you can also manually source in the syntax file. Edit the file with gvim and at : (colon) command give 'so' command. For example -

        gvim foo.pc
:so $VIM/syntax/esqlc.vim

The syntax source files are at /usr/share/vim/syntax/*.vim. Vim supports more than 120 different syntax files for different languages like C++, PERL, VHDL, JavaScript,...and so on!!

Each syntax file supports one or more default file name extensions, for example, JavaScript syntax file supports the *.js extension. If you happen to use an extension that conflicts with another default syntax file (such as adding JavaScript to a *.html file) than you can source in the additional syntax file with the command :so $VIM/syntax/javascript.vim. To avoid all of this typing, you can create a soft link like -

        ln -s $VIM/syntax/javascript.vim js
gvim foo.html (... this file contains javascript functions and HTML)
:so js

Wednesday, April 16, 2008

Singapore Ranking

Singapore consistently scores high marks in global and regional rankings of the factors that matter to businesses. These range from political risk to workforce productivity, from the quality of life to the prospects for making profits.

Singapore: Most Cost-Competitive Place for Business

Country Cost Index Rank

Singapore 77.7 1
Canada 94.5 2
France 95.6 3
Netherlands 95.7 4
Italy 97.8 5
United Kingdom 98.1 6
United States 100.0 7
Japan 106.9 8
Germany 107.4 9

Source: KPMG Competitive Alternatives Study, 2006

According to a study by accountancy firm KPMG, Singapore is the most cost-competitive business location among nine industrialised countries.

The bi-annual study - which covers 128 cities in nine countries - indicated that Singapore was 22 per cent cheaper than the benchmark United States.

KPMG's 2006 Competitive Alternatives study analyses 27 cost components, including wages, freight, business taxes, rent and utilities.

World's easiest place to do business

Rank Country

1 Singapore
2 New Zealand
3 United States
4 Canada
5 Hong Kong
6 United Kingdom
7 Denmark
8 Australia
9 Norway
10 Ireland

Source: World Bank report: "Doing Business 2007: How to Reform"

Singapore tops World Business Environment rankings

Country Total Score Global Rank

Denmark 8.75 1
Finland 8.72 2
Singapore 8.70 3
Canada 8.70 4
Switzerland 8.66 5
Australia 8.65 6
Hong Kong 8.64 7

Source: EIU Country Forecast, February 2008

World's Most 'Network Ready' Country

Rating Country

1 United States
2 Singapore
3 Denmark
4 Iceland
5 Finland
6 Canada
7 Taiwan
8 Sweden

Source: Global Information Technology Report 2005/06, World Economic Forum

World: E-readiness Rankings

Rank Country

1 Denmark
2 United States
3 Switzerland
4 Sweden
5 Britain
6 Netherlands
7 Finland
8 Australia
9 Canada
10 Hong Kong
11 Norway
12 Germany
13 Singapore
14 New Zealand

Source: Economist Intelligence Unit, 2006

Singapore: 2nd Most Technologically Ready Nation in Asia

Rank Country

1 Finland
2 Japan
3 Sweden
4 Israel
5 Iceland
6 Germany
7 United States
8 Switzerland
9 Norway
10 Denmark
11 Singapore
12 Canada
13 United Kingdom
14 Netherlands
15 United Arab Emirates
16 Taiwan

Source: Global Competitiveness Report 2006-2007

Most competitive Asian Economy

Rank Country

1 United States
2 Singapore
3 Hong Kong
4 Luxembourg
5 Denmark
6 Switzerland
7 Iceland
8 Netherlands

Source: World Competitiveness Report 2007

Best Labour Force

Country Rating

Singapore 88
USA 75
Taiwan 74
Belgium 73
Japan 72
Ireland 67
Netherlands 66

Source: BERI's 2007 Labour Force Evaluation Measure (LFEM) report

Countries with the least restrictive immigration laws for employing foreign labour

Ranking Country

1 Ireland
2 Chile
3 United Kingdom
4 Singapore
5 Hong Kong
6 Iceland
7 Scotland
8 Argentina
9 Finland
10 Portugal

Source: IMD World Competitiveness Yearbook 2006

Singapore: 2nd in the World for Global Potential Competitiveness

Rank Country

1 Hong Kong
2 Singapore
3 United States
4 Switzerland
5 Belgium
6 Netherlands

Source: Japan Center of Economic Research, 2007

Most attractive investment incentives in Asia

Rank Country

1 Slovak Republic
2 Czech Republic
3 Ireland
4 Singapore
7 Hong Kong
10 Thailand
11 United States

Source: IMD World Competitiveness Yearbook 2005

Singapore: 1st in the World for Quality of Air Transportation

Ranking Country

1 Singapore
2 Bavaria
3 Hong Kong
4 Germany
5 Denmark
6 Finland
7 Australia
8 Austria
9 Iceland
10 Netherlands

Source: World Competitiveness Yearbook 2006

Singapore: Best Quality for Port Infrastructure

Ranking Country

1 Singapore
2 Netherlands
3 Hong Kong
4 Germany
5 Belgium
6 Denmark
7 Finland
8 Japan

Source: Global Competitiveness Report 2006-2007

Most Vital International Air Travel Hubs

Rank City

1 Paris
2 Anchorage
3 London
4 Singapore
5 New York
6 Los Angeles
7 Port Moresby
8 Frankfurt
9 Tokyo
10 Moscow

Source: National Academy of Science, May 2005

World: Overall Competitiveness

Rank Country (<20m pop)

1 United States
2 Hong Kong
3 Singapore
4 Iceland
5 Denmark
6 Australia
7 Canada
8 Switzerland
9 Luxembourg
10 Finland

Source: IMD World Competitiveness Yearbook 2006

Singapore: 2nd in the world for Investment Potential, 1st in Asia

Rank Country POR Score

1 Switzerland 82
2 Singapore 78
3 Netherlands 75
4 Japan 75
5 Norway 73
6 Taiwan 72
7 Germany 71
8 Austria 69

Source: BERI Report August 2006

Bureaucracy and Red Tape in Asia

Country Level of Red Tape (0 = no red tape, 10 = high levels of red tape)

Singapore 2.48
Hong Kong 2.52
Taiwan 5.21
South Korea 5.49
Malaysia 5.9
Japan 6.07
Thailand 6.39
Philippines 7.54
China 7.67
Vietnam 8.23
India 8.2
Indonesia 8.62

Source: Political and Economic Risk Consultancy, June 2006

World's Top 20 Most Globalised Nations

Rank Country

1 Singapore
2 Switzerland
3 United States
4 Ireland
5 Denmark
6 Canada
7 Netherlands
8 Australia
9 Austria
10 Sweden
11 New Zealand
12 United Kingdom
13 Finland
14 Norway
15 Israel
16 Czech Republic
17 Slovenia
18 Germany
19 Malaysia
20 Hungary

Source: A.T. Kearney/FOREIGN POLICY Magazine Globalization Index 2006

Perceptions of Corporate Governance Standards

Country Rating (0 being the best and 10 the worst)

Singapore 2.4
Japan 3.8
Hong Kong 4.2
Taiwan 5.8
South Korea 5.9
Thailand 5.95
Malaysia 6
India 6.1
Philippines 6.85
Indonesia 7.5
China 8
Vietnam 8.8

Source: Political and Economic Risk Consultancy, June 2006

Singapore has one of Asia's highest Integrity Government

Country Level of Corruption (0 = no corruption, 10 = high levels of corruption)

Singapore 1.3
Japan 3.01
Hong Kong 3.13
Macao 4.78
South Korea 5.44
Taiwan 5.91
Malaysia 6.13
India 6.76
China 7.58
Thailand 7.64
Philippines 7.8
Vietnam 7.91
Indonesia 8.16

Source: Political and Economic Risk Consultancy, March 2006

Global Country Brand for Shopping

Rank Country

1 United States
2 Singapore
3 Italy
4 United Arab Emirates
5 Japan
6 France
7 United Kingdom
8 Canada
9 Thailand
10 India

Source: Global Country Brand Index, 2006

Country Brand for Nightlife/Dinning

Rank Country

1 Italy
2 Singapore
3 United States
4 Spain
5 Netherlands
6 United Kingdoms
7 France
8 Greece
9 Thailand
10 Brazil

Source: Global Country Brand Index, 2006

The best place to live for Asian expatriates

Rank Location

1 Singapore
2 Sydney - Australia
3 Melbourne - Australia
4 Canberra - Australia
5 Kobe - Japan
6 Auckland - New Zealand
7 Copenhagen - Denmark
8 Vancouver - Canada
9 Wellington - New Zealand
10 Basel - Switzerland

Source: ECA International 2006

Asia's No.1 place to live, work and play

Rank City Country

1 Zurich Switzerland
2 Geneva Switzerland
3 Vancouver Canada
4 Vienna Austria
5 Auckland New Zealand
6 Dusseldorf Germany
7 Frankfurt Germany
8 Munich Germany
9 Bern Switzerland
9 Sydney Australia
33 Paris France
34 Singapore Singapore
35 Tokyo Japan

Source: Mercer Human Resource Consulting, 2005-2006

Singapore: World's 2nd Freest Economy

Rank Country

1 Hong Kong
2 Singapore
3 Australia
4 United States
5 New Zealand
6 United Kingdom
7 Ireland
8 Luxembourg

Source: The Heritage Foundation, Index of Economic Freedom 2007