Archive for March, 2007

Today of Last Year

Saturday, March 31st, 2007

“Great news will come from far away” - March 31, 2006

“You will soon reach your personal goal” - March 31, 2007

I like the cookies.

Why I am not Neo

Saturday, March 31st, 2007

I just played a first person shooting game. I came across its website, download it and played on several servers set up by users. It was not new for this kind of games. I guess there are hundreds of first shooting games like this all over the Internet. So the name of the game is not important. It’s just the virtual world experience important. I logged on one server which has not only human players, but also bot players. You know what, these bots are so fast, that you can’t catch them at all. They are always chasing you and picking up the nearby weapons.

It just reminds me of one of my favorite movie, The Matrix. It’s just like you are in a world that software are human shaped, you are your-digital-self. How is it possible to fight against a piece of code that is designed to play with you, or kill you in its world I should say. I always imagine myself as Neo in the movie and used to set the screen saver to be those falling characters shamelessly. Apparently I’m not, unless I know the bug of the code and find a way to hack it somehow. Human beings have defects. That are why there are bugs in the software designed by human. If we think about it further that the code is designed by code, then it’s really hard to imagine what will happen if the story of Matrix comes true. How are we gonna win in the machine’s world? A world designed by machines, where the designer machines were designed their parent machines and so on?

Fortunately these haven’t come true yet. It requires hard mathematical proves to show a code designing its child code is possible. For now, it only proves that Neo is not human being in the film. That’s my understanding of the story, that Neo is actually another piece of code to balance the machine world. That gives us the new hope. We are not fast; we are not accurate. How are we going to fight against those bots in the game? One thing and the only thing we can do to win the game, is to design another bot using the so called SDK. We can make it with more robust algorithms, so it’s even faster than the enemies. Hey, we are human, we are famous of making tools, to compensate what we are naturally lacking of.

Actually this is already happening. Think about computer virus and anti-virus software. How are we supposed read the binaries byte by byte to find out which one is bad? Of course not. I am less worry now, even I am not Neo. Here comes my favorite picture of the movie.

没有装字典软件么?

Friday, March 30th, 2007

上海的 Windows Live 国际产品组最近正在测试基于微软自己的 Windows Live Agent 平台的 Live Messenger 英汉字典机器人。只要在 Live Messenger 添加 en-cn@hotmail.com 为好友就可以了。这样比我每次都要去某个搜索网站打“fy someword”要方便很多。因为还在测试,所以功能只有翻译一项。如果以后能加入其它的功能,比如输入拼音返回中文,就会更酷了。反馈地址在  http://feedback.live.com/?mkt=zh-cn

找骂

Wednesday, March 28th, 2007

一篇话题很简单的日志,老中看不懂,老洋读不通,你丫中英混着写就高档次了么?要时刻自我批评,警惕浮华主义的滋生。

例子:

一篇话题很简单的日志(Blog),老中看不懂,老洋读不通,你丫中英混着写就高档次(Modern)了么?要时刻自我批评(Self-Criticizing),警惕浮华主义(Ostentationism)的滋生。

Monkey Kick Off

Wednesday, March 28th, 2007

Just found a interesting flash game, called “Monkey Kick Off“. It’s pretty simple, that all you need to do is just click. I’ve got 4949 “monkey meters”, as shown off in the screenshot. What’s your score?

March 30, 2007 Update: You can’t beat me.

如果臭虫数量是表现一个软件的质量的话

Sunday, March 25th, 2007

刚刚看到驱动之家的一则新闻,说今年一月份以来“家庭服务器版 Windows 发现 2400 个 bug ”。其中 15% 的 Bug 已修正,也就是说有大概还有 2000 个 Bug 未修正。因为我本身就是个 SDET,所以对新闻的真实度不表示怀疑。这个报道也很中立,没有对事情本身做太多评价。基于对事实的尊重,下面是三个开源软件公司及组织的 Bug 数据库地址,分别为 Redhat, Mozilla 和 OpenOffice.org :

  1. http://www.openoffice.org/issues/query.cgi
  2. https://bugzilla.redhat.com/bugzilla/query.cgi?format=advanced
  3. https://bugzilla.mozilla.org/query.cgi?format=advanced

各位看官也不要闲着,请在“ Only bugs changed between: ”下面的起始栏里面填上“ 2007-01-30 ”(月底也算一月份,对吧?),然后在截至栏填上今天的日期。还有,要记得不要把已修复(Resolved)和已关闭(Closed)的 Bug 算在内哦。然后点 Search 按钮,看看返回多少 Bug。我在此不做任何评价。

Let PowerShell to summarize your IM history

Saturday, March 24th, 2007

(March 25, 2007) Update: Thanks to James Manning for the -passthru parameter to simply the command.

Windows PowerShell, also known as “Monad”, is a cool shell environment to replace old CMD shell under Windows. It is an object oriented shell and it allow easy manipulation of different types of objects interactively. Another advantage is the support of various data structures and formats, such as XML. Just like other good old shells, it also supports piping. The difference is that, instead of text stream, it sends objects through the pipes.

I always want to find out some information about my Live Messenger history. Now let’s see what PowerShell can do with it. In most cases, Live Messenger history is saved under “My Received Files\<Live ID with some numbers>\History” in your Document folder. Now let’s boot into PowerShell and “Set-Location” or ”cd” to this folder. If you type “Get-ChildItem” or “dir” you will see a bunch of .xml files listed.

Alright, let’s first try to find the top 10 friends with most letters:

Get-ChildItem | Sort-Object Length -descending | Select-Object -first 10

At this point, I assume you are already familiar with the concept of piping. Here it gets a list of files, sort it and display the first 10. That’s not too difficult to understand.

Actually those files are in XML format. That’s why it ends with .xml extension. One important XML element in these files is the message. Each message element corresponds to a sentence sent between me and my friend. Let’s see how PowerShell deals with XML files in this case. The following command lists the top 10 friends with most messages:

Get-ChildItem |
ForEach-Object {
    $_ |
    Add-Member noteproperty -name count -value ([XML] (Get-Content $_ -Encoding UTF8)).Log.Message.Count -passthru
} |
Sort-Object -property count -descending |
Select-Object -first 10 |
Format-Table count,Name

It first gets a list of files. For each file, it creates a new object $o. Then it adds the count of messages from the XML file as a property of $o, as well as the name of each file. Finally, it sorts the object based on number of messages and displays the top 10.

Another interesting XML element of Live Messenger history file is LastSessionID. I guess It is the number of chat sessions established by either me or my friend. With a little modification to the previous command, I can know the top 10 friends with most sessions:

Get-ChildItem |
ForEach-Object {
    $_ |
    Add-Member noteproperty -name count -value ([Int32] ([XML] (Get-Content $_ -Encoding UTF8)).Log.LastSessionID) -passthru
} |
Sort-Object -property count -descending |
Select-Object -first 10 |
Format-Table count,Name

A small change is that LastSessionsID is read as a string. So we have to convert it to a integer number using [Int32].

Other XML elements, such as Date, Time and even text in each message, are very informative too, as long as you can explorer them in a good way. Right now, there are other more information I can think of out of my head, e.g. the top 10 longest message you received, the first 10 person talked with you, the longest 10 chat sessions in your IM history and so on.

For updated information and tricks on PowerShell, here is a good resource. If you have used Live Messenger on two or more computers, you might also want to consider this history merger.

Guess who sends the most smiles to me? :)

Be confident

Thursday, March 22nd, 2007

This is either a big or a small problem. But it is no problem to understand that confidence is important for one to survive in its group, its industry and even in its life. Some people finds itself lack of confidence but others are not. I am for sure not the latter case. So I want to put myself a little note here to summarize what I brainstormed. and get ready for other suggestions.

So, it all comes to 3 simple questions as follows.

  • What is confidence?

Without directly looking into my good old Oxford dictionary, the first interpretation of confidence that comes out of my head is that you believe in yourself when you speak and behave. You know what you are doing is right and what you are saying is correct. Lacking of confidence, in this case, is that you are afraid to talk and act because the uncertainty exists in your mind. It can be that you are involved in a challenging workplace and everyone seems to be smarter than you. So you are more convinced by others instead of convincing others. I guess this is my current situation.

  • Why need confidence?

You want to grow. Growing needs confidence. With confidence you can ask questions in depth, do certain give-it-a-try works and eventually gain knowledge on what you have heard and seen. Meanwhile, growing means getting familiar with the area you are in, so you will be convincing others more often. The biggest side effect of this is that you get to be even more confident, so the question becomes an answer to itself. It’s like investment that you invest your current amount of money to earn more.

  • How to establish confidence?

One often finds itself confidence in particular area after some milestone it reached in its past. Such milestone can be a diplomas, a certificate or any remarkable award. It proves the skills the holder had in some ways. But that’s not always really true. I just had my road test for driving license last month, but now I am still not sure if I can take a car and give a ride on the express way. It seems like experience plays a more important role in establishing the confidence. Alrite, you take a deep breath and get your feet wet. That’s where experience starts from. Once you are comfortable with it, which means you have a minimum confidence, then invest it. Keep growing it until someone tells you you are over confident. Well, that’s another issue.

十年

Monday, March 12th, 2007

1997 年:电影解压卡、MIDI 游戏音乐、单色纯数字手机

2007 年:电影解压卡MIDI 游戏音乐单色纯数字手机

是进步还是倒退?是通信、娱乐的新浪潮还是吃饱的撑的?

Quick and Dirty

Monday, March 12th, 2007

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.


Chat with me. =)