This file contains 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
set-option -g prefix C-l | |
bind-key Space last-window | |
# Avoid Esc key delay when using VIM | |
set -sg escape-time 0 | |
set-option -g history-limit 1000000 | |
# See here for instructions to install tpm |
This file contains 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
"================================================================================ | |
" Setups | |
" 1. Install vim-plug | |
" 2. Run `:PlugInstall` in NeoVim | |
"================================================================================: | |
"================================================================================ | |
" Install Plugins | |
"================================================================================ | |
" Specify a directory for plugins |
This file contains 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
" shortcuts for TeX symbols | |
autocmd FileType tex inoremap <buffer> <silent> __ __<C-R>=UltiSnips#Anon('_\{${1:${VISUAL}}\}', | |
\ '__', '', 'i')<cr> | |
autocmd FileType tex inoremap <buffer> <silent> ^^ ^^<C-R>=UltiSnips#Anon('^\{${1:${VISUAL}}\}', | |
\ '^^', '', 'i')<cr> | |
autocmd FileType tex inoremap <buffer> <silent> (( ((<C-R>=UltiSnips#Anon('\left(${1:${VISUAL}}\right)', | |
\ '((', '', 'i')<cr> | |
autocmd FileType tex inoremap <buffer> <silent> `a `a<C-R>=UltiSnips#Anon('\alpha', |
This file contains 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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Use the koma-script document style | |
\documentclass{scrbook} | |
\KOMAoptions{twoside=false} % disable two-side formatting for scrbook | |
% alternatively, for shorter essay, use the following | |
% \documentclass{scrartcl} | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
% Useful packages |
This file contains 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
% Some people asked the LaTeX template for http://pluskid.org/assets/chiyuan-resume.pdf | |
% So I put a sample here. Feel free to use / modify it. Note you need to use xelatex to | |
% compile it and change the fonts to the ones you prefer and have on your system. | |
\documentclass[11pt]{article} | |
\usepackage{color} | |
\definecolor{ColorURL}{rgb}{0.1,0.12,0.45} | |
\usepackage[colorlinks=true,urlcolor=ColorURL]{hyperref} | |
\usepackage{fontspec,xunicode,xltxtra} | |
\usepackage[left=.8in,right=.8in,top=.9in,bottom=.7in]{geometry} | |
\usepackage{setspace} |
This file contains 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
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker: | |
"======================================= | |
" Initialization { | |
"======================================= | |
set nocompatible | |
call pathogen#infect() | |
filetype plugin indent on | |
"} |
This file contains 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 sys | |
class Data: | |
def __init__(self, line): | |
data = line.split() | |
self.label = data[0] | |
self.feats = dict() | |
for i in range(len(data)-1): | |
a,b = data[i+1].split(':') | |
self.feats[int(a)] = b |
This file contains 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
# vim: filetype=ruby | |
output "compiled/files" | |
class AsyFilter < Rake::Pipeline::Filter | |
attr_accessor :config | |
def initialize | |
@output_name_generator = proc { |fn, wrap| | |
@config = {'ext' => 'png', 'opt' => ''} |
This file contains 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
" vim: set foldmarker={,} foldlevel=0 foldmethod=marker: | |
"======================================== | |
" Basic setting { | |
"======================================== | |
set nocompatible | |
set visualbell " disable sound bell | |
let mapleader = ',' | |
filetype plugin indent on " auto filetype identification |
This file contains 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
template <typename T> | |
class SGVector | |
{ | |
public: | |
SGVector(int32_t len) | |
{ | |
int32_t size = sizeof(T)*len + sizeof(int32_t); | |
uchar *memory = malloc(size); | |
m_buffer = memory + sizeof(int32_t); |
NewerOlder