1、定义 组合模式(Composite Pattern)也叫合成模式,将对象组合成树形结构以表示“整体-部分”的层次结构,使得用户对单个对象和组合对象的使用具有一致性。 2、通用类图 Component抽象构件角色:定义参加组合对象的共有方法和属性,可以定义一些默认的行为或属性。 Leaf叶子构件:...
分类:
其他好文 时间:
2014-08-18 20:11:32
阅读次数:
249
Wildcard Matching
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequen...
分类:
其他好文 时间:
2014-08-18 18:34:13
阅读次数:
214
n 基本框架:a) grep命令b) 正则表达式c) grep中使用正则表达式d) vi中使用正则表达式9.1 grep命令 命令格式:grep [option] pattern + 文件列表 常用的option: -E 用扩充的正则表达式进行模式匹配 -i 不区分大小写 -n 显示行号 -v 反向...
分类:
其他好文 时间:
2014-08-18 16:01:22
阅读次数:
186
n 基本框架:a) Make常用内嵌函数b) 多级目录Makefile的编写4.1Make常用内嵌函数函数调用的一般形式:$(function arguments(参数))1) $(wildcard PATTERN) : 匹配当前目录下指定模式的文件例子:src=$(wildcard *.c)2) ...
分类:
其他好文 时间:
2014-08-18 15:58:42
阅读次数:
157
名字 grep, egrep, fgerp解释: grep是一个最初用于Unix操作系统的命令行工具. 在给出文件列表或标准输入后, grep会对匹配一个或多个正则表达式的文本进行搜索, 并只输出匹配(或者不匹配)的行或文本.用法: grep [option] 'PATTERN' file ....
分类:
其他好文 时间:
2014-08-18 12:16:14
阅读次数:
249
设计模式(Design Patterns) ——可复用面向对象软件的基础设计模式(Design pattern)是一套被反复使用、多数人知晓的、经过分类编目的、代码设计经验的总结。使用设计模式是为了可重用代码、让代码更容易被他人理解、保证代 码可靠性。 毫无疑问,设计模式于己于他人于系统都是多赢的,...
分类:
编程语言 时间:
2014-08-18 12:15:34
阅读次数:
344
To find the most common words, we can apply the DSU pattern; most_common takes a histogram and returns a list of word-frequency tuples, sorted in reve...
分类:
其他好文 时间:
2014-08-17 17:00:32
阅读次数:
180
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 P L S I ...
分类:
其他好文 时间:
2014-08-17 13:09:52
阅读次数:
168
今天准备学习singleton pattern,顾单词思含义,就是一个实例的意思。单例的实现思路是:私有化构造函数,提供公有方法获取类的实例。下面定义一个音乐播放器类MusicPlayer,观察单例的实现方法class MusicPlayer{ private static readonly ...
分类:
其他好文 时间:
2014-08-16 13:42:00
阅读次数:
219
leetcode这道题还挺有意思的,实现通配符,'?'匹配任意字符,'*'匹配任意长度字符串,晚上尝试了一下,题目如下:Implement wildcard pattern matching with support for'?'and'*'.'?' Matches any single chara...
分类:
其他好文 时间:
2014-08-16 01:01:59
阅读次数:
351