上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 41 下一页
  2012年3月4日
摘要: #!/usr/bin/python#-*- coding:cp936 -*-import re;import os;import sys;if(__name__=="__main__"): p=re.compile('(^\s+|\s+$)'); pdigit=re.compile('^\d+'); delimiter='\t'; strdict='dict.dat'; strcontigency='contigency.dat'; str_input=str(sys.argv[1]); str 阅读全文
posted @ 2012-03-04 14:54 finallyly 阅读(4684) 评论(0) 推荐(0) 编辑
  2012年2月25日
摘要: HDFS File System Shell GuideOverviewcatchgrpchmodchowncopyFromLocalcopyToLocalcountcpdudusexpungegetgetmergelslsrmkdirmoveFromLocalmoveToLocalmvputrmrmrsetrepstattailtesttexttouchzOverviewThe FileSystem (FS) shell is invoked bybin/hadoop fs <args>. All FS shell commands take path URIs as argum 阅读全文
posted @ 2012-02-25 10:49 finallyly 阅读(1114) 评论(0) 推荐(0) 编辑
  2012年2月21日
摘要: #!/usr/bin/pythonimportsys;importre;defgetPrecision(TP,TN,FP,FN):result=0.0;result=TP/(TP+FP);returnresult;defgetRecall(TP,TN,FP,FN):result=0.0;result=TP/(TP+FN);returnresult;defgetFvalue(TP,TN,FP,FN):result=0.0;p=getPrecision(TP,TN,FP,FN);r=getRecall(TP,TN,FP,FN);result=2*p*r/(p+r);returnresult;def 阅读全文
posted @ 2012-02-21 18:28 finallyly 阅读(1371) 评论(0) 推荐(0) 编辑
摘要: 1.数据管理脚本:原始文件格式id\tclusterId\tgoldstandardIdDataManagement.py#!/usr/bin/pythonimportcPickleasp;importsys;importre;if(__name__=="__main__"):filename=str(sys.argv[1]);preturn=re.compile('(^\s+|\s+$)');fidsrc=file(filename,'r');clusters={};#(key,[])goldstandards={};#(key,[])fo 阅读全文
posted @ 2012-02-21 13:03 finallyly 阅读(6737) 评论(0) 推荐(1) 编辑
摘要: b = set([0, 1, 3, 4, 5]) c = set([3, 4, 5, 6, 7]) print b & c #求交集 print b | c #求联集 print b - c #只留下 b 独有的 阅读全文
posted @ 2012-02-21 09:29 finallyly 阅读(370) 评论(0) 推荐(0) 编辑
  2012年2月17日
摘要: s1='20120125';6s2='20120216';7a=time.strptime(s1,'%Y%m%d');8b=time.strptime(s2,'%Y%m%d');9a_datetime=datetime.datetime(*a[:3]);10b_datetime=datetime.datetime(*b[:3]);11printb_datetime-a_datetime;http://blog.csdn.net/nankaihunter/article/details/5003327为了从字符串中提取时间,并进行比 阅读全文
posted @ 2012-02-17 17:34 finallyly 阅读(65948) 评论(1) 推荐(1) 编辑
  2012年2月16日
摘要: http://wiki.ubuntu.org.cn/Python%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97 阅读全文
posted @ 2012-02-16 20:56 finallyly 阅读(316) 评论(0) 推荐(0) 编辑
摘要: test.py的路径在DatesManagement上一层。 阅读全文
posted @ 2012-02-16 19:53 finallyly 阅读(553) 评论(0) 推荐(0) 编辑
  2012年2月14日
摘要: import re; 5 import time; 6 import datetime; 7 if(__name__=="__main__"): 8 #today=int(time.strftime("%w")); 9 10 anyday=datetime.datetime(2012,2,15).strftime("%w");11 print anyday 阅读全文
posted @ 2012-02-14 22:10 finallyly 阅读(5870) 评论(0) 推荐(0) 编辑
  2012年2月10日
摘要: #!/bin/sh 2 maildir=baikewaringmail 3 lastVersion=xxxxxxxxxxxxxx/lastVersion/datestr.txt 4 mydatestr=`sed -n '1p' $lastVersion` 5 echo "the datestr is $mydatestr" 阅读全文
posted @ 2012-02-10 11:32 finallyly 阅读(7134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 41 下一页