上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页
摘要: from multiprocessing import Pooldef f(x): print 'cal ', x return x * xdef callback1(arg): print arg print 'result ready, in callback'if __name__ == '__main__': pool = Pool (processes =4) result = pool.apply_async(f, [10], callback=callback1) #result = pool.apply_async(f, [10] 阅读全文
posted @ 2013-04-13 16:50 邓维 阅读(385) 评论(0) 推荐(0) 编辑
摘要: install ImageMagick download rpm package fromhttp://www.imagemagick.org/script/binary-releases.php#unix but lots of dependencies. how to solve, one way is apt-get install imagemagick , one is install smart 阅读全文
posted @ 2013-04-09 11:17 邓维 阅读(115) 评论(0) 推荐(0) 编辑
摘要: xoff3=509if [ "$xoff3" -gt 500 ] then echo "yoff3 > 500"fisuch a heavy burden 阅读全文
posted @ 2013-04-09 11:17 邓维 阅读(109) 评论(0) 推荐(0) 编辑
摘要: #!/bin/bashimage="/media/C/1.jpg"result="/media/C/12.jpg"width=`convert $image -format "%w" info:`height=`convert $image -format "%h" info:`#Now convert your percentages to pixels as variables, for examplexoff=`convert xc: -format "%[fx:$width*10/100]&quo 阅读全文
posted @ 2013-04-09 10:44 邓维 阅读(568) 评论(0) 推荐(0) 编辑
摘要: jade-->htmlhttps://github.com/visionmedia/jade#jade1jade(1)Usage: jade [options] [dir|file ...]Options: -h, --help output usage information -V, --version output the version number -o, --obj <str> javascript options object -O, --out <dir> output the compiled html to <dir> -p, ... 阅读全文
posted @ 2013-04-03 15:35 邓维 阅读(1099) 评论(0) 推荐(0) 编辑
摘要: update'$set': { "options":{ "A":"choice A stands for", "B":"choice B stands for", "C":"choice C stands for", "D":"choice D stands for", } }find$and:[{html:/答案/},{html:/回复/}]$or:[{html:/答案/},{title:/测试/} 阅读全文
posted @ 2013-04-02 15:14 邓维 阅读(146) 评论(0) 推荐(0) 编辑
摘要: fs = require('fs')fs.readdir ".", (err, filenames) -> for fi in filenames console.log fi console.log "ready" console.log 'end'dengwei@V1088:~/node_test$ lsa.coffee app.js circle.js d.coffee echo.js example.jsoutput:endcircle.jsexample.jsecho.jsd.coffeeapp.jsa.c 阅读全文
posted @ 2013-03-26 22:05 邓维 阅读(753) 评论(0) 推荐(0) 编辑
摘要: 非原创。原作者(ZX_WING(xing5820@163.com)写得很好,加上之前的确遇到过很多信号问题,产生了很多疑问,原创的两张图失效了,转贴补充之。1.什么是“Segmentation fault in Linux”?我们引用wiki上的一段话来回答这个问题。Asegmentation fault(often shortened toSIGSEGV) is a particular error condition that can occur during the operation ofcomputer software. A segmentation fault occurs wh 阅读全文
posted @ 2013-02-20 11:44 邓维 阅读(55076) 评论(0) 推荐(6) 编辑
摘要: #!/usr/bin/python#return a listdef ret_test(a,b): l=[a,b] return ldef ret_test2(a,b):# return a tuple# t=(a,b)# return t# return 2 value = return a tuple return (a,b)#list acceptedl1=ret_test(1,2)print l1 #tuple acceptedt1=ret_test2(1,2)print t1#2 value acceptedx,y=ret_test2(... 阅读全文
posted @ 2013-02-20 09:41 邓维 阅读(33122) 评论(0) 推荐(0) 编辑
摘要: #!/usr/bin/pythondef fun(la): la[0]=-1def fun2(la): la=-1#a list can be changedl1=[1,2,3]fun(l1)print l1#error:'tuple' object does not support item assignment#t1=(4,5,6)#fun(t1)#print t1#will not changesb=3fun2(sb)print sb#change to a list then succeedsb2=[3]fun(sb2)print sb2the code also te 阅读全文
posted @ 2013-02-19 23:18 邓维 阅读(253) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 34 下一页