All of the following information is based on go version go1.8.3 darwin/amd64.
(Bold = supported by go out of the box, ie. without the help of a C compiler, etc.)
androiddarwin
| type Integer interface { | |
| int | int8 | int16 | int32 | int64 | uint | uint8 | uint16 | uint32 | uint64 | |
| } | |
| func minBitwise[T Integer](a, b T) T { | |
| _a := uint64(a) | |
| _b := uint64(b) | |
| c := -((_a - _b) >> 63) | |
| return T(_a&c | _b&^c) | |
| } |
| import numpy as np | |
| np.set_printoptions(suppress=True) | |
| ec_cnt = 2 # end consumer industries count (always last in the Q) | |
| precision = 2 | |
| # cross industry consumption coefficients (0..1) with trade (=1) - given | |
| A = np.array([ | |
| [0, 0.2, 0, 0, 0], |
| rm *.pem | |
| rm *.srl | |
| rm *.cnf | |
| # 1. Generate CA's private key and self-signed certificate | |
| openssl req -x509 -newkey rsa:4096 -days 365 -nodes -keyout ca-key.pem -out ca-cert.pem -subj "/C=FR/ST=Occitanie/L=Toulouse/O=Test Org/OU=Test/CN=*.test/[email protected]" | |
| echo "CA's self-signed certificate" | |
| openssl x509 -in ca-cert.pem -noout -text |
| // Standard normal cumulative distribution function. | |
| fn normal_dist(z: f64) -> f64 { | |
| let t = 1.0 / (1.0 + 0.2316419 * z.abs()); | |
| let d = 0.3989423 * (-z * z / 2.0).exp(); | |
| let p = | |
| t * d * (0.3193815 + t * (-0.3565638 + t * (1.781478 + t * (-1.821256 + t * 1.330274)))); | |
| 1.0 - p | |
| } |
| class CharRnn(nn.Module): | |
| def __init__(self, vocab_size, n_fac, n_hidden, batch_size, layers=2): | |
| super().__init__() | |
| self.e = nn.Embedding(vocab_size, n_fac) | |
| self.rnn = nn.LSTM(n_fac, n_hidden, layers, dropout=0.1) | |
| self.l_out = nn.Linear(n_hidden, vocab_size) | |
| self.n_hidden = n_hidden | |
| self.layers = layers | |
| self.init_hidden_state(batch_size) |
| def detach_from_history(h): | |
| if type(h) == torch.Tensor: | |
| return h.detach() | |
| return tuple(detach_from_history(v) for v in h) | |
| class CharRnn(nn.Module): | |
| def __init__(self, vocab_size, n_fac, n_hidden, batch_size): | |
| super().__init__() |
| class CharRnn(nn.Module): | |
| def __init__(self, vocab_size, n_fac, n_hidden): | |
| super().__init__() | |
| self.e = nn.Embedding(vocab_size, n_fac) | |
| self.rnn = nn.RNN(n_fac, n_hidden) | |
| self.l_out = nn.Linear(n_hidden, vocab_size) | |
| self.n_hidden = n_hidden | |
| def forward(self, inp): | |
| b_size, v_size = inp.size() |
| package main | |
| import ( | |
| "fmt" | |
| "sort" | |
| ) | |
| type VInt int | |
| func (vi VInt) Value() int { |
| package rtree | |
| import ( | |
| "math" | |
| "math/rand" | |
| "testing" | |
| "github.com/dhconnelly/rtreego" | |
| rtreego2 "github.com/patrick-higgins/rtreego" | |
| rtreego3 "github.com/tidwall/rtree" |