2009年1月27日

python的XML解析

折腾了好几个小时,终于明白了两点:

1.UTF-8格式的汉字和gb2312的汉字是不同的.
2.utf-8的汉字在终端上显示是乱码.(我还以为是解析的结果不对.没想到是print到终端上,终端的显示有问题.)
3.虽然资源占用大一些,建议使用utf-8, 并在python源程序中加上:
     # -*- coding: utf-8 -*-
4.对于不支持utf-8编码的软件,要将文本文件用notepad打开,并另存为utf-8格式

   Dive Into Python

 阮一峰: 字符编码笔记:ASCII,Unicode和UTF-8

--
颂祺 / Cordialement / With kind regards / Viele Gruesse / Met vriendelijke groet

Lancelot MAY

readmore »»
2009年1月25日

新年快乐!

祝各位牛年快乐,万事如意~~~

readmore »»
2008年12月29日

No Country for Old

"No country for old" is a film name. I didn't like that film after seeing it. It is so strange for me that I could not catch its point.

The word "No country for old" was back to my mind when I heard that two German sites of our company would be closed in the first quarter of next year. Our company was split from the mother company last year. Then it was merged to another company in August this year. Just a few days after the merge finished, it was announced that the merged company would be merged to another company-- the result would be the unique wireless related semiconductor company of Europe in near future. Do you think it is exciting? Sorry, I don't think so. It means that lots of employee will loss their jobs and cannot find a new job -- there is almost no other choice in European wireless industry for who was laid off by the company.

Not only in Europe but also in world wide, there are less and less companies in wireless communication industry. And fresh graduate students rush in wireless communication area every year. They learned latest technology and requested less salary.    

There is no country for old.

readmore »»
2008年10月28日

如果给一块钱的话

昨天下班的时候路过天桥,有个中年妇女坐在天桥的楼梯上并且引起交通拥堵--这个位置通常是有人乞讨的,但是这次不像。一个中年男人正转身走过来,似乎是夫妻俩吵架了,丈夫正在返回来赔礼道歉。但是女人的脾气不是那么容易消除的,看起来男人也没啥自信。
我在想,如果我仍一块钱给这个占了乞讨者位置的女人会有什么结果?
a.跳起来骂我
b.很郁闷地跟着他丈夫离开
c.把责任归咎于她丈夫并且吵得更凶了

readmore »»
2008年1月25日

是不是该囤粮了?


今天在薛兆丰的blog上看到了这个标题:

价格管制悍然出 台,商品短缺指日可待

想起了前几天的一件事情:从超市回来后,我惊呼牛奶涨价15%以上。老妈很肯定的告诉我,牛奶的价格还要涨-- 养殖户养奶牛一直在亏钱,只好把牛都杀了以防亏的更多,所以牛奶的供给会短缺,价格会继续上涨。
没有学过经济学的老妈都知道的事情,为啥领导们不知道呢?

readmore »»

12月的CPI是6.5%.每家报纸在报导的时候都会在后面再加一句:全年CPI是4.x%
我一直在想,全年上涨4%,现在年息也差不多是4%,还算不亏。
今天突然琢磨过来了,从去年12月到今年12月,上涨了6.5%,还是很亏的!

readmore »»

当年中学读书时,每天早上都要背名句,记得有一句是"如此星辰如此夜,为谁风露立中宵"。出处不记得了。

这几天看 木木的blog ,才发现自己背错了,原文应该是 "似此星辰非昨夜,为谁风露立中宵", 而且背错的还不止我一个人,goole一下会发现一堆人都是在写"如此星辰如此夜,为谁风露立中宵"……

文字上些微的不同,意境就差多了

黄仲则原韵《绮怀》

十六首之十五
几回花下坐吹箫,银汉红墙入望遥。
似此星辰非昨夜,为谁风露立中宵。
缠绵思尽抽残茧,宛转心伤剥后蕉。
三五年时三五月,可怜杯酒不曾消。
 

readmore »»