Skip to content

Instantly share code, notes, and snippets.

View robinfang's full-sized avatar
🐌
人都麻了

robinfang robinfang

🐌
人都麻了
View GitHub Profile
@robinfang
robinfang / ReplacePic.user.js
Created July 2, 2014 15:53
替换妈蛋的校园网登录界面图片
// ==UserScript==
// @name Replace Pic
// @namespace http://robinfang.github.com/
// @version 0.1
// @description 替换妈蛋的校园网登录界面图片
// @match http://202.204.48.82/1.htm
// @match http://kuandai.ustb.edu.cn/1.htm
// @copyright 2014+, Fang
// ==/UserScript==
@robinfang
robinfang / joinfiles.bat
Created July 14, 2014 07:53
利用CMD的COPY命令合并文件
copy weibo.* all.txt /b
@robinfang
robinfang / proxychecker.py
Created August 17, 2014 03:49
检查代理可用否
from grab import Grab, GrabError
from multiprocessing.dummy import Pool as ThreadPool
import time
def load_proxy_list(filepath):
f = open(filepath)
proxy_list = f.read().splitlines()
f.close()
return proxy_list
@robinfang
robinfang / PostSearcher.java
Last active August 29, 2015 14:06
lucene 4.10 basic searcher
package hpcde;
import java.io.File;
import java.io.IOException;
import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.standard.StandardAnalyzer;
import org.apache.lucene.document.Document;
import org.apache.lucene.index.DirectoryReader;
import org.apache.lucene.index.IndexReader;
@robinfang
robinfang / PostIndexer.java
Created September 9, 2014 17:45
lucene 4.10 basic indexer
package hpcde;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;
import java.util.Map;
import org.apache.lucene.analysis.Analyzer;

##可能涉及的东西 Java html css js 数据库 Python ##版本与开发环境 Java版本:1.7
开发环境:Eclipse IDE for Java EE Developers,版本代号Luna ##学习方式 不限,自学为主,有问题可以问。 ##学习过程:

select * from pond.userrelation ur left join user u on ur.tuid = u.uid where u.uid is null;
alter table userrelation add constraint fk_userrelation_tuid foreign key (tuid) references user(uid);
select c from (SELECT count(*) as c, weibo.uid FROM demo.weibo join user on weibo.uid = user.uid group by weibo.uid order by c desc) as temp where c > 5;
@robinfang
robinfang / matlab_plot.m
Last active August 29, 2015 14:08
一些matlab脚本
% pagerank
A=[0.0166666666666667,0.466666666666667,0.0166666666666667,0.0166666666666667,0.166666666666667,0.0166666666666667;0.466666666666667,0.0166666666666667,0.916666666666667,0.0166666666666667,0.166666666666667,0.0166666666666667;0.466666666666667,0.466666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.0166666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.0166666666666667,0.166666666666667,0.466666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.466666666666667;0.0166666666666667,0.0166666666666667,0.0166666666666667,0.316666666666667,0.166666666666667,0.0166666666666667;]
P0=[0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;0.166666666666667;]
r(:,1)=P0
for i = 1:50
r(:,i+1) = A^i*P0
end
x = [1:51]
plot(x,r,'DisplayName','r vs.x','XDataSource','x','YDataSource','r');figure(gcf)
% ----
@robinfang
robinfang / diffusion_g.py
Last active August 29, 2015 14:09
传播模拟
#coding=utf-8
import diffusion_i as dfi
import numpy as np
import pylab as pl
from igraph import *
def countN(g,beta,times):
count = []
for i in xrange(times):
result = dfi.diffusion(g=g,beta=beta)
print('.'),