#前言 由于大家都懂的, 国内使用go get的时候, 经常会各种失败, 如果有vpn的话, 打开vpn, 问题就解决了, 但vpn其实挺不灵活的.
相对来说shadowsock则灵活得多.
#解决方案 shadowsock + Privoxy
思路就是, 使用shadowsock建立一个本地sock5代理, 但因为go get 需要http代理, 所以需要使用privoxy把sock5代理转为http代理.
| # Use multirust to manage multiple Rust builds: | |
| # 1. Install multirust | |
| curl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh | |
| # 2. Show installed Rust builds | |
| multirust list-toolchains | |
| # 3. Install new build (stable, beta, nightly) | |
| multirust update nightly |
| ZigZag-Encoding | |
| --------------- | |
| Maps negative values to positive values while going back and | |
| forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...) | |
| (i >> bitlength-1) ^ (i << 1) | |
| with "i" being the number to be encoded, "^" being | |
| XOR-operation and ">>" would be arithemtic shifting-operation |
#前言 由于大家都懂的, 国内使用go get的时候, 经常会各种失败, 如果有vpn的话, 打开vpn, 问题就解决了, 但vpn其实挺不灵活的.
相对来说shadowsock则灵活得多.
#解决方案 shadowsock + Privoxy
思路就是, 使用shadowsock建立一个本地sock5代理, 但因为go get 需要http代理, 所以需要使用privoxy把sock5代理转为http代理.
| 1. Go to Sublime Text to: Tools -> Build System -> New Build System | |
| and put the next lines: | |
| { | |
| "cmd": ["python3", "-i", "-u", "$file"], | |
| "file_regex": "^[ ]File \"(...?)\", line ([0-9]*)", | |
| "selector": "source.python" | |
| } | |
| Then save it with a meaningful name like: python3.sublime-build |
| These commands are based on a askubuntu answer http://askubuntu.com/a/581497 | |
| To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below. | |
| USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING. | |
| ABSOLUTELY NO WARRANTY. | |
| If you are still reading let's carry on with the code. | |
| sudo apt-get update && \ | |
| sudo apt-get install build-essential software-properties-common -y && \ | |
| sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \ |
ec2-54-152-134-146.compute-1.amazonaws.com.Follow the installation instructions on the Airflow website.
To configure Airflow to use Postgres rather than the default Sqlite3, go to airflow.cfg and update this configuration to LocalExecutor:
# The executor class that airflow should use. Choices includeSay you have an array for which the ith element is the price of a given stock on day i.
If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
Example 1: Input: [7, 1, 5, 3, 6, 4] Output: 5
| import torch | |
| import torch.nn as nn | |
| import numpy as np | |
| import torch.optim as optim | |
| from torch.autograd import Variable | |
| # (1, 0) => target labels 0+2 | |
| # (0, 1) => target labels 1 | |
| # (1, 1) => target labels 3 | |
| train = [] |