最近需要统计一下项目中代码的总行数,写了一个Python小程序,不得不说Python是多么的简洁,如果用Java写至少是现在代码的2倍。importos
path="/Users/rony/workspace/ecommerce/ecommerce/hot-deploy/"
globaltotalcount
totalcount=0
defcfile(path):
allfiles=os.listdir(pa..
分类:
编程语言 时间:
2014-11-11 23:09:40
阅读次数:
486
使用dd来测试硬盘读写速度dd只能提供一个大概的测试结果,而且是连续IO而不是随机IO,理论上文件规模越大,测试结果越准确。读性能测试#timeddiflag=direct,nonblockif=/dev/sda2of=/dev/nullbs=8kcount=8388608因为/dev/sda2是一个物理分区,对它的读取会产生IO,/dev/null是..
分类:
其他好文 时间:
2014-11-11 23:06:58
阅读次数:
429
You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum o...
分类:
其他好文 时间:
2014-11-11 22:57:13
阅读次数:
280
问题描述:
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4...
分类:
其他好文 时间:
2014-11-11 21:09:06
阅读次数:
207
插入排序 public static int[] insert_sort(int arr[]){ int i = 0,temp; //插入排序 for(int j = 1;j0 && arr[i]>temp){ arr[i+1]=arr[i]; i-...
分类:
编程语言 时间:
2014-11-11 20:42:08
阅读次数:
255
1 #include"string.h" 2 #include"malloc.h" 3 4 5 void swap(int a,int b) 6 { 7 int temp; 8 temp=a; 9 a=b;10 b=temp;11 }12 13 int get_...
分类:
编程语言 时间:
2014-11-11 20:36:56
阅读次数:
204
http.ServerResponse的write()或end()方法写出内容有中文乱码时, 首先要确定所有引用的JS文件的编码格式为UTF-8,再在write()或end()方法前加上 res.writeHead(200, ‘Content-Type:text/plain;charset=utf-8‘); 写...
分类:
Web程序 时间:
2014-11-11 19:26:21
阅读次数:
155
RabbitMQ 概念: fanout:不处理路由键,转发到所有绑定的队列上 direct:处理路由键,必须完全匹配,即路由键字符串相同才会转发 topic:路由键模式匹配,此时队列需要绑定要一个模式上。符号“#”匹配一个或多个...
分类:
其他好文 时间:
2014-11-11 19:22:45
阅读次数:
238
杀死数据库连接:
DECLARE @temp NVARCHAR(20)
DECLARE myCurse CURSOR
FOR
SELECT spid
FROM sys.sysprocesses
WHERE dbid = DB_ID('YourDatabaseName')
OPEN myCurse
FETCH NEXT FROM myCurse INTO @temp
WH...
分类:
数据库 时间:
2014-11-11 19:12:36
阅读次数:
214
今天在给工程添加百度地图SDK时,涉及到百度地图的模拟器与真机环境下的.a文件的合并,在使用终端进行 合并时,出现:xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not...
分类:
其他好文 时间:
2014-11-11 18:42:34
阅读次数:
177