Quick and Dirty

How do you solve the problem that a single page cannot display two sets of information in different character encodings under IE? I had this problem in the counterize plugin for WordPress, since the default page is in UTF-8 but the IP location information retrieved from somewhere else is in GB2312. So everytime I have to switch back and forth in IE -> View -> Encoding. Apparently Firefox does not have this problem. I don’t know how does it detects the GB2312 text and displays it correctly. But I do have a work around for this.

It is fairly simple. Create a separete page with its default encoding set to GB2312 and retrieves whatever information in GB2312 it wants. Then in the UTF-8 page that used to be problematic, replace the original script calls with iframe calls to the new GB2312 page. That’s it!

Example: Replace something like

<script src=”a.php?some=parameters”></script>

with something like

<iframe src=”b.php?some=parameters”></iframe>

where in b.php it passes some=parameters to a.php directly by using the script tag.

One more advantage is that when browser creates iframe objects, it creates a separate thread for loading the framed page. It allows constant information in the UTF-8 page to be displayed first while GB2312 page is loading, instead of waiting long for the GB2312 text to be retrieved and the displays the rest of the main page.

It is quick and dirty, but as long as it works, I’m fine with it. Remember to set the iframe to be borderless and transparent.

Zhengzhou Noodles

OK, most of you have heard of Shanghai Noodles. It is very popular in Chinese-like food courts and cafeterias in North America. I guess it pretty much because it is low cost and its recipe is simple to follow. Sometime it is called Lo Mein (捞面), means “noodles out of soup” in Chinese, to differentiate from soup noodles. In Chinese foods, Lo Mein from various cities can be very different. The differences take places in preparation and ingredients.

Zhengzhou Noodles

This evening, I made myself my favorite Lo Mein. It is called Zhengzhou Noodles with Pork and Spinach, where Zhengzhou is the capital city of Henan Province, and it is my town where I was born. Just like Shanghai Noodles, its recipe is very simple too.

Ingredients: Any kinds of noodles (e.g. wheat noodles), Any kind of grounded meat (e.g. pork), any kind of green leaf vegetable (e.g. spinach), raw garlic (4 slices, grounded), oil, soy sauce and salt.

I never find out how much some item in the ingredients is required, because I hate to remember the numbers and units. Take a look at the above picture and figure it out yourself. Actually the ingredients are not important here. It is the preparation identifies Zhengzhou Noodles.

Preparation:

  1. Prepare the noodles in the normal way. Take away the water and cool down in a plate.
  2. Put 2 spoons of oil in a frying pan and turn on the stove.
  3. When it is hot enough, put the grounded pork and 4 spoons of soy sauce in.
  4. Stir frying for a minute, then put spinach in.
  5. Keep stirring until spinach is soften.
  6. Add some water and wait until it boils.
  7. Turn off the stove. Add grounded garlic and salt according to your taste.
  8. Mix with noodles and enjoy it.

My father taught me how to make it on phone when I first learned cooking in Canada. Before I learned cooking other foods, I made myself Zhengzhou noodles almost every week. I tried different noodles, meat and vegetables but this one is my favorite. My mother loves to add some vinegar and that sometimes makes my mouth running too.

已不是我(上)

在办公室的时候,又一次在 MSN 上被请教如何去 emerge 某个 ebuild。那个朋友说他每次到最后都会得到一个 Segmentation Fault,应该怎么办?我说,我已不是我。关于这个朋友的问题,我发了几个网页给他,然后就解决了。他对此很感谢,说他现在已经迷上了他所接触的东西。我心里于是不知道有什么东西“碰“了一下。很久以前,我曾经坐在同样的命令行前。眼睛没有离开过屏幕整整 22 个小时,我却根本不辛苦。相反,那是一件很享受的事情。最后要结束的几个小时里,我甚至会异想天开自己就是 Neo,看到的就是一行行滑落的 Matrix。我也曾经陈不住气地向所有的朋友宣布,这就是我的梦想。现在看来,那样的水平也想出来混。呵,幼稚。

很久没有对那时候的爱好再那么歇斯底里了。我并没有忘记,只是更愿意完全抛弃过去的所学、所想。因为那些只是技术,并不是宗教。既然是技术,掌握就好。无谓的说教和争论,和我无关。这各阶段的进化,正式终止。我把过去若干年来对电脑的兴趣规划成三个阶段。我管每各阶段都叫做一次进化。对这个世界来说,每个阶段只是又多了一个 Geek;而对这个 Geek 来说,每次进化就是多了一个世界。虽然没有太大的成绩,但是从最早的兴趣开始到现在,也有一段时间了。有些东西很想记录下来,所以就写在这里,留给未来的我看。

我和计算机的接触开始于 7、8 岁时在母亲所在的单位地上捡起来的很奇怪的纸条。我会在上面画画,或者把纸条撕个粉碎,然后幸灾乐祸地看着母亲去收拾。现在想起来,上面那些密密麻麻的小孔竟然就是我们现在众所周知的 Software。那些打孔机器就像科幻电影那样兹兹地响着,我不知道那是什么。当时的我做梦都不会想到,若干年后我竟要以这些小孔所代表的 1 和 0 赖以为生。那时候的记忆我留存的不多了,但可以算是冥冥之中带我走向之后三次进化的宿命吧。

在我小学五年级的时候,也就是在 93 年的暑假,我辍学了。我和父亲、母亲,还有孪生的哥哥离开了老家,去了一个叫做深圳的小村庄。母亲因此离开了之前的单位,我也以为与那些打孔机器从此无缘。深圳离另外一个稍微大一点叫做香港的村庄很近,因此生活……不,电视也更加多彩。很快,家人就发现这样的多彩并不生活。看着别人家的孩子都参加各种培训班,我也被列入了一个之后让我父亲十分后悔的计划中,那就是把我和哥哥送去一个位于深圳市青少年宫的电脑班。之前还非常担心我们没有求知欲,能不能在里面呆上两天还是跟问题。那时候学的东西很先进,比如 DOS 和 Turbo BASIC。而且是在当时最快的 386 上运行的。也就是那短短的几天,让我进入了一个从来没有体验过的世界。

很快,一个星期过去了,一个月过去了。我把每天的生活都放在了电脑班、旁边图书馆的电脑书籍区里。很幼稚地把某个教材里的代码抄下来,然后写在家里的电脑上运行。然后修修改改,乐在其中。时间因此过得飞快,我也在深圳的一个小学百无聊赖地混完了六年级,然后混到了小学对面的中学。但是每天的生活还是没有变,放学回家就坐在电脑前,一直到睡觉。理所当然地,我的学习成绩一落千丈,因为我不务正业的时间实在太多了。甚至有几次父亲都想把那些电脑都砸了。哥哥也好不到哪里去,跟我为了争坐在电脑前面的时间吵得不可开交是经常的事情。因为理科成绩不理想,高中的时候我就读于文科班。那时候的成绩排名,好几次在全年级竟然是倒数一二。虽然都是成绩单上写的,没有公开,我也会不知廉耻地拿着到处炫耀。那些好学生、奥数尖子、老师的重点培养对象们避之不得。(一直到现在还在炫耀,借光鄙视一下自己。)再那样下去,我可能连大学都考不上。家里面开始重新思考我的出路,在我不知情的情况下,密谋了一个改变我一生的计划……(上、

&ldquo;我等着你回来,我等着你回来&rdquo;

想象一下将要结束的假期,还有不见许久的同事,很多刚刚结束春节长假的上班族可能都会期待从新回到离别已久的办公室。当然,前提是你超级喜欢自己的这份工作。期待之后是什么?很多人都会说不上来。但是,我们马上就要结束产假,明天就要回来上班的 Andy 肯定会疯掉。(木哈哈,想起他明天那个时候的表情我就想笑。)在微软,有一个传统跟闹洞房很像,只不过闹得目标不是人,而是——办公室。每当一个同事放假即将归来的时候,所有人就会提前去把这个员工的办公室“收拾”一番。没听懂么?这有个例子:

好吧,反正他不懂中文,我就放心大胆地说出来吧。这次我们的计划是,把所有人的照片都打印成大头贴,然后贴在他办公室里面所有能贴的地方。请不要局限你的思维,这里说的是所有物理条件、化学条件都允许的地方——想象一下那个每一个按键都被贴上头像的102键键盘 :)大家虽然都是做办公室搞脑力活动的,但是在整人方面动作也很快。大概半个小时就让 Andy 的办公室基本上除了每个人的大头贴其它什么也看不到。一位仁兄大概算了一下,如果每天花一个小时去十张大头贴的话(工作任务第一),少说都得三、四个月才得让办公室恢复原样吧,木哈哈哈……康桑巴米达,Music!“我们等着你回来,我们等着你回来。”

Transportation in Great Seattle Area

If you go to previous post, you will see the pictures I took during my visit to Seattle downtown with her. I like not only this city very much, but also the surrounding areas. There are many great places to take a look. The Lake Washington divides the whole area into two parts, the Seattle city and the eastside, where the eastside is where I work and live. Although I don’t have a vehicle so far, it is not difficult for me to travel among all these cities, because there are resources and flexible commute combinations to access and use.

Most of the time, I take bus. Before I go to some place, the first thing I do is to visit the Online Trip Planner. It is a great tool and it really helped me a lot for my settlement in last month. In the page, you enter the starting point and the destination, the date of the trip (schedules for most routes are different in weekdays and weekend), how far you want to walk and other preferences. I usually choose Fewest Transfers since I am really lazy :P. Then after a click on [Plan Trip] button, it shows several itineraries according to your need. Another neat feature I like, is the Plan Return Trip in the result page, so I don’t have to re-enter everything again for my return.

Another useful tool for taking a bus on time, is Seattle Bus Tracker. Simple enter the route number at the upper left corner, it then shows the locations of the buses for a specific route in real time. It is a great replacement to the bus schedule lookup table. Need to mention that this nice tool is based on Microsoft Virtual Earth.

In some cases, the place I want to go cannot be reached by a bus, such as trails at Redmond. That’s one of the reasons why I bought a bike. Bike is a convenient tool for traveling, but it doesn’t help much if you are thinking about going to Pike Place Market from Redmond and come back. Fortunately, there is a solution to that if you prefer to ride your bike at both ends. Both of the transit companies, Sound Transit and Metro Bus, have bicycle racks installed on their buses that allows passengers travel with their bikes. I was surprised about it when I first came and it strongly supports my decision to get a bike. More resources for biking in this area are here.

If you drive, there are other commute choices such as carpool, vanpool and Park-n-Ride. All these different methods of traveling can also be combined, for instance having a bicycle rack installed on the vanpool vehicles. So, where do you want to go today?

Happy Chinese New Year

Tomorrow will be the first day of the year of Pig. Well, there are really not many events here for the celebration, except a party by CHIME in Saturday night tomorrow. The most important and happiest thing is that she is coming to town! Alright, I appreciate that if there are any suggestions of good restaurants Seattle, Bellevue and Redmond.

Happy New Year!

排球队的老照片

今天 Miaomiao 同学带我去 Overlake Christian Church 打排球。球场上老中青各阶级各肤色的人民群众都有。若干年后再一次返回球场,气势依旧,技术龟烂。特别是扣球,基本上是 100% 失误率。弹跳就更不用说了,好像地球引力对我来说特别强。战术意识还有,前排进攻的时候知道站在旁边补位。可惜,返回原来位置的时候,验证了当年排球队老高高老师的一句话:跟火车转弯一样。唉,光阴一去不复返啊。想当年在深圳实验学校打副攻的时候……算了,英雄不提当年勇。还好翻出两张旧照片,可以美美地沉浸一会。

刚拿完深圳冠军,正在给女子组比赛加油。

颁奖典礼,那年我17岁。