This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import math | |
def prf(tlist, plist, n): | |
''' | |
cal the (precision, recall, f-score) | |
rlist:real values list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* "Google Now" Card | |
*/ | |
body { | |
background: #e1e1e1; | |
min-height: 100%; | |
margin: auto; | |
} | |
ul.gNow { | |
width: 450px; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* MARK 使用Matcher.quoteRepalcement()过滤特殊字符 */ | |
matchRes.appendReplacement(sb, Matcher.quoteReplacement(replacement)); | |
// 格式化日期 | |
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(System.currentTimeMillis()); | |
public void getNdayBefor(int n){ | |
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
Calendar now = Calendar.getInstance(); | |
now.set(Calendar.DATE, now.get(Calendar.DATE) - n); |