最近看到很多关于C++11的文档,有些是我不怎么用到,所以就略过去了,但是lambda表达式还是比较常用的,其实最开始学习python的时候就觉得lambda这个比较高级,为什么C++这么弱。果然C++增加这个东西。语法[ capture ] ( params ) mutable exception...
分类:
编程语言 时间:
2014-07-08 23:49:31
阅读次数:
400
Implement regular expression matching with support for '.' and '*'.
'.' Matches any single character.
'*' Matches zero or more of the preceding element.
The matching should cover the entire input st...
分类:
其他好文 时间:
2014-07-08 16:57:40
阅读次数:
193
;; Building Abstractions With Procedures
( define ( my-sqrt x )
( define ( good-enough? guess )
(
( define ( improve guess )
( average guess ( / x guess ) ) )
...
分类:
其他好文 时间:
2014-07-08 15:22:37
阅读次数:
306
var result = DataSummaryRepository.FindBy(x => x.UserID == argMemberNo && x.SummaryDate = argStarDate).OrderByDescending(x => x.SummaryDate).GroupBy(x...
分类:
其他好文 时间:
2014-07-06 22:09:09
阅读次数:
6084
int_ip = lambda x: '.'.join([str(x/(256**i)%256) for i in range(3,-1,-1)])ip_int = lambda x:sum([256**j*int(i) for j,i in enumerate(x.split('.')[::-1]...
分类:
编程语言 时间:
2014-07-06 21:21:30
阅读次数:
281
/×width:expression(this.width>100&&this.width>this.height?100:true);height:expression(this.height>100?100:true);width:expression(this.width>100?100:tr...
分类:
Web程序 时间:
2014-07-06 19:53:57
阅读次数:
228
ECMAScript通过RegExp类型来支持正则表达式。使用类似Perl的语法就可以创建一个正则表达式:var expression=/pattern/flags;其中模式(pattern)部分可以是任何简单或复杂的正则表达式,可以包含字符类、限定符、分组、向前查找以及反向引用。每个正则表达式都可...
分类:
Web程序 时间:
2014-07-06 14:38:13
阅读次数:
246
PostgreSQL正则表达式基础:OperatorDescriptionExample~Matches regular expression, case sensitive'thomas' ~ '.*thomas.*'~*Matches regular expression, case insen...
分类:
其他好文 时间:
2014-07-06 13:31:33
阅读次数:
156
λ表达式的基本用途
回调与Java8的λ表达式 说明了Java8的λ表达式的基本用途:完成了回调的原意——代码的参数化。
回调:可以简单地说,如果你的方法需要override底层或JDK的某个类的方法,而且你从来没有自己调用过,则该方法就是回调。例如Applet定义的init()、start()、stop()和destroy();图形绘制方法paint(Graphics)、update(Gra...
分类:
编程语言 时间:
2014-07-05 23:33:43
阅读次数:
338
lambdTesting=lambda x: x*3print(lambdTesting(5))输出 15像C#一样传递lambda表达式:def abc(t,a): return t(a)print(abc(lambdTesting,15))输出:45
分类:
编程语言 时间:
2014-07-05 18:02:49
阅读次数:
196