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 threading import Thread | |
from Queue import Queue | |
''' | |
an alternative to Python's ThreadPool, but this version can make use of any kind of functions | |
''' | |
class ThreadPool: | |
def __init__(self, cnt): |
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 fastcluster import linkage | |
from collections import deque | |
from sklearn.metrics import mean_squared_error | |
import numpy | |
def f_creator(coef, intercept): | |
def f(x): | |
return intercept + coef * x | |
return f |
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
$ babel --version | |
5.8.29 (babel-core 5.8.29) |
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 with global option because node.js has two kinds of package installs, | |
# one is 'global' everything in the computer can use the global packages | |
# another one is 'local' only the designated area can use the local packages | |
# here we want babel (as a system-wide program) can be used from anywhere | |
$ npm install --global babel |
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
$ node --version | |
v4.2.1 | |
$ npm --version | |
3.3.10 |
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
$ nvm alias default 4.2.1 |
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
# never installed before | |
$ nvm install v4.2.1 | |
# upgrading | |
$ nvm install v4.2.1 --reinstall-packages-from=<your_old_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
$ nvm | |
Node Version Manager | |
Usage: | |
nvm help Show this message | |
nvm --version Print out the latest released version of nvm | |
nvm install [-s] <version> Download and install a <version>, [-s] from source. Uses .nvmrc if available | |
nvm uninstall <version> Uninstall a version | |
nvm use <version> Modify PATH to use <version>. Uses .nvmrc if available |
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
$ brew info nvm | |
nvm: stable 0.29.0, HEAD | |
Manage multiple Node.js versions | |
https://github.com/creationix/nvm | |
Not installed | |
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/nvm.rb | |
==> Caveats | |
Please note that upstream has asked us to make explicit managing | |
nvm via Homebrew is unsupported by them and you should check any |
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
$ brew search nvm | |
convmv mvnvm nvm |