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
sudo tlmgr update --self --all | |
sudo tlmgr install \ | |
collection-latexrecommended collection-fontsrecommended collection-langjapanese \ | |
newtx txfonts helvetic fontaxes boondox \ | |
kastrup tex-gyre \ | |
here multirow letltxmacro \ | |
beamer bxdpx-beamer pgfplots \ | |
standalone \ | |
refcheck |
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
def xtime(x): | |
res = (x << 1) ^ (0x1b if (x & 0x80) else 0x00) | |
return res & 0xFF | |
def dot(x, y): | |
product = 0 | |
mask = 0x01 | |
while mask: | |
if y & mask: | |
print(hex(x)) |
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
import math | |
def find_order(m, N): | |
for r in range(1, N): | |
if pow(m, r, N) == 1: | |
return r | |
N = 35 | |
for m in range(2, N): | |
print('----------') |
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
'.source.proverif': | |
'editor': | |
'commentStart': '(* ' | |
'commentEnd': ' *)' | |
'increaseIndentPattern': 'process' |
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
Host github.com | |
HostName github.com | |
IdentityFile ~/.ssh/id_ed25519 | |
User git | |
Host bitbucket.org | |
HostName bitbucket.org | |
IdentityFile ~/.ssh/id_ed25519 | |
User git | |
Port 22 |
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
# 答えの確認用 | |
import numpy as np | |
p = 337 | |
f = np.poly1d([1,0,0,0,0,0,0,0,1]) | |
p1 = np.poly1d([334, 180, 335, 283, 72, 123, 112, 19]) | |
p2 = np.poly1d([325, 304, 135, 76, 127, 83, 191, 272]) |
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
TYPE=Ethernet | |
PROXY_METHOD=none | |
BROWSER_ONLY=no | |
BOOTPROTO=static | |
DEFROUTE=yes | |
IPV4_FAILURE_FATAL=no | |
NAME=enp0s8 | |
DEVICE=enp0s8 | |
ONBOOT=yes | |
ZONE=public |
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
# ~/.ssh/config | |
Host local1 | |
Port 22 | |
HostName 127.0.0.1 | |
User root | |
Host local2 | |
Port 22 | |
HostName 192.168.1.2 |
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
# https://en.wikipedia.org/wiki/Binary_GCD_algorithm | |
def binary_gcd(a, b): | |
g = 1 | |
odd = 1 | |
while a > 0: | |
if (a & odd) == 0 and (b & odd) == 0: | |
a >>= 1 # g /= 2 | |
b >>= 1 # b /= 2 | |
g <<= 1 # g *= 2 |
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
import socket | |
import urllib2 | |
true_socket = socket.socket | |
def make_bound_socket(source_ip): | |
def bound_socket(*a, **k): | |
sock = true_socket(*a, **k) | |
sock.bind((source_ip, 0)) | |
return sock | |
return bound_socket |