Archive for Pictures

虎年快乐

今年春节,我在外地,没能和家人一起过。虽然很早知道今年过年不在家,虽然之前已经和老婆商量好我们推迟一周庆祝,但那天,一个人在外地,还是有点感伤。

很奇怪,上周六,我们在中国城买完用来剁馅儿的芹菜回家后,我有点想家。(嗯,想家这个词儿有意思,还是别分析了吧,要不然一晚上都得耗在这博客上)我给自己做了芹菜炒猪肉吃,一共放了五个干红辣椒,蒜瓣若干,葱姜少许。我超水平发挥,竟然做出了一道色香味俱全的佳肴!老婆吃素,儿子不能吃辣,这盘菜,我一个人包圆了!我小盅喝辣酒,大口吃菜,直呼过瘾!老婆开始幽默,“看你老爹的模样,吃我做的菜时从来没有这么高兴过!”并再次奉劝我要学习烹调。我现在倒开始真有这个心思了。

我们昨天包的水饺。买了现成的饺子皮儿,一些肉末,老婆用食品加工机把蔬菜打碎后我调馅。以下是我们包的水饺。面相不咋地,吃起来一般。

祝读者朋友虎年快乐,万事如意!

馅儿和皮儿

Chinese New Year 2010

包好的饺子
Chinese New Year 2010

成品和辣酒(孔府家酒,儿子称之为手榴弹酒,因瓶子的外形)吃饺子不就蒜,不是男子汉!请看小碟子里的蒜泥。之后,我笑逐颜开,熏倒外人无数,老婆称之为“Breath to Kill” (有揶揄詹士帮License to Kill之意)

Chinese New Year 2010

最后,送一张写真给你,挑战尺度极限!抱歉,这篇写得有点自恋。

Happy Mardi Gras

Comments (5)

Different lingoes for bookmark lookup and why bookmark lookup can be costly

In the past, when I read technical books, I tend to skim through them, looking for keywords and only read the part that is relevant at the moment, and move on. Sometimes I would make an attempt at finishing a whole book, but a few months or even years later, I haven’t even finished the first 3 chapters!

I took a different approach recently. Now I’ve set up daily goals to read 50 or more pages or a key section of a technical book, and follow through. I am reading two technical books at the moment: Itzik Ben-Gan et al’s Inside Microsoft SQL Server 2005: T-SQL Querying, and Baron Schwartz et al’s High Performance MySQL. It’s nice to read database books that focus on different vendor implementations (SQL Server, MySQL, Oracle, etc.), because each one explains certain things from a slightly different angle, with slightly different language, and at times this gives you a better feel of the overall picture and clarity to certain key concepts.

Here I am talking about quality technical books, though, because the industry churns out way too much junk. It certainly is a waste of time and money on poorly thought out and written books.

Anyway, today I went through Itzik Ben-Gan’s performance tuning chapter. I used SQL Server 2008’s Management Studio to do tests against a SQL Server 2005 instance. I noticed an interesting change in terminologies: in SQL Server 2008, a bookmark lookup on a table with clustered index is now called Key Lookup, on a table without clustered index is (still) called RID lookup. Here are some screen shots:

Bookmark lookup in SQL Server 2005 on a table with cluster index

Sql2005BookmarkLookupCluster
Bookmark lookup in SQL Server 2005 on a table without cluster index

Sql2005BookmarkLookupHeap
Bookmark lookup in SQL Server 2008 on a table with cluster index

Sql2008BookmarkLookupCluster
Bookmark lookup in SQL Server 2008 on a table without cluster index

Sql2008BookmarkLookupHeap

To recap, here are the terms used for bookmark lookups in the 3 most recent SQL Server releases:

SQL Server 2000: bookmark lookup
SQL Server 2005: RID lookup on a heap, Clustered Index Seek on a table with clustered index
SQL Server 2008: RID lookup on a heap, Key Lookup on a table with clustered index

SQL Server’s clustered index implementation went through some interesting changes. Prior to SQL Server 7, all non-clustered index contains a pointer to the actual row(s) that has the value of the indexed keys. This pointer (RID, Row ID) physically points to the position on which page in which internal file that row is at. Starting from SQL Server 7, for tables without a clustered index (heap), the implementation stays the same. However, for tables with clustered index, the pointer is the clustered index.

This can potentially have a big impact for bookmark lookup on tables with clustered index. Here is why: to do lookups, SQL Server needs to traverse through clustered index, thus more reads. The number of additional reads this causes depends on the level of clustered index and how many rows the query touches. Suppose the clustered index has 3 levels (root, leaf, and one intermediate level), then a single bookmark lookup will incur 3 additional logical reads. If the query touches 2000 rows, then bookmark lookup will cause 6000 additional reads.

Note I am not bashing against clustered index though. Overall, in my opinion, the benefits of clustered index definitely outweighs its drawbacks. Now this post is getting long and I want to go back to my books, so I will stop here.

Comments (1)

你用什么方法输入中文?

我虽然可以在Linux或Unix上活动,也用Perl,Vim,正则表达等Unix上出来的东西,但不算专家。为进一步提高自己在这方面的经验水平,我决定在家用Ubuntu,而不仅仅只是用VMWare的虚拟机器。

我在这儿介绍过怎样给英文版的Ubuntu安装中文输入软件。装上之后,发现这个软件提供好几种输入方法。简体的有二笔,二笔-QS,五笔,自然码,和智能拼音。繁体的输入法就更多了,我听说过仓颉和注音,而在下图里罗列的其它方法,以前还真没以任何方式接触或听说过。我用的是简体智能拼音。

Ubuntu上的简体中文输入法
Simplified Chinese entry methods

Ubuntu上的繁体中文输入法
Traditional Chinese entry methods

在Windows上,我用Google Pinyin,但我对其它中文输入法一直都很好奇:它们都有什么优缺点,哪一个更快(当然会因人而异),因为我只知道一种。不知读者朋友有什么评论和建议。

也曾想过用听写软件代替手输入中文,但从未尝试过,不知这种软件是否成熟。

Comments (5)

峨嵋小馆

Rockville是华盛顿特区在马里兰州的郊区。之前我来这儿好几次了。这次来之前,我查了一下这儿的中餐馆,找到了一个名字叫“峨嵋小馆”的地方。它离我的旅馆很近,走得到,挺好的。这儿交通也很方便,坐往Shady Grove方向的Metro红线,Twinbrook站下车,再走六七分钟就到。

Joe’s Noodle House
1488-C Rockville Pike
Rockville, Maryland
301-881-5518
http://www.joesnoodlehouse.com

这里的菜不错,服务员也好,很讲礼貌。和她们闲聊,感觉得到她们的友好与温暖。她们有从河北和广东来的。在那儿做打扫工作擦桌子的是一位拉美裔的女士。看着他们用基本的英语和手势交流,开玩笑的一个片段,和他们脸上的笑容,真好。就想,我们能不能抛开肤色,外貌,宗教,语言等的差异,摈弃对与自己不同的群体的贬低、非人化和妖魔化或盲目崇拜,向以人为本的方向努力?

贴几张这个小馆的菜的照片。明天有可能和网上认识的Prince Roy会面,期待中。现在该回去做一些Linux,MySQL,和Perl之类的东西。千里之行,始于足下。

峨嵋小馆
梅酒,拌豆腐,红油抄手,和辣椒小炒

峨嵋小馆
蒜炒菠菜和夫妻肺片

Comments (3)

2009牛年看春晚小记

亲爱的读者朋友们,牛年快乐!

这两天都和老婆忙活着,张罗一些年货和年夜饭的事儿。前两天在中国城花27刀买了个蒸锅,老婆做了馒头(我们鲁南家乡话叫馍馍)。她做得挺不错。今天我们再接再厉,做了一整桌的清蒸面食过年:素蒸饺,馍馍,芹菜猪肉蒸饺,素包子。再加上凉拌黄瓜花生米儿和茶叶蛋,也算丰盛。我拿出了几年前买的红星二锅头小酌一下,自斟自饮。我还买了一些蒜苗,明天自己胡乱炒个蒜苗猪肉吃吃。蒜苗这个东西,这十几年来吃的次数不会超过五次。

1995年来美国后,我就一直没看过春晚,到今年已经有14个春秋了。由于种种原因,我自来美国后就没有机会在中国过年。现在儿子都上四年级了,虽然每个春节都会一起庆祝,但觉得年还是要在中国过才能感受到那个气氛。虽然跟儿子谈过春晚,这个根在大陆的,全家齐聚看电视吃年夜饭的共同情结,但百闻不如一见。看奥运后知道了怎样在网上看中国电视,所以几个星期前我就打算和儿子一起看今年的春晚。我用的是TV Ants,效果还不错。

看春晚

记一下片段和个人感想。

  • 还别说,看春晚还真能调动气氛,真觉得有年味儿。总起来说我的感觉还是挺正面的,虽然我没看全,看得时候也是有一搭没一搭的,没死盯着电脑,生怕错过一个细节。我是从那四个农民歌手唱歌时开始看的,大红大紫的周董我没看着。我不算是周董的粉丝,但我喜欢他的一些歌,觉得他是个好孩子。
  • 儿子、老婆和我一起看。小家伙趴在电脑前看,好像津津有味的样子。他喜欢那个台湾魔术师。我和老婆在厨房边做饭边看。老婆喜欢那个爱尔兰舞蹈。我说他们这个挺好,是很有效的民间外交。
  • 还是感觉得到那种硬让你感动的牵强台词和肉麻氛围,不过比十几年前好多了,毕竟那么久的行事和思维方式不是一夜之间就应该强行变化的。从另一个角度来看,十几亿人的节目,众口难调,更何况,从我个人的理解来看,关于春晚的主导评论,不一定就代表着大部分人的观点,因为中国的主要人口分布在农村和小城镇,而他们在网络和媒体上的声音应当还算弱小。嗓门儿大并不意味着有道理。
  • 看完那个在亚丁湾护航的海军官兵的新年贺词,觉得不错。完了那个说子弟兵的小品就没有太注意,感觉可能有点肉麻,就没细看。那个奥运义工的小品总体不错,但还是稍感牵强。毛阿敏唱得挺好的。其他的歌曲也不错。

    另外,太多人我都不认识。和冯巩搭档的那个演在外留过学的女士我就不知道是谁。和成龙一起演唱的那三位我一个都不认识。女主持我是一个都不认识。男主持我知道朱军,因为在我买的西游记光碟里,看到他的西游记剧组访谈节目,好像叫艺术人生。白岩松我知道,因为我欣赏他的一些文章,尤其是他的关于奥运火炬事件的评论和其他评论(好像是他在日本韩国采访的感言)。感觉白岩松和汪峰长得挺像的。汪峰是我欣赏的歌手之一。

    我知道山东老乡毕福剑。2007年探亲时看到过他的一次节目,当时不太喜欢他,但感觉他在小品里演的挺好。

    罗大佑、李宗盛、周华健、和张震岳的组合挺不错。他们的新歌,名字忘了,就很棒!我是大佑的铁杆歌迷。张震岳的歌我从未听过。欢迎读者推荐好歌给我。

    那些京剧、越剧等组合都很好。老歌串唱,《在希望的田野上》,《光荣属于八十年代的新一辈》等也很煽情,不错。

看来要把这些年我错过的春晚找来,已快进的方式看看,应当还是有收获地。

Comments (2)

Medium-sized drink

Note: I am looking at some of older draft posts in my blog. I removed a few that just had a title there but no content. I saw this one, which looks half-done and was written close to 2 years ago, but I have no idea what I intended to write for the rest of the post. So here it is. In any event, a 32 ounce medium-sized drink bottle is something to behold! Large size drink holds around 42 ounces, which should be slightly more than 30% bigger than the one pictured below.

A couple of weeks ago, I was in a rush and ordered a spicy grilled chicken sandwich from Wendy’s. I was thirsty too, so I requested a medium drink. I normally don’t go to fast food stores like McDonald’s, Burger King, Wendy’s, and such. When I do, I normally just ask for a cup of tap water. I was really surprised when the guy from the drive-thru window passed me this cup of drink:

Medium sized Wendy's drink

He must have seen the expression on my face. Before I said anything, he smiled and said: “Yup, that is a MEDIUM drink”

The gigantic bottle actually wouldn’t fit inside the cup holder of my Neon. This experience reminded me that when I was in Xiamen University in the early 90’s, we were all excited when McDonald’s opened its first store on ZhongShan Lu. In fact, well-educated university students worked fairly hard to get a part-time job there. I flipped burgers and mopped floors there for a couple of weeks, and even got brave enough to court a nice looking McDonald’s colleague, before she scared me away with some strange stories.

Comments (2)

2009春节前随记

耶诞节前到芝加哥郊区的宜家家居买有瑞典风味的食品,慰籍老婆思乡之情。我们的车停到了这个商店的出口附近。这儿离入口有几步路的小距离。那天风大,天冷,路滑。安静内敛的老婆露出无厘头本色:“要不我们从出口倒着走进去,这样商店该不会不满意吧!”。逗得我和儿子哈哈大笑。

—–

儿子的学校要搞国际食品节,我们做了瑞典和中国的宣传海报。以下是我们做的中国海报。大部分的字是我写的。感觉我的硬笔书法,和庞中华的有一拼!

学校画报

—–

上周五晚上听到了厨房里有咯吱咯吱的声音,当时就怀疑是老鼠。我拿了用来排浴缸堵水的活塞来赶,打开橱门后,老鼠已经跑了。装在纸袋子里的一些干面包被咬开,还被拖出来一块。这老鼠应当是从楼里的水管道里来的。

说来在这个两室一厅住了近9年了。中间好像记得有过一次老鼠。那次我用胶布封住了靠墙的一个小口,以后老鼠就没再来。上周五晚上我们再次用胶布封口,并把食品移开。到目前为止没感到有老鼠到访的迹象。今天给物业管理公司打了电话,希望他们有办法处理一下。现在对我们这栋楼的物业管理公司信心不大。他们卫生打扫的越来越差劲,但价格升得可快了。

—–

今年春节,我打算再次包饺子。小时候过年的那些活动,如炸馓子,炸萝卜和地蛋(土豆)丸子,放鞭炮,喝冰雪露、金奖白兰地等,都不太可能复制。对联儿还是要写的。嗯,还要考虑一下其他一些活动。

Comments

Happy Holidays 2008

And Happy New Year to you!

Christmas meal with Swedish characteristics

2008 Christmas meal

Opening presents

Ben opening Christmas presents

Christmas tree

2008 Christmas tree

Playing in the snow

Ben and friends playing at school playground

Comments

美国竞选随记

8月初入美籍后,就有了选举权。之后到库克县政府给自己办了选民登记,参加了今年的美国总统大选。总统的票我投给了奥巴马,国会两院的票我给了民主党和绿党党员,库克县的一些职位我给了民主党、绿党、和共和党。和大多数选民一样,我对选票上的大部分竞选者一无所知,像一些法官之类,并且这些人很少有竞选对手,就一个人参选,你投不投他都会被选上。

说来好玩儿,今年五月左右我差点到奥巴马的竞选总部去做一个MySQL的项目。我当时客户的信息部门老总在里面有内线,努力一下可能有戏。但我那时和另一个潜在客户有一个口头上的约定,就没有去争取。

8月份麦肯挑佩林做竞选搭档,一开始竟有民调反弹。这个狐狸精,挤眉弄眼地搞一些暗示,说风凉话,煽动基督教原教旨主义者的狂热,给无知的、肤浅的、骨子里有莫名优越感的悲情人士推波助澜,稍微有点“流氓会武术,挡也挡不住”的架势。朕有点坐不住了,该出手时就出手,亲自出马,助小奥一臂之力。

因我已是公民,所以就已个人的名义捐了点小钱,之后为竞选做义工。申请做义工挺有意思:竞选总部要三个人的电话、电邮来核实我的信息。照办后,还参加了一个网上培训。因为我申请的是数据库方面的义工,所以培训是针对网上选民数据库的查询。不知数据从何而来,但很详细,虽然会有误差:大部分选民的姓名、地址、生日、性别、政党倾向、过去的投票历史,等等等等。

后来他们要求数据库的义工做全职,又不给钱,所以这事儿没办成。但被征召为小卒,到邻州搞人海战术,做地毯式轰炸,canvassing。就这样我去了威斯康星。就是密尔沃基分部的人,从选民数据库里根据事先定好的标准,查出一些人的地址。我们拿着这些地址去敲门,希望他们能投奥巴马一票。我和两位女士,从我社区的民主党党支部出发,开车去了密尔沃基。我们去了郊区的一个大部分是白人的社区敲门。如果主人在家的话,以我的经验,大部分的对话都很简短。实际上这种推销有点尴尬,和传教类似。所以后来奥巴马竞选总部邀请我轰炸印第安纳,我拒绝了,虽然我很想让这个保守的中西部州在总统竞选上倒向奥巴马。

纽约地铁站。这个站名上有中文“华埠”,因在中国城
New York City subway

后来离选举日越近,奥阵营的信心也越足。我,和其他很多人一样,收到了竞选夜到格兰特公园参加集会的邀请,当然要交钱买票。我没去。直到现在我还常收到奥阵营的电邮要钱,搞得我有点烦。

奥巴马的当选,确实是具有里程碑意义的事情,可喜可贺。其实感觉民主和法制社会的建立,是一个渐进的过程。即使有了这个框架,要维护真正意义上的、或者说接近真正意义上的民主,不让政府部门被说客和特殊利益集团利用道德、宗教、商业等极端恐怖手段所操纵,都需要人们长久的、持之以恒的努力。美国、台湾、泰国等过去几年的经历就是很好的反面教材。个人以为发展中国家的民主法制建设,有太多的事情要做。当然要学习、汲取他国的经验和教训,但可以肯定的是,照抄任何国家的模式都不行。在这个过程里面,对政府既要合作,也要维权;既要抗争,也要妥协;既要谨慎,也要大胆。光靠写煽动性的文字不行,多为大部分农民和城镇民众的利益做实事才是正本。民主法制的道路,是自己的路;在权衡利弊考虑方式之后,要脚踏实地得自己走。

Comments

Why we fight — US government movie during World War II

I’ve read a couple of history books lately. Chinese history overall, especially the period since the mid 19th century, is fascinating to me. American history is also of great interest. I am currently working on an American history book.

Anyway, I noticed a series of US military propaganda movies on Netflix, made during World War II, called Why We Fight. One of them is the Battle of China. Another one, War comes to America, was on the same DVD. I watched both a few weeks ago. There is also a documentary of the same title, produced in 2005, that depicts the Military-industrial complex. I think I will check out that movie as well.

Anyway, it was really interesting to look back. How perceptions and people’s sense of history change over time, and how powerful a narrative can be when propagated through mainstream media of superpowers, first setting the context, then being wired, translated, quoted, and commented in media outlets all over the world. Fortunately, blogging, grassroots journalism, and the easy availability of information is changing that, probably similar to what happened when printing caused the easy availability of information in Europe right before the Protestant movement.

Here are a few images and things I found interesting.

1. There were a couple of scenes that depicts American people reciting the Pledge of Allegiance (对美国效忠宣言,美国中小学生每天早晨的例行活动和政府、法院仪式上常用的宣言) in War Comes to America. It was interesting to hear when “under God” was not part of it. “under God” was added in 1954;

2. The song, March of the Volunteers (义勇军进行曲), now the national anthem of the People’s Republic, was repeated a few times in the movie;

3. A few enduring images were chosen to represent China. The Great Wall was among them. It also included this image, the Potala Palace in Tibet:

Why we fight

4. Here is a map of China, as depicted in the movie.

Why we fight

5. At the end of the Battle of China, there was a narrative. I didn’t copy down the exact sentence, but it was something to the effect of “Your Japs were the Yellow Peril and we will crush your yellow faces”. According to wikipedia, Yellow Peril first referred to Chinese, then shifted to the Japanese during Japan’s aggression and invasion of East and Southeast Asia. The fear-mongering and stereotype of people is just incredible.

6. And finally, here is the picture of farmer winnowing wheat or rice in the 1940s. It looked familiar and intimate because I saw my parents and grandparents winnowing wheat like that in the 70s and early 80s. When I was growing up, the cutting and transporting of wheat to the threshing ground was all manual labor, and my mom did most of it. I did my meager share of that work also, but threshing was mostly done by threshing machines powered by electric motors during my day. My mom told me that the whole process of wheat harvesting in my hometown is mostly mechanized nowadays.

Why we fight

Comments (2)

« Previous entries