心随所致,梦想为开。Follow the Dreams & Heart.
读书学习
python的安装
May 28th
1. 下载与安装
python的安装非常简单,直接从官方网站下载python的安装程序,运行即可。目前最新的python版本是2.5.1。
2.IDE与编辑器
由于python是以缩进(ident)来表示程序的层次结构,因此非常不建议使用notepad之类的普通文本编辑器来编写python程序。所以选择一个合适的IDE或者编辑器就非常重要。官方网站上列出了一些常见的IDE和编辑器,我目前用的PythonWin。
3.入门教程
不知从什么年代开始,可能是学习AutoCAD的ObjectARX的时候吧,我认为最好的入门教程就是程序的帮助或者Tutorial,Python也不例外。官网上有一堆的入门教材,当然也包括了Python Tutorial。其实安装完python后,在安装目录下有个帮助文件python25.chm,里面同样带有tutorial。
加菲猫语录
May 16th
>I hate mondays. — Garfield 我恨星期一。 — 加菲 >Never send a man to do a cat’s job. — Garfield 决不要让人去做猫的工作。 — 加菲 >Money is not everything. There’s Mastercard & Visa. 钞票不是万能的,有时还需要信用卡。 >One should love animals. They are so tasty. 每个人都应该热爱动物,因为它们很好吃。 >Save water. Shower with your girlfriend. 要节约用水,尽量和女友一起洗澡。 >Love the neighbor. But don’t get caught. 要用心去爱你的邻居,不过不要让她的老公知道.。 >Behind every successful man, there is a man. And behind every unsuccessful man, there are two. 每个成功男人的背后,都有一个女人。每个不成功男人的背后,都有两个。 >Every man should marry. After all, happiness is not the only thing in life. 再快乐的单身汉迟早也会结婚,幸福不是永久的嘛。 >The wise never marry, And when they marry they become otherwise. 聪明人都是未婚的,结婚的人很难再聪明起来. >Success is a relative term. It brings so many relatives. 成功是一个相关名词,他会给你带来很多不相关的亲戚(联系)。 >Never put off the work till tomorrow what you can put off today. 不要等明天交不上差再找借口, 今天就要找好。 (more…)
The Decorator Pattern
Mar 15th
Decorator – Attach additional reponsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
CName: Wrap
OO Principles:
- Classes should be open for extension but close for modification.
Bullet Points:
- Inheritance is one form of extension, but not necessarily the best way to achieve flexibility in our designs.
- In our designs we should allow behavior to be extended without the need to modify existing code.
- Compostion and delegation can often be used to add new behaviors at runtime. (more…)
世界上最远的距离——怀念我的老师
Mar 14th
从hi.baidu上看来的,只因为它是泰戈尔的诗。记得在很久很久以前,我们那位清高的语文老师,经常给我们朗诵泰戈尔的诗,比如“飞鸟集”里面的东西。 那时候觉得泰戈尔的神思都过于游离,不知所终,但是或许这才是诗人。
那位语文老师文学素养很高,古往今来似乎无所不知。那个时候就喜欢听他讲故事。每每在语文课上,从一个小小的命题可以旁征博引、引经据典,设为痴狂。这种痴狂和现在流行的“忽悠”有着本质的差别。太多动人的故事都是凄美的,我们的老师也不理外。他有自己的志向,虽然他的志向在今天看来已经异常的普通。他努力的读书努力的学习,为的就是今天已经听的腻烦了词——“考研”。在10年前,他向往大城市,他不甘心自己的困于鸟笼的命运,他去挑战。10年前,研究生没有今天这般泛滥和泡沫化,他失败了,同时也牺牲了健康。这注定是一个悲剧。
范进没有中举,在这种科考制度中酝酿出来的悲剧又何止他一个呢。
世界上最远的距离 不是 生与死的距离 而是 我站在你面前 你不知道我爱你 世界上最远的距离 不是 我站在你面前 你不知道我爱你 而是 爱到痴迷 却不能说我爱你 世界上最远的距离 不是 我不能说我爱你 而是 想你痛彻心脾 却只能深埋心底 世界上最远的距离 不是 我不能说我想你 而是 彼此相爱 却不能够在一起 (more…)
The Observer Pattern
Mar 13th
Observer – defines a ont-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.
OO Principles
- Strive for loosely coupled designs between objects that interact.
Bullet Points
- The Observer Pattern defines a ont-to-many relationship between objects.
- Subjects, or we also known them, Observables, update Observers using a common interface.
- Observers are loosely coupled in that the observalbe knows nothing about them, other than that they implement the Observer interface.
- You can push or pull the data of the Observalbe when using the pattern(pull is considered more “correct”).
- Don’t depend on a specific order of notification for you Observers. (more…)
The Strategy Pattern
Mar 9th
The Strategy Pattern defines a family of algorithms, encapsulates each once, and makes them interchangebale. Strategy lets the algorithm vary independently from clients that use it.
OO Principles:
- Encapsulate what varies.
- Favor compostion ove inheritence.
- Program to interface, not implementation.
Bullet Points:
- Knowing the OO basics does not make you a great OO designer.
- Good OO designs are reusable, extensible and maitainable.
- Patterns are proven object-oriented experience.
- Patterns don’t give you code, the give you general solution to design problems. You apply them to your specific application. (more…)
读了“与空姐同居的日子”
Feb 21st
这两天如同两年一样漫长,晚上无聊地玩着数独的游戏,累计都有360分钟了。
刚刚又一口气看完了一部小说,花三个小时。小说的名字叫“和空姐同居的日子“,或者是“和我同居的女人“,写非常好,也很美的故事。原先就看过一部分,但是担心会是悲剧性的结局,所以一直没有读下去。今天终于看完了,似乎美满的结局。他们的幸福是痛并快乐着。
Windows Live Messenger 8.1.0178 Final
Jan 30th
Windows Live Messenger 8.1 出来了,有几个比较不错的改进。目前最新的版本就是这个8.1.0178 Final了,下载地址在:
这个是About的截图:
主要的更新有:
-Yahoo interoperability – now you can chat to your Yahoo -Messenger friends from Windows Live Messenger
-Your display name, status and personalization roam with you to any computer
-Improved sign-in performance
-Redesigned contact cards
-A bonus of 2 free VOIP calls
-it runs on Windows Vista!
其中加粗的这三个功能是比较赞的,虽然前两个是本来就应该做好的。不管怎么说,改了就是好同志嘛。
另外,前两天问人才知道,好友列表前如果有黄星星的表示space更新了,据说还是跟QQ学的。呵呵。