- Visual Studio (VS) 2013 (2008, 2010 亦可)
- Python Tools for Visual Studio (PTVS) 2.1
- [Miniconda3][conda3](Python 官方的安裝檔亦可)
PTVS 的版本可以透過 VS 中 HELP -> About Microsoft Visual Studio 查看。Python 的版本選擇非常多,請參見 PTVS 說明。在這邊是選用 Miniconda3 (Python 3.4) 示範。
## R-benchmark-25 from http://r.research.att.com/benchmarks/R-benchmark-25.R | |
# brew install r [--with-openblas] | |
$ Rscript R-benchmark-25.R 2014-03-01 (六) 00:41 CST | |
Loading required package: Matrix | |
Loading required package: methods | |
Loading required package: lattice | |
Loading required package: SuppDists | |
警告訊息: | |
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, : |
PTVS 的版本可以透過 VS 中 HELP -> About Microsoft Visual Studio 查看。Python 的版本選擇非常多,請參見 PTVS 說明。在這邊是選用 Miniconda3 (Python 3.4) 示範。
import numpy as np | |
rs = np.random.RandomState(seed=5566) | |
n_conditions = 10 | |
# Here we simulate a complex computation, for example, analogy of the magnitude | |
# of gradient decent which expects to be strictly positive. But from the result | |
# we find that it seems to be sometimes negative, we wish to find out when and | |
# what condition our program produces bogus ouput. | |
# | |
# This is the case to use pdb and condition break point |
from datetime import datetime | |
from pytz import timezone # pip install pytz | |
# Setup remote time | |
remote_tz = timezone('US/Pacific') # PST for example | |
remote_dt = remote_tz.localize(datetime(2015, 5, 1, 14, 0)) # May 1, 2015 PM2:00 PST | |
# Setup Taipei local time | |
tpe = timezone('Asia/Taipei') |
$ export CC=clang | |
$ export CXX=clang | |
$ export FFLAGS=-ff2c | |
$ git clone https://github.com/numpy/numpy.git | |
$ cd numpy | |
$ python3 setup.py build | |
$ python3 setup.py install |
if a==b: | |
with open('f.txt') as f: | |
# do something | |
# do something |