Skip to content

Instantly share code, notes, and snippets.

View brickgao's full-sized avatar
🎯
Focusing

Xiongzhi Gao brickgao

🎯
Focusing
View GitHub Profile
# -*- encoding: utf-8 -*-
import requests
import os
def get_page(lower_bound=1, upper_bound=1000000):
if not os.path.exists('./pages/'):
os.mkdir('./pages')
base_url = 'http://zhidao.baidu.com/question/'
@brickgao
brickgao / scatter_prototype.py
Created February 22, 2015 05:52
Prototype for scatter.
# -*- coding: utf-8 -*-
from vispy.scene import SceneCanvas, visuals
import numpy as np
from vispy import app
plots = []
var usb = require('usb');
var my_drive = usb.findByIds(4901, 49193);
my_drive.open();
interfaces = my_drive.interfaces[0];
interfaces.claim()
@brickgao
brickgao / 问卷一时爽-统计火葬场.py
Created April 21, 2014 10:22
不用自动化问卷系统的人生
# -*- coding: utf-8 -*-
import os
_file_list = os.listdir(u'./data')
_cnt = 0
for _file_name in _file_list:
_cnt += 1
print str(_cnt) + u' start to analyse ' + _file_name
with open(os.path.join(u'./data', _file_name), 'r') as _file:
@brickgao
brickgao / pressure_test.py
Last active December 24, 2015 14:29
一个简单的并发压力测试脚本
# -*- coding: utf8 -*-
import httplib, threading, time
total = 0
succ = 0
fail = 0
exce = 0
maxtime = 0
mintime = 9999
gt3 = 0
@brickgao
brickgao / Baiduyun_Sample.js
Created September 22, 2013 18:59
A sample to get real url from baiduyun
var http = require('http')
var options = {
host: 'yun.baidu.com',
port: 80,
path: '/share/link?shareid=197263&uk=4264834298',
method: 'GET'
};
var req = http.get(options, function(res) {
@brickgao
brickgao / gist:6270713
Last active December 21, 2015 07:19
D3.js Learning
<!--A bar Chart Part1-sample1-->
<!DOCTYPE html>
<html>
<head>
<title>A bar Chart Part 1</title>
<style type="text/css">
body {
height: 100%;
}
.chart div {
@brickgao
brickgao / py_httprequest.py
Created May 9, 2013 15:28
Just a example to login renren.com
from sgmllib import SGMLParser
import sys,urllib2,urllib,cookielib
import getpass
class loginrenren(SGMLParser):
def __init__(self, mail, password):
SGMLParser.__init__(self)
try:
@brickgao
brickgao / ApplyMemory.cpp
Last active December 10, 2015 09:08
操作系统大作业 分配连续的8M物理内存
//By Brickgao
#include <iostream>
#include <queue>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <ctype.h>
@brickgao
brickgao / Codeforces Round 142 (Div. 2) C.cpp
Created October 10, 2012 10:07
Codeforces Round 142 (Div. 2) C
//By Brickgao
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
using namespace std;