【创建型】1、单例模式(Singleton Pattern) 2、工厂方法模式(Factory Method Pattern)3、抽象工厂(Abstract Factory Pattern)4、建造者模式(Builder Pattern) 5、原型模式(Prototype Pattern) 【结构型...
分类:
编程语言 时间:
2014-06-25 21:18:34
阅读次数:
247
题目
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching sh...
分类:
其他好文 时间:
2014-06-25 19:56:35
阅读次数:
275
标准库:一些最爱
re
re模块包含对正则表达式的支持,因为曾经系统学习过正则表达式,所以基础内容略过,直接看python对于正则表达式的支持。
正则表达式的学习,见《Mastering Regular Expressions》(精通正则表达式)
re模块的内容
最重要的一些函数
函数
描述
compile(pattern[,fl...
分类:
编程语言 时间:
2014-06-25 08:28:05
阅读次数:
304
"Could not find SQL statement to include with refid xxx"A: 认真把每个用到xxx的地方都看一遍
分类:
数据库 时间:
2014-06-25 00:58:20
阅读次数:
216
题目
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 ...
分类:
其他好文 时间:
2014-06-24 23:59:25
阅读次数:
338
欢迎关注我的新博客地址:http://cuipengfei.me/
实在想不到什么动词可以当做脱衣服来讲了,所以从现在开始这系列博文就叫做Desugar Scala了。除非哪天才思泉涌,又想到了新词:)
开始正文。
名字叫做unapply和unapplySeq的方法在Scala里也是有特殊含义的。
我们前面说过case class在做pattern match时很...
分类:
移动开发 时间:
2014-06-24 19:42:48
阅读次数:
265
在linux系统上有三大文本处理工具分别是:grep,sed,awk,这次主要来看看awk。awkoption‘pattern‘file-F指定分隔符;-v申明自定义变量;查看当前系统上,用户名和用户shell,输出分隔符为~.#awk-F:‘BEGIN{OFS="~";print"UserNameShell"}{print$1,$7}END{print"==============..
分类:
系统相关 时间:
2014-06-24 16:09:14
阅读次数:
397
Observer Pattern 是一种常用的设计模式,它是一种事件监听模型,...
分类:
编程语言 时间:
2014-06-22 20:57:04
阅读次数:
279
模板方法模式(template method pattern) 详解本文地址: http://blog.csdn.net/caroline_wendy模板方法模式(template method pattern): 在一个方法中定义一个算法的骨架, 而将一些步骤延迟到子类中. 模板方法使得子类可以在不改变算法结构的情况下, 重新定义算法中的某些步骤.模板方法可以进行挂钩(hook), 钩子(hoo...
分类:
其他好文 时间:
2014-06-22 18:49:01
阅读次数:
227
模式匹配的实现,'?'代表单一字符,'*'代表任意多的字符,写代码实现两个字符串是否匹配。
Implement wildcard pattern matching with support for '?' and '*'.、
'?' Matches any single character.
'*' Matches any sequence of characters (inclu...
分类:
其他好文 时间:
2014-06-22 16:40:44
阅读次数:
225