Skip to content

Instantly share code, notes, and snippets.

View gongzhitaao's full-sized avatar
🐢
(๑•̀ㅂ•́)و✧

Zhitao Gong gongzhitaao

🐢
(๑•̀ㅂ•́)و✧
  • DeepMind
  • Montreal, CA
  • 19:57 (UTC -04:00)
View GitHub Profile
@gongzhitaao
gongzhitaao / pathadd.bash
Created July 1, 2016 20:56
Manage Linux environment variables such as PATH, LD_LIBRARY_PATH
# -*- mode: shell-script; coding: utf-8; -*-
pathadd() {
# key
local key=${2:-PATH}
# value of key
local ret=${!key}
# remove trailing slash
@gongzhitaao
gongzhitaao / ebook.org
Last active March 24, 2024 08:52
Open book website collection

美国国家学术出版社所有 PDF 图书开放免费下载

美国国家学术出版社所有 PDF 图书开放免费下载美国的国家学术出版社 (National Academies Press,NAP)于2011年6月2日宣布,将其出版的所有 PDF 版图书对所有读者免费开放下载,并且将这些图书去除 DRM 保护。这其 中不仅包括超过4000种最新出版的图书,还包括已经提交报告将于未来一段时 间出版的图书。

国家学术出版社负责美国国家科学院(National Academy of Sciences)、美 国国家工程学院(National Academy of Engineering)、美国国家医学院

@gongzhitaao
gongzhitaao / book.md
Last active June 8, 2016 20:51
半緣脩道半緣君

  • 耶路撒冷3000年
  • 留住手艺
  • 和尚与哲学家
  • 禅与摩托车修理艺术

步甜

  • 永远的普罗旺斯
@gongzhitaao
gongzhitaao / keybase.md
Created April 30, 2016 16:38
what is keybase???

Keybase proof

I hereby claim:

  • I am gongzhitaao on github.
  • I am gongzhitaao (https://keybase.io/gongzhitaao) on keybase.
  • I have a public key whose fingerprint is 493D 59EA F22A 2603 1C3C FD5C 8984 BD68 547A 8270

To claim this, I am signing this object:

@gongzhitaao
gongzhitaao / CompileRecent.md
Last active December 23, 2017 20:55
Compile the most recently changed tex file

This make file finds the most recently changed tex file and compile it.

@gongzhitaao
gongzhitaao / kmp.cpp
Last active January 4, 2022 08:07
KMP implementation in C++
int kmp(const string &T, const string &P) {
if (P.empty()) return 0;
vector<int> pi(P.size(), 0);
for (int i = 1, k = 0; i < P.size(); ++i) {
while (k && P[k] != P[i]) k = pi[k - 1];
if (P[k] == P[i]) ++k;
pi[i] = k;
}
@gongzhitaao
gongzhitaao / maze.cpp
Last active August 29, 2015 14:08
COMP 2710 Lab 3
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <fstream>
#include <sstream>
#include <map>
#include <queue>
#include <vector>
#include <utility>
@gongzhitaao
gongzhitaao / Makefile
Last active August 29, 2015 14:07
COMP 2710 Lab2
CXX=g++
EXE=main
FLG=-std=c++11 -O2 -Wall
all : $(EXE)
$(EXE) : main.cpp
$(CXX) $(FLG) -o $@ $<
clean :
@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:03
Maze DFS

A maze pattern is generated by Depth-First Search (DFS) algorithm. To create more interesting/skewed maze, the probability to search for each direction, i.e. top, right, down and left is randomized. As a result sometimes it's more likely to go upward, if available, than right. This generator could be found in mazejs.

@gongzhitaao
gongzhitaao / README.md
Last active August 29, 2015 14:02
Game of life