Skip to content

Instantly share code, notes, and snippets.

View erjiaqing's full-sized avatar
📡
BG6TOE

Song GUO erjiaqing

📡
BG6TOE
View GitHub Profile
@erjiaqing
erjiaqing / benchmarkResult
Last active April 22, 2019 05:36
Map Test
goos: linux
goarch: amd64
BenchmarkGoMap-4 10 152401135 ns/op 61921158 B/op 19104 allocs/op
BenchmarkFakeMap-4 5 225634561 ns/op 105266198 B/op 519008 allocs/op
BenchmarkGoMapQuery-4 3 337183233 ns/op 61943141 B/op 19210 allocs/op
BenchmarkFakeMapQuery-4 3 383323147 ns/op 105281136 B/op 519060 allocs/op
BenchmarkGoMapQueryOnly-4 10 177926115 ns/op 0 B/op 0 allocs/op
BenchmarkFakeMapQueryOnly-4 10 156825677 ns/op 0 B/op 0 allocs/op
BenchmarkGoMapQueryAndUpdate-4 10 195413146 ns/op 0 B/op 0 allocs/op
BenchmarkFakeMapQueryAndUpdate-4 10 157194905 ns/op 0 B/op 0 allocs/op
@erjiaqing
erjiaqing / test2.go
Last active March 19, 2019 09:34
Find fastest method to get length in golang
package main
import (
"testing"
)
var smallInt = []int{1, 32, 102, 47, 2222, 986, 0, 2}
var bigInt = []int{
1234567890, 123456789, 123456789012, 123, 1,
12, 12345667801234, 1234567890123, 1234, 12345678901,
@erjiaqing
erjiaqing / nott.js
Last active April 2, 2019 07:47
丢掉乱七八糟的课程表吧!No Time Table,将课表导出为日历文件!(Tampermonkey脚本)
// ==UserScript==
// @name No Time Table
// @namespace http://app.ejq.me/
// @version 0.0.4.1
// @description Export time table as ICS file.
// @author EJQ
// @include http://210.42.121.132/servlet/Svlt_QueryStuLsn*
// @include http://210.42.121.133/servlet/Svlt_QueryStuLsn*
// @include http://210.42.121.134/servlet/Svlt_QueryStuLsn*
// @include http://210.42.121.241/servlet/Svlt_QueryStuLsn*
@erjiaqing
erjiaqing / ScoreGuesser.js
Last active January 11, 2018 13:46
让武大学子在查分时……有那么一点心理准备的Tampermonkey脚本
// ==UserScript==
// @name Score Guesser
// @namespace http://app.ejq.me/
// @version 0.5.1
// @description Hide your score.
// @author EJQ
// @include http://210.42.121.132/servlet/Svlt_QueryStuScore*
// @include http://210.42.121.133/servlet/Svlt_QueryStuScore*
// @include http://210.42.121.134/servlet/Svlt_QueryStuScore*
// @include http://210.42.121.241/servlet/Svlt_QueryStuScore*
% Original zhfontcfg.sty
% https://gist.github.com/blindFS/318c4d5e00b2eb06247c
% xetex/xelatex 字体设定宏包
\ProvidesPackage{zhfontcfg_mac}
\usepackage[cm-default]{fontspec} %[cm-default]选项主要用来解决使用数学环境时数学符号不能正常显示的问题
\usepackage{xunicode,xltxtra}
@erjiaqing
erjiaqing / SegTree.cpp
Last active August 29, 2015 14:04
线段树模板
#include <cstdio>
using namespace std;
const int maxn=131072;
int seg[maxn*2+5];
int query(int x,int l,int r,int ql,int qr)
//询问[ql,qr]闭区间
{
if (ql<=l && r<=qr) return seg[x];
int mid=(l+r)/2,ret=0x7fffffff;//0x7fffffff=MAX_INT
if (ql<=mid) ret=min(ret,query(x*2,l,mid,ql,qr));
set nu
set ai
set ci
set ts=4
set sw=4
set sts=4
sy on
set si
function g:compileByFileType()
set nu
set ai
set ci
set ts=4
set sw=4
set sts=4
sy on
set si
function g:compileByFileType()
@erjiaqing
erjiaqing / bzoj3083.cpp
Created April 24, 2014 07:38
Accepted/32728 kb/8252 ms
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
using namespace std;
const int maxn=100005;
vector<int>e[maxn];
typedef vector<int>::iterator vi;
//--线段树
@erjiaqing
erjiaqing / bzoj3531.cpp
Created April 23, 2014 01:01
Accepted/86328 kb/11992 ms
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
using namespace std;
const int maxs=4000000,maxn=100005;
//--线段树
struct tree{
int l,r,c,m,s;