5/12/2009

错误的短信,搞笑的回复

那天不知道为什么,手机莫名其妙群发给几十个人同一条短信,内容是: 一直忙...

很多关心我的朋友很及时的回了短信,表示感谢,以下是具有代表性的回复:

1. 啥?

2. 什么意思?

3. ......?还没下班?

4. 忙什么?

5. ???

6. 有点小忙

7. 怎么了?

8. ?!

9. To me?

10. 呵呵...没啊,刚吃完饭

11. 啊?

12. 忙还来骚扰我~

13. 啥叫一直忙?

14. What's up, man ?

15. 你发的短信啥意思?

16. 发错了?哈...还好没有乱说什么呀....

Read more...

5/02/2009

感冒了,小记

脑袋昏沉沉得,因为感冒了。但还是不想睡。想写点什么,却无从写起,生怕文字里又做回那个多愁善感的自己,生怕自己也忍不住流泪。坚硬的心里能有一块柔软的地方容忍我们放肆地追忆,那是对过去最好的纪念。
当一切简简单单地平平淡淡地随着时间推移而逝,我还能做回我自己?别告诉我该怎么走,我就是喜欢踟蹰于林间小道,别告诉我去哪里,他人的方向绝不是我的下一站,别问我是否需要人相伴,一个人也能自得其乐。我的选择就是让柔软的心变得坚硬,让现实掩饰幻想,让每一次脚步都是不由自主,是无法变更,是绝望。
想停下来,哪怕是作片刻的休息,看看四周的条条框框。每一次,就是在周遭的世界里,自娱自乐,没有丝毫激情。我明白,那是一种两难的境地,渐渐被周遭的世界抛弃,渐渐被真正的内心抛弃。多久未曾被感动?此刻感动的心悸,令我恋上了那残缺的美。
有没有那么一天我一无所有穷困潦倒,依然有人向我微笑:起来吧,我在你身边。

Read more...

4/10/2009

连续休息四天,随记

今天开始到星期一休息四天.因为前段时间加过班,算是轮休吧,而星期一是复活节.

下午去房地产展走了一遭,人很少,看不到"小阳春",但是价格比去年年底普遍上涨了1000吧.

晚上去买了个键盘和鼠标.

公司的项目基本告一段落,以后的时间基本是写文档和维护. It's so boring !

所以最近正想参加一个open source的项目.
===========================

毕业两年了,改变了很多,唯一不变的还是不安定的心.
不在这里,也不在那里.
不再一个人逛街听音乐,但是依然喜欢沉默

做自己,偏执狂才能生存的更好,这个世界都不会看好你
因为人们
只向金钱低头,只向金钱承认错误

==========================
文字写出来就会变味
能理解你的人,一个眼神,一个暗示便能理解你
期望不能理解你的人能了解你
只会让你伤心

==========================
不求理解
所以才有知己的可贵
没有理解
现实生活中,人们还是处处笑脸相迎

==========================
勇气就是
你能理直气壮的与人谈论勇气
我没有勇气

我的所有乐观,都是鼓励自己
我的所有悲观,都是鞭策自己

因此,
我不曾改变

Read more...

4/08/2009

硬件世界

班级群里聊天,闹出一个笑话:
赛哥: sorry seems to be the hardest word
海豹: Xman来翻译一下
Xman: 抱歉 看起来像硬件世界

果然大家都是搞计算机的,三句话不离本行^ ^.

今天笑话了:
小孩: 谁有HAPPY TREE FRIENDS的在线播放地址啊
赛哥: 三个快乐的小朋友?
小孩: 一群小动物的那个,然后每集都有被杀掉的,死得很惨的,那片很搞笑
我 : 那为什么是 三个朋友?
小孩: HAPPY TREE FRIENDS !

我狂汗!

Read more...

4/02/2009

解决Python IDLE启动失败的问题

Python3.1 是3月份刚release的,装在vista上后,报如下错误信息:

IDLE's subprocess didn't make connection.Either IDLE can;t start a subprocess or personal firewall software is blocking the connection

临时解决方式:
在目录C:\Python31\Lib\idlelib下,找到PyShell.py
找到下面这行:
use_subprocess = True
改为:
use_subprocess = False

然后删除同一个目录下的PyShell.py的compile文件.
重新启动后,IDLE顺利打开,但是No SubProcess.

Read more...

4/01/2009

BLOGGING SHOULDN’T BE “A MONOLOGUE" ????

很难改变.第二点很多人都不同意:

1. It's normal one comment per 100 views

2. we can't comment anonymously

3. the content of blogs are not easy to comment :) I mean, if you just say "yeah, it's fine today", then we readers have no comments

4. technology related blogs always get few comments.
but " technology trends" blog which updated frequently will get comments. (you may consider such kind of blog)

5. Maybe internal blog need advertise accors ericsson , most of people in our department even don't know :)

6. telecom blog is hard to get comment, I mean not only in ericsson, blogs that talks about telcom technology throughout the world meet the same problem. This is because of the telecom knowledge, telecom knowledge is not changing as fast as other computer technology. So sometimes not fast changing means "no comments", means " yeah, it is".

7. Internal blog is not attractive, if the blog open to external, I will migrate my blog here too :)
And if it support Wordpress, it's great !

Read more...

Creative Commons

Creative Common 是一个非盈利性的组织. 这个组织免费提供工具给全世界的从事创造性工作的人们.一个类似free software的组织.
已经有很多书用的是 creative common copyright.

Share, Remix, Reuse — Legally

什么是Creative Commons ?
http://creativecommons.org.au/materials/whatiscc.pdf

Read more...

3/29/2009

Big idea

An interesting idea suddenly come into my brain, While I am copy and paste the code.This is an idea about search engine and SNS. I do undoubtedly believe the idea will come ture in the near future as "clound" deployed more widely. Invoation product always means investment and technology, and most important your tough heart.
It's a great opportunity if you can earliest bring innovation product into use. I'd like to work with talent guys on such kind of innovation.

Read more...

3/22/2009

最近生活

最近每周都很忙,公司里项目时间比较紧,在画Block description, rework, delivery,比之前忙了许多。周末晚上还要忙着帮朋友的宾馆做一个网站.遇到一些莫名其妙的问题,总算是解决了。网站中餐厅部分,还要更新一下,去徐家汇的朋友可以去他的一品乐餐厅吃一顿,菜做得很好吃。
因为虚拟主机给朋友放网站了,所以建了个二级域名继续存放个人信息。
最近的小阳春,楼市又火爆起来了,真的是莫名其妙,不得不改变对中国楼市考虑的方式。中国特色无处不在。
推荐一些不错的网址,这里是open source方面的文档,有很多好资料,慢慢找吧.
这里则有几万本免费的可在线阅读或者下载的书籍。但是都是英文版的。

Read more...

3/18/2009

Collections Framework (1)


Collection — the root of the collection hierarchy. A collection represents a group of objects known as its elements. The Collection interface is the least common denominator that all collections implement and is used to pass collections around and to manipulate them when maximum generality is desired.


Set — a collection that cannot contain duplicate elements.
List — an ordered collection (sometimes called a sequence).

Lists can contain duplicate elements. The user of a List generally has precise control over where in the list each element is inserted and can access elements by their integer index (position).


Queue — a collection used to hold multiple elements prior to processing. Besides basic Collection operations, a Queue provides additional insertion, extraction, and inspection operations.


Queues typically, but do not necessarily, order elements in a FIFO (first-in, first-out) manner. Among the exceptions are priority queues, which order elements according to a supplied comparator or the elements' natural ordering. Whatever the ordering used, the head of the queue is the element that would be removed by a call to remove or poll. In a FIFO queue, all new elements are inserted at the tail of the queue. Other kinds of queues may use different placement rules. Every Queue implementation must specify its ordering properties.


Map — an object that maps keys to values. A Map cannot contain duplicate keys; each key can map to at most one value.

Read more...

3/12/2009

BlogSpot上传模板时bx-****错误的解决方式

1. 打开新模板XML文件

2. 查找所有 widget id

3.把 b:widget id='Anything1' 改成b:widget id='Anything11'
这里 Anything指任何名字。
比如"b:widget id='Header1'" 改成 "b:widget id='Header11'"

记住一定要改成2位数字

4. 然后重新上传模板就可以了

Read more...

3/05/2009

Why few comments for your our blogs ?

In ericsson internal blog, one guy wrote such a blog, He douts why few comments on blogs, why it is one-way communication.

My reply:

======

This is my first commet, I think there are lots of reasons that few comments on blogs.

1. It's normal one comment per 100 views

2. we can't comment anonymously

3. the content of blogs are not easy to comment :) I mean, if you just say "yeah, it's fine today", then we readers have no comments

4. technology related blogs always get few comments.
but " technology trends" blog which updated frequently will get comments. (you may consider such kind of blog)

5. Maybe internal blog need advertise accors ericsson , most of people in our department even don't know :)

6. telecom blog is hard to get comment, I mean not only in ericsson, blogs that talks about telcom technology throughout the world meet the same problem. This is because of the telecom knowledge, telecom knowledge is not changing as fast as other computer technology. So sometimes not fast changing means "no comments", means " yeah, it is".

7. Internal blog is not attractive, if the blog open to external, I will migrate my blog here too :)
And if it support Wordpress, it's great !

Blog Be a log.

Read more...

电信一周观察:A tough market

1. 思科第四季度财报符合预期,销售额91亿美元,环比降12%,同比降7.5%。 思科预计Q1同比下降15%到20%。

    2. 思科和雅虎日本合作,雅虎采用思科的7000系列路由器。思科向互联网web service provider角色迈出一大步。

    3. 思科的7600路由器将支持LTE(只需要插入一块blade).

    4. Nokia's net cash balance has been weakened to around 2.4 BEur from 10.5 BEur a year ago.

    5. Nokia and Qualcomm signed a collaboration deal to develop 3G and 3G+ devices for North America

    6. Nokia had previously announced that they will add Facebook clients to their phones and somehow integrate the phones’ address book with the Facebook friends list. Now at 2009’s MWC Nokia announced they will bundle Skype with their phones too – with similar address book integration.

    7. 中兴和中国联通工程师的努力下,成功打通国内第一个跨省的WCDMA视频电话!这个电话是从深圳打到西安的,更多的3G功能正在测试中。

    8. ZTE announced another technological breakthrough by achieving the world's first EV-DO Revision B (Rev.B) VoIP Call on its CDMA2000 system, marking the first time in the industry that a CDMA vendor achieves an 9.3 Mbps download rate and 5.4 Mbps upload rate

    9. Market share infomation(市场占有率)
    According to the study Ericsson had 32% market share in Q4 2008, same as the previous year, while NSN decreased from 27% to 23%. The winners were Huawei (now 12%) and ZTE (now 5%). ALU decreased from 16% to 14%. Nortel and Motorola had 6% and 4% in Q4 2008.


    10. 阿尔卡特朗讯的股票价值低于1美元, penny stock!

     11. According to Dell’Oro, Alcatel-Lucent is the market leader in 4Q’08 in DSL, IP DSL and VDSL shipments, and continues to lead these segments from a full-year perspective as well.  (DSL: digital subscriber line)



Read more...

3/04/2009

你还想读研吗?

很可怜,刚刚中央电视台的新闻:我国研究生政策改变,从以研究变为以应用为主。

    很可怜,在读和准备读的研究生们,你们被耍了,你们其实是本科生!

    更可怜的,是在读和准备读大学的大学生们,你们更被耍了!你们自己都不知道是不是该继续读研究生!

    当研究生从竞争优势变成basic requirement的时候。大家都被耍了!

Read more...

3/01/2009

我的收藏

看看我的收藏夹里有些什么:

关于经济

    1. http://gb.stockq.org  国际股市指数行情,全球的股市指数,股指期货数据.

    2. http://sns.ganguba.com/space.php?uid=694 投资大师曹仁超博客

关于技术

    1.http://java.chinaitlab.com/ IT实验室java频道

    2. http://dotnet.chinaitlab.com/ IT实验室.net频道

    3. http://www.msuniversity.edu.cn/default.aspx 微软学生中心

    4. http://www.cisco.com/univercd/home/home.htm cisco文档中心

    5. http://www.ctiforum.com/index.html 通信方面新闻,技术网站

    6. http://www.xemacs.org/index.html  Xemacs主页

    7. http://www.csdn.net/ 最大的IT技术社区

    8. http://bbs.c114.net 通信人家园

    9. http://code.google.com/intl/zh-CN/apis/maps/documentation/index.html google地图二次开发

    10. http://www.java2s.com/ java code example大量实用代码

    11. http://code.google.com/intl/zh-CN/apis/opensocial/ OpenSocial google主页

    12. http://www.ibm.com/developerworks/cn/ IBM developerworks 中国

    13. http://www.developer.com/ developer网站,国外优秀的技术网站

    14. http://blogs.sun.com/ sun员工的博客

    15. http://www.infoq.com/ infoq 企业软件开发方面的信息

    16. http://erlang-china.org/ erlang中国

    17. python相关网站:

          http://uselesspython.com/ 

          http://www.cetus-links.org/oo_python.html

          http://showmedo.com/videos/python

          http://gnosis.cx/TPiP/

    18. http://www.swc.scipy.org/ 提高你的开发技术

    19.  http://www.martinfowler.com/ 牛人blog

其他实用网站

     1. http://www.google.cn/transit google交通查询

     2. http://shbbs.soufun.com/ 房地产论坛

     3. http://www.freepdfconvert.com/convert_pdf_to_source.asp 在线转换文档格式, PDF变成word

     4. http://cinemaworld.kodak.com/paipian.htm 柯达影院的排片计划

Read more...

2/23/2009

写在2009年2月22日凌晨之后-记住这样的日子,记住自己说过的话

      周六,阳光明媚,好久未见这么好的太阳,在家洗洗晒晒算是比较舒服的,或许我是一个有洁僻的人,喜欢一层不染的干净环境,我想这一辈子,我或许会因为这个原因,比别人多花一倍的时间在整理东西和打扫卫生上,不知道着算不算在浪费时间。晚上突如骤来的闪电和雷阵雨,搅乱了人的心情,或许我也做了点过分的事情。


       半夜,“暴风骤雨”急至,砸东西,一个完全陌生的人展现在我的眼前,纵然他很激动,把那一大堆东西都砸掉,我却很冷静,真是佩服自己,换做平时,我也早已疯狂。看着那些东西被砸在那个角落,我的心随着一起破碎,隐隐生疼,人在愤怒的时候会砸东西,呵呵,真的是很好的发泄方式.没有争吵,我安慰,我认错,把我这辈子都没做过的事情都做了,为的仅仅是留住这段感情,一切恢复平静,大家躺在床上,其实各怀心事,或许他在想我是一个无理取闹的人。我却在想,他是一个这么让我觉得陌生的人。女孩子难道不是需要哄的吗?为什么我从来都没有享受过这种待遇,就算是,也是自己强烈要求得来。或许他一心认为是我的错,难道这件事情责任就都在我的身上吗?一个对家庭负责的男人,应该不会把女的放在家里,连一句关心的问候和电话都没有吧,况且现在还没有结婚。为什么不能换一个方式呢?如果过程中主动打个电话发个短信表示问候,那么一切或许都不会发生,寒冷的心。我是那种对我好一分,我会回报三分的人。我只是希望自己是被关心的,仅此而已,这个或许跟我缺少安全感有关系。

Read more...

2/19/2009

电信一周观察:2009 Mobile World Congress

Record Event, View, Issue in the telecom area every week ! No matter in englisg or chinese!News mainly come from telecom website, media, internal website in Ericsson.

1. Verizon 选择爱立信和阿尔卡特朗讯作为LTE主要的设备提供商。各个设备提供商在这个全球第一个商用LTE(4G)网络中的瓜分如下:
RAN: 爱立信 阿尔卡特朗讯
IMS: 阿尔卡特朗讯 诺基亚西门子
Packet Core: 阿尔卡特朗讯 爱立信

爱立信在北美市场的第一个LTE网络合同中完胜,很可惜的是,在这个合同里没有看到华为的身影。而,阿尔卡特朗讯作为美国本土的企业,占有明显的优势。

2. There is no OS war. This is not a PC world. There will be multiple OS co-existing in mobile phones ?
-----Lee Williams, executive director at the Symbian Foundation

3. No other industry is probably changing faster than the telecom at the moment ?
----- Internal blog

4. NSN claims strong services growth.
NSN is becomming Huaweiish in its communication about services ?

5. 爱立信宣布获得中国联通WCDMA份额中的30%,而不是此前宣布的26.5%,但是爱立信CEO并没有进一步解释多获得的份额的具体情况。" A very important victory for us ".

6. Nokia and Qualcomm signed a deal on Tuesday to develop a new range of advanced 3G handsets to launch next year on the North American market.In a joint statement, Nokia and Qualcomm said the new devices would be based on Nokia’s S60 software and Qualcomm’s MSM (Mobile Station Modem) chips and “are expected to launch in mid-2010”. They will be compatible with the open source Symbian Foundation platform.

7.运营商和终端设备商宣布在2012年之前,大多数手机充电器兼容。

8. “The crisis is not a telecom crisis, what we have now is the direct opposite of a bubble.” He continued to say, “We are still not seeing any decline in order intake to speak of and we are going to make use of our strength in order to gain market share. But I will repeat that it would be foolish to claim that we are not going to be affected by the financial crisis in some way.”
-------Ericsson CEO

9. LG, Intel, and Ericsson are working together to develop a new type of pocket-sized computer that has a constant internet connection and phone capabilities. The new devices will be built around the Linux operating system and are expected to reach the market in early 2010. The devices will be based on Intel’s new Moorestown platform. Several other manufacturers are working on similar products but, according to Intel, LG will be one of the first companies to launch them. Ericsson is responsible for the module that will provide 3G capability for the devices.

10. ZTE is currently in discussions with U.S. wireless operators and plans on introducing a "full portfolio" of handsets in all market segments, as well as data cards in the U.S. market, according to Xiong Hui, ZTE's vice president for handset marketing.

11. ZTE and Hong Kong's mobile operator CSL New World Mobility announced that they would work together to build in Hong-Kong, the world's first SDR (Software Defined Radio) based HSPA+ network making it the first large-scale all-IP network with such technology.

Read more...

2/17/2009

写在2009年2月

        昨天晚上和一个多年的好朋友一起吃饭,他们即将回南通,在上海我又少了一个可以玩的人,有点伤心。那种天南海北聊天的快感很爽,聊一些乱七八糟的八卦事情也觉得很舒服,我承认我们很俗很八卦,在这样一个物质的城市里,能够俗气和八卦其实也不是件容易的事情。最近觉得自己越来越封闭,生活也越来越单调。自从来到上海后没有交过一个新的朋友,每天往返于家与公司之间,周末偶尔去叔叔家一次,就是我全部的生活,慢慢的发现自己良好的交际能力有所下降,碰到好朋友大多数时间是听她讲,自己却找不到话题来讲,接触的人实在太少,没有什么可以讲的。大学同学叫我一起去苏州聚会,我也提不起精神,找理由拒绝,以前的我完全不是这样子,不知道自己这是什么状态,不知道是我变了,还是别人也和我一样。


        现在想想自己的朋友圈子其实很小,真的很小,初中联系的就那几个,高中联系的也就那几个,大学联系的也只有那几个,加起来也就那么多,虽然还有一些零散的高中朋友偶尔联系,但是很少。大学毕业后,也没有交过一个新的朋友,一直那几个人转来转去,渐渐的因为地域的关系联系越来越少,不知道在哪一天,有些人会从此失去联系。



       2009年需要去改变这些!!!

Read more...

2/10/2009

过去的2008,现在的2009

为了看今天骑士对湖人的比赛,起得比较早。现在头晕晕的,没有心思看文档写代码。
2009年匆匆过去2个月了,上来总结一下2008年,展望展望2009年。我是一个喜欢有计划的人,但是常常活在没有计划中;或者说计划太多,不知该如何取舍,用朋友的话讲是优柔寡断。
2008年对我而言是比较幸运的一年。

      1)2008年的大半年是在南京度过的,在那里参与TD-SCDMA的项目,很可惜的是在国庆之后又被调回上海。从2007年底开始到2008年底,有差不多一年的时间在南京参与这个项目。南京TD-SCDMA做的是RBS(Radio Base Station)和RNC(Radio network controller),RNC其实是TD-SCDMA和WCDMA共用的,只要稍作调整,所以南京TD-SCDMA项目主要做的是RBS。我做的那个子系统是JAVA开发的,属于O&M,算是复习了一把JAVA.在这个项目中最大的收获是增加了3G RAN的知识以及还有每个月不错的补贴。而最大的遗憾是,有人问我能不能给移动员工做一些3G的培训时,我由于当时工作确实很忙而拒绝了。至少我丢掉了尝试的机会。
      2)比较幸福的是,2008年和GF的关系很稳定,虽然两个人经常有些小摩擦,但是磕磕绊绊也不算坏事。因为打算再过大约三年的时间再结婚,所以今年过年的时候已经先订了婚。计划赶不上变化,我也想不到大学出来以后如此快的就订婚了。
      3)2008还有一件比较爽的事,年中的时候有一次加薪。
2008年是相对平稳的一年,也是波澜不惊的一年。因为看到了自己的一点进步,所以觉得比较充实。

      2009年也许是比较迷茫的一年,不知自己何去何从,不知自己该如何提高,不知自己该如何抉择,就如2008年的伊始。
      2009年肯定没有2008年那样的加薪,也没有2008年那样的机会出差(工作中的计划已经安排到5月份了)。而继续手头的工作呢?不会有大的困难,但是也肯定不会在技术上有什么进展。何况公司的技术,是拿不出手的。在公司里用来干活,出了公司一文不值。把去年我觉得需要充电的方面列出来,那可是一大堆:英语,java,RAN, core network protocol , word and excel skill , design pattern, unix, TD node B, shell script, UML, clearcase, XML, ANT, Junit (coverage), C++, project management.一大堆这些东西列出来,都需要提高,但是又不可能有足够的时间去看这些,更何况技术这东西看得再多也是不值钱的。
2009年最重要的,是思考清楚自己到底该往哪一条路发展。做技术也就那几条路:一是做技术到天黑;二是转到market或者presales和客户打交道;三是做咨询;四是做管理;五是做培训。第一条,一直做技术下去,并不是兴趣所在(以前一直以为这是我的兴趣所在),究其原因,还是国内没有能让做技术人定不下心来的环境。第二条转到market和presales渐渐是自己所感兴趣的方向,学习新技术的时候觉得钻研进去很有意思,很有成就感,事实上和人交往也是如此,多交一个朋友,和一个陌生人推心置腹,你也会觉得很有成就感。第三条咨询,也是很有前途的方向,只是切入点太窄了,没有机会(牛叉的外企概率几乎是零),咨询的最高的境界就是soho或者自己run公司了。第四条管理分为项目管理和技术管理,最好的方式还是从小公司做起。在大公司大概和公务员事业单位一样,慢慢熬。第五点是不错的,教育行业一直是热点,教育和计算机结合在国内才兴起没多久。
       以上是做技术的,分析完了还是迷茫。还有便是不再做技术,想想如何创业。最理想的创业项目是和工作相关,其次是和计算机,通讯相关,最后是和IT完全不相干。和工作相关的可能性,目前为止为零。有人也和我说了,如果你想做自己的事情,那么你先得找一份可能自己去单干的工作,这是上策。
       乱,乱,乱。综上所述,2009年做以下几件事:
       1. 提高英语
       2. 多交几个朋友,别让机会溜走
       3. 尽量去做有利于长远发展的工作
       4. 学习一些技术

Read more...

判定是否是素数

最normal的方式:
[coolcode lang="C++" linenum="off"]
int is_prime(int n) {
for (int i=2; i<=(int) sqrt(n); i++) if (n%i == 0) return 0;
return 1;
}
void main() {
int i,count=0;
for (i=1; i<10000; i++) count += is_prime(i);
printf("Total of %d primes\n",count);
}
[/coolcode]

改进一点,只要判断到N的开方:
[coolcode lang="C++" linenum="off"]
int is_prime(int n) {
long lim = (int) sqrt(n);
for (int i=2; i<=lim; i++) if (n%i == 0) return 0; return 1;}
[/coolcode]

调用sqrt()方法不够快速,直接用一下代码replace:
用JAVA做测试,下面这个方法在计算100000内质数时,比上面方法快16毫秒。
我的机器性能可能比较低,但是能说明这个算法确实比上面那种快!
[coolcode lang="C++" linenum="off"]
int is_prime(int n) {
for (int i=2; i*i<=n; i++) if (n%i == 0) return 0;
return 1;
}
[/coolcode]

更快一点,我们不用检测偶数因子:
[coolcode lang="C++" linenum="off"]
int is_prime(int n) {
if (n == 1) return 0; // 1 is NOT a prime
if (n == 2) return 1; // 2 is a prime
if (n%2 == 0) return 0; // NO prime is EVEN, except 2
for (int i=3; i*i<=n; i+=2) // start from 3, jump 2 numbers
if (n%i == 0) // no need to check even numbers
return 0;
return 1;
}
[/coolcode]

最高效的算法,列出L和U之间所有素数:
[coolcode lang="C++" linenum="off"]

void sieve(int L,int U) {
int i,j,d;
d=U-L+1; /* from range L to U, we have d=U-L+1 numbers. */
/* use flag[i] to mark whether (L+i) is a prime number or not. */
bool *flag=new bool[d];
for (i=0;ifor (i=(L%2!=0);i/* sieve by prime factors staring from 3 till sqrt(U) */
for (i=3;i<=sqrt(U);i+=2) {
if (i>L && !flag[i-L]) continue;
/* choose the first number to be sieved -- >=L,
divisible by i, and not i itself! */
j=L/i*i; if (jif (j==i) j+=i; /* if j is a prime number, have to start form next
one */
j-=L; /* change j to the index representing j */
for (;j}
if (L<=1) flag[1-L]=false;
if (L<=2) flag[2-L]=true;
for (i=0;icout << endl;
}
[/coolcode]

Read more...

1/19/2009

击败华为?

公司内部网上留言很多,总结一下看看colleague有哪些观点 :)

1. The MAIN POINT is that industry leaders have steered away from direct price-on-price confrontation whith chineese companies where value is destroyed and lead their industry into a new direction.

2. Attract Huawei key people by exremely good conditions (believe it or not, the salary level in Ericsson China is not as competitive as Huawei's now), that's one of the reasons we keep on loosing colleagues to Huawei.

3. Combine the R&D function more closely with the local marketing and sales; one of the most frequent critisms from customer (like China Mobile) when compares Ericsson to Huawei is that Ericsson takes longer time to response to they needs than Huawei. There are several Ericssson R&D centers in China already (still expending), but they can only get projects from Sweden, we first line account people has diffcult to get their help soon enough, sometimes it goes very critical.

4. Encourage and amplify innovation. I can't agree more that the greatest advantage of Ericsson versus Huawei is our innovation, which is still big now. Huawei's half-military culture can never be as creative as Ericsson's culture. But how to utilize this advantage to the maximum extend, it seems need real serious strategic changes.

5. Using enemy's measures to counter back themselves

6. Open up - release code! This destroys value for competitors and brings on developers (see symbian, or eclipse, or linux, etc.) By giving away code Ericsson becomes the place for developers to turn when they need components or tools, they do free work for Ericsson.

7. Stop knowledge transfer - Ericsson lays off smart engineers, they go right across the street to Huawei. This transfers know-how and ability as well as IP to Huawei. Large companies everywhere lay off people when times are bad, but you have to think strategically. Hire smart, hire for the long term, keep good people even in bad times. Good engineers are hard to find and Ericsson has laid off many good engineers, this might come back to hurt them later on, but the worst damage has been creating a mini-Ericsson inside Huawei.

8. Focus on quality, not price - Price is always going to erode, whether it is Huawei, ZTE, or Nokia Siemens. Don't focus on price instead focus on quality and value for money. It Huawei makes bad products they may gain market share at first, but they will wilt over time if customers are not pleased with quality.

Read more...

1/04/2009

无语

算了一下,加上1月房租,12月到现在已经花了8500,12月花了6000..

Read more...