Reflection of my schooling life

2010
07.09
I was reading through Dailytech, saw an interesting news that a Chinese outsourcing firm once accepts applicants with IQ of more than 140, but as usual, it was the comments that were more insightful and representative of the society (http://www.dailytech.com/article.aspx?newsid=18974)

As someone with above average IQ score (mid 130 to low 140 depends on how I'm tested and how I felt at the time of taking the tests), I faced some of the problems mentioned in the comments when I was in primary and secondary school. Most of the time, I could understand abstract concepts faster than my classmates, and I hated it when the teacher had to explain multiple times to students who were slower. I also disliked solving the same problems (not seen as the same by most of my classmates though) over and over again.

Thankfully, I was in the system that is meritocratic, which rewards performance rather than hard work. I had a few understanding teachers who realised that I could study more advanced materials, and the school's initiative to place students with equal ability together. In the end, I enjoyed my schooling years.

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

From Charles Dickens’ “The Uncommercial Traveller”

2010
07.05
Are not the sane and the insane equal at night as the sane lie a dreaming? Are not all of us outside this hospital, who dream, more or less in the condition of those inside it, every night of our lives? Are we not nightly persuaded, as they daily are, that we associate preposterously with kings and queens, and notabilities of all sorts? Do we not nightly jumble events and personages and times and places, as these do daily? Said an afflicted man to me, when I visited a hospital like this, ‘Sir, I can frequently fly.’ I was half ashamed to reflect that so could I – by night.

I wonder that the great master, when he called Sleep the death of each day’s life, did not call Dreams the insanity of each day’s sanity.

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

??

2010
06.08
???
??
????????
????
?????
???
??
????????
????
?????
???
??
????????
????,?????
???
??
??????????
????,?????
???
??
?????????
?????
????

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Drive: the surprising truth about what motivates us

2010
06.01
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Black guy got owned by Chinese in rapping

2010
06.01
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Steve Jobs – Flash is no longer necessary

2010
04.29
Apple has a long relationship with Adobe. In fact, we met Adobe’s
founders when they were in their proverbial garage. Apple was their
first big customer, adopting their Postscript language for our new
Laserwriter printer. Apple invested in Adobe and owned around 20% of
the company for many years. The two companies worked closely together
to pioneer desktop publishing and there were many good times. Since
that golden era, the companies have grown apart. Apple went through
its near death experience, and Adobe was drawn to the corporate market
with their Acrobat products. Today the two companies still work
together to serve their joint creative customers – Mac users buy
around half of Adobe’s Creative Suite products – but beyond that there
are few joint interests.

I wanted to jot down some of our thoughts on Adobe’s Flash
products so that customers and critics may better understand why we do
not allow Flash on iPhones, iPods and iPads. Adobe has characterized
our decision as being primarily business driven – they say we want to
protect our App Store – but in reality it is based on technology
issues. Adobe claims that we are a closed system, and that Flash is
open, but in fact the opposite is true. Let me explain.

First, there’s “Open”.

Adobe’s Flash products are 100% proprietary. They are only
available from Adobe, and Adobe has sole authority as to their future
enhancement, pricing, etc. While Adobe’s Flash products are widely
available, this does not mean they are open, since they are controlled
entirely by Adobe and available only from Adobe. By almost any
definition, Flash is a closed system.

Apple has many proprietary products too. Though the operating
system for the iPhone, iPod and iPad is proprietary, we strongly
believe that all standards pertaining to the web should be open.
Rather than use Flash, Apple has adopted HTML5, CSS and JavaScript –
all open standards. Apple’s mobile devices all ship with high
performance, low power implementations of these open standards. HTML5,
the new web standard that has been adopted by Apple, Google and many
others, lets web developers create advanced graphics, typography,
animations and transitions without relying on third party browser
plug-ins (like Flash). HTML5 is completely open and controlled by a
standards committee, of which Apple is a member.

Apple even creates open standards for the web. For example, Apple
began with a small open source project and created WebKit, a complete
open-source HTML5 rendering engine that is the heart of the Safari web
browser used in all our products. WebKit has been widely adopted.
Google uses it for Android’s browser, Palm uses it, Nokia uses it, and
RIM (Blackberry) has announced they will use it too. Almost every
smartphone web browser other than Microsoft’s uses WebKit. By making
its WebKit technology open, Apple has set the standard for mobile web
browsers.

Second, there’s the “full web”.

Adobe has repeatedly said that Apple mobile devices cannot access
“the full web” because 75% of video on the web is in Flash. What they
don’t say is that almost all this video is also available in a more
modern format, H.264, and viewable on iPhones, iPods and iPads.
YouTube, with an estimated 40% of the web’s video, shines in an app
bundled on all Apple mobile devices, with the iPad offering perhaps
the best YouTube discovery and viewing experience ever. Add to this
video from Vimeo, Netflix, Facebook, ABC, CBS, CNN, MSNBC, Fox News,
ESPN, NPR, Time, The New York Times, The Wall Street Journal, Sports
Illustrated, People, National Geographic, and many, many others.
iPhone, iPod and iPad users aren’t missing much video.

Another Adobe claim is that Apple devices cannot play Flash games.
This is true. Fortunately, there are over 50,000 games and
entertainment titles on the App Store, and many of them are free.
There are more games and entertainment titles available for iPhone,
iPod and iPad than for any other platform in the world.

Third, there’s reliability, security and performance.

Symantec recently highlighted Flash for having one of the worst
security records in 2009. We also know first hand that Flash is the
number one reason Macs crash. We have been working with Adobe to fix
these problems, but they have persisted for several years now. We
don’t want to reduce the reliability and security of our iPhones,
iPods and iPads by adding Flash.

In addition, Flash has not performed well on mobile devices. We
have routinely asked Adobe to show us Flash performing well on a
mobile device, any mobile device, for a few years now. We have never
seen it. Adobe publicly said that Flash would ship on a smartphone in
early 2009, then the second half of 2009, then the first half of 2010,
and now they say the second half of 2010. We think it will eventually
ship, but we’re glad we didn’t hold our breath. Who knows how it will
perform?

Fourth, there’s battery life.

To achieve long battery life when playing video, mobile devices
must decode the video in hardware; decoding it in software uses too
much power. Many of the chips used in modern mobile devices contain a
decoder called H.264 – an industry standard that is used in every
Blu-ray DVD player and has been adopted by Apple, Google (YouTube),
Vimeo, Netflix and many other companies.

Although Flash has recently added support for H.264, the video on
almost all Flash websites currently requires an older generation
decoder that is not implemented in mobile chips and must be run in
software. The difference is striking: on an iPhone, for example, H.264
videos play for up to 10 hours, while videos decoded in software play
for less than 5 hours before the battery is fully drained.

When websites re-encode their videos using H.264, they can offer
them without using Flash at all. They play perfectly in browsers like
Apple’s Safari and Google’s Chrome without any plugins whatsoever, and
look great on iPhones, iPods and iPads.

Fifth, there’s Touch.

Flash was designed for PCs using mice, not for touch screens using
fingers. For example, many Flash websites rely on “rollovers”, which
pop up menus or other elements when the mouse arrow hovers over a
specific spot. Apple’s revolutionary multi-touch interface doesn’t use
a mouse, and there is no concept of a rollover. Most Flash websites
will need to be rewritten to support touch-based devices. If
developers need to rewrite their Flash websites, why not use modern
technologies like HTML5, CSS and JavaScript?

Even if iPhones, iPods and iPads ran Flash, it would not solve the
problem that most Flash websites need to be rewritten to support
touch-based devices.

Sixth, the most important reason.

Besides the fact that Flash is closed and proprietary, has major
technical drawbacks, and doesn’t support touch based devices, there is
an even more important reason we do not allow Flash on iPhones, iPods
and iPads. We have discussed the downsides of using Flash to play
video and interactive content from websites, but Adobe also wants
developers to adopt Flash to create apps that run on our mobile
devices.

We know from painful experience that letting a third party layer
of software come between the platform and the developer ultimately
results in sub-standard apps and hinders the enhancement and progress
of the platform. If developers grow dependent on third party
development libraries and tools, they can only take advantage of
platform enhancements if and when the third party chooses to adopt the
new features. We cannot be at the mercy of a third party deciding if
and when they will make our enhancements available to our developers.

This becomes even worse if the third party is supplying a cross
platform development tool. The third party may not adopt enhancements
from one platform unless they are available on all of their supported
platforms. Hence developers only have access to the lowest common
denominator set of features. Again, we cannot accept an outcome where
developers are blocked from using our innovations and enhancements
because they are not available on our competitor’s platforms.

Flash is a cross platform development tool. It is not Adobe’s goal
to help developers write the best iPhone, iPod and iPad apps. It is
their goal to help developers write cross platform apps. And Adobe has
been painfully slow to adopt enhancements to Apple’s platforms. For
example, although Mac OS X has been shipping for almost 10 years now,
Adobe just adopted it fully (Cocoa) two weeks ago when they shipped
CS5. Adobe was the last major third party developer to fully adopt Mac
OS X.

Our motivation is simple – we want to provide the most advanced
and innovative platform to our developers, and we want them to stand
directly on the shoulders of this platform and create the best apps
the world has ever seen. We want to continually enhance the platform
so developers can create even more amazing, powerful, fun and useful
applications. Everyone wins – we sell more devices because we have the
best apps, developers reach a wider and wider audience and customer
base, and users are continually delighted by the best and broadest
selection of apps on any platform.

Conclusions.

Flash was created during the PC era – for PCs and mice. Flash is a
successful business for Adobe, and we can understand why they want to
push it beyond PCs. But the mobile era is about low power devices,
touch interfaces and open web standards – all areas where Flash falls
short.

The avalanche of media outlets offering their content for Apple’s
mobile devices demonstrates that Flash is no longer necessary to watch
video or consume any kind of web content. And the 200,000 apps on
Apple’s App Store proves that Flash isn’t necessary for tens of
thousands of developers to create graphically rich applications,
including games.

New open standards created in the mobile era, such as HTML5, will
win on mobile devices (and PCs too). Perhaps Adobe should focus more
on creating great HTML5 tools for the future, and less on criticizing
Apple for leaving the past behind.

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Sorting in Standard ML

2010
04.28
Standard Quicksort taking the first element of a list as the pivot.
Best and average case: O(n lg n), worst case happens when the list is
already sorted, O(n^2).

fun qsort [] = [] | qsort [x] = [x] | qsort (x::xs) = let fun qs (a, left, right, [])= qsort(left) @ a::qsort(right) | qs (a, left, right, y::ys) = if (y<a) then qs(a, y::left, right, ys) else qs(a, left, y::right, ys); in qs(x,[],[],xs) end; Standard insertion sort. Best case occurs when the list is already sorted, O(n), average and worst case: O(n^2). fun ins (x, []) = [x] | ins (x, y::ys) = if y><x then y::ins(x, ys) else x::y::ys; fun insort [] = [] | insort [x] = [x] | insort (x::xs) = ins(x, insort(xs) ); Merge sort. Best, average, and worst case: O(n lg n) fun merge ([], []) = [] | merge ([], ys) = ys | merge (xs, []) = xs | merge (x::xs, y::ys) = if x><y then x::merge(xs, y::ys) else y::merge(x::xs, ys); fun mersort [] = [] | mersort [x] = [x] | mersort (xs) = merge(mersort(List.take(xs,length (xs) div 2)), mersort(List.drop(xs, length (xs) div 2))); Quicksort combined with insertion sort when the number of elements to be sorted is small (>the same as standard Quicksort.

[code]
fun qsort2 [] = []
| qsort2 [x] = [x]
| qsort2 (x::xs) =
if length(x::xs) else let fun qs (a, left, right, [])= qsort2(left) @ a::qsort2(right)
| qs (a, left, right, y::ys) =
if (y

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

Easter term – here we go

2010
04.21
The shortest term in Cambridge, the most beautiful, and yet the most
hectic term is about to begin. I’m absolutely looking forward to the
great weather, all the new knowledge to be learned, and continue to
meet new people. Inevitably, I will have to face the Tripos
examinations, wish me luck and the determination to do my absolute
best in the next six weeks to prepare for it.

On the mixed side, my first year of university life is ending. I’m
looking forward to year two.

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

A seemingly awesome desk

2010
04.11
[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

An open letter from Reporters Without Borders to PM Lee

2010
03.31
Prime Minister Lee Hsien Loong
Prime Minister’s Office
Orchard Road
Istana
Singapore 238823
Paris, 25 March 2010

Dear Prime Minister,

A foreign news organisation has yet again been forced to apologise to
you and your father and pay you a large sum of money for publishing an
article you did not like. This time it is the New York Times Co. that
is a victim of this double punishment because of a compliant judicial
system that always rules in favour of you and your family in all the
lawsuits you bring against foreign news media.

Before the New York Times Co., you succeeded in punishing the Far
Eastern Economic Review (FEER), FinanceAsia.com, The Economist,
International Herald Tribune and Asian Wall Street Journal for their
coverage of the political and economic situation in your country.

Threatened by a trial, the New York Times Co. apologised to you and
your father, Lee Kuan Yew, for the article “All in the Family,”
written by Philip Bowring and published in the 15 February issue of
the International Herald Tribune. As well as an apology, this US media
company had to pay 114,000 US dollars in damages.

Your lawyer, Davinder Singh, said Bowring’s article violated an
“agreement” between your family and the International Herald Tribune,
which was sentenced in 1994 to pay a large sum in damages for an
article entitled “The claims about Asian values don’t usually bear
scrutiny.”

The now defunct Far Eastern Economic Review agreed last November,
after a long legal wrangle, to pay you and your father 290,000 US
dollars in damages. Despite a lack of evidence, Singaporean judges
ruled in favour of your family both in the original trial and on
appeal without a thought for media freedom.

Reporters Without Borders condemns the judicial harassment which you
and your father have practiced for years in order to prevent foreign
news media from taking too close an interest in how you run your
country. It does serious and lasting harm to press freedom in
Singapore.

Your government has repeatedly displayed a disturbing inability to
tolerate foreign journalists. Last October, for example, Benjamin
Bland, a British freelancer who strings for The Economist and The
Daily Telegraph, was denied a visa and permission to cover an APEC
summit in Singapore. “I was forced to leave Singapore after the
government refused to renew my work visa without any explanation,”
Bland told Reporters Without Borders.

But the censorship has above all affected local media and local
artistic production. In October 2009, for example, the ministry of
information, communication and arts upheld a ban on a documentary by
Singaporean filmmaker Martyn See about government opponent Said
Zahari.

In response to the publication of the Reporters Without Borders 2009
press freedom index, in which Singapore was ranked 133rd out of 175
countries, your law minister, K. Shanmugam, described it as “absurd”
and “disconnected from reality.”

Unfortunately, the facts show that we are right.

In the six years since you became prime minister and said you favoured
an “open” society, we have seen very few improvements in the situation
of free speech.

We therefore think your government should take the following measures
as a matter of urgency:

1. Put a stop to the libel actions which you and your relatives have
been bringing against Singaporean and foreign media that cover
Singaporean developments in an independent manner. As the UN special
rapporteur for freedom of expression recently said, the prime
minister, his minister and high officials must refrain from suing
journalists over their articles and comments.

2. Amend the criminal code so as to abolish prison sentences for press offences.

3. Amend the press law, especially the articles concerning the
granting of publication licences. The current restrictions are
preventing the emergence of independent media. The film law should
also be relaxed.

4. Reform the national security law so as to abolish administrative
detention, which allows the authorities to imprison people because of
what they think.

5. Reform the Media Development Authority so that it is no longer able
to censor and can solely make recommendations about TV programmes and
films.

6. Allow government opponents and civil society representatives
unrestricted access to the public media.

7. Guarantee the editorial independence of all the media owned by
Singapore Press Holdings (SPH) and Media Corporation of Singapore
(Mediacorp).

8. Transfer the money that your family has obtained in damages from
foreign and Singaporean news media to a support fund for imprisoned
journalists that Reporters Without Borders proposes to set up.

We regret that you, the members of your government and your father
keep citing the need to guarantee Singapore’s stability as grounds for
controlling the media and maintaining its draconian laws. Countries
that show the most respect for press freedom, such as Finland and
Norway, are peaceful and prosperous democracies. Freedom of expression
is not a source of political unrest. Quite the contrary.

You have perpetuated your father’s legacy by continuing to harass and
intimidate news media. As a result, aside from a few websites
specialising in Singapore, no news outlet can publish independent news
and information about issues affecting the political situation in your
country.

We would be very honoured to be able to meet with you in order to talk
about our observations and our proposals for guaranteeing press
freedom in Singapore in person.

Respectfully,
Jean-François Julliard
Secretary-General

Posted via email from ramblings of a comsci student

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]