##可能涉及的东西
Java html css js 数据库
Python
##版本与开发环境
Java版本:1.7
开发环境:Eclipse IDE for Java EE Developers,版本代号Luna
##学习方式
不限,自学为主,有问题可以问。
##学习过程:
This file contains hidden or 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
| // ==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== |
This file contains hidden or 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
| copy weibo.* all.txt /b |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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; |
This file contains hidden or 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
| 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; |
This file contains hidden or 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
| 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); |
This file contains hidden or 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
| 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; |
This file contains hidden or 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
| % 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) | |
| % ---- |
This file contains hidden or 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
| #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('.'), |