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
| 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
| // ==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
| B5axT6gt2 | |
| B59DfrIiA | |
| B59qQhkSD | |
| B59nXdi45 | |
| B57Siulzs | |
| B58e9kwQf | |
| B58Wb70Ts | |
| B58vClpOx | |
| B57G1khD2 | |
| B546J2XTg |
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
| @echo off | |
| set PATH=%PATH%;C:\Program Files\Git\bin | |
| tasklist|grep java|sed "s/\SYSTEM//g"> e:\pid.txt | |
| for /F "tokens=2" %%a in (e:\pid.txt) do ( | |
| taskkill /pid %%a /F | |
| ) | |
| del e:\pid.txt | |
| tasklist -v|grep cmd|sed '/restarttomcat.bat/'d> e:\cmdpid.txt | |
| for /F "tokens=2" %%a in (e:\cmdpid.txt) do ( | |
| taskkill /pid %%a /F |
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
| text= doc.xpath("script")[-1].text | |
| aaa = text.split("\"html\":\"") | |
| data = aaa[1].rstrip("\"})") | |
| f = codecs.open("gggggodlike.html", 'w', encoding = 'utf-8') # 用到了codecs,需要先import进来 | |
| f.write(data) | |
| f.close() |
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 networkx as nx | |
| from independent_cascade import * | |
| from collections import defaultdict | |
| import random | |
| def countDegree(input): | |
| result = defaultdict(int) | |
| for i in input: | |
| result[i] = result[i]+1 | |
| f = open("degree.csv","w") |
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 | |
| def writeLine(file, i1, i2): | |
| file.write("%s,%s\n" % (i1, i2)) | |
| if __name__ == "__main__": | |
| file = open("test","w") | |
| i1 = 25.0 | |
| i2 = 20.0 | |
| i12 = 5.0 | |
| N = 1000.0 |
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
| var nodes = [], | |
| clinks = [], | |
| linkedByIndex = {}; | |
| var node_drag = d3.behavior.drag().on("dragstart", dragstart).on("drag", dragmove).on("dragend", dragend); | |
| function dragstart(b, a) { | |
| force.stop(); | |
| event.stopPropagation() | |
| } |
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
| import java.io.IOException; | |
| import org.jsoup.*; | |
| import org.jsoup.nodes.Element; | |
| import org.jsoup.select.*; | |
| public class Parser2 { | |
| /** | |
| * @param args |