ITeye博客

Dev in Shanghai

CherryRemind · 共 26 篇文章

[置顶] Design Patterns and OOP

Design Patterns A design pattern is a recurring solution to a standard problem. The most well-known design patterns (in total 23) were documented by Erich Gamma, Richard Helm, Ralph Johnson, John Vlissides also called The Gang of Four (GOF) in the book Design Patterns -- Elements of Reusable Softwa…

2007-10-23 10:49 · Base · 评论(0)

window磁盘空间加空间命令

开始 — 运行 — Diskpart DOS界面会自动打开,再进行以下操作 输入List volume获取各磁盘的详细信息,并得知各分区的卷号 输入Select volume 0,0就是卷号 在输入 Extend Size=10236,就是你需要扩展到D盘的大小

2011-05-30 14:00 · Base · 评论(0)

算法复杂度

复习下时间复杂度计算 http://blog.csdn.net/zhuchzhi/archive/2007/03/14/1529514.aspx http://blog.csdn.net/iluna/archive/2009/05/09/4159485.aspx 按数量级递增排列依次为:常数阶O(1)、对数阶O(log2n)、线性阶O(n)、线性对数阶O(nlog2n)、平方阶O(n^2)、立方阶O(n^3)、k次方阶O(n^k)、指数阶O(2^n)。 有如下复杂度关系 c < log2N < n < n * Log2N < n^2 < n^3 < 2^n < 3^n < n! sum=0;…

2011-05-25 15:36 · Base · 评论(0)

Tomcat https(SSL) 简单的证书配置

参考 http://confluence.atlassian.com/display/JIRA/Running+JIRA+over+SSL+or+HTTPS#RunningJIRAoverSSLorHTTPS-ImportCertificateIntoTheTruststore ,这个是配jira,但是差不多。 因为正式的CA申请要填什么东西,还要钱,很麻烦,如果我们只想在开发环境测试, 只要一个测试的证书用用就可以了,很多网上的sample不够详细,我记录下自己的研究。 我们一开始做的证书,用IE7访问的时候总是有个error, 看起来不舒服。后面解决这两个问题。 Windows环境,在C…

2010-03-08 15:33 · Base · 评论(1)

DB Solo很强大

Key Features * Cross-platform SQL Query Tool with support for all major DBMS products * Multiple simultaneous database connections * Browse and manage database structures with a couple of mouse clicks * Create and drop common database objects using the advanced DBA features. * Enter ad-hoc SQL quer…

2009-08-07 15:18 · 体验 · 评论(0)

Mac Configuration

set up root passwd new mac system don't have root password sudo passwd root svn version 1.4.4 python 2.5.1 download the latest python 2.5.4 http://www.python.org/download/releases/2.5.4/ macport software management tools in Mac

2009-05-07 00:09 · 体验 · 评论(0)

OS share

Linux与Linux之间传送文件: scp file username@hostIP:文件地址 例: scp abc.txt endall@IP:/home/endall/abc.txt windows与Linux之间传送文件: 笔者用putty的内置PSCP。其它如 SSH Secure File Transfer Client 先在WIN的DOS下,PUTTY目录下及PSCP文件所在目录。 pscp file username@hostIP:文件地址 例:pscp d:abc.txt endall@IP:/home/endall/abc.txt pscp endall@IP:/home…

2008-11-19 19:35 · 麻烦的要记的 · 评论(0)

变量转移 Variable Change

看了一个片子《决胜21点》, 里面有段, 教授出了一题,“3扇门, 一扇门是对的, 另外的是错的, 你怎么选择”, Ben说,“我选第一扇门”, “OK, 那我告诉你第三扇门是错的, 现在再给你一次机会, 你选哪个?”,Ben说“第二扇 !”, 教说“Good! ...” 听到一个词"变量转移。。" 仔细想想也对。嘿嘿 see these answers: http://answers.yahoo.com/question/index?qid=20080406131845AAhHQHE 第二次如果继续选第一扇门, 那概率还是1/3, 所以换一下,选第二扇, 就是2/3了

2008-07-01 22:22 · 杂侃 · 评论(0)

21天 Ruby-------- conditional

最近一直忙着面试... 现在终于有时间来继续学习ruby了. :) ruby中的条件语句 a = 8 if a > 0 puts "a > 0" elsif a < 0 puts "a < 0" else puts "a == 0" end a = 0 str = if a > 0 then "a > 0" elsif a < 0 then "a < 0" else "a == 0" end puts str a = 0 puts "a == 0 g" if a == 0 puts "a == 0 h" unless a != 0 a = 1 case a when -1 puts "a =…

2008-05-22 15:50 · Ruby · 评论(0)

21天 Ruby-------- oo

class People def initialize(name, age) @name = name @age = age end def to_s "name = #{@name}, age = #{@age}" end end lily = People.new("Lily", 18) puts lily class Teacher < People def initialize(name, age, gender) super(name, age) @gender = gender end def to_s super + ", gender = #{@gender}" end en…

2008-05-02 21:53 · Ruby · 评论(0)

'guice', 'warp' ,'domain driven design'

guice -- dependent injection warp -- dynamic finder AbsEntity ---- 抽象类 提炼所有域对象的Generic属性和行为 IEntity ---- 对象行为的Generic接口 觉得Annotation用的舒服啊. MainModule.java替代Spring的applicationContext.xml配置文件 import java.io.Serializable; import java.util.Date; import java.util.List; import javax.persistence.EntityMan…

2008-04-30 16:25 · 体验 · 评论(0)

21 天Ruby-------- loop

class ForLoop def callFor for i in 1..3 print "index = #{i}\n" end end def callWhile a = 1 a *= 2 while a < 10 puts a a -= 2 until a < 0 puts a end def callWhile2 a = 1 a += 1 while a < 5 puts a # print "index = #{a}\n" end def time 3.times do print "Ho! " end end def upto 1.upto(3) do |x| puts x e…

2008-04-25 13:30 · Ruby · 评论(0)

21天 Ruby-------- symbol

Test1.rb print "1: " puts "name".object_id print "1: " puts "name".object_id print "1: " puts "name".object_id print "2: " puts :name.object_id print "2: " puts :name.object_id print "2: " puts :name.object_id print "3: " puts 123456.object_id print "3: " puts 123456.object_id print "3: " puts 1234…

2008-04-25 11:16 · Ruby · 评论(0)

Design Pattern --------------------- Iterator

好文借鉴 对容器中元素的访问涉及到3个方面。 1.容器的类型 2.检索容器内元素的方法 3.对元素的操作 比如说我们有一个表示书店的book_store类。里面保存了各种各样的book类的实例。 book类有name和type两种属性。表示书的名字和类别。 因此book_store类内部会用一个容器来保存book的实例。比如list。 class book { public: string name; string type; }; class book_store { private: list m_books; }; 我们现在有这样一个简单的应用,那就是输出所有的书名到屏幕。 那么我们来…

2008-04-08 15:57 · Base · 评论(0)

Design Pattern --------------Flyweight

好文借鉴 Flyweight是减少内存的使用量的一种模式,间接的可能会提高性能。两者没有必然联系。 Flyweight和Object pool完全不同。FlyWeight内部用到的共享机制在实现上和object cache有点像,但是有本质上的区别。不要把两者混为一谈。请仔细读一下GoF的原著。 Flyweight未必会减少实例的创建次数。反而可能会增加实例的创建次数。(尤其对于非JAVA语言) Flyweight内部的共享机制和object pool的区别。 4.1 原理不同 object pool的原理是复用(一个对象被反复使用,但同时只有一个“人”在使用),flyweight的原理是共…

2008-04-08 15:48 · Base · 评论(0)