Google is leaving China

Yesterday Google's Corporate Development and Chief Legal officer, David Drummond wrote an entry on his blog, announcing that Google would withdraw its business from China, if the two parties' negotiation fail.

Political censoring has hindered Google from competing against China-native search engine Baidu. Google sounds threatening and this withdrawal may cost both parties billions of dollars of lost. If negotiation fails, Google will probably re-locate its Asia business strategy to Taiwan.

http://googleblog.blogspot.com/2010/01/new-approach-to-china.html

A sticky note for Ubuntu installation

gcin

http://cle.linux.org.tw/trac/wiki/GcinDistros

1
im-switch -s gcin

ShowTime theme

1
2
3
4
5
gpg --keyserver hkp://keyserver.ubuntu.com:11371 --recv-key 881574DE && gpg -a --export 881574DE | sudo apt-key add -

sudo gedit /etc/apt/sources.list
deb http://ppa.launchpad.net/bisigi/ppa/ubuntu jaunty main
sudo apt-get install showtime-theme

Emacs, checkGmail

1
2
3
sudo apt-get install emacs
sudo apt-get install checkgmail
checkgmail -update

Python 101: Intro to Python

Most tutorials start with installation, and write a simple program called "Hello World", I will follow this tradition just to make sure we cover the basics. Then I will move into control structures and some basic OOP, because almost everything we do in Python is OOPs.

Where to get python?
http://python.org/download/ and get whichever version you want, either 2.6.4 / 3.1.1 (at the time of this writing)

2.6.4 vs 3.1.1, which one?
It gets very technical when one is asked to explain the difference. Here is the shortest and simplest version:

Go with 2.X branch because 3.X branch has a lot of changes, and many existing books, codes and resources are written based on 2.X, so you are better off learning 2.X branch.

If you are very serious about learning Python, you will be happy with 2.X and then learn the differences later.

Write Hello World

Just like any other modern programming language,

1
print "Hello World"

Notice that, unlike C++, Python does not end with semicolon ;

Hack Python Program

As an beginner, you are better off hacking programs, rather than writing the entire program yourself. Once you understand what each line means, then you can write your own program. For example, just change the values or words around.

Unlike complex language like C++, Python is very simple, yet elegant. You do not always need to declare and define types and identifiers.
When we assign a number to any variable, Python knows it is an integer by default. When it is within double quote "", Python knows it is a string.

1
2
abc = 1
cde = "What"

When you need floating point and other numerical types, then, yes, you do need to specify it. So use the option when it is mandatory.

Here is the major difference between the 3.X and 2.X. By default (2.X) if you do 3 divide 5, you get ZERO, whereas in 3.X you get an answer with demicals. If you are using 2.X, you must add one decimal point to any one of the numbers. For 3.X, you are no longer require to declare this extra decimal, because by default 3/5 will print a rounded answer.

1
2
3
4
5
6
7
8
9
10
11
IDLE 2.6.4      
>>> 15/2
7
>>> 3/5
0
>>> 3.0 / 5
0.59999999999999998
>>>
>>> 3/5.00
0.59999999999999998
>>>

Another way is to declare it a floating point, and round it up (check doc / google for answer).
(more...)

New Year 2010!!

Welcome 2010 !!!

LOL I am tired of reading "Happy New Year" every year on AIM and Facebook. I do not celebrate New Year eve for a few years already because I am not a kid anymore.

A new decade!!

Yeah, it's 2010, another decade since 2000. So what? Just stay home, like we never had a new year before.

I have a boring life now. I really need some works to do over this break. I have a planned agenda before the break, but I am procrastinating. Oh my god, I need stop it.

Oh, I am reading Rainie Yang's bog recently. Her latest entry 心.煩... is here. Her blog says a lot about her life. I have read a few other artists' blogs before, yet, I find Rainie's one frankest, especially with her emotion state. For numerous times she mentions that she wants to be in love.

I start learning about the true face of Rainie Yang through various sources: drama, blog, news and interviews. At 娛樂百分百, she interpreted her new song "青春鬥" how she felt as being 25 years old. She said only love could keep her young. As an actress, as well as a star, she could not have an open relationship. She has at least five known love affairs and the only one she ever admitted was with 小鬼, whom was her first boyfriend in high school, and whom she thought she would marry with. Nevertheless, her parents' divorce had her lost faith in marriage and love. A week ago she told the reporters that she was still single, but she felt she was "in love" for the past couple months. She was referring to her role in Hi My Sweetheart. She once admitted that she wanted to be in love, but she would not promise because she could not.

Oh well, it is my time to sleep. I wish everyone has a great starting.

I am really bored without Hi My Sweetheart !!!! >3<