objective-c中使用实施适配器模式的时候使用的是协议适配器模式(Adapter Pattern),适配器模式又叫做变压器模式,也叫做包装模式(Wrapper),可是包装模式却不止一个,装饰模式也是包装模式。适配器模式是一种补救模式,他能够让你从因业务扩展而系统无法迅速适应的苦恼中解脱出来。我...
分类:
其他好文 时间:
2014-08-10 12:48:00
阅读次数:
249
表单验证required属性,可以应用在大多数的元素上,如果元素内容为空,则不允许提交pattern属性,将属性设置为某个格式的正则表达式min属性与max属性,规定数值类型或日期类型的input元素的专有属性,限制其范围step属性,控制input元素中值增加或减少的步幅,如果用户输入的值在0到1...
分类:
Web程序 时间:
2014-08-10 12:43:50
阅读次数:
391
Winphone没有直接删除文件夹的接口(因为文件夹不为空是删除不了的),所以要自己实现
publicstaticvoidDeleteDirectoryRecursively(thisIsolatedStorageFilestorageFile,StringdirName){
Stringpattern=dirName+@"\*";
String[]files=storageFile.GetFileNames(pattern);
fo..
今天在CodePlex的Roslyn讨论区发现了一个帖子:Draft spec for records and pattern-matching in C#,估计MS计划在C# 6.0中支持模式匹配了。设计草案的文档如下:Pattern Matching for C#,看起来非常不错的样子。模式匹配...
分类:
其他好文 时间:
2014-08-09 13:20:07
阅读次数:
210
给两个矩阵i和j,只包含零和一。求是否能在j矩阵中选择若干行和若干列,使得他和i完全相同...
分类:
其他好文 时间:
2014-08-08 18:11:49
阅读次数:
153
设置好内部状态,然后依据不同的函数作为行为模式,进行状态转换。有点像Finite Automata算法,两者的思想是一样的。会Finite Automata,那么这个设计模式就非常easy了。#pragma once#include #include #include #include enum S...
分类:
其他好文 时间:
2014-08-08 17:35:16
阅读次数:
197
深入理解JavaScript 模块模式(原文)http://www.cnblogs.com/starweb/archive/2013/02/17/2914023.html英文:http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern...
分类:
编程语言 时间:
2014-08-08 17:29:26
阅读次数:
265
目前没什么想说的 ?先刨个坑 ?留下一段代码 以后或许用得上吧? SimpleDateFormat?format?=?new?SimpleDateFormat(PATTERN);
System.out.println(format.format(new?Date()));
@SuppressWarnings("res...
分类:
移动开发 时间:
2014-08-08 16:39:56
阅读次数:
257
1 pattern 模式,方式n eg. A change in the pattern of his breathing became apparent.他的呼吸方式明显起了变化。 图案 eg. A golden robe embroidered with red an purple thread...
分类:
其他好文 时间:
2014-08-08 08:26:57
阅读次数:
273
10 interview question on Singleton Pattern in JavaQuestion starts withWhat is Singleton class? Have you used Singleton before? Singleton is a class wh...
分类:
编程语言 时间:
2014-08-08 01:43:45
阅读次数:
284