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
| # encoding: utf8 | |
| """ | |
| Created on 2017.10.24 | |
| @author: yalei | |
| """ | |
| import numpy as np |
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
| # 0. system: ubuntu or centos? | |
| if [ $UID -ne 0 ] | |
| then | |
| echo "Error: must be root to run this script." | |
| exit -1 | |
| fi | |
| is_ubuntu=(` cat /etc/issue | grep -i ubuntu `) | |
| password=$1 | |
| # 1. zsh |
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
| # encoding: utf8 | |
| """ | |
| Created on 2017.08.17 | |
| @author: yalei | |
| """ | |
| from __future__ import unicode_literals |
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 edu.princeton.cs.algs4.MinPQ; | |
| import edu.princeton.cs.algs4.Stack; | |
| import edu.princeton.cs.algs4.StdIn; | |
| import edu.princeton.cs.algs4.StdOut; | |
| public class HorseRun{ | |
| private int n = 10; | |
| private int count; | |
| private Stack<Point> road; |
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
| # encoding: utf8 | |
| """ | |
| Created on 2017.06.27 | |
| @author: yalei | |
| Reference: | |
| 1. http://www.ruanyifeng.com/blog/2017/06/smtp-protocol.html | |
| 2. http://blog.online-domain-tools.com/2014/11/14/how-to-verify-email-address/ |
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
| microbenchmark:::microbenchmark(system('curl http://127.0.0.1:9123/predict?val=190')) | |
| microbenchmark:::microbenchmark(system('curl http://127.0.0.1:9124/predict?val=190')) |
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
| # encoding: utf8 | |
| """ | |
| Created on 2017.03.06 | |
| @author: yalei | |
| """ | |
| import itertools |
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
| # encoding: utf8 | |
| """ | |
| Created on 2017.01.21 | |
| @author: yalei | |
| """ | |
| import inspect | |
| import re |
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
| # encoding: utf8 | |
| """ | |
| Created on 2017.01.21 | |
| @author: yalei | |
| """ | |
| import sys | |
| import traceback |
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
| >>> def f(): | |
| ... a = 1 | |
| ... locals()['a'] = 123 | |
| ... print locals() | |
| ... | |
| >>> f() | |
| {'a': 1} | |
| >>> def f(): | |
| ... locals()['a'] = 123 | |
| ... print locals() |