KWrite

Rational Evolution

May 20th, 2010

Google versus Apple

http://eleganceit.com/blog/wp-content/uploads/apple-vs-google_2.jpg

Does it ring a bell?

Isn’t it similar to the war between Microsoft and Apple in the early 90s? While Microsoft focused on creating a platform and inviting hardware/software partners to develop on that platform, Appled tried to produce all-in-one products at its best. Apple had some revolutionary products at the time and they once were hugely successful. But it the end, you know who won the war.

It looks like that Apple is walking the same path. Steve Jobs is clearly obsessed with his idealistic philosophy. Perhaps the vision of Steve Jobs in 1997, shortly after he came back to Apple, is only temporary.

I predict that Google Android will leap over Apple iPhone anytime soon.

March 13th, 2010

“Bibles” in High Performance Computing

This is the continuation of my series “Bibles” in Applied Math. I write a new page for this section because it is a bit off from what most people call “Applied Math”. Further, this topic deserves a blog entry, or even a forum, on its own because being able to make your code run 10-15% faster (or even 90% faster if you haven’t mastered certain level of the art of programming) is a big deal nowadays. It can even land you a lucrative job (here’s an example).

Suppose that you’re a master of Numerical Algorithms. You’ve spent 2 years working on a complex engineering problem and recently have developed a new algorithm that can solve the problem in linear time instead of the state-of-the-art O\left(N\log N)\right). Your new solver (and the 2 years) would be wasted if it is poorly written and/or poorly compiled. Here are a couple out of thousands of common poor programming practices.

1. Computing the same thing over and over again

for (int k=0;k<100;k++) {
 out[k] = 0;
 for (int i=0;i<M;i++)
  for (int j=0;j<N;j++)
   out[k] += kernel(i,j) * in[k];
}

In this example, kernel(i,j) is re-computed 99 times. Because this matrix Kernel is independent from the outer loop, it can and most of the times should be pre-computed. If the computation of kernel is computationally intensive, which is common, pre-computation of the matrix can make your program run 99.9 times faster.

2. Using the right flags when compiling

[zer0ne@ion]$ g++ myProgram.cpp -o myProgram
[zer0ne@ion]$ ./myProgram
Total time: 68.74 seconds
[zer0ne@ion]$ g++ -O3 myProgram.cpp -o myProgram
[zer0ne@ion]$ ./myProgram
Total time: 13.9 seconds
[zer0ne@ion]$ g++ -O3 -DNDEBUG myProgram.cpp -o myProgram
[zer0ne@ion]$ ./myProgram
Total time: 11.54 seconds

So, if you’re already good at designing algorithms, it’s worth to learn a bit of performance optimization tricks. I am no expert in HPC, let alone related fields such as Computer Architectures or Compilers, so my best bet is to point you to some great books out there. Also for the same reason, I’ll appreciate if you share your own tips.

  1. Performance Optimization of Numerically Intensive Codes by Hoisie. $73 seems high for a 173-page book but this thin bible is worth every penny. It covers all basic stuffs such as CPU architecture, compiler optimization, memory localit, profiling, etc.
  2. High Performance Computing by Kevin Dowd & Charles Severance. Similar contents but this book explains things in greater depth.

October 9th, 2009

On the 2009 Nobel Peace Prize

http://blogs.wvgazette.com/coaltattoo/files/2009/04/obama-change.jpg

Is the Norwegian Nobel Committee a political activist body?

Here’s an excerpt of CNN’s interview with Norwegian Nobel Committee Chairman, Thorbjorn Jagland, right after he announced the 2009 Nobel Peace Prize result.

CNN: A great many people are delighted. Some people are shocked. He has been in office less than a year. Most of what he’s tried, he’s still just at a startup. Is the committee acting a little fast?

Thorbjorn Jagland: No, not at all. We want to promote what he stands for. And this is the long standing history of the Peace Nobel Committee. We want to enhance the ideals that Obama is promoting for.

So did he admit that the Norwegian Nobel Commitee (or the Peace Nobel Committee) is actually a political activist body that exists to promote certain agendas instead of recognizing good works that have been done? This doesn’t seem to agree with its formal constitution.

October 2nd, 2009

On Multi-Tasking

Multi-taskingAs a HR manager for a new company, I have opportunities to read tons of resumes sent to my inbox. Unlike what I thought, there are still too many applicants, especially student job seekers, highlighting their Multi-Tasking skill in the resumes. I usually deleted those applications immediately.

It’s a deadly mistake to include this skill in your resume.  The hype is so dead now.

(A victim of the ADHD syndrome, I many times multi-task as well. However, it is my weakness, not strength.)

June 30th, 2009

Global economic recession due to the one-child policy in China

http://media.economist.com/images/20090124/D0409BB1.jpg
(Image source: The Economist)

Some western scholars (such as on Freakonomics and on Real Time Economics Blog) are now blaming the one-child policy in China as a reason of the global economic recession. Let’s see how the logic flows.

  1. Preferences for sons together with the one-child policy and together with the inexpensive ultrasounds technology, many couples in China choose abortion based on the gender of the unborn children.
  2. (1) leads to the surplus of unmarried men.
  3. The marriage market becomes highly competetive. In order to get a wife, Chinese men now have to compete more vigorously.
  4. Due to (3), families with sons have to save more so that their sons can look more attractive in the future. [According to the research by Shan-Jin Wei and Xiaobo Zhang, published on the National Bureau of Economic Research, in the areas where high boys/girls ratios are high, the saving rates are higher, too.]
  5. (4) is the reason of the jump of savings in China over the last 2 decades. In 2007, a household in China saves 30% of their income on average, while this figure was 16% in 1991.
  6. (5) leads to the surplus of cash of the Chinese. Meanwhile, half of the world away, Americans are more interested in spending. The purchasing demand in America is always high. The current Fed chairman, Mr. Bernanke,chairman pointed out that the surplus of cash in China lead to easy and huge long-term debts, with low interest rates, by the Americans.
  7. Obviously, these low interest rates would gradually propagate into financial activities in the US and over the world. Most notable is in the mortgage business. [Last March, Alan Greenspan defended the Fed on the Wall Street Journal that the Fed was powerless to prevent the housing bubble due to "the decoupling of monetary policy from long-term mortgage rates".]
  8. Due to the low interest rates and hence easy loans, Americans were more more encouraged to buy houses. This gives rise to the high housing prices trend and bad financial investments from housing. The housing bubble started from here.
  9. The bubble could not grow forever and finally bursted when the interest rates starated to rise and the prices started to drop. This housing burst is the source of the credit crisis and later on the global economic recession.

Phew, this kind of reasoning is like blaming the butterfly in Brazil for causing the tornado in Texas [see butterfly effect] :). On the other hand, with the population of 1.3 billion, it is increasingly visible that whenever the Chinese sneezes, the whole world catches cold.

June 28th, 2009

The “King of Pop” effect

http://g-ecx.images-amazon.com/images/G/01/music/tcg/michael-jackson_tcg_01._V221746329_.jpg

Osama Bin Laden could have hidden himself from the American military but he’s probably unable to run away from the news of Michael Jackson’s death.

Within a few hours after MJ’s death, the Thriller skyrocketed to the no. 1 album on iTunes. Many media sites experienced traffic slowdown and even crashed multiple times. As of now, 2 days since the news, there is countless number of  news articles and online talks about this event. MJ’s albums have spectacularly and totally invaded the iTunes Top Albums charts in 25 countries and undoubtedly other music stores as well.

Phenomenal statistics, aren’t they? But the mind-boggling question is: do people care about his death or about him that much? I doubt it. OK, perhaps not the right question to ask. How’s about: are there that many people who really love his music? Hm, possibly. The more interesting question to me is: how do we understand the dynamics of a mass movement like this? It definitely doesn’t equal the sum of each individual’s behavior. Geeky speaking, any linear approximation to this highly non-linear fashion could yield dreadful decisions.

MJ is a perfect example for this kind of study but by no means the only one. One can also relate this case to the Obama effect, the Paris Hilton effect (aka. “you start getting famous for being famous”), or more seriously the credit crisis that has been affecting each of us.

The internet obviously has played a big role in magnifying the scale of these phenomena. Knowing that doesn’t make us happier and you may ask: is there any new marketing or valuation model hidden in these effects that we can learn? An unknown I wish to further understand.

May 28th, 2009

Wave: the new monster product of Google

The product hasn’t been released yet but you all can see the demo below.

In short, I bet anything that this product will revolutionize the way this world communicates, just like how emails triumphed over regular mails. The impact of this product can be as big as of Google Search. No joke!

May 7th, 2009

A European Champions League Dream Final

… between the two most dominant clubs in the world: Manchester United (MU) vs. Barcelona (Barca).

http://i276.photobucket.com/albums/kk1/coco092008/football_fc_barcelona_manchester_un.jpg

Well, the media has been talking about the controversies after the epic semi-final (Chelsea vs. Barca) and they’ll continue talking/writing about it for weeks. It was such a hell of a game. I admit that Chelsea played better, tactically, in the 2nd leg but overall, Barca deserved the ticket to Rome for the final. Full respect to the players on both sides for their fighting spirit.

This game might not have been as entertaining as the historical victory of Barca over Real Madrid last weekend but it is of a much higher level and well depicts the true modern football. The players brought so many good flavors to the game: philosophy, tactics, and intensity.

Now, what is my take on the final game in Rome? The Barca team this season could go down in history as the most talented club team ever. As a consequence, their players are technically superior to MU’s ones. However, I’d give a slight edge to MU (55% for MU and 45% for Barca) because:

  1. MU has more depth in their squad. They have decent (even high quality) backup players for almost almost every position on the field.
    • Barca’s defence, on the other hand, is very thin and becomes vulnarable whenever a first-team player misses due to injury or suspension. Today, in the game against Chelsea, they didn’t have the service of the Puyol and Toure was pulled back as a centre back. As a consequence, without the three musketeers Toure-Xavi-Iniesta, Barca’s midfield looked very dull.
    • Worst, in the final, they’ll miss 3 defenders. Gerard Pique can be a sufficient replacement for Rafael Marque but the two full backs positions will cause a lot of thinking for Pep Guardiola.
  2. Though technically superior, Barca’s players are not as physical. If allowed space to play their style, they’re weapons of mass destruction. Otherwise, they’re stuck. This is nothing new. They dominated the game but got stuck twice this year against Chelsea. It was exactly the same last year, albeit different outcome, when they played against an “anti-football” MU.
  3. Alex Ferguson won’t tell his players to play attacking football and be victims of Barca. Unlike his counterpart, Alex is too pragmatic and experienced. He’ll probably apply the same tactics that Hiddink used this year and he himself used last year: parking a bus in front of the goal and killed off the game through a couple of counter attacks.

In summary, the final will surely be another hell of a game. Despite the reasons above, I’m a supporter of Barca.

  • Unlike at other clubs (even Manchester United or Arsenal), most of Barca’s talents (Puyol, Xavi, Iniesta, Messi, Pique, Valdes, Krkic) are home grown. Their youth academy La Masia can easily produce a full team that has the potential of winning the Champions League.
  • Coached by a manager who grew up in Barcelona and has played for the team himself.
  • Their uniforms don’t have the name of any corrupted insurance giant.
  • Still, they’re one of the two best teams in the world.

Who on earth doesn’t love these boys?

April 27th, 2009

Top Gear – Vietnam Special Episode

http://farm4.static.flickr.com/3240/3153719740_d33dfe5549.jpg?v=0

It’s a must watch if you fall into one of these categories

  • Adventurous Travelers
  • Motorcycle Riders
  • You grew up in, have been to, or have already planned to visit Vietnam

Part 1

Part 2

April 6th, 2008

Immigration Policy: US vs. UK

To a large number of observers, the now financial center of the universe is London, not New York City (see this and this [1]). I’m sure many of you will find it ridiculous but well, whatever you believe doesn’t change the deteriorating reality. Let’s see why what is what from an immigration view point [1.5]. Historically, America was famous as the Disneyland for talents. It doesn’t seem to be the case nowadays.

US. H1B Program.

Suppose that you’re an international citizen. You will need to apply for an H1B visa in order to work in the US. It’s a complex program but generally speaking, here are some relevant facts to keep in mind:

  • You need a job offer and the sponsorship from an American company/institution in order to apply for the visa. Even if you’re a semi-superman but living in another country (or your country) at the time you apply for jobs, it isn’t that easy to get such an offer.
  • Let’s keep assuming that you’re a semi-superman. You still may have to enter the H1B lottery game to decide your fate. The lottery is very likely if you don’t hold an advanced degree (Master or PhD).

How many talents would be crossed out by this system? A lot, I assume. Moreover, this complicated and hilarious process does discourage many smarties and a good percentage of them just don’t give a damn working in the US.

UK. Points-based Immigration System.

The UK has a fundamentally different program called Highly Skilled Migrant Program (HSMP) [2], besides the usual work permit system. Basically, you earn points by your track record including education level, age (the younger the better), income, UK experience, etc.. If you have enough points (75), you are automatically qualified to enter and work/do business in the country. No a priori job offer needed. No sponsorship. No quota and no lottery.

If you’ve received a PhD (50 points) from a UK university (5pts) and you’re 27 (20pts), then boom: they (British people) red carpet to welcome you. If your PhD is from somewhere else, a little income will qualify you as well. Until recently, an MBA from a top business school would also give you the unconditional access. Try this HSMP calculator to see if you fit in this highly discriminating system.

Is it similar to America post World War II?

Footnotes

[1] The NYTimes and Fortune magazine articles were published in 10/2006 and 08/2007 (respectively), when the US economy was much stronger than it is now. There are also numerous other writings on this newly debated subject.

[1.5] The rising or London (or decline of NYC) and their immigration policies are correlated. However, this article doesn’t assert with confidence that one is the cause of the other. On the cause, some joked that the British merely benefits from the influx of Russian millionaires/billionaires.

[2] The HSMP is being phased out and replaced by a similar program called Points-based Immigration System – Tier 1.