This file contains hidden or 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
| # tab management | |
| vim -p file1 file2 ... open multiple files each in a tab: | |
| :tabedit {file} edit specified file in a new tab | |
| :tabfind {file} open a new tab with filename given, searching the 'path' to find it | |
| :tabclose close current tab | |
| :tabclose {i} close i-th tab | |
| :tabonly close all other tabs (show only the current tab) | |
This file contains hidden or 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
| # Install rbenv | |
| brew install rbenv | |
| # Completely uninstall rbenv | |
| brew uninstall rbenv | |
| # list all available versions | |
| rbenv install -l | |
| # install a specific Ruby version |
This file contains hidden or 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
| # Linux | |
| sudo apt install tmux | |
| # Mac | |
| brew install tmux | |
| # install oh my tmux | |
| cd | |
| git clone https://github.com/gpakosz/.tmux.git | |
| ln -s -f .tmux/.tmux.conf | |
| cp .tmux/.tmux.conf.local . |
This file contains hidden or 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
| from pyfiglet import Figlet | |
| f = Figlet(font='slant') | |
| print(f.renderText('Welcome!')) | |
| # _ __ __ __ | |
| #| | / /__ / /________ ____ ___ ___ / / | |
| #| | /| / / _ \/ / ___/ __ \/ __ `__ \/ _ \/ / | |
| #| |/ |/ / __/ / /__/ /_/ / / / / / / __/_/ | |
| #|__/|__/\___/_/\___/\____/_/ /_/ /_/\___(_) |
This file contains hidden or 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 numpy as np | |
| from time import sleep | |
| from sailing import SailingGridworld | |
| import random | |
| gamma = 0.9 | |
| # Set up the environment | |
| env = SailingGridworld(rock_penalty=-2) |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # encoding: utf-8 | |
| """ | |
| progressbar.py | |
| Created by Shuailong on 2017-05-20. | |
| Progress bar and logger. |
This file contains hidden or 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
| # coding: utf-8 | |
| ''' | |
| Calculate the mean and variance of each dimension of glove or w2v. | |
| ''' | |
| import argparse | |
| from tqdm import tqdm | |
| import torch | |
| parser = argparse.ArgumentParser( |