Aug 23, 2007 - Protected: 二十年政治考试题和学生守则

Comments

我父亲考大学的时候:

考题: 领导我们事业的核心是?

答案: 领导我们事业的核心力量是中国共产党, 指导我们思想的理论基础是马克思列宁主义.

研究生守则第一条:

努力学习马克思主义、毛泽东思想和邓小平理论,用正确的理论武装自己的头脑,坚持真理、崇尚科学.

我上初中的时候:

考题: 四项基本原则具体指?

答案: 必须坚持社会主义道路; 必须坚持无产阶级专政; 必须坚持共产党的领导; 必须坚持马列主义, 毛泽东思想。

大学生守则第一条:

坚持四项基本原则,热爱祖国,热爱人民,拥护中国共产党;努力学习马列主义、毛泽东思想和党的方针政策,关心国家大事,树立积极健康的人生观。

我中考的时候:

考题: 党在社会主义初级阶段的基本路线是什么?

答案: 领导和团结全国各族人民,以经济建设为中心,坚持四项基本原则,坚持改革开放,自力更生,艰苦创业,为把我国建设成为富强、民主、文明的社会主义现代化国家而奋斗.

中学生守则第一条:

热爱祖国,热爱人民,拥护中国共产党。努力学习, 准备为社会主义现代化贡献力量。

我高考的时候:

考题: 三个代表具体指

答案: 中国共产党要始终代表先进生产力的发展要求; 中国共产党要始终代表中国先进文化的前进方向; 中国共产党代表要最广大人民的根本利益. (注: 如故意少掉”要”字, 给双倍分)

小学生守则第一条:

热爱祖国,热爱人民,热爱中国共产党. 好好学习, 天天向上.

我考研的时候

考题: 八荣八耻具体含义:

答 案: 以热爱祖国为荣 以危害祖国为耻 以服务人民为荣 以背离人民为耻 以崇尚科学为荣 以愚昧无知为耻 以辛勤劳动为荣 以好逸恶劳为耻 以团结互助为荣 以损人利己为耻 以诚实守信为荣 以见利忘义为耻 以遵纪守法为荣 以违法乱纪为耻 以艰苦奋斗为荣 以骄奢淫逸为耻.

小学生守则2-10条

二、按时上学,不随便缺课。专心听讲,认真完成作业。

三、坚持锻炼身体,积极参加课外活动。

四、讲究卫生,服装整洁,不随地吐痰。

五、热爱劳动,自己能做的事自己做。

六、生活俭朴,爱惜粮食,不挑吃穿,不乱花钱。

七、遵守学校纪律, 遵守公共秩序。

八、尊敬师长,团结同学,对人有礼貌,不骂人,不打架。

九、关心集体,爱护公物,拾到东西要交公。

十、诚实勇敢,不说谎话,有错就改。

我弟弟考大学的时候.

考题: 和谐社会的总要求是:

答案: 民主法治; 公平正义; 诚信友爱; 充满活力; 安定有序; 人与自然和谐相处

小时候老师教我的幼儿园守则:

听老师话, 不和其他小朋友抢苹果吃, 团结友爱其他小朋友, 多参加课外活动, 午睡时不许讲话, 不要攀折花花草草.

由此看来, 我们只要能做到幼儿园小朋友一样, 排排站, 发果果, 和谐社会的总目标也就不远了. 还有就是, 政治考试越来越简单了, 这样对于研究生队伍政治素质会下降的, 连小朋友都能考研了.

Aug 21, 2007 - 推荐几篇关于密码学的文章

Comments

最近一段时间, 争取经常推荐优秀的技术文章.

统统告…告诉我密码——DES

统统告…告诉我密码——RSA

统统告…告诉我密码——MD5

虽然网上这种入门文章非常多, 但往往缺少技术细节, 看完依然不知道实践中要掌握什么. 这几篇文章在入门和技术细节中达到了比较好的折衷(当然具体写程序的时候还是有很多技术细节要注意的).

对了, 作者是高中生.

Aug 18, 2007 - Qi Xi (Chinese Valentine’s Day)

Comments

[Disclaim: Some text here are cited from Wikipedia under the GNU Document Licence]

Qi Xi (七夕; Pinyin: qī xī; “The Night of Sevens”) is Chinese Valentine’s Day (sometimes called Magpie Festival) It’s on the seventh day of the seventh lunar month on the Chinese calendar; thus its name. In 2007, this festival falls today, August 19.

There is a very romatic story of Cowherd and Weaver Girl. As in late summer, the stars Altair and Vega are high in the night sky, our ancestors observed that and a love story came out.

A young cowherd named Niulang (Chinese: 牛郎; Pinyin: niú láng, “the cowherd”, the star Altair) happens across seven fairy sisters bathing in a lake. Encouraged by his mischievous companion the ox, he steals their clothes and waits to see what will happen. The fairy sisters elect the youngest and most beautiful sister Zhinü (Simplified Chinese: 织女; Traditional Chinese: 織女; Pinyin: zhī nǚ, “the weaver girl”, the star Vega) to retrieve their clothing. She does so, but since Niulang has seen her naked, she must agree to his request for marriage. She proves to be a wonderful wife, and Niulang a good husband, and they are very happy together. But the Goddess of Heaven (in some versions Zhinü’s mother) finds out that a mere mortal has married one of the fairy girls and is furious. (In another version, the Goddess forced the weaver fairy back to her former duty of weaving colorful clouds in the sky because she could not do her job while married to the mortal.) Taking out her hairpin, the Goddess scratches a wide river in the sky to separate the two lovers forever (thus forming the Milky Way, which separates Altair and Vega).

qixi2.jpg

Zhinü must sit forever on one side of the river, sadly weaving on her loom, while Niulang watches her from afar and takes care of their two children (his flanking stars β and γ Aquilae).

But once a year all the magpies in the world take pity on them and fly up into heaven to form a bridge (鵲橋, “the bridge of magpies”, Que Qiao) over the star Deneb in the Cygnus constellation so the lovers may be together for a single night, the seventh night of the seventh moon.

qixi3.jpg

There are also lots of traditions, but now in China, we usually treat Qi Xi as the second Valentine’s Day in a year. We also have many beautiful poems about Qi Xi, one of my favourite is:

秋夕 –(唐)杜牧
红烛秋光冷画屏,
轻罗小扇扑流萤。
天阶夜色凉如水,
坐看牵牛织女星。

Translated as:

The painted screen is chilled in silver candlelight,

She uses silken fan to catch passing fireflies.

The steps seem steeped in water when cold grows the night,

She lies watching heart-broken stars shed tears in the skies.

I am not so that sad, of course ;)

Aug 17, 2007 - A Gmail bug explained

Comments

Here is a quite funny picture I found today on digg. It is called the Best Phishing Email, Ever. Despite the funny nature of this hilarious letter, have someone really noticed that in this letter, we have G mail or Gma il instead of Gmail? (one extra blank in between the letter “G” and “m”, or “a” and “i”).

gmail_scam.jpg

Last year when I was interviewed in Google, I reported this bug to Gmail team, (Sadly to say, they didn’t take it very serious, as it’s still there now). Maybe they can argue that it’s a feature, but let me take five minutes to explain why is it. (I guess it’s fairly simple and straightforward).

Let’s start from a little background about HTML. We all know that when we send colorful texts like “Google” via gmail, the email format is actually HTML. Here is a quite important aspect about HTML: An HTML user agent should treat end of line in any of its variations as a word space in all contexts except preformatted text.(Page 20, RFC1866) That is to say, a cstring in HTML source file like “a\nb\nc” will have the redering output identical to “a b c”. Therefore, it’s really confusing that we have to use
to make a newline within a paragraph in HTML text, and “\n” is equivalent to a white space in most of the cases.

Now let’s go back to Gmail. When I send myself a piece of email with a colorful string “Google” via Gmail, I got “Googl e“. Via viewing the source of the HTML, we can actually find that there is a “\n” in between those letters. For example, this is a piece of HTML(javascript) excerpted from Gmail source related to this colorful Google:


\u003cfont color\u003d\”#000099\”\>G\u003c/font\>\u003cfont color\u003d\”#ff0000\”\>o\u003c/font\>\u003cfont style\u003d\”background-color:#ffffff\” color\u003d\”#ffcc00\”\>o\u003c/font\>\u003cfont color\u003d\”#3333ff\”\>g\u003c/font\>\u003cfont color\u003d\”#33cc00\”\>l\u003c/font\>\u003cfont color\u003d\”#ff0000\”\>e\u003c/font\>\n \u003c/div\>\n\u003cdiv\> \u003c/div\>\n\u003cdiv\>

Here \u003c is “<“, \u003d is “=”, without the bold “\n” in this line, the result should be “Google“. So, why we have an extra “\n” here? Who did this trick? The answer is simple: “Gmail”. For some reason, Gmail breaks a long line in HTML source file into multiple lines and sends the email out (I haven’t figure out the rule that Google uses to break lines in HTML source file). By doing several trival experiments like sending mail from Gmail to Hotmail and vice versa, I am now pretty sure the problem is caused by Gmail automaitc line breaking strategy. That is to say, Gmail client automatically inserts a newline(“\n”) symbol in the HTML source file and causes this “visual bug”. Actually this bug is quite easy to fix, for instance, just break the line at the first blank after the label name, for example, like:

<span

style=”color: rgb(255, 0, 0)”>red</span><span

style=”color: rgb(0, 255, 0″>green</span>

instead of say

<span style=”color: rgb(255, 0, 0)”>red</span>

<span style=”color: rgb(0, 255, 0″>green</span>

or

<span style=”color: rgb(255, 0, 0)”>red</span><span style=”color: rgb(0, 255, 0″>

green</span>

The first generates “redgreen“, and last two give “red green

BTW, here is a nice tip for interviewees: love your prospective employer, love their products. Eventually, you would have a very nice understanding about their culture and products. All companies are willing to hire guys who actually love their culture and products (and can even find bugs :).

PS: in preparing this article, I found that Gmail team has secretly updated the text format system from using plain old to fancy (and elegant) XHTML+CSS .

PS2: http://www.opinionatedgeek.com/dotnet/tools/Base64Decode/Default.aspx is a nice online tool for decoding the base64 format.