Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
library(tidyverse) | |
library(gganimate) | |
NUMPLAYERS = 45 | |
ROUNDS = 5000 | |
INITWEALTH = 45 | |
#initialize the bank | |
#columns wealths of the NUMPLAYERS players | |
#rows show wealths of each of the ROUNDS ticks of the clocks |
alias 'pg_sql_restore'='PGPASSWORD=SOMEPASSWORD psql -cO -U username -d dbname -h localhost -f ' # + set path to backup file | |
alias 'pg_tar_restore'='PGPASSWORD=SOMEPASSWORD pg_restore -cO -U username -d dbname -h localhost ' # + set path to backup file |
require 'mina/bundler' | |
require 'mina/git' | |
set :application, "forum" | |
set :domain, '%SERVERNAME%' | |
set :deploy_to, "%PATH-TO-APPLICATION%" | |
set :repository, '%REPOSITORY-URL%.git' | |
set :branch, 'master' | |
set :login, "%LOGIN%" |
require 'mina/bundler' | |
require 'mina/git' | |
set :application, "forum" | |
set :domain, '%SERVERNAME%' | |
set :deploy_to, "%PATH-TO-APPLICATION%" | |
set :repository, '%REPOSITORY-URL%.git' | |
set :branch, 'master' | |
set :login, "%LOGIN%" |
Related Setup: https://gist.github.com/hofmannsven/6814278
Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import math,random | |
import numpy as np | |
def rand(a, b): | |
return (b-a)*random.random() + a | |
def dtanh(y): | |
return 1.0-y*y | |
def mat(x): |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
<?php | |
/* | |
tcp dns client for google dns over https (https://dns.google.com) | |
ubuntu上使用: | |
在/etc/rc.local里加/usr/bin/php /home/<your_name>/dns2https.php | |
执行: | |
sysv-rc-conf unbound off | |
sysv-rc-conf dnscrypt-proxy off |