Skip to content

Instantly share code, notes, and snippets.

@tanyuan
tanyuan / generate-mean-csv.sh
Last active February 21, 2016 07:21
Generate a CSV for experiment result.
#!/bin/bash
# Compute means of experiment data CSVs in a directory into a CSV.
# Example: ./generate-mean-csv.sh data/rawdata/vib-3/
# CSV directory
dir=$1
# Write CSV header
echo "Date,User Id,Gender,Age,vibtime,waitingtime,Data Count,Accuracy (%)"
@tanyuan
tanyuan / csv-statistics.md
Created February 29, 2016 03:32
Useful CSV commands.

CSV Command Line Statistics

tree list a tree view of current directory recursively, better than ls.

Check line counts for all data:

    wc -l *.csv

Install Python toolkit csvkit for csv* commands.

@tanyuan
tanyuan / GitHub-Project-Creation-Flow.png
Last active February 29, 2016 04:28
Useful git and GitHub commands.
GitHub-Project-Creation-Flow.png
@tanyuan
tanyuan / network.md
Created March 5, 2016 17:05
Network conflict when installing desktop environment.

Network conclict

The only frustration installing Arch Linux is network conflict:

  • Console: netctl
  • GNOME: NetworkManager

Use systemctl to stop disable services.

@tanyuan
tanyuan / emacs.md
Created March 10, 2016 18:39
Emacs key bindings and troubleshooting

Emacs

Basic Key Bindings

  • Shortcut starts with C-x.

  • Command name starts with M-x.

  • Custom shortcut starts with C-c.

  • C-x C-c: Exit Emacs.

  • C-x C-f: Find file.

@tanyuan
tanyuan / emacs-lisp.md
Created March 10, 2016 18:43
Emacs Lisp basic

Emacs Lisp

Lisp is List Processor. Lisp is a programmable programming language.

Emacs is built by Emacs Lisp, a dialect of Lisp.

something is a variable. Like a pointer point to something defined.

`something is "something" itself.

@tanyuan
tanyuan / example.png
Last active March 12, 2016 14:07
Plot confusion matrix in grey scale.
example.png
@tanyuan
tanyuan / extract-bib.py
Created April 1, 2016 12:45
Rename academic papers to author-year-title.pdf.
import argparse
import bibtexparser
if __name__ == '__main__' :
parser = argparse.ArgumentParser(description='Extract bib file to author, year, and title.')
parser.add_argument('input', help='Input file (.bib)')
args = parser.parse_args()
filename = args.input
@tanyuan
tanyuan / git-merge-branch.md
Created April 5, 2016 00:47
How to merge the right and easy way.

Git: Merge remote branch

  1. git fetch origin BRANCH
  2. git merge origin BRANCH
  3. Resolve conflict:
    • Manually. grep -lr '<<<<<<<' .
  • Choose one side.git checkout --ours PATH/FILE or git checkout --theirs PATH/FILE
@tanyuan
tanyuan / inkscape.md
Created April 20, 2016 16:09
Inkscape tips for Illustrator users

Inkscape Notes For Users From Illustrator

Shortcuts

  • In menu Edit > Preferences > left panel Interface > Keyboard Shortcuts, set Shortcut file to Adobe Illustrator, so you have V to select, A to edit nodes, P for pen tool etc.

  • Set Ctrl+D as duplicate.

  • Set zoom in and out with =, -.