Skip to content

Instantly share code, notes, and snippets.

@djour
djour / stock_corr.py
Created May 7, 2017 16:14
stock correlation analysis
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import tushare as ts
#获取数据
s_pf = '600000'
s_gd = '601818'
sdate = '2016-01-01'
edate = '2016-12-31'
@djour
djour / 3_install_deeplearning_libs.sh
Created March 21, 2017 07:55 — forked from graphific/3_install_deeplearning_libs.sh
Installation script for Deep Learning Libraries on Ubuntu 14.04
#!/usr/bin/env bash
# Installation script for Deep Learning Libraries on Ubuntu 14.04, by Roelof Pieters (@graphific)
# BSD License
orig_executor="$(whoami)"
if [ "$(whoami)" == "root" ]; then
echo "running as root, please run as user you want to have stuff installed as"
exit 1
fi
###################################
@djour
djour / gprof2dot.py
Created October 4, 2016 01:33 — forked from WuXianglong/gprof2dot.py
Generate a dot graph from the output of several profilers.
#!/usr/bin/env python
#
# Copyright 2008-2014 Jose Fonseca
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@djour
djour / README.md
Created December 29, 2012 14:17 — forked from chuangbo/README.md

替换上你的Email,密码,域名ID,记录ID等参数,就可以运行了。 会在后台一直运行,每隔30秒检查一遍IP,如果修改了就更新IP。

获得domain_id可以用curl curl -k https://dnsapi.cn/Domain.List -d "login_email=xxx&login_password=xxx"

获得record_id类似 curl -k https://dnsapi.cn/Record.List -d "login_email=xxx&login_password=xxx&domain_id=xxx"

@djour
djour / gist:2425359
Created April 20, 2012 02:23
FIXME point in feature test for TradWeight
diff --git a/xapian-core/tests/api_anydb.cc b/xapian-core/tests/api_anydb.cc
index 636b30c..eec31f6 100644
--- a/xapian-core/tests/api_anydb.cc
+++ b/xapian-core/tests/api_anydb.cc
@@ -2287,6 +2287,7 @@ DEFINE_TESTCASE(tradweight1, backend) {
enquire.set_query(Xapian::Query("word") );
mset = enquire.get_mset(0, 25);
+ mset_expect_order(mset,2,4);
// FIXME: should check that TradWeight(0) means wdf and doc length really
@djour
djour / gist:2422049
Created April 19, 2012 16:15
Patch for Implementation of tf-idf scheme(basic scheme in SMART)
diff --git a/xapian-core/include/xapian/weight.h b/xapian-core/include/xapian/weight.h
index 09cbe46..0d9a3ac 100644
--- a/xapian-core/include/xapian/weight.h
+++ b/xapian-core/include/xapian/weight.h
@@ -506,6 +506,51 @@ class XAPIAN_VISIBILITY_DEFAULT TradWeight : public Weight {
double get_maxextra() const;
};
+/** Xapian::Weight subclass implementing the basic tf-idf scheme
+ *
@djour
djour / gist:2414613
Created April 18, 2012 16:11
Define subclass tf-idf for weighting scheme
diff --git a/xapian-core/include/xapian/weight.h b/xapian-core/include/xapian/weight.h
index 09cbe46..7592af1 100644
--- a/xapian-core/include/xapian/weight.h
+++ b/xapian-core/include/xapian/weight.h
@@ -506,6 +506,51 @@ class XAPIAN_VISIBILITY_DEFAULT TradWeight : public Weight {
double get_maxextra() const;
};
+/** Xapian::Weight subclass implementing the basic tf-idf scheme
+ *