2007年01月08日

在S60手机上运行Python程序, 不是开玩笑哦, Nokia终于干了一件让我兴奋的事了…

Check this out~
Nokia Python for S60

Python for S60是Nokia提供的在S60执行Python脚本的工具, OpenSource的, 现在版本是是V1.2, 支持的功能有

  • GPRS和蓝牙的网络支持
  • 本地及远程执行Python程序
  • 支持本地GUI Widget
  • 发送短信
  • 安装包生成工具
  • 二维的图形图像, 以及全屏应用程序.
  • 摄像头和截屏API
  • 联系人和日程表API
  • 声音录制和回放
  • 读取系统信息, 如IMEI号码, 存储空间, 可用内存等
  • 富文本显示(字体, 颜色, 样式)
  • 支持矢量UI
  • 扩展了键盘事件
  • 拨打号码
  • ZIP模块

PS: 虽然不是很喜欢Nokia的手机, 但现在又多了一个买Nokia手机的理由了… 以前用过7650(应该是第一台S60手机), Nokia的手机太粗糙了, 不过Siemens不复存在了, 没办法~

2006年12月29日

28号了, 还没到除夕,  提前回顾一下自己的2006吧. 同时算给关心我的朋友一个交待吧, 我平时比较懒不喜欢解释.

以这张照片作为我2006年的开端, 那时是1月5日, 当时给这集照片命名为<最后一场雪>. 学期即将结束, 然后去德国, 然后毕业, 我清楚, 这很可能是最后一场雪了.

回 家休息了一段时间, 就去北京办理签证, 期间肥婆也从广州飞过来了, 在北京漂啊漂. 我喜欢北京. 签证需要面见, 看着别人都被问得#%@#%, 不免有点紧张. 到我了, 德国面官问我去哪实习, 我说”BenQ Mobile, former Siemens Mobile”, 对方听到Siemens, 说了一句”Very Good”, 然后就No more question了, 哈哈, 很自豪.

上了飞机, 十几小时后, 我来到了另一个世界. 这是我到德国后拍的第一张照片. 拉着一个我几乎拉不动的巨型行李箱, 我一个人来到了德国. 也许可以算是很幸运,  遇上了德国几十年来最大雪的一个冬天. 我的德国生活就在白茫茫中开始了.

我知道这次来不再是客人, 我在这里生活将遇到很多困难, 虽然我知道在别人眼里这是件很Shiny的事.
起飞之前, 房子还没着落. 当我在空中的时候, 同事帮我搞定了, 不过第一个礼拜要先在Youth Hostel度过.

第一个礼拜显得特别寒冷, 还没有家, 每天晚上下班后, 一个人走在大街上, 琳琅满目(因为<橱窗法>, 即使关门了也要开等), 而我寻找的, 只是便宜的能填饱肚子的东西, e.g.香肠, 除了在这种状况下, 德国香肠吃起来都很棒的.

在办公室当然语言也是个问题了, 一是自己英语菜, 二是还不习惯同事的德国口音. 那时什么都是发E-Mail – 最舒服的方式了. 不过No big deal, 英语不好就keep talking, 晚上狂看Friends, 既可以放松有可以学英语.

这时的德国是冰冷的.

一个礼拜后, 搬进了自己的apartment, 算是有个窝了. 加上同事和朋友的帮忙, 生活上的问题开始迎刃而解.

在Keep talking一个月后, 感觉任督二脉被打通了, 语言不再是个问题. 开始融入了team, 提出和实现自己的想法, 信任同事和得到同事信任, 展现自己.

我的办公桌. 屏幕上的便签大部分都是同事叫我的德语脏话, 记下来随时用~

周末在河边看书, 去别的城市参加朋友的Party, 在酒吧看拜仁的比赛;

在有F1比赛的周末, 到Schwabin的法拉利餐厅看F1大奖赛, 然后到English Garden溜达…
一个月后, 觉得自己在这里生活了.

越来越喜欢自己的工作, 也越来越喜欢自己的生活. 在F1比赛周末, 基本都是在Schwabin度过, 这里有餐厅, 有Cafe, 有大学, 有图书馆, 有公园, 有学生, 有美女… 慢慢也开始喜欢下班后到州立图书馆看书, 不需要任何证件进入, 只是进去时不可以带包, 出来要检查, 以防有人窃书, 我就见过有类似乞丐的人进去图书馆了.

没有比赛的周末, 就抓紧时间去旅游, 开始明白旅行的意义.

如果第一个月的问题时语言的话, 那么第二个月的问题就是怎样融入这里的生活.

毕业答辩的时间一改再改, 我的回国时间也一推再推.

五月的最后一天就把房子退回给房东了, 也就是最后一个礼拜又开始流浪. 辗转了几家青年旅馆后, 最后又回到了刚来时住的旅馆, 算是个圆满的轮回.

最后的的时光除了工作, 就是足球, 啤酒, Party….

世界杯开幕后第二天, 我飞了, 在热闹中离开.

10小时后, 回到了北京, 感觉瞬间换了个世界(我在飞机上都是睡觉的), 我依然感觉不到时差. 在北京逗留了两天, 见了几个朋友, 到北京的研发中心溜达了一圈. 然后会到了西安.

搞完了那个摸不着头脑的答辩, 又开始准备下一次离别了. 一次又一次集体活动, 总是希望能有多一点的时间能呆在一起. 每天都很high, 但其实心底是痛的.

拍完毕业照, 疯狂也快到头了.

我还是宿舍最后一个开始收拾的, 收拾着四年的回忆和梦想.

也许很多人有这样的错觉: 这次离校就像以前那样, 不过是放暑假回家, 放完就回来了. 我没有, 我很清楚这一走就是要离开一个世界了. 我努力的记下这里的一切. 这一个月也许是二十年来最伤感的一个月.

我还是拉着那个拉不动的巨型箱子, 上了火车, 回到家里.

我又到了另一个世界.

半年内三次的时空变化让人错愕.

我决定have a break, 我去了北京,

去了无数次香港,

还从香港娶了个老婆.

我放弃了一些东西, 因为我想认识自己, 想知道自己想要什么东西.

人生总有潮起潮落, 潮退时欣赏一下风景, 涨潮时抓紧十几冲上浪尖. 没有潮落就不会又潮起, 潮落不是坏事, 潮起让人兴奋, 但潮落也值得享受.

自己最想成为怎样的人时迫切的目标.

2007有什么目标? 还是那句: 比2006好.

谢谢你们, thanks for giving so much. Wish you guys have a good slide to new year 2007.

2006年12月12日

1. == and String.equals()

Firstly look into this code:

String s1 = "test";
String s2 = "test";
boolean result = s1== s2;

What the result will be? It will be true. not because the content of s1 and s2 are equal, but because the s1 and s2 references are so.

The == operator, when applied to references, simply compares the references themselves for equality, and not the referenced objects. s1 s2 here are two references to this "test" string-valued constant in Constant Pool, and we should know all strings in this pool are guaranteed to be unique.

Conversely, if two references are equal using ==, then you can be sure that they refer to identical objects. So if you are comparing strings, and there is a good chance of encountering identical ones, then you can say:

if (s1 == s2 || s1.equals(s2))

"Always perform a cheap test before an expensive on, if you possibly can", here == is much cheaper than equals().

2. Interning Strings

The Java String class has a method called intern(), it returns a string that has the same contents as this string, but is guaranteed to be from a pool of unique strings. Saying:
str = str.intern();
adds the string to the pool if not already there, and returns a reference to the interned string. Interned strings can be compared with each other using ==, which is much cheaper than using equals() to do the comparison.  For any two strings s1 and s2, s1.intern() == s2.intern() is true if and only if s.equals(t) is true.

An example of interning strings:

// interning strings 
public class str_intern { 
    public static void main(String args[]) { 
        String str = new String("testing"); 
        // interning not done 
        if (str == "testing") 
            System.out.println("equal"); 
        else 
            System.out.println("unequal"); 
        // interning done 
        str = str.intern(); 
        if (str == "testing") 
            System.out.println("equal"); 
        else 
            System.out.println("unequal"); 
    } 
}

 
In the first example, the test str == "testing" compares false, because str is a reference to a string that is a copy of the literal "testing", while "testing" itself is an interned string, and therefore the corresponding references are distinct.  In the second example,  the test compares true, because str has been interned, and the reference returned from the intern() call is identical to the reference to the "testing" literal already in the internal string pool.

String interning is a very fast way of doing comparisons within a pool of strings, with an initial cost incurred in actually doing the interning, comparing with existed strings by equals(Object).

2006年11月28日

2006年09月21日

From Horst Thieme’s blog @ SUN

Trisent TrilocatorTrisent is a technology company that has created a revolutionary new way to continuously track the location of mobile phones. Unlike Cell-ID technology the system is continuously aware of the location of the tracked phone, when a phone moves the location is automatically updated. This is a real alternative to GPS and it uses standard mobile phone handsets! Trisent argues: "GPS handsets are expensive, they drain your battery quickly and in many situations they cannot see the satellites so they don’t always work. Trisent’s technology overcomes these problems by using off-the-shelf technology which works anywhere with mobile coverage."

Trisent, a scottish mobile company, partners together with russian operator Vimpelcom to roll this service out. Perhaps a nightmare for every worker but a great control about their employees for the companies using this service. The only opportunity NOT to get tracked is by switching of the mobile phone…

More info at http://www.trisent.com/.

2006年09月11日

Schumi, 舒马赫

王者就应该象王者一样离开.

虽然所有的流言和猜测都显示, 你真的要停下来了, 但我是相信奇迹的人, 在你说出要Retire前, 我都相信你会继续, 因为你还有战斗的心.

不懂的人会觉得F1很无聊, 是你们铁三角教会我看F1, 不单单是技术上的. 你超乎寻常的冷静, 你的驾驶艺术, 你对节奏的把握等等等, 都将被很多人怀念; 你犯的错误, 也会被人们记住甚至嘲笑. 但这些都将是过眼的浮云…

你的胜利, 是意志的胜利.

很遗憾没能早点看你的比赛, 或者说享受你的比赛, 看你怎么在低潮中坚持, 建立自己的王朝; 很后悔在德国没去纽伦堡看欧洲大奖赛, 就是你们长舒一口气的地方.

其实有时候F1赛场很象人生, 一场比赛往往就在等一个超越的机会, 生活中的卧薪尝胆, 忍辱负重不是同样的道理吗? 时间会逼你进入下一个人生阶段, 不管你愿不愿意, 人总要不停适应不同的阶段. 开心幸福往往反而让人觉得难过, 快乐和黑夜一样, 都是毒品. 喜欢黑夜, 宁静的黑夜, 会让人神经细胞变得活跃,让人思考, 想什么? 想过去, 想未来, 想过去的痛苦, 过去的快乐. 让你陷入不能自拔的沉湎, 快乐是最大的痛苦.

Anyway, Schumi, Thank you & All the best!

2006年09月10日

再过两个小时, F1意大利大奖赛将开始. 再过两个小时,比赛结束,Schumi将在发布会中公布自己的去留问题.关于你的去留问题,全世界都已经陷入疯狂的讨论中.

今晚, 无论你决定Stay还是Stop,注定全世界无数的车迷都将为你流泪,. 但我多渴望能听到你说继续.

希望你今晚能举起象征王者的拳头,还有熟悉的一跳.

而我, 正在等Someone’s response, 也许注定是个不眠夜…

2006年08月20日

如果爱迪生需要从草垛中找到一根针,他会马上像勤奋的蜜蜂般一根根地检查稻草,直到他发现自己要找的东西……

看到这样的做法,我感到非常遗憾。因为我知道,只需要一点点理论和计算,他就能省去90%的力气。

—尼古拉·特斯拉,《纽约时报》

2006年08月03日

Basecamp made a survey among its users about what’s web 2.0. Here the the survey detail.

It’s funny to see what users are thinking on this topic. And the survey received all kind of response: open source, social apps, rounded corners,  make life easier, replace desktop software…Absolutely the hottest word is AJAX.

Attached some funny comments :) :

10. The pendulum has swung back to the little guy for now. Now the big guys like Murduch have to buy the little guys like MySpace. Curious to see how the big guys will actually regain the upper hand technically beyond aquisitions. What moves does Microsoft have left to try to kill web 2.0? Is the public finally too smart to fall for trojan programs from Microsoft whose ultimate goal is the payment of high license fees down the road.

88. A world free of its dependence on all things Microsoft! ;-)

100. A new way of dealing with user experience. It entails making the web application more like a desktop application as well as a more community oriented approach.

103. easy social applications

282. Web 2.0 to me means a movement in people, companies and software towards a more service based, interactive, user driven online social sphere.

340. It means BETA ;-)

433. Ajax. Ugly reflections and glassy graphics. Pointlessness. Despair.

458. To me it means user-centric, clean, text based web. Web that actually makes my life easier.



2006年08月02日

上礼拜就想写这篇文章.

Charles Arthur: 网络互动站点的1%规律

什么是1%规律?

这是一个根据统计得出的大致规律:100个在线的群体中,有一个人创建内容,10个人参加互动(讨论或提出建议),剩下的89个人只是在旁观。

早期的相关数据表明80%的站点数据由20%的用户创建,但在如今这一比例正在逐渐降低。那些Web2.0团队们需要思索一些问题了。实际上,一个过多追求互动体验和由用户创建的内容的网站将会看到10个人里9个人基本都是匆匆过客。

麦田: Web2.0 只对1.5%的网民有效


第一点是:凭什么让用户为你贡献内容。坦率地说,这条障碍我很早就知道,并且我对之有解决方案。但我看见好多国内的web2.0新兴网站,压根就克服不了这个障碍。他们把网站摆上了线,他们把web2.0的概念喊得震天响,但他们就是没法让用户访问他们的网站――遑论为之贡献内容?!这些操盘者,和几年前嚷嚷着“六度空间”就开始做SNS网站的哥几个水品差不多,都是“概念拥有者”,却不拥有用户。

 

但第二点,我却是过了很长时间,走了很多弯路才想明白,即:其实绝对不会有太多用户贡献内容,只有1.5%的用户会做这样的事情。Web2.0 只对1.5%的网民有效


Randfish: Top 100 Digg Users Control 56% of Digg’s HomePage Content

A logical extension shows that the top 100 Digg Users have contributed 14,249 stories to the homepage, or 56.41%. At Digg, a very select group of users is dominating the popular homepage content. Far from being a mass of opinion, Digg is instead showing, primarily, the content opinions of just a few, select folks.


Keso:
1%、1.5%、56%与Web 2.0的用户

站在纯商业的角度去看待用户贡献内容,自然无法理解为什么用户要为你贡献内容,因为你首先错误地把用户当打工仔或者网站的义工看待了。但如果换个角度,这 问题就一点儿都不难理解。用户从来不是为任何商人贡献内容,他们只为自己贡献内容。我把照片上传到Flickr,根本不是为了给Flickr贡献内容;我 把网摘保存到365key,也根本不是为了给365key贡献内容。谁让我先获得价值,谁就可以获得我贡献的价值,我认为这是公平的,并没有背离商业规 律。

我的想法:
- WEB 2.0是舞台, 用户是表演者. 用户表演是为了得到自我满足;
- 我曾经以为用户参与和作贡献是因为自我的觉悟, 自愿地贡献内容, 现在看来, 这是傻X的想法;
- 生产者只可能是极少数;
- 但消费者也是不可或缺的, 虽然他们没有贡献内容. 但如果失去观众, 生产者的表演将失去意义.
- 不要把用户当成免费劳动力;
- 自利是用户参与的本质动力.

我的问题:
WEB 2.0也应该有一个生态平衡的指数, 到底这个指数是多少, 服务最能健康发展? 是1%吗?