This file contains 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
tap "golangci/tap" | |
tap "gromgit/fuse" | |
tap "grpc/grpc" | |
tap "homebrew/bundle" | |
tap "homebrew/cask" | |
tap "homebrew/core" | |
tap "kyoshidajp/ghkw" | |
tap "px4/px4" | |
brew "a2ps" | |
brew "arp-scan" |
This file contains 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
# License: | |
# I hereby state this snippet is below "threshold of originality" where applicable (public domain). | |
# | |
# Otherwise, since initially posted on Stackoverflow, use as: | |
# CC-BY-SA 3.0 skyking, Glenn Maynard, Axel Huebl | |
# http://stackoverflow.com/a/31047259/2719194 | |
# http://stackoverflow.com/a/4858123/2719194 | |
import builtins | |
import types |
This file contains 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 chainer import cuda | |
from chainer import function | |
from chainer.utils import type_check | |
import numpy as np | |
import cupy as cp | |
def _kern(): | |
return cuda.elementwise( | |
'T cond, T x, T slope', 'T y', |
This file contains 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
fruits = ['apple', 'banana', 'grape'] | |
for fruit in fruits: | |
print(fruit) |
This file contains 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
$ cd | |
$ tar zxvf ~/Downloads/gnat-gpl-2014-x86_64-darwin-bin.tar.gz | |
$ cd gnat-gpl-2014-x86_64-darwin-bin | |
$ sudo ./doinstall |
m/nを切り上げる
(m + n - 1) / n
m/nを切り下げる
m / n
m/nを四捨五入する
This file contains 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
#include <numeric> | |
using namespace std; | |
// T accumulate( InputIt first, InputIt last, T init ); | |
string concatvec(vector<string> expr){ return accumulate(expr.begin(), expr.end(), string(""));} | |
int main(){ | |
vector<string>vs; // 適当な文字列を入れてく | |
string s = concatvec(vs); |
This file contains 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
long long combination(int n, int r){ | |
long long i = 1; | |
int k = r>n-r?n-r:r, cnt; | |
if(k < 0) return 0; | |
for(cnt = 1; cnt <= k; cnt++){ | |
i *= n - cnt + 1; | |
i /= cnt | |
} | |
return i; | |
} |
This file contains 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
#define MOD 100000007 | |
long long comb(int P_, int Q_){ | |
static const int N_ = 1020; | |
static long long C_[N_][N_]; | |
if(C_[0][0]==0){ | |
int i,j; | |
for(i = 0; i < N_; ++i) C_[i][0] = C_[i][i] = 1; | |
for(i = 0; i < N_; ++i) for(j = 1; j < i; ++j) C_[i][j] = (C_[i-1][j-1] + C_[i-1][j])%MOD; |
NewerOlder