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