A square pattern of size N x N (1 20 #include
21 #include 22 using namespace std; 23 24 //旋转90度的操作 25 int
**transiformation_one(int before[][11],i...
分类:
其他好文 时间:
2014-05-16 03:10:30
阅读次数:
361
一、观察者模式内容观察者模式在对象之间定义了一对多的依赖,这样一来,依赖它的对象都会受到通知并自动更新。(接口回调的一种方式,观察者在同一个被观察者对象中注册自己的信息(引用),当被观察者发生变化时,调用观察者的特定方法,告诉观察者。)观察者模式又叫做发布-订阅(Publish/Subscribe)...
分类:
其他好文 时间:
2014-05-15 21:06:48
阅读次数:
466
NSString *pattern = @"(?).*?(?=)";
2.
3. NSString *pattern1 = @"";
4.
5. NSURL *URL = [NSURL URLWithString:@"http://www.weather.com.cn/weather/101010100.shtml"];
6. NSString *string = [NSStri...
分类:
移动开发 时间:
2014-05-15 15:12:23
阅读次数:
265
【题目】
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 I G
Y I R
And then read line by line: "PAHNAPLSI...
分类:
其他好文 时间:
2014-05-15 04:30:57
阅读次数:
313
这个模式比较简单,嘿嘿,简单写一下。
老样子,先看 外观模式(Facade Pattern)定义:提供一个统一的接口,用来访问子系统中的一群接口,外观定义了一个高层的接口,让子系统更容易使用。其实就是为了方便客户的使用,把一群操作,封装成一个方法。
举个例子:我比较喜欢看电影,于是买了投影仪、电脑、音响、设计了房间的灯光、买了爆米花机,然后我想看电影的时候,我需要:
1、打开爆米花机
2、...
分类:
其他好文 时间:
2014-05-15 00:18:02
阅读次数:
265
Total Accepted: 8400 Total Submissions: 38235 My Submissions
Say you have an array for which the ith element is the price of a given stock on day i.
Design an algorithm to find the maximum profi...
分类:
其他好文 时间:
2014-05-14 19:39:53
阅读次数:
275
grep命令可以从文本中或者通过管道送过来的字符流中或一个"-"符号代替文件名来搜索精确或者模糊的匹配信息,grep家族有三个命令:grep,egrep,fgrep。grep支持正则表达式匹配查找egrep支持扩展正则表达式匹配查找fgrep不支持正则表达式匹配查找grep命令的格式:grep[OPT]‘PATTERN‘F..
分类:
系统相关 时间:
2014-05-14 17:24:27
阅读次数:
428
备忘录模式(Memento Pattern)又叫做快照模式(Snapshot
Pattern)或Token模式,属于行为模式。定义(源于GoF《设计模式》):在不破坏封闭的前提下,捕获一个对象的内部状态,并在该对象之外保存这个状态。这样以后就可将该对象恢复到原先保存的状态。应用场景以保存游戏进度为例...
分类:
其他好文 时间:
2014-05-14 11:37:32
阅读次数:
238
tree --help以树型结构显示文件及文件夹usage: tree
[-acdfghilnpqrstuvxACDFQNSUX] [-H baseHREF] [-T title ] [-L level [-R]][-P
pattern] [-I pattern] [-o filename] [--...
分类:
系统相关 时间:
2014-05-14 11:15:56
阅读次数:
506