Skip to content

Instantly share code, notes, and snippets.

View skyzh's full-sized avatar
🐱
working

Alex Chi Z. skyzh

🐱
working
View GitHub Profile
@skyzh
skyzh / index.html
Created July 25, 2019 01:02
Use d3.js to visualize collision between point and segment
<!DOCTYPE html>
<html>
<head>
<title>Physics Test</title>
</head>
<body>
<svg id="main" width="800" height="800"></svg>
<script src="https://d3js.org/d3.v5.min.js"></script>
<script src="main.js"></script>
</body>
@skyzh
skyzh / 1_GaokaoData_README.md
Last active May 29, 2019 11:01
2018 Shanghai Comprehensive Enrollment Analysis

2018 年上海高考综合评价数据分析。数据来自阳光高考公示。

@skyzh
skyzh / _Deque_README.md
Last active May 3, 2019 10:19
Deque for Data Structure homework
#include <iostream>
#include <climits>
#include <cstring>
using namespace std;
template<typename T>
struct BST {
struct Node {
T x;
@skyzh
skyzh / BinomialHeap.cpp
Created April 17, 2019 07:51
Binomial Heap in cpp
#include <iostream>
#include <queue>
using namespace std;
template<typename T>
struct BinomialHeap {
struct Node {
T x;
int order;
@skyzh
skyzh / Anki.md
Last active April 11, 2019 04:17
Review Anki cards on Kindle
  1. Use Basic Print Support Anki addon.
  2. Print to HTML
  3. Apply CSS
  4. Print to PDF

This CSS adds card number and forces page break after each card.

image

# 2019-01-29 21:44:41
[General]
dns-server = 1.2.4.8, 114.114.114.114, 223.5.5.5, 8.8.8.8, system
ipv6 = true
skip-proxy = 127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,100.64.0.0/10,17.0.0.0/8,localhost,*.local,169.254.0.0/16,224.0.0.0/4,240.0.0.0/4
bypass-system = true
[Rule]
@skyzh
skyzh / _textbook.md
Created February 22, 2019 14:52
Generate textbook order for classmates

image

@skyzh
skyzh / bsdata.csv
Last active January 29, 2019 14:22
BlueSense Hourly Data Summary (2017)
We can't make this file beautiful and searchable because it's too large.
time,hum,pm01,pm10,pm25,tc,pressure
1496055566.9861677,44.4780655859387,11.685786224350602,15.028218400689576,13.864547438152512,29.63095288049607,
1496059170.883296,48.802584171295166,11.749699074074075,14.9380787037037,13.80851851851852,29.29816748936971,
1496062774.7723284,49.04658399899801,12.923555068226118,16.577614522417157,15.315606725146198,28.989999961853027,
1496067441.328689,51.788095235377014,9.65302374293221,12.148919778310509,11.25103238924606,28.872821715218688,
1496071045.2175376,53.20250063896178,7.9643287037037025,10.032731481481477,9.283449074074074,28.628667157491048,
1496075042.9485977,54.61931124918388,8.610370370370369,10.613842592592594,9.854004629629632,28.40766700267791,
1496078646.8541663,56.04033413887023,8.788773148148149,10.723796296296292,10.073194444444443,28.132917173703497,
1496082250.7668355,56.885917924245184,7.483635477582846,9.139502923976606,8.550604288499024,27.993999977111816,
1496085854.6636848,57.2112507279714,7.639215399610135,9.46486842105263,8.80893762183236,27.8
@skyzh
skyzh / course_export.js
Last active January 29, 2019 14:21
Read course data
const data = require('./data.json');
const reg = {
time: /星期(.*?)[ ]+第(.*?)节--第(.*?)节/,
header: /行课安排为第(.*?)-(.*?)周?,其中:/,
loc: /(.*?)\((.*?)-(.*?)周\)[ ]+(.*?)\((.*?)-(.*?)周\)/,
loc_unknown: /[ ]*(.*?)[ ]+(.*?)\((.*?)-(.*?)周\)/,
bi_week: /(单|双)周/
};
const fetch_data = {
header: ["week_start", "week_end"],