原来这么长时间没写了,今天阅读《集体智慧编程》的时候,发现了python的一个功能,列表推导式。留个存[ 表达式 for 变量 in 列表] 或者[表达式
for 变量 in 列表 if 条件]例如:ll=[1,2,3,4,5,6,7,8,9,0]print (v*10 for v in ll if...
分类:
编程语言 时间:
2014-06-11 11:23:16
阅读次数:
330
1, 安装nodejs安装python。2,安装node-gyp:sudo npm
install -g
node-gyp3,写代码:新建一个目录,创建hello.cc文件,然后创建binding.gyp文件:hello.cc#include#includeusingnamespace
v8;Han...
分类:
编程语言 时间:
2014-06-11 11:10:24
阅读次数:
380
Jenkins的job->build 支持Ant,maven,windows
batch和Shell,
但是我们知道python,perl,ruby等脚本其实也是shell脚本,所以这里的Shell可以扩展为python,perl,ruby等。例如:
下面执行windows batch 和pytho...
分类:
编程语言 时间:
2014-06-11 10:03:49
阅读次数:
296
原题地址:https://oj.leetcode.com/problems/rotate-image/题意:You
are given annxn2D matrix representing an image.Rotate the image by 90 degrees
(clockwise).Fo...
分类:
编程语言 时间:
2014-06-11 09:43:59
阅读次数:
1264
让我纠结了一天多的问题,给大家看下,有相同情况的可以不用浪费时间了,本人当时找了好半天都没找到什么有用的信息,项目在本地没有问题,但部署在服务器后,获取不到https页面的信息,加入下面的代码就可以了,因为iis7.5的安全协议比较高的原因。我的获取页面需要cookie,不需要的可以去掉;GET的方...
分类:
Web程序 时间:
2014-06-11 09:41:22
阅读次数:
351
学习了元祖,写了小程序。#encoding = utf-8 a =
("success","false","what")print "first"print a #print all stringprint "\n"print
"second"print a[:] #pirnt all string...
分类:
编程语言 时间:
2014-06-11 09:07:45
阅读次数:
322
原题地址:https://oj.leetcode.com/problems/powx-n/题意:Implement
pow(x,n).解题思路:求幂函数的实现。使用递归,类似于二分的思路,解法来自Mark Allen Weiss的《数据结构与算法分析》。代码:class
Solution: #...
分类:
编程语言 时间:
2014-06-11 08:59:33
阅读次数:
317
原题地址:https://oj.leetcode.com/problems/edit-distance/题意:Given
two wordsword1andword2, find the minimum number of steps required to
convertword1toword2....
分类:
编程语言 时间:
2014-06-11 08:58:49
阅读次数:
293
计时器setTimeout :
指定时间之后单次调用clearTimeout:取消后续函数调用setInterval:指定之间后重复调用clearnterval:单位:毫秒Locationwindow
的location属性引用Location对象window.location === docume...
Ctrl+m+Crtr+o折叠所有大纲Ctrl+M+Crtr+P:
停止大纲显示Ctrl+K+Crtr+C: 注释选定内容Ctrl+K+Crtr+U: 取消选定注释内容Ctrl+J : 列出成员
智能感知Shift+Alt+Enter: 切换全屏编辑Ctrl+B,T / Ctrl+K,K: 切换书签...
分类:
其他好文 时间:
2014-06-11 08:33:23
阅读次数:
262