1、lambda函数 lambda可用于定义函数,例子: func = lambda x,y: x+y print func(x,y) 2、函数可作为参数传递 def f2(f1,a): f1(a,1) return f1 f2(f1,4) 3、map re = map((lambda x: x+3 ...
分类:
编程语言 时间:
2017-01-22 18:06:04
阅读次数:
196
<script type="text/javascript"> //随机取得数组中的一个元素 function Rand(){ var arr=[11,22,33,44]; var a=Math.floor(Math.random()*arr.length);//Math.floor(Math.ra ...
分类:
编程语言 时间:
2017-01-22 18:03:55
阅读次数:
221
public ActionResult Upload(HttpPostedFileBase Namefile) { //判断文件是否存在 if (Namefile == null) { return Content("没有文件"); } //获取上传文件的名称,位置 var fileName = D ...
分类:
数据库 时间:
2017-01-22 17:48:22
阅读次数:
280
1.这时候几种将函数赋值给一个变量,然后执行这个变量 是怎样的结果: 答疑: aaa 是将 hi() 的运行结果赋值给它,即 return 返回的匿名函数,此时有一个闭包,则每次调用 aaa 时都访问的同一个 a,aaa() 第一次运行结果为 1,第二次为2 而 bbb 将是将 hi 这个函数名赋值 ...
分类:
其他好文 时间:
2017-01-22 16:56:27
阅读次数:
129
break 用于跳出循环 return 用于停止方法 ...
分类:
其他好文 时间:
2017-01-22 16:45:15
阅读次数:
105
设置工作目录: #include <unistd.h> int chdir(const char *path); int fchdir(int fd); chdir() changes the current working directory of the calling process to t ...
分类:
其他好文 时间:
2017-01-22 16:43:23
阅读次数:
171
赚多少钱、赚多长时间、有多大的风险 投资决策者要考虑的两个因素:收益+风险 1.1 收益与期望收益率 1.1.1持有期收益率 hloding period return(HPR) 概念 the total return on a asset or portfolio over a period du ...
分类:
其他好文 时间:
2017-01-22 16:42:11
阅读次数:
160
算是一道概率dp吧。 状态互相依赖的动态规划,需要使用高斯消元。 ...
分类:
其他好文 时间:
2017-01-22 15:17:35
阅读次数:
206
Description Byteasar是一个很纠结的人。每次他经过Bytetown的时候都知道有至少2条不同的路径可以选择,这导致他必须花很长时间来决定走哪条路。Byteasar最近听说了Bytetown的修路计划,他可能是唯一一个为此感到高兴的人——他有机会消除他的烦恼。 在Byteasar一共 ...
分类:
其他好文 时间:
2017-01-22 13:41:48
阅读次数:
227
case: 41 2 3 444 2 3 166 5 4 2 3 186 1 4 7 2 5 8 3122 7 4 1 3 5 8 10 12 9 6 11 ...
分类:
其他好文 时间:
2017-01-22 12:35:22
阅读次数:
208