顾名思义,工厂模式就是类似于生活中的工厂,可以生产我们想要的东西,回到代码,假如我们需要一个实例,直接从工厂中拿即可。eg:假如我们定义一个“球”类的接口1
public interface Ball{2 public void sayName();3 }此时我们再定义两个球类实现这个接口1...
分类:
其他好文 时间:
2014-05-16 23:31:40
阅读次数:
370
题目: Evaluate the value of an arithmetic expression
inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an
integer or another e.....
分类:
其他好文 时间:
2014-05-16 05:56:07
阅读次数:
221
1. synchronized
If two threads are using the same function( here we use output to print out string) of another instance, if we want to make sure that these two threads are not disturbing each other.
...
分类:
其他好文 时间:
2014-05-15 11:14:14
阅读次数:
389
题目:Evaluate the value of an arithmetic expression
inReverse Polish Notation.Valid operators are+,-,*,/. Each operand may be an
integer or another expr...
分类:
其他好文 时间:
2014-05-13 22:43:01
阅读次数:
335
1 /** 2 大意:给定一组x[],y[],z[] 确定有没有两个不同的x[i], x[j]
看是否存在一个ID使得 3 y[i]17 #include 18 using namespace std;19 long long
x[1010],y[1010],z[1010];20 2...
分类:
其他好文 时间:
2014-05-13 21:15:24
阅读次数:
352
You are given a sequence of integers, A1,A2,...,An. And you are allowed a manipulation on the sequence to transform the origin sequence into another sequence B1,B2,...,Bn(Maybe the two sequences are s...
分类:
其他好文 时间:
2014-05-13 13:45:10
阅读次数:
327
Fromtimetotime,peoplewantmetocreateLINUXinitscriptsforthem.Iusuallyjusttakeanexistingoneforanotherserviceandchangeituptoworkformynewapplication,butmostofthemhavebecomesolongthesedaysthatIenduphavingtohackoutatonofcodejusttoreducethemdowntotheverybasicscript..
分类:
系统相关 时间:
2014-05-13 03:59:53
阅读次数:
306
当我在subsite里点击”Add a document”,报这个错,后来一看event log:
在AAM里加上一条: 问题搞定:
分类:
其他好文 时间:
2014-05-12 13:14:07
阅读次数:
306
题目链接:
http://acm.timus.ru/problem.aspx?space=1&num=1114
1114. Boxes
Time limit: 0.6 second
Memory limit: 64 MB
N boxes are lined up in a sequence (1 ≤ N ≤ 20). You have A red ball...
分类:
其他好文 时间:
2014-05-09 21:58:58
阅读次数:
471
Yet another easy-to-understand, easy-to-use aws s3 python sdk code examples....
分类:
编程语言 时间:
2014-05-09 20:51:39
阅读次数:
703