Skip to content

Instantly share code, notes, and snippets.

anonymous
anonymous / eva.py
Created January 6, 2014 09:40
Evaluation Metrics
# !/usr/bin/python
# -*- coding: utf-8 -*-
import math
def prf(tlist, plist, n):
'''
cal the (precision, recall, f-score)
rlist:real values list
@eLindemann
eLindemann / dabblet.css
Created April 1, 2013 20:41
"Google Now" Card
/**
* "Google Now" Card
*/
body {
background: #e1e1e1;
min-height: 100%;
margin: auto;
}
ul.gNow {
width: 450px;
@wfwei
wfwei / usage.java
Last active October 9, 2015 03:57
Basic Java Usage
/* 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);