0. 形式for ( declaration : expression ) statement0.1 根据标准将会扩展成这样的形式:1 {2 auto&& __range = expression;3 for (auto __begin = begin-expression,4 __end = en...
分类:
编程语言 时间:
2015-05-09 14:57:35
阅读次数:
180
原型:#include forward_iterator remove_if(forward_iterator start,forward_iterator end,Predicate p);函数remove_if()移除序列[start, end)中所有应用于谓词p返回true的元素.此函数返回一...
分类:
其他好文 时间:
2015-05-09 14:55:17
阅读次数:
106
这篇博文逐渐写一点关于Ruby的编码风格,主要参考ruby-stytle-guide。一些命名准则函数与变量使用蛇形小写比较好:some_var, some_function目录和文件也使用snack_case类使用驼峰命名CamelCase,1 class SomeClass2 3 4 end
分类:
其他好文 时间:
2015-05-09 14:53:24
阅读次数:
121
const表示不能修改 static表示作用域限定在本文件中// EOCAnimatedView.h#import @interface EOCAnimatedView : UIView- (void)animate;@end// EOCAnimatedView.m#import "EOCAnima...
分类:
其他好文 时间:
2015-05-09 13:17:33
阅读次数:
95
步骤1、发出协议(在发协议者.h文件 下@interface-@end 上边) @protocol hireOneMaid @required//必须要实现的方法(默认)//打扫房间- (void)cleanHouse;//照看孩子- (void)lookayMyBaby;//给我做饭- (vo.....
分类:
其他好文 时间:
2015-05-09 11:35:45
阅读次数:
98
';echo '本周结束日期:',$now_end,'';echo '上周开始日期:',$last_start,'';echo '上周结束日期:',$last_end,''; 注意:由于国外的星期都是从周日开始,中国习惯从周一开始,所以直接使用strtotime("last monday") 就会....
分类:
Web程序 时间:
2015-05-09 07:41:58
阅读次数:
211
本来要写个全面一点的 函数式编程文章,不过查了一些资料,发现看不太懂,境界不够,等有时间补上吧。
支持函数编程的语言特点:(以lua为例)
1,函数是第一类值,与其他传统类型具有相同权利。
一,可以存储到变量中,无论是全局变量还是局部变量
例: function haha() print "haha" end local x = haha x() 输出haha
a = pr...
分类:
其他好文 时间:
2015-05-08 20:21:14
阅读次数:
120
1 void reverse(char* str, int begin, int end) 2 { 3 char temp; 4 for( ; begin < end; begin++) 5 { 6 temp = str[end]; 7 st...
分类:
其他好文 时间:
2015-05-08 20:06:15
阅读次数:
231
http://www.tekuba.net/program/346/ios自动释放池(autoreleasepool#import@interfaceTest:NSObject@end@implementationTest@endintmain(intargc,constchar*argv[]){N...
分类:
移动开发 时间:
2015-05-08 17:51:43
阅读次数:
124
sed:行编辑工具sed[option]...‘地址编辑命令‘filename...地址格式:start_line[,end_line]#需要编辑的行号/patten1/,/patten2/#第一次被pattern1匹配到的行开始,至第一次被pattern2匹配到的行结束之间的所有行;/pattern/#对被pattern匹配到的行进行相关操作无地址#对全文进..
分类:
其他好文 时间:
2015-05-08 11:09:32
阅读次数:
141