今天在TerryLee的cnblog(http://terrylee.cnblogs.com)里看到了与设计模式相关的整套文章,初学设计模式看完每篇文章后做些笔记和摘抄。 ●什么是设计模式,什么是架构? 设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计...
分类:
Web程序 时间:
2014-07-10 11:34:47
阅读次数:
199
.NET下的23中设计模式。※创建型模式篇●单件模式(Single Pattern)●抽象工厂模式(Abstract Factory)●建造者模式(Builder Pattern)●工厂方法(Factory Method)●原型模式(Protype Pattern)※结构型模式篇●适配器模式(Ada...
分类:
Web程序 时间:
2014-07-10 11:11:42
阅读次数:
242
This post introduces Sandbox pattern to avoid the namespace drawbacks(1. Reliance on a single global variable to be the application’s global. 2. Long,...
分类:
数据库 时间:
2014-07-07 20:15:42
阅读次数:
262
设计模式(Design Patterns) ——可复用面向对象软件的基础设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代码可靠性。 毫无疑问,设计模式于己于他人于系统都是多赢的,设...
分类:
编程语言 时间:
2014-07-07 19:32:40
阅读次数:
486
DP is, enumeration + pruning. If you can think of enumeration pattern of a problem, plus a recurrence relation later, you are there.Main ref:http://bl...
分类:
其他好文 时间:
2014-07-03 09:32:27
阅读次数:
213
String.indexOf的模拟实现,没想象中有多么高深的查找算法,就是最普通的遍历查找思路:先找到第一个相同的字符,然后依次比较后面的字符,若都相等则表示查找成功 /** * 查找字符串pattern在str中第一次出现的位置 * @param str * @par...
分类:
其他好文 时间:
2014-07-02 21:23:28
阅读次数:
223
虽然是做web开发,但是web中的很多配置有的时候却不是很清楚,只是知道怎么配置,于是就把在网上看到各种关于web.xml的东西整理一下:web.xml中url-pattern的3种写法1完全匹配/test/list.do2 路径匹配/* 3扩展名匹配 *.do *.html * Filte...
分类:
Web程序 时间:
2014-07-01 17:42:39
阅读次数:
222
外观模式(Facade),为子系统中的一组接口提供一个一致的界面,此模式定义了一个高层接口,这个接口使得这一子系统更加容易使用。 外观模式结构图:代码模板://四个子系统的类class SubSystemOne{public: void MethodOne() { cout MethodOne();...
分类:
其他好文 时间:
2014-06-30 11:40:31
阅读次数:
201
题目
The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows
like this: (you may want to display this pattern in a fixed font for better legibility)
P A H N
A...
分类:
其他好文 时间:
2014-06-30 00:07:36
阅读次数:
268
说明
arraysplit
(string$pattern
,string$string
[,int$limit
])
本函数返回一个字符串数组,每个单元为string经区分大小写的正则表达式pattern作为边界分割出的子串。如果设定了limit,则返回的数组最多包含limit个单元,而其中最后一个单元包含了string中剩余的所有部分。如..
分类:
Web程序 时间:
2014-06-28 06:42:42
阅读次数:
230