Search This Blog

Google Analytics

Saturday, April 20, 2013

Yahoo! Mail New Re-thought iOS and Android App

Ever since Marissa Mayer came on board as the CEO of Yahoo, its mobile strategy seem to have taken quite a bit of a lift. Once slow and sometimes buggy Yahoo! Mail mobile app has now been revamped and re-thought.

Quote from Yahoo! corporate blog post Unbox Your Mail with Yahoo! Mail For Tablets,

Today, we’re excited to introduce the Yahoo! Mail Apps for iPad and Android tablets - a full-screen experience that gets rid of the noise. There are no folders, no buttons, no tabs - just you and your mail - and you can easily flip through it like a magazine. We've designed Yahoo! Mail to take full advantage of the tablet making reading your email faster, easier and just a little bit more fun.



Download Yahoo! Mail for iPad and Android tablets now.

Flat Design Language Makes It to Facebook Too

Facebook redesigned its icons moving from a more 3D-like icons to flat icons. The changed icons which also include its logo are as below:



Thursday, April 18, 2013

Get Facebook Home on Any Android Phone

Facebook Home is live but is available only on selected phones for now. Lifehacker has a tip on how to Get Facebook Home on Any Android Phone.

A first look on Facebook Home.

Tuesday, April 16, 2013

Constant "Check Disk" After Windows Update 2823324

You may be encountering constant prompt to perform "Check Disk" on boot-up after performing the recent Windows Update. Microsoft Security team has confirmed a problem with security update 2823324 and has since pulled it off from the pipe.

Should you have unfortunately installed it, please read this Microsoft release on the steps required to uninstall 2823324. I personally experienced the problem and resolved it using the just-mentioned instruction.

All the best.

Control Postback Only On Second Attempt After Validation Error

Recently, I encountered a problem whereby my DropDownList in UpdatePanel didn't AutoPostBack after a validator control return failure. The PostBack only happen after I tried to change the SelectedIndex the second time.

Reading from a blog, I learnt that resetting Page_BlockSubmit back to False in client side will resolve the problem.

What is Page_BlockSubmit?

When the user clicks on a button causing a full post back, after running Page_ClientValidate ASP.NET runs another built in function ValidatorCommonOnSubmit. Within Page_ClientValidate, Page_BlockSubmit is set based on the validation. The postback is then blocked in ValidatorCommonOnSubmit if Page_BlockSubmit is true. No matter what, at the end of the function Page_BlockSubmit is always reset back to false.

If a page does a partial postback without running any validation and Page_BlockSubmit has not been reset to false, the partial postback will be blocked. In essence the above function, RunValidation, acts similar to ValidatorCommonOnSubmit. It runs the validation and then returns false to block the postback if needed. Since the built in postback is never run, we need to reset Page_BlockSubmit manually before returning the validation result.

Video: Accident Near Bugis Involving Mercedes Driver

On 15 April 2013 before 8:30pm, an accident involving up to 7 vehicles occurred near Bugis at the junction of Victoria Street and Middle Road. This accident is said to be the result of a drunken or fainted Mercedes driver.

Investigation is still on-going. Thank goodness, passengers in the taxi are unharmed.

Sunday, April 14, 2013

Facebook Home "Launch Day" Video Ad

What do you think of the Facebook Home "Launch Day" video ad? What message is Facebook trying to convey? Did you having a better understanding what Facebook Home is all about after watching this video? IMO, the video seems to suggest Facebook Home is a great potential for creating distractions.

Apollo 11 summarised in 100 seconds video

Presented here is the first manned mission to the Moon by the Americans, July 1969, in 100 one-second increments. Enjoy the voyage.

PSY - Gentleman

South Korean the Gangnam Style man has just released his new music video - Gentleman. Will this new Gentleman video break previous Gangnam Style record 1.5 billion YouTube views? Currently, the Gentleman video has recorded 6.9 million views so far.


What do you think of this new video? IMO, I find it rather clown and non-gentleman.

Friday, April 12, 2013

Tim Ho Wan (添好運) Opened in Plaza Singapura

Michelin Star dim sum (點心) restaurant from Hong Kong, Tim Ho Wan (添好運), is finally opened in Singapore, Plaza Singapura.


Address : Plaza Singapura, 68 Orchard Rd #01-29A
Tel. No.: 6251 2000

Boost Your Facebook Privacy

An interesting article from the LifeHacker How Facebook Uses Your Data to Target Ads, Even Offline will guide you how to boost your Facebook privacy.

Wednesday, April 10, 2013

How to Disable Chrome New Right Menu?

If you somehow or rather don't like the latest Chrome's right menu, there is a way to disable it.

  1. Look for the shortcut where you usually start Chrome e.g. on your Desktop.

  2. Right click on the shortcut and then Properties.

  3. Make sure the Shortcut tab is selected.

  4. In the Target field at the end of "C:\Program Files\Google\Chrome\Application\chrome.exe" after space add "–-disable-new-menu-style" without quotes. (note we have got two hyphens before disable).

  5. Click OK to apply changes.

Done! The next time you click on this shortcut, the good usual familiar right menu will be used.

» Don't like Chrome’s New Menus? Here is how to Disable Them | TechDows

Article On Responsive Design


Articles from the Smashing Magazine featuring on responsive web design catering for both desktop and mobile. Interesting.

Difference Between LCD, LED, Plasma, and OLED TV

20 Best Wireframing Tools for Web Designers and Developers

Just for reference - a list of the 20 Best Wireframing Tools for Web Designers and Developers.

Thursday, April 04, 2013

My trust in Citibank has gone down the drain

Please do share if you do have a bad experience with Citibank or any other banks too.

Dear Sir/Mdm,

Reference to a request from @AskCiti (Twitter handler) to send an email to the above email address for elaboration as to why I have decided to terminate my credit card and my relationship with Citibank, I am here - now writing this email.

Twitter correspondence here: https://twitter.com/AskCiti/status/319451681580519424

So, what actually happened?

  1. On Feb 2013, I received a credit card bill from Citibank showing an annual fee of S$150 + S$10.50 charged onto my card.

  2. I called in to +65 6225 5225, spoke to a customer service officer (CSO) and requested for a waiver. The guy I spoke to promised and reassured me a total of S$160.50 would be waived on the spot. I proceeded to make bill payment without the waived amount.

  3. On Mar 2013, I received a credit card bill from Citibank. What shocked me was not only the S$160.50 wasn't been waived, a further S$21.85 was incurred due to an unexpected debit balance carried forward from Feb 2013.

  4. I called in to +65 6225 5225 last week, spoke to a customer service officer (CSO), explained what happened, and demanded for a waiver of S$150 + S$10.50 + S$21.85 = S$182.35. The CSO reassured me the amount would be waived in 3 working days. Not trusting Citibank this time round and wouldn't want this "debt" to be carried forward to yet another billing cycle, I insisted Citibank contact me on any update. I proceeded to make bill payment without the S$182.35.

  5. 3 working days have passed - nothing is done, no one from Citibank contacted me.

  6. I called +65 6225 5225 yesterday on 3 Apr 2013, spoke to a customer service officer (CSO), explained the whole story again, and was told my request for waiver was not in the system.

  7. The CSO helpfully made a waiver on the spot, reassured me the waiver done and completed.

  8. Losing trust completely in Citibank, I requested for a complete closure of my card. I was then redirected to the closure department.

  9. Citing my lost in trust in Citibank and lack of follow up from Citibank as the reason for closure, the last CSO I spoke to proceeded to close my account.

  10. Almost immediately after the tele-conversation, the last CSO phoned. It's this very last conversation that really made me laughed till I almost dropped. This CSO suggested I should stay with Citibank for 1 more year since all charges were waived. She then revealed the real 2 reasons for me to continue - 1) she forgot to verify my identity, 2) there was a system error encountered and my first conversation with her was not logged.

  11. Do you expect me to repeat everything again after the recording system is turned on?

  12. How can I convince myself to believe and trust Citibank again if simple procedure like verification of identity and making sure the recording system is running (if need be) are not ensured?

FYI, a copy of this email is published here.

Tuesday, April 02, 2013

How to Determine Origin of Food From Bar Codes?

According to a Facebook post, it is possible to determine the origin of food bought from a supermarket by reading the barcodes on the package itself.

Disclaimer: I am not sure if it is 100% accurate.

HOW TO READ BAR CODES... (everyone must know)

ALWAYS READ THE LABELS ON THE FOODS YOU BUY--NO MATTER WHAT THE FRONT OF THE BOX OR PACKAGE SAYS, TURN IT OVER AND READ THE BACK CAREFULLY!


With all the food and pet products now coming from China, it is best to make sure you read label at the supermarket and especially when buying food products. Many products no longer show where they were made, only give where the distributor is located. The whole world is concerned about China-made "black-hearted goods".

Can you differentiate which one is made in Taiwan or China ? The world is also concerned about GMO (Genetically Modified Organism) foods; steroid fed animals (ex: 45 days old broiler chicken).

It is important to read the bar code to track its origin. How to read Bar Codes....interesting !

If the first 3 digits of the bar code are 690, 691 or 692, the product is MADE IN CHINA.
471 is Made in Taiwan .
If the first 3 digits of the bar code are 00-09 then it's made or sourced in USA.

This is our right to know, but the government and related departments never educate the public, therefore we have to RESCUE ourselves. Nowadays, Chinese businessmen know that consumers do not prefer products "MADE IN CHINA", so they don't show from which country it is made. However, you may now refer to the barcode -

Remember if the first 3 digits are:
890......MADE IN INDIA
690, 691, 692 ... then it is MADE IN CHINA
00 - 09 ... USA and CANADA
30 - 37 ... FRANCE
40 - 44 ... GERMANY
471 ........ Taiwan
45 or 49 ........JAPAN
489...........HONG KONG
50 .......... UK
57 .........DENMARK
64..........FINLAND
76.........SWITZERLAND and LIENCHTENSTIEN
471......... is Made in TAIWAN (see sample)
628.........SAUDI ARABIA
629.........UNITED ARAB EMIRATES
740..........745 - CENTRAL AMERICA

All 480 Codes are Made in the PHILIPPINES.

Do let me know how true is this!

More information can be found at GS1 Prefix List - How to Determine Origin of Food From Barcodes?.

MSSQL: Run Large SQL Script

Having problems when running large SQL scripts using the SQL Management Studio (SSMS)? I would suggest you use sqlcmd instead. Save your script in a flat file (e.g. .sql or .txt) and pass the file as an input parameter to sqlcmd like below.

sqlcmd -S SERVER\INSTANCE -i mysqlscript.sql

In case you are having problems logging in, you may wish to try either one of them.

sqlcmd -S SERVER\INSTANCE,PORT -i mysqlscript.sql

OR

sqlcmd -S np:\\127.0.0.1\pipe\MSSQL$INSTANCE\sql\query -i mysqlscript.sql

NOTE: Replace SERVER, INSTANCE, PORT accordingly to suit your server configuration.

Hope it helps.

Monday, April 01, 2013

Google New April Fools' Day Features

As part of Google's tradition, a series of new features or initiatives were announced in this year's April Fools' Day.

We have announcement from YouTube at which they announced they are now ready to announce the best ever uploaded video in 10 years' time. The selection process will be by several technicians based on strict guidelines. And YouTube will be shut down for good.


Next, we have announcement featuring whole new service in beta - Google Nose - a whole new different experience in search using a sense.


We also have got Google Maps launching treasure mode.


Joining in the fun, Gmail is launching Gmail Blue, obviously in mockery on Windows Blue - making everything blue.


Google Fiber is bringing fiber close to you, as long as you are connected to a "pole".


For webmasters and marketers, Google Analytics participated in this joke day by including hits from the International Space Stations.

Last but not least, a Google Easter Egg for you just by doing a search.

Sunday, March 31, 2013

10 Must-Have Chrome Extensions for Developers

The Mashable published 10 Chrome extensions for web developers and I bet web developers like you yourself must be using some of them. Do you have your own favourite extensions? Do share with us.

  1. Firebug Lite
  2. Web Developer
  3. Session Manager
  4. Clear Cache
  5. Chrome Sniffer
  6. JSONView
  7. Resolution Test
  8. Edit This Cookie
  9. Page Speed Insights
  10. Postman - REST Client

Related Readings:

10 Firefox Add-Ons for Designers

The Mashable published 10 Firefox Add-Ons for Designers and I bet web designers and web developers like you yourself must be using some of them. Do you have your own favourite add-ons? Do share with us.

  1. ColorZilla
  2. Pencil
  3. MeasureIt
  4. Stylish
  5. View Source Chart
  6. Firesizer
  7. HTML Validator
  8. Font Finder
  9. CSS Usage
  10. Tab Mix Plus

Related Readings:

10 Firefox Add-Ons for Developers

The Mashable published 10 Firefox Add-Ons for Developers and I bet web developers like you yourself must be using some of them. Do you have your own favourite add-ons? Do share with us.

  1. Firebug
  2. Web Developer
  3. FireFTP
  4. YSlow
  5. Greasemonkey
  6. JSONView
  7. RESTClient
  8. Empty Cache
  9. JS Deminifier
  10. Fireshot

In my own opinion, HttpFox should be the other worthy mention add-on.

Related Readings:

How does it look like in major cities at night without lights?

Ever wonder how does it look like at night without lights? A New York City-based photographer who spent the last two years documenting glaciers around the world produced his impression in major cities - dark, star-lighted sky, and sometimes can be cold.

Notify Me! Android App

A FREE Android app that lets you create a list of apps that are allowed to light the screen up and show their notifications on it as a popup in front of your lock screen.

More information here:

Wednesday, March 27, 2013

Tuesday, March 26, 2013

18 Inspiring Examples of Websites Developed Using HTML5

Looking for HTML5 websites for inspiration? Webrevisions published an article recently introducing 18 such websites.

Friday, March 22, 2013

MSSQL: Update running sequence / number

Let's say we have a table with a column of numbers and for some reason, they are not in running sequence. Instead of editing the rows manually, we can actually do it using a SQL script.

Hopefully the following helps.

--Create some test data
IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'tblTest') AND type in (N'U')) DROP TABLE tblTest
GO
CREATE TABLE tblTest (Label VARCHAR(20), OriginalOrderNo INT, OrderNo INT)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('four', 4, 4)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('seven', 7, 7)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('one', 1, 1)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('two', 2, 2)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('five', 5, 5)
INSERT INTO tblTest (Label, OriginalOrderNo, OrderNo) VALUES ('nine', 9, 9)
GO
--BEFORE
SELECT * FROM tblTest ORDER BY OrderNo
GO
--DO the UPDATE
UPDATE t1 SET t1.OrderNo = t2.Sequence
FROM tblTest t1 INNER JOIN (
 SELECT Label, OrderNo, ROW_NUMBER() OVER (ORDER BY OrderNo) AS 'Sequence'
 FROM tblTest) AS t2 ON t1.OrderNo = t2.OrderNo
GO
--AFTER
SELECT * FROM tblTest ORDER BY OrderNo
GO
IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID(N'tblTest') AND type in (N'U')) DROP TABLE tblTest
GO

Wednesday, March 20, 2013

MSSQL: Get schema owner of database tables

To retrieve a list of schema owner of database tables, try the following code snippet. Hope it help.s

SELECT t.object_id AS 'TableID', t.name AS 'TableName', s.schema_id AS 'SchemaID', s.name AS 'SchemaOwner'
FROM sys.tables t inner join sys.schemas s ON t.schema_id = s.schema_id
ORDER by t.name

Saturday, March 16, 2013

Introducing Samsung GALAXY S 4

This is really looking like Samsung is building its own ecosystem. Looks like there is going to have more and more Samsung in-house apps and a growing personalisation going on in an Android phone.

Samsung S IV accessories announced

Samsung introduced together with the Samsung Galaxy S 4, 11 accessories for the Samsung Galaxy S 4. The accessories are: S Band, S View Cover, Game Pad, Wireless Charging Pad / Cover, Flip Cover, Pouch, Protective Cover+, Headset, Extra Battery Kit, HRM and Body Scale.

Most of the accessories can be used by Samsung’s S-Health 2.0 application.

» Accessories announced by Samsung for the Galaxy S 4 | SamMobile

McDonalds FREE 1,000 Egg McMuffin

McDonalds Singapore is participating its "National Breakfast Day" by giving away 1,000 Egg McMuffinTM absolutely FREE per participating stores, while stocks last, on 18 March 2013 (coming Monday).


How does it work?

McDonalds will give away Free Egg McMuffinTM Giveaway coupon at its participating stores on 18 March 2013. Recipients will then have to present the original coupon on the same day in the morning for redemption.

More information on the giveaway can be found at www.mcdonalds.com.sg/nbd/.

Friday, March 15, 2013

List of known domain names blocked by Kaspersky products

I am putting across a serious note on Kaspersky products blocking domains including Google, Facebook and Twitter. From my experiment, it seems this is true when I am using Google Chrome browser. Have tried to contact Kaspersky via Twitter but am ignored completely. A quick web search on the world wide web reaffirmed that this is not affecting just me, but possibly thousands others as well.

The Kaspersky product I am using is Kaspersky Endpoint Security 8 with the latest database definitions installed as of today. I am not too sure if other Kaspersky variant products are having similar restrictions too.

Some of the confirmed legitimate domains blocked are the following:

Last Updated: 25 March 2013, 3:00 PM (GMT+8)

VictimDomain Remark Added on
Facebook*.akamaihd.net/* Facebook photos 15 Mar 2013
Facebook*.facebook.com/* General website 15 Mar 2013
Get Satisfaction*.cloudfront.net/* Resources 19 Mar 2013
Google*.ggpht.com/* Resources 15 Mar 2013
Google*.google.com/* Several Google services 15 Mar 2013
Google*.googleapis.com/* Resources e.g. Analytics 15 Mar 2013
Google*.googleusercontent.com/* Resources 15 Mar 2013
Google*.gstatic.com/* Resources 15 Mar 2013
Google*.googlegroups.com/* Files hosted may have problems 23 Mar 2013
Microsoft*.ms/* Resources 25 Mar 2013
Microsoft*.wlxrs.com/* Resources 25 Mar 2013
Pinterest*.pinimg.com/* Resources 19 Mar 2013
Twitter*.twimg.com/* Twitter photos 15 Mar 2013
UserVoice*.uservoice.com/* General website 17 Mar 2013
YouTube*.youtube.com/* General website 15 Mar 2013
YouTube*.ytimg.com/* YouTube photos 15 Mar 2013

Right now, I have to add the above domain names (will be growing) as trusted urls to be able to consume content normally.

Please let me know any other domains blocked by Kaspersky so I can add them here too to benefit everyone.

Why is Google killing Google Reader?

If you are still unware, Google will be axing Google Reader on 1 July 2013. Do participate on online petitions hoping the popular service will stay!

Ever wonder why is Google killing Google Reader? Here is a word from former Google Reader Product Manager, Brian Shih, on this.

Join Online Petition to Keep Google Reader Alive

Since Google Reader started 8 years ago, I have been a great fan of it, using it on a daily basis. It is indeed sad to hear we will have to bid farewell to Google Reader on 1 July 2013. Immediately after the closure is announced, online petitions started and quickly begin to receive signatures in tens of thousands on same day. Do participate in them and hopefully Google will listen for once.

  1. Petition on Change.Org
    Objective is to hope Google Reader will stay alive.

  2. Petition on keepgooglereader.com
    Objective is to get Google Reader open sourced so enthusiasts can run the web application themselves. This is with the understanding that Google will not reverse its decision to axe Reader.

I trust Google to product excellent product and not to discontinue just because it is not generating money out of it.

Thursday, March 14, 2013

Goodbye to Google Reader

It is indeed very sad news coming from Google - Google Reader is to be discontinued from 1 July 2013 onwards. This is Google's yet another round of spring cleaning effort.


We launched Google Reader in 2005 in an effort to make it easy for people to discover and keep tabs on their favorite websites. While the product has a loyal following, over the years usage has declined. So, on July 1, 2013, we will retire Google Reader. Users and developers interested in RSS alternatives can export their data, including their subscriptions, with Google Takeout over the course of the next four months.

Google also advised in their support page on how to go about downloading your data so you can bring your RSS subscriptions to a RSS alternative.

The closing of Google Reader must have upset several users including myself and Americans have already started putting up a petition to Keep Google Reader Running. To date, the petition has garnered over 26,000 signatures.

Wednesday, March 13, 2013

Google launches webmasters help for hacked sites

Google launches a new support website to provide help to webmasters if their sites are hacked. For instance, your website will be labelled as "harmful" by Google if it is suspected to hacked.


Google offered several advices and a video for such scenarios. Do watch and read the advices.

Samsung S IV Teaser Video (Part 2)

Samsung released Part 2 of their teaser video to their soon-to-be-announced Samsung S IV phone.

Part 2

You may visit part 1 too.

Sunday, March 10, 2013

Manually download of Android SDK Components (Android SDK platforms)

More information here.

When Responsive Web Design Is Bad For SEO

Insightful article on When Responsive Web Design Is Bad For SEO.

MSSQL: sp_MSforeachdb to loop through all databases without using cursors

sp_MSforeachdb is an undocumented stored procedure since SQL 2005 that can come in real handy, looping through all databases to get information without having to write cursors. The idea of its usage is to use the [?] placeholder and SQL will intelligently do a replace with a database name.

Just some sample usage of sp_MSforeachdb.

--Get all table/columns information from all databases
sp_MSforeachdb 'SELECT * FROM [?].[INFORMATION_SCHEMA].[COLUMNS]'

--Check for orphans login
EXECUTE sp_MSforeachdb 'sp_change_users_login @Action=''report'''

--Get database information - space, name
EXECUTE sp_MSforeachdb 
 'SELECT
  ServerName=@@SERVERNAME, DBName=DB_NAME(), [fileid], CONVERT(DECIMAL(12,2),ROUND([size]/128.000,2)) AS ''SizeMB'',
  SpaceUsedMB = CONVERT(DECIMAL(12,2),ROUND(FILEPROPERTY([name],''SpaceUsed'')/128.000,2)),
  FreeSpaceMB = CONVERT(DECIMAL(12,2),ROUND(([size]-FILEPROPERTY([name],''SpaceUsed''))/128.000,2)) ,
  name, filename
  FROM dbo.sysfiles'

Undocumented may mean it may not be supported in future versions. My last check is sp_MSforeachdb still works for SQL 2008.

Related reading:
  1. MSSQL: sp_MSforeachtable to loop through all tables without using cursors

MSSQL: sp_MSforeachtable to loop through all tables without using cursors

sp_MSforeachtable is an undocumented stored procedure since SQL 2005 that can come in real handy, looping through all tables in a database to get information without having to write cursors. The idea of its usage is to use the [?] placeholder and SQL will intelligently do a replace with a table name.

Just some sample usage of sp_MSforeachtable.

--Check space used for each table in a database
EXECUTE sp_MSforeachtable 'EXECUTE sp_spaceused [?]';

--Check for integrity of tables in a database
EXECUTE sp_MSforeachtable 'DBCC CHECKTABLE ([?])'

Undocumented may mean it may not be supported in future versions. My last check is sp_MSforeachtable still works for SQL 2008.

Related reading:
  1. MSSQL: sp_MSforeachdb to loop through all databases without using cursors

Saturday, March 09, 2013

How to block/unblock Messenger contacts after migration to Skype?

After having moved my messenger to Skype for a few weeks, the experience is like taking 100 steps backwards. Other than once encountering login issues, my impression on Skype has reached new bottom.

On the first day when I first migrated to Skype, messaging my contacts encountered problems. I soon realised that's all because I appeared offline on Messenger previously. A quick resolution not to lose all these contacts is to go back to Messenger, appear online to all contacts, exit from Messenger, then login to Skype again. Why didn't Skype think of this and do a proper synchronise job.

Blocking a messenger contact is so damn difficult on Skype. I repeat again - MESSENGER contact. The reason for repeating is because blocking a Skype contact is a few clicks away within the Skype program itself but NOT for a MESSENGER contact.

To block a messenger contact, you can only do it from Microsoft Live People page.
  1. Login to Windows Live account http://www.outlook.com on your preferred browser.

  2. Click on the down arrow from the top menu followed by the People option.


  3. Then go to Manage > Limit Access.

  4. You may then limit access to selected contacts on this page.

NOTE: It is required to re-login Skype for the block/unblock to take effect.

Linux Cheat Sheet (Command Lines)

# cheat_sheet.org.sh
# (C) William Hackmore, 2010
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License.
# Best viewed in emacs org-mode.

* Reference:
** Basics:
*** Getting help:

# View the manual for target command
man command

# Get help with a target command (probably the same as above, but not always):
command -h

# In case you forget the name of a command, print possible commands relating to guess:
apropos guess

# View index of help pages:
info

*** Command Line Utilities:
**** Basic File and Directory Operations:
# Print current working directory:
pwd

# Show files in current directory:
ls

# Show maximum information about all files, including hidden:
ls -a

# Recurse into subdirectories and list those as well:
ls -R

# Move/rename a file or directory (be careful that you don't move the source over a destination with the same name):
mv source destination

# Delete target forever (be very careful), use -r recursive flag for directories:
rm target

# Copy file or directory:
cp source destination

# Mount filesytem:
mount /dev/device_name /media/device_name

# Unmount:
umount /media/device name

# Forensically clone filesystems and do other low-level operations on files. Be careful with this one. Can be destructive:
dd

# Work with filesystems and partitions. (Easier, still quite dangerous):
fdisk

**** System Administration:

# Execute command as an administrator (can be destructive/insecure. Use only for system administration tasks):
sudo command

# Become system administrator:
sudo -s

# Quit system administration:
exit

***** Installing software from a .tgz (also known as a tarball):

# First, unzip the tarball (see section on tar, below)
# Next, move into unzipped directory:
cd software_directory

# Always read README first if it is provided, in case there are any modifications to the procedure outlined below:
cat README

# Automatically check for appropriate configurations and generate a MAKE file in the directory:
./configure

# Compile software. May require sudo:
make

# Move files into their appropriate locations. May also require sudo:
make install

# Clean up files in directory, in case make command fails, or just to remove unnecessary cruft:
make clean

***** Ubuntu/Debian Software repositories:

# Check distro repositories for software updates:
sudo apt-get update

# Download and install updates (update first):
sudo apt-get upgrade

# Search for package in the repositories:
apt-cache search keyword

# Get more detail on one specific package:
apt-cache show package_name

# Download and install a package:
sudo apt-get install package_name

# View the output of a command in a more convenient format:
command | less

**** Working With Files:

# Print a file in terminal:
cat file

# Find files matching filename:
locate filename

# Search through filename for matches to phrase:
grep phrase filename

# Search through output of a command for phrase:
command | grep phrase

**** Working With Processes:

# List all running processes:
ps -e

# Standard system monitor showing a more extensive view of all processes and system resources:
top

# Like top, but with a better, cleaner interface:
htop

# Stop a process from using all system resources and lagging computer:
nice process_name

# Kill misbehaving process (use sparingly, last resort, try 'nice' command first):
pkill process name

# Start a process in the background
command &

# Start a process in the background and have it keep running after you log off
nohup command &

**** Compression and Encryption:

# Make a simple compressed backup of a file or directory:
tar -cvzf backup_output.tgz target_file_or_directory

# Open a compressed .tgz or .tar.gz file:
tar -xvf target.tgz

# Encrypt a file:
gpg -o outputfilename.gpg -c target_file

# Decrypt a file:
gpg -o outputfilename -d target.gpg

# Zip and encrypt a directory simultaneously:
gpg-zip -o encrypted_filename.tgz.gpg -c -s file_to_be_encrypted

*** The Bash shell:
**** File Name expansions:
# Current user's home directory:
~/

# Current directory:
./

# Parent directory:
../

# Or even (Two parent directories down):
../../

# All files in target directory. (Be very careful.):
/*

**** Output Redirects:

# Redirect output of one command into the input of another with a pipe:
command_1 | command_2

# Or even:

command_1 | command_2 | command_3

# Redirect output to a file:
command > file

# Or:

file > file

# Or even, to redirect in a different direction:
file < file

# Append output rather than writing over the target file:

file_or_command >> file

# Works like |, but it writes output to both target and terminal:
tee target

# Redirect standard output and error to /dev/null, where it is deleted.
command > /dev/null 2>&1

**** Controlling Execution:
# Wait until command 1 is finished to execute command 2
command_1 ; command_2

# Or even:
command_1 ; command_2 ; command_3

# && acts like ; but only executes command_2 if command_1 indicates that it succeeded without error by returning 0.
command_1 && command_2

# || acts like && but only executes command_2 if command_1 indicates an error by returning 1.
command_1 || command_2

**** Bash Wildcards:
# Zero or more characters:
*

# Matches "phrase" and any number of trailing characters:
phrase*

# Matches any incidences of "phrase" with any trailing or leading chars:
*phrase*

# Matches any one char:
?

# Matches any of the characters listed inside brackets:
[chars]

# Matches a range of chars between a-z:
[a-z]

** Advanced:
*** Command Line Utilities, Continued:
**** Networking:

# Configure network interfaces:
ifconfig

# Configure wireless network interfaces:
iwconfig

# Connect to a remote server.
ssh username@ip_address

# Forward X from target to current machine (Get a remote desktop. Somewhat obscure, but very useful):
ssh -X username@ip_address

# Copy files over the network from one machine to another:
scp source_filename:username@ip_address target_filename:target_username@target_ip_address

# Copy only changes between files or directories (super efficient way to sync directories, works either locally or with remote servers using username@ip_address:optionalport, just like ssh):
rsync source target

# Check to see if target is online and responding
ping ip_address

# View network route to target:
traceroute6 ip_address

# Network Monitor
netstat

# Manage standard linux firewall (advanced users only)
iptables

# Scan this machine to check for open ports:
nmap 127.0.0.1

***** netcat:

# Listen for input from network on recieving_port, dump it to a file (insecure, but handy):
netcat -l recieving_port > file_copied

# Pipe the output of a command to a target ip and port over the network:
command | netcat -w number_of_seconds_before_timeout target_ip target_port

# Use tar to compress and output a file as a stream, pipe it to a target ip and port over the network:
sudo tar -czf - filename | netcat -w number_of_seconds_before_timeout target_ip target_port

**** Users and Groups:
# Change owner of a file or directory:
chown user_name:group_name directory_name

# Change privileges over file or directory (see man page for details.)
chmod

# Create a new user:
adduser

# Change user privileges (be very careful with this one):
usermod

# Delete user
deluser

# Print groups:
groups

# Create a new group:
groupadd

# Change group privileges:
groupmod

# Delete group:
delgroup

# Temporarily become a different user:
su username

# Print usernames of logged in users:
users

# Write one line to another user from your terminal:
talk

# Interactive talk program to talk to other users from terminal (must be installed from repositories.):
ytalk

**** Working With Files, Continued:
# View what processes are using what files:
lsof

# View the differences between two files:
diff file_1 file_2

# Output the top number_of_lines of file:
head -n number_of_lines file

# Like head, but it outputs the last -n lines:
tail -n number_of_lines file

# Checksum a file:
md5sum file

# Checksum every file in a directory (install this one from repositories.):
md5deep directory

# Checksum a file (better algorithm with no hash collisions):
sha1sum

# Same operation as md5deep, but using sha1:
sha1deep

# Call command every few number_of_seconds, and display output:
watch -n number_of_seconds command

# Execute command, print how long it took:
time command

# View files in directory from largest to smallest:
du -a directory | sort -n -r | less

# remove spaces from filenames in current directory:
rename -n 's/[\s]/''/g' *

# change capitals to lowercase in filenames in current directory:
rename 'y/A-Z/a-z/' *

***** Environment and Hardware:
# Print full date and time:
date

# Print the hostname of this machine:
echo $HOSTNAME

# Print information about current linux distro:
lsb_release -a

# Print linux kernel version:
uname -a

# Print information about kernel modules:
lsmod

# Configure kernel modules (never do this ;p ):
modprobe

# View Installed packages:
dpkg --get-selections

# Print environment variables:
printenv 

# List hardware connected via PCI ports:
lspci

# List hardware connected via USB ports:
lsusb

# Print hardware info stored in BIOS:
sudo dmidecode

# Dump captured data off of wireless card:
dumpcap

# Dump info about keyboard drivers:
dumpkeys

***** Ubuntu System Administration, Advanced (Continued):

# Add a Personal Package Archive from Ubuntu Launchpad:
add-apt-repository

# Install a .deb file from command line:
sudo dpkg -i package.deb

**** Python:

# Update pip (Python package manager):
pip install -U pip

# search pip repos for a library:
pip search library_name

# create a virtual ython environment to allow install of many different versions of the same Python modules:
virtualenv dirname --no-site-packages

# connect to a virtual python environment
source dirname/bin/activate

# disconnect from a virtual python environment:
deactivate

# install package into virtual python environment from outside:
pip install packagename==version_number -E dirname

# export python virtual environment into a shareable format:
pip freeze -E dirname > requirements.txt

# import python virtual environment from a requirements.txt file:
pip install -E dirname -r requirements.txt

**** git (all commands must be performed in the same directory as .git folder):

# Start a new git project:
git init

git config user.name "user_name"

git config user.email "email"

# Make a copy of a git (target can be specified either locally or remotely, via any number of protocols):
git clone target

# Commit changes to a git:
git commit -m "message"

# Get info on current repository:
git status

# Show change log for current repository:
git log

# Update git directory from another repository:
git pull [target]

# Push branch to other repository:
git push [target]

# Create a new branch:
git branch [branchname]

# Switch to target branch:
git checkout [branchname]

# Delete a branch:
git branch -d [branchname]

# Merge two branches:
git merge [branchname] [branchname]

# Show all branches of a project:
git show-branch

*** Virtualization:

#clone a virtual machine (this works, it's been tested):
vboxmanage clonehd virtual_machine_name.vdi --format VDI ~/target_virtual_machine_name.vdi

#mount a shared virtual folder:
#you need to make sure you have the right kernel modules. You can do this with modprobe, but this package works instead in a ubuntu-specific way.

sudo apt-get install virtualbox-ose-guest-utils

sudo mount -t vboxsf name_of_shared_folder_specified_in_Virtualbox path_of_mountpoint

*** mysql:

# Get help:
help

# Show databases:
show databases;

# Choose a database to use:
use database_name_here;

# Show database schema:
show tables;

# Delete database:
DROP DATABASE databasename;

# New database:
CREATE DATABASE databasename;

# Create a new user:
CREATE USER username@localhost IDENTIFIED BY 'password';

# Show users:
select * from mysql.user;

# Delete a user:
delete from mysql.user WHERE User='user_name';

# Give user access to all tables (make them root). the "%" means that they can sign in remotely, from any machine, not just localhost.:
grant all privileges on *.* to someusr@"%" identified by 'password';

# give certain privileges to a user on a certain database:
grant select,insert,update,delete,create,drop on somedb.* to someusr@"%" identified by 'password';

# Tell mysql to use new user priv policies:
flush privileges;

# change user password:
use mysql;

update user set password='password'('newpassword') where User='user_name';

# mysql command line args:
# export text file with commands to rebuild all mysql tables:
mysqldump databasename > dumpfilename.txt

# restore from a dump:
mysql -u username -p < dumpfilename.txt

# dump entire database:
mysqldump -u username -p --opt databasename > dumpfile.sql

# restore from entire database dump:
mysql -u username -p --database=databasename < dumpfile.sql

Courtesy of a GitHub user here

Friday, March 08, 2013

Moving forward ...

Moving forward, I will be writing more articles on tips and tricks in doing things.

How to get the new Facebook Newsfeed (Google+) look?

Facebook announced a revamp on its Newsfeed putting more emphasis on the news area. My take on the new look reminds me of Google+. Facebook must have taken some design cues from Google+ and incorporating them onto theirs. Study Facebook’s New News Feed: The Before & After Look and see for yourself.

Ok, so how do I opt in to the new Newsfeed? Click this link, scroll all the way down and then click on the "Try the new look" button. You will be placed in the waiting list.

Wednesday, March 06, 2013

Resolve Skype unable to login problem

I woke up in the morning finding myself unable to log myself onto Skype to access my Messenger contacts. After figuring out for some time and sometimes even accusing my anti-virus program, I conclude this is a problem with the Skype installed on my laptop, since I am having no problems with Skype on my Android.

To resolve the login problem, I attempted to remove my profile completely. This seems to have resolved everything.

Before performing the following steps, make sure Skype program has exited i.e. Skype shouldn't even be lurking in your system tray.
  1. Start Menu > Run

  2. Type %appdata%\skype

  3. Click OK button.

  4. Delete the folder bearing the name of your Skype login name. It may be in the form of <username> or live#<username>.

Your Skype should run okay now.

For Mac users, the path is User/Library/Application Support/Skype.

Tuesday, March 05, 2013

SQL Management Studio - "Saving changes is not permitted ..." error

Sometimes when you are working something using SQL Management Studio (SSMS) and intend to make changes to existing table schema, e.g. adding a new column, you may encounter the following error message. You are unable to proceed making the changes you desire with SSMS user interface.

Saving changes is not permitted ...

So what can you do? Either you re-create the table or write ALTER statements (but let's not do that!).

There is, however, a known trick to get around the above annoying "Saving changes is not permitted ..." error. Here are the steps to do just that!
  1. From the SSMS, go to Tools > Options.
  2. Select the Designers page.
  3. Un-check "Prevent saving changes that require table re-creation".
    Options Box
  4. Click OK button.

You should be good to go now!

Programming Is Not For Everybody

Just as I posted "Every student in every school should have the opportunity to learn to code" few days back, there is another article saying Programming Is Not For Everybody.

I sort of quite agree with the latter article especially on the last statement for some people.

A lot of time, it’s sitting in front of a computer screen, looking at a colorful text document, and thinking, and thinking, and typing, getting angry, and wondering why the hell you’re living a life sitting down.

But still, I love programming :)

Samsung S IV First Teaser Video


Part 2 of the above video is out now.

Saturday, March 02, 2013

Google Releases Interactive Infographics to Explain How Search Works

Google released an interactive infographics to explain just 'How Search Works'. It comes in 3 parts - Crawling and Indexing, Algorithms, and Fighting Spam.

YouTube Does a Harlem Shake With an Easter Egg

YouTube has joined Harlem Shake. Simply perform a search on 'do the Harlem Shake' on YouTube to reveal the Easter Egg.

The Harlem Shake effect starts off with the YouTube's logo shaking, followed by the search results. A video record of the Easter Egg is as follows:

Friday, March 01, 2013

Chrome Super Sync Sports - Run, Cycle Swim With Friends

Google just launched Chrome Super Sync Sports, a Chrome Experiment web app that syncs any smartphone or tablet running the Chrome app with a corresponding computer, turning your device into a handheld controller.

To start playing, players must first visit the Super Sync Sports website, get a URL and a unique game ID code, which are then entered into the mobile Web browser in order to enter the game. One can either enter as a single player mode or multi-player mode. In the game, players can compete by running, cycling or swimming, all controlled using hand gestures on the mobile screen. Players' progress in the game will be telecast on the desktop browser.


Very creative.

Wednesday, February 27, 2013

Removing .NET Framework

In case one needs to remove .NET framework for some reason e.g. re-installation, there is a free .NET Framework cleanup tool.

The .NET Framework cleanup tool supports removing the following products:

  • .NET Framework - All Versions
  • .NET Framework - All Versions (Tablet PC and Media Center)
  • .NET Framework - All Versions (Windows Server 2003)
  • .NET Framework - All Versions (Windows Vista and Windows Server 2008)
  • .NET Framework - All Versions (Windows 7)
  • .NET Framework 1.0
  • .NET Framework 1.1
  • .NET Framework 2.0
  • .NET Framework 3.0
  • .NET Framework 3.5
  • .NET Framework 4
  • .NET Framework 4.5

» .NET Framework Cleanup Tool User's Guide | Aaron Stebner's WebLog

Every student in every school should have the opportunity to learn to code

Code.org is a non-profit foundation dedicated to growing computer programming education.

Our vision is that every student in every school has the opportunity to learn how to code. We believe computer science and computer programming should be part of the core curriculum in education, alongside other science, technology, engineering, and mathematics (STEM) courses, such as biology, physics, chemistry and algebra.

Tuesday, February 26, 2013

jQuery: Move Up, Move Down, Delete Elements

The following article describes how to make use of jQuery to move elements up/down and also to delete them.

How it will look like

The JavaScript bit
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script language="javascript" type="text/javascript">
    $(document).ready(function() {
        $(".moveDown").click(function() {
            $(this).closest("li").insertAfter($(this).closest("li").next());
            //$(this).parent().parent().insertAfter($(this).parent().parent().next());
        });
        $(".moveUp").click(function() {
            $(this).closest("li").insertBefore($(this).closest("li").prev());
            //$(this).parent().parent().insertBefore($(this).parent().parent().prev());
        });
        $(".deleteItem").click(function() {
            $(this).closest("li").remove();
        });
    });

    function getSequence() {
        var liIds = $('.olList li').map(function(i, n) {
            return $(n).attr('attr');
        }).get().join(',');

        alert(liIds);
    }
</script>

The HTML bit
<ol class="olList">
    <li attr="1">
        <span>Item 1</span>
        <span><a href="javascript:void(0)" class="moveUp">Move Up</a></span>  
        <span><a href="javascript:void(0)" class="moveDown">Move Down</a></span>  
        <span><a href="javascript:void(0)" class="deleteItem">Delete</a></span>
    </li>
    <li attr="2">
        <span>Item 2</span>  
        <span><a href="javascript:void(0)" class="moveUp">Move Up</a></span>  
        <span><a href="javascript:void(0)" class="moveDown">Move Down</a></span>  
        <span><a href="javascript:void(0)" class="deleteItem">Delete</a></span>
    </li>
    <li attr="3">
        <span>Item 3</span>  
        <span><a href="javascript:void(0)" class="moveUp">Move Up</a></span>  
        <span><a href="javascript:void(0)" class="moveDown">Move Down</a></span>  
        <span><a href="javascript:void(0)" class="deleteItem">Delete</a></span>
    </li>
</ol>
<br />
<input type="button" value="Get Sequence" onclick="getSequence()" />

Highlights from Singapore Budget 2013

The highlights from Singapore Budget 2013 delivered by Finance Minister, Tharman Shanmugaratnam, on 25 February 2013.

Bug on iOS 6 and iOS 6.1 let anyone access your phone without passcode

The bug on iOS 6 that allows anyone to access your phone without having to key in a valid passcode but Apple has fixed this with the release of iOS 6.1.


Very shortly, hackers found yet another bug this time round on iOS 6.1, exploiting the emergency call feature again to access your phone's data, voicemail and contacts.

Sunday, February 24, 2013

How to delete the server history list from SQL Management Studio 2008?

Especially if you are in an environment where you need to connect to several different DB servers, the list of server names in your SQL Management Studio (SSMS) may get lengthy and some may even become defunct.

The question is how do I delete them? The steps involved is actually quite simple (note this is for SSMS 2008).

  1. Go to %UserProfile%\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell
  2. Find SqlStudio.bin file and delete it.

The server name list is now clean again.

SQL Management Studio 2008

Thursday, February 21, 2013

Google Glass Commercial Ad

Yahoo! Homepage Refresh - Newsfeed and Infinite Scrolling

Yahoo! CEO, Marissa Mayer, announced in a blog post that the homepage of Yahoo! (U.S. only) is refreshed. The new homepage features a new newsfeed section with infinite scrolling.

Designed to be more intuitive and personal, the new Yahoo! experience is all about your interests and preferences. Since streams of information have become the paradigm of choice on the web, we’re introducing a newsfeed with infinite scroll, letting you experience a virtually endless feed of news articles. Whether you are a sports fanatic or entertainment buff, you can easily customize your newsfeed to your interests. And, to make Yahoo! even more social, you can log in with your Yahoo! or Facebook ID to get articles from thousands of news sources as well as those shared by your friends.

Sunday, February 17, 2013

Meteorite hit Russia, injuring almost 1,000

On 15 Feb, a meteorite entered Earth and came direct impact onto central Russia, setting off a shockwave that shattered windows and injuring almost 1,000 people in an event unprecedented in modern times. Preliminary investigation by the NASA suggests the meteor is unrelated to the less than 24 hours later asteroid which was set to pass Earth at a distance of 27,520 kilometres.

Quote from Nasa,

The trajectory of the Russia meteor was significantly different than the trajectory of the asteroid 2012 DA14, which hours later made its flyby of Earth, making it a completely unrelated object.

The reason as to why the Russian meteor was not detected is because it came out of the daytime sky. These are nearly impossible to find ahead of time because telescopes can only spot asteroids during the night. This is as quoted from the NASA.

CSS Architectures, Part 1: Principles of Code Cleanup and the New Best Practices

Useful article on CSS.

Saturday, February 16, 2013

Understanding Google APIs

A comprehensive well-written article on Google APIs.

Gangnam Style is history; Harlem Shake is NOW!

The PSY Gangnam Style has been copied all over the world and YouTube hits gathered more than 1.3 billion views so far - a record for YouTube.

Now, everybody is doing a brand new 30 seconds dance. This is how easy the dance can be setup. We just need one one person with a helmet and a mask in a seemingly normal environment. That person will start the Harlem Shake first before the entire room join in the dance.

Because of the simplicity of creating own Harlem Shake, many have joined in the fun, including big organisations like Pepsi, Google, Facebook and Microsoft.

Pepsi does the Harlem Shake
http://www.youtube.com/watch?v=DeMuHWai8-o

Google does the Harlem Shake
http://www.youtube.com/watch?v=8OiFb5O4fio

Facebook does the Harlem Shake
http://www.youtube.com/watch?v=dXC85PNVms4

Windows 8 does the Harlem Shake
http://www.youtube.com/watch?v=GNcnI3wfiso

Saturday, February 09, 2013

Permalinks for Google Drive Images

In December last year, I talked about How to Download Google Docs With a Click. An unofficial blog Google Operating System published an article on getting a permalink for images uploaded onto the Google Drive, hence, allowing you to embed it onto your own blog or website.

Here's how to do just that.

  1. Find out the file id
  2. The permalink will be as such: https://docs.google.com/uc?export=view&id=[FILE ID]

PM Lee's Speech at Parliamentary Debate on Population White Paper


Thursday, February 07, 2013

Speech by Mr Inderjit Singh on Population White Paper

People's Action Party MP, Mr Inderjit Singh, debated on the Population White Paper and put up his point across that he is against his own party's 6.9m projected population. I applaud his courage to stand up against the party whip and for his fellow Singaporeans.

His key points are;

  1. Slow down immigration and focus on resolving all issue related to the past population boom.
  2. We can live with a slightly slower growth (not zero or slow growth) and hence moderate dependence on foreigners.
  3. Use the Dubai model to complement our local workforce with foreign workforce, but don’t grant them PRs – ie a transient workforce.
  4. Abandon the 6.9m figure by 2030, this will be another rapid growth which we cannot handle.
  5. Solve Singaporeans problems first and also don’t give PRs same privileges as citizens.

As published on Mr Inderjit Singh's Facebook status, the full speech made in the parliament is as below:

Speech by Mr Inderjit Singh, MP for Ang Mo Kio GRC
On the White Paper on Population


Madam Speaker, thank you for allowing me to join the debate on the White Paper on Population.

While the report has some compelling arguments for the 6.9m population figure projected, we all know it is based mainly on economic considerations. Had we focused on things like building a cohesive nation with a strong national identity, the outcome would likely be very different.

I feel the time has come for us to find a better balance between economic growth and social cohesion and yes there will have to be tradeoffs of economic growth but I would rather trade some of these for a cohesive, united nation where people feel taken care of at home and are confident of their future. I am not saying we go for low or no growth. Instead I am willing to adjust my growth expectations for a more comfortable life for all Singaporeans. I am confident we will still be able to pursue respectable economic growth when companies and Singaporeans are faced with a situation of tightened labour availability by focusing on improving ourselves through productivity and higher value capabilities. Finland and other small nations have done, we can do it too.

Our past decade of rapid population growth has already created too many problems which need to be solved first before we take the next step. I call on the government to take a breather for five years, solve all the problems created by the past policies of rapid economic and population growth. We can safely say that we have failed to achieve the goal set by the then Prime Minister Goh Chok Tong, of a Swiss standard of living for most Singaporeans, except for the higher income Singaporeans including foreigners who just recently decided to make Singapore their home. So I call for a breather in this quest of growing the population and focus on improving the lives of Singaporeans and achieve that promised Swiss Standard of living for most Singaporeans first before we plan our next growth trajectory.

Taking Care of the Singaporean Core

I have a big issue with the number of PRs and new citizens we are planning to add to our population. I don't see the necessity to be as aggressive when the key consideration of the population growth is the economy. We have already added too many new citizens and PRs and need time for integration and social cohesion to happen. Looking at history, our population grew from around 2.4m in 1980 to 3m in 1990 and then to 4m in 2000, reaching 5.3m last year. Just looking at the resident population alone, we grew the numbers from 2.3m in 1980 to 2.7m in 1990, 3.3m in the year 2000 and then to 3.8m last year. So in the last decade we added more than 1m to the resident population, and the in last 25 years, which is close to 1 generation of Singaporeans, we have added another close to 50% more to our resident population. I believe this must be the fastest rate of population growth in the world and I feel this is just too much for us to comfortably go back and build a national identity and social cohesion which was progressing very well till the 1990s. Adding another 500,000 to 800,000 more PRs and citizens as proposed by the white paper will be disastrous and add to our already difficult infrastructure and social problems.

If it is economic growth we want then let's just adopt the Dubai model of a transient workforce which will give us a lot more flexibility to manage numbers in the longer term. On PRs, today we already have too many of them and they are enjoying full citizen privileges without the citizens' responsibilities. For example;

  • Far too many PR boys who skip NS when they turn 18. After enjoying the privileges they have a choice of not doing NS and then leave the country. I believe only around 30% of all PR boys do NS today. Well, our Singapore sons don't have a choice but to do NS, it is an office not to do it.
  • PR children study at their International system schools sticking to their home cultures.
  • PRs can buy HDB flats from the open market driving prices of HDB flats too high.

So I urge the government to reduce the number of projected new PRs and citizens just to the population replacement levels and be more selective and differentiate their privileges from citizens. I have a few suggestions for the government to consider;

  • The government in the past couple of years has tried to draw the distinction between PRs and citizens by increasing school fees and healthcare fees for them. But I wonder would it not have been better to instead partially subsidize these same fees for Singapore citizens? So do it the other way round, reduce fees for Singaporeans not just increase for PRs.
  • PR children must be made do national service - it should no longer be a choice and we should make it an offence if they don’t do it. We should not grant PRs to families who don’t commit their sons to National Service.
  • HDB - if a PR buys a HDB flat from the open market, charge a levy of say $50k and allow them to sell only to Singaporeans. If the PR takes up citizenship within 5 years, we can refund the levy.
  • Children of PRs should be made to study in our national schools so that we increase the chance of integrating them at the next generation.
  • On the employment front, it is time we implement a Singaporean first hiring policy like what is done in some developed countries like Canada. Companies should show proof first that they were not able to fill a position with a Singaporean before they are allowed to hire a foreigner.
  • Reconsider the dependents policy - I have come across a number of cases where our targeted one child from China brings in 2 parents who then bring 2 parents each as their dependents - Net is that we gain one young one child who we brought in for our future but also inherited 6 older people - making our ageing population issue worse not better.

I feel the differentiated privileges will separate the genuine ones from those who are here for a ride. We should grant PRs to those who are most likely going to take up citizenships so these differentiated privileges should not stifle our plans to attract quality PRs and new citizens.

This brings me to the point of how many Singaporeans are feeling about the presence of such huge numbers of new citizens, PRs and foreigners amongst our midst. First for housing - there is no doubt that the influx of foreigners in Singapore has driven up our property prices. PRs are buying HDB flats from the open market which drives up prices.

Just last week I had a dialogue session with my private estates residents and one of my residents complained that a new citizens recently bought a landed property in this old estate and was building a 3 and a half storey towering house. Well the, new citizen, the owner of the house was also present and when, I spoke with him during the tea session I found out that he was a new citizen formerly from China, just gained his citizenship and bought not 1 but 3 landed properties in Kebun Baru alone. I was surprised and saddened because many Singaporeans cannot afford to do the same, and this new citizen, no matter how he may have made his wealth is able to do so.

Many young Singaporeans I talk to, especially those who have recently graduated and have just entered the workforce feel demoralized because many of the things that they grew up aspiring to have are now beyond their reach. Our aggressive growth strategies, which allowed cheaper foreign workers, including professionals to easily gain employment passes degraded or depressed wage levels of many Singaporeans, not just the lower income Singaporeans. I remember when I started work in 1985, my salary was $1900 as an entry level engineer. After a few years I could afford a house and a car. Today, 28 years later, an entry level engineer in Singapore earns $2600, just $700 more than what I earned when I started. The mathematics is very simple, the cost of living did not just go up by 1.3% per annum the last 27 years and even more, the cost of owning a HDB flat is did not just go up by 37% since 1985.

Finally, I am perturbed by the banquet analogy used by Minister Khaw. We are talking about lives of Singaporeans. Our banquet guests come for one night and leave when the function is over. There is no turning back when we grant PR and citizenships. We must be more exact about the numbers we want to add to the Singapore population and not plan on a basis of 'hoping we hit some number". Because if overdo things and end up with a population of more than 7m, it may be too late to stop the fast moving train of population growth when we fire up all the engines of growing the population. We missed the mark the last 10 years, and are already paying a high price for that mistake.

In my speech in this house in 2008 during the committee of supply debate on the population I urged the government to abandon the "the instant tree mentality" in trying to grow the population in response to the declining birth rates. At that time, I did not agree with the rate of growth pursued and we know the consequences and the hardship Singaporeans faced as a result of the rapid growth, Instant trees cannot grow strong roots and can be uprooted in difficult times. I once again urge the government to slow down and plan on reaching their population target over a longer time horizon. I don't think we can live with a 6.9m population in 2030. We may be able to handle it in 2050, no one really knows. Please abandon this 'instant tree" mentality as we cannot afford to make Singaporeans lives more difficult as a result. I rather we err on the side of caution when it comes to growing our population. We cannot keep paying a high price for planning misjudgements.

In Conclusion, I would like to see us take a breather from re-growing our population again. We have too many problems as a result of the last breath taking population growth rate. As a government we need to rebuild the trust and confidence among Singaporeans that our citizens matter most to us and that we are willing take a break from our relentless drive for growth to solve their problems, make their lives more comfortable, give them a better quality of life and show them that any future growth of population will not create similar social and cost of living problems. At this stage many Singaporeans from all walks of life don't have the confidence that we can handle another steep growth of the population, so let's not push it. I would like all of us, including the government to spend the time creating and environment that gives us confidence in our future and one where our young can see a sense of hope of opportunity and if we fail to instil a sense of hope and opportunity for our future generations, we will not be able to root them here and build a strong national identity and a strong nation. This is what building a strong Singapore core should entail. So let's delay all plans for further population growth for now.

Saturday, February 02, 2013

Free Online Education

For your information if you are interested in free online education.

Access blocked websites, stream US / UK stuff

For people who like to stream US/UK stuff but don't want to pay VPN, try Hola. They have support for Windows, Android, Chrome, Firefox and Apple.

Alternatively, try TunnelBear VPN. It's free for first 500MB of data each month. They have support for Windows, iOS devices, Mac and Android.

Turn your browser into a text editor

When we need to jot down something quick that doesn't need to be saved later, we often open up Notepad. There is actually a simple quick handy way to do it right in your browser. All you need to do is type the following code into the browser's URL bar:

data:text/html, <html contenteditable>

The above trick uses the Data URI's format and telling the browser to render an html.

» One line browser notepad | coderwall

Sunday, January 27, 2013

Punggol East By Election 2013 voting result

Ms Lee Li Lian of the Workers' Party (WP) has won the Punggol East by-election in a hard fought 9-days campaign. Dr Koh of the People's Action Party (PAP) has lost by a margin of slightly more than 10%. This shows the ruling party may need to put in more work on both both national and local issues to convince Singaporeans into voting for them in the next General Election. The other 2 candidates, Kenneth Jeyaretnam of the Reform Party (RP) and Desmond Lim (Singapore Democratic Alliance (SDA), failed to secure the minimum 12.5%, hence losing their $14,500 election deposits.

Are we moving slowly towards a 2-party system? Perhaps but not that soon. To-date, the Workers' Party is now sitting on 8 parliamentary seats out of the total 88 seats. The remaining 80 seats are by the PAP's.

The breakdown voting result is as such:

Lee Li Lian (WP)        16,038 votes (54.52%)
Koh Poh Koon (PAP)      12,856 votes (43.71%)
Kenneth Jeyaretnam (RP) 353 votes (1.20%)
Desmond Lim (SDA)       168 votes (0.57%)

Total valid votes       29,415
Total rejected votes    417
Total votes             29,832

An irrelevant comment - Why is the total rejected votes more than the votes for RP and SDA? Oops.

The by election result was announced by the Returning Officer, Yam Ah Mee, at around 11pm last night. Watch Yam Ah Mee possibly last appearance as a Returning Officer below.


NOTE: Above result does not include the overseas votes.

Scenes from Block 322, Hougang Ave 5

Such was the scenes from the Workers' Party supporters at a coffeeshop at block 322 along Hougang Ave 5. Simply electrifying.

Saturday, January 26, 2013

Lee Li Lian ‪speaks at the Workers' Party rally, Punggol East by-election, Jan 23, 2013‬

Low Thia Khiang speaks at the Workers' Party rally, Punggol East by-election, Jan 23, 2013

Chen Show Mao speaks at the Workers' Party rally, Punggol East by-election, Jan 23, 2013‬

Sylvia Lim speaks at the Workers' Party rally, Punggol East by-election, Jan 23, 2013‬

Dr Koh Poh Koon speaks at the PAP rally, Punggol East by-election, Jan 24, 2013

Prime Minister Lee Hsien Loong, People's Action Party rally, Punggol East by-election, Jan 24, 2013

Kenneth Jeyaretnam speaks at the Reform Party rally, Punggol East by-election, Jan 24, 2013

Redesigning Google: how Larry Page engineered a beautiful revolution

When Page took office, his first directive was clear. "Larry said ‘hey everyone, we’re going to redesign all of our products,’" recalls Jon Wiley, lead designer on Google Search. Wiley and co had just two months to give Google a fresh coat of paint, and to start thinking holistically about how Google as a whole was perceived. "We had a mandate to make this all look good," Wiley says.



» Redesigning Google: how Larry Page engineered a beautiful revolution | The Verge

Preview of what Blackberry 10 has got

A brief preview on what the new Blackberry 10 has got up its sleeve.

Thursday, January 17, 2013

Punggol East by-election hopeful Ooi Boon Ewe speaks to reporters

Ooi Boon Ewe was the first to collect nomination form for the on-going by-election in Punggol East. But on the nomination day, Ooi dropped out of the contest claiming he had lost his political donation certificate and his required deposit for the by-election was lost with his driver.

In this video, he accused media unfairness to him.

Popular Posts