模板方法模式
GOOD:把不变的代码部分都转移到父类中,将可变的代码用virtual留到子类重写
#include
#include
#include
using namespacestd;
classAbstractClass
{
public:
void Show()
{
cout我是"
...
分类:
其他好文 时间:
2014-10-16 18:48:03
阅读次数:
198
我经常说Javascript的设计不够严谨,有很多失误。
今天的这一篇,前半部分就谈为什么会这样,后半部分将列举Javascript的10个设计缺陷。
我参考的文献主要是Douglas Crockford的专著《Javascript语言精粹》(JavaScript:
The Good Parts)和Fredrik Holmström的文章《我对Javascript的抱怨》(My
...
分类:
编程语言 时间:
2014-10-16 16:39:12
阅读次数:
282
Average Score
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob is a freshman in Marjar University. He is clever and diligent. However, he is not good at math, especially in Mathematical A...
分类:
其他好文 时间:
2014-10-16 00:48:01
阅读次数:
428
题目:找出两个数组(有重)相同的元素,两种方法publicclass出两个数组相同的元素{publicstaticvoidmain(String[]args){//TODOAuto-generatedmethodstubString[]test1={"damon","happy","ly","good","losers"};String[]test2={"love","winner","damon","mai"};//***************..
分类:
编程语言 时间:
2014-10-15 15:45:41
阅读次数:
150
水
Average Score
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob is a freshman in Marjar University. He is clever and diligent. However, he is not good at math, especially in Mathemati...
分类:
其他好文 时间:
2014-10-15 00:07:49
阅读次数:
238
Average Score
Time Limit: 2 Seconds Memory Limit: 65536 KB
Bob is a freshman in Marjar University. He is clever and diligent. However, he is not good at math, especially in Mathematical A...
分类:
其他好文 时间:
2014-10-14 21:48:09
阅读次数:
147
You must have heard about IP Phone and SIP (Software IP Phone).Nowadays standard PSTN phone are being replaced by IP Phones one of the main reason why...
分类:
其他好文 时间:
2014-10-14 17:42:18
阅读次数:
286
一直以来对this的理解只在可以用,会用,却没有去深究其本质。这次,借着《JavaScript The Good Parts》,作了一次深刻的理解。下面我们一起来看看这个this吧。 在我们声明一个函数时,每个函数除了有定义时的parameters(形参),自身还会有额外的两个参数,一个是this,...
分类:
编程语言 时间:
2014-10-14 17:25:08
阅读次数:
221
一直以来对this的理解只在可以用,会用,却没有去深究其本质。这次,借着《JavaScript The Good Parts》,作了一次深刻的理解。下面我们一起来看看这个this吧。 在我们声明一个函数时,每个函数除了有定义时的parameters(形参),自身还会有额外的两个参数,一个是this....
分类:
编程语言 时间:
2014-10-13 23:57:37
阅读次数:
218
A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message con...
分类:
其他好文 时间:
2014-10-12 16:45:38
阅读次数:
157