This file contains hidden or 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 <cstdio> | |
#include <ratio> | |
template <typename R, intmax_t N> | |
struct ratio_pow { | |
using prev = typename ratio_pow<R, N-1>::value; | |
using value = std::ratio<R::num * prev::num, R::den * prev::den>; | |
}; | |
template <typename R> |
This file contains hidden or 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
"---------------------------------------------------- | |
" appearance | |
"---------------------------------------------------- | |
" | |
syntax on | |
set laststatus=2 | |
set t_Co=256 | |
" colorscheme desert |
This file contains hidden or 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
# README: | |
# Copy this file to /usr/lib/systemd/system/ | |
# sudo systemctl daemon-reload | |
# systemctl enable ipython-notebook | |
# systemctl start ipython-notebook | |
# The WorkingDirectory and ipython-dir must exist | |
# If you don't want anything fancy, go to http://127.0.0.1:8888 to see your notebook | |
# wheneber you want it | |
[Unit] |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
fa = open("a.txt", "r") | |
fb = open("b.txt", "r") | |
for a, b in zip(fa, fb): | |
print a.rstrip() | |
print b.rstrip() | |
fa.close() | |
fb.close() |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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
// 本体 | |
function DMMCalenderFromGmail() { | |
// prefixとsuffixに挟まれた文字列の取得 | |
function findLine(body, prefix, suffix) { | |
var istart, iend; | |
istart = body.indexOf(prefix) + prefix.length; | |
iend = istart + body.slice(istart).indexOf(suffix); | |
return body.slice(istart, iend); | |
} | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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-once | |
#include | |
#cloud-config | |
#cloud-boothook | |
sudo apt-get update | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ |
This file contains hidden or 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 requests | |
from requests.adapters import HTTPAdapter | |
from requests.packages.urllib3.poolmanager import PoolManager | |
class SourceAddressAdapter(HTTPAdapter): | |
def __init__(self, source_address, **kwargs): | |
self.source_address = source_address | |
super(SourceAddressAdapter, self).__init__(**kwargs) |
OlderNewer