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
# RewriteMap する前に RewriteEngine on が必要. | |
# これをやっておかないと,map lookup FAILED というエラーではまる. | |
# RewriteMap を呼び出す時点で,「RewriteEngine on」してないから使えないよ,というエラーを出してくれれば楽なのに‥‥ | |
RewriteEngine on | |
RewriteMap mapper prg:/path/to/mapper | |
<Location /shibboleth-required-area> | |
AuthType shibboleth | |
ShibRequestSetting requireSession 1 | |
ShibUserHeaders on |
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
;; MIME part を表示するときに doc-view-mode を利用しないための設定 | |
;; doc-view-mode を使うようになっていると,applicate/pdf な MIME part | |
;; を表示できずに,単にファイルを保存してしまう. | |
(setq mailcap-mime-data | |
(mapcar | |
(lambda (data) | |
(cons (car data) | |
(delq nil | |
(mapcar | |
(lambda (pair) |
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 chainer | |
from chainer import Link, Chain, Function, Variable, cuda | |
import chainer.functions as F | |
import chainer.links as L | |
import numpy as np | |
class LSTMEncoder(Chain): | |
def __init__(self, vocab_size, embed_size, hidden_size, ignore_label=-1): | |
super(LSTMEncoder, self).__init__( | |
xe = L.EmbedID(vocab_size, embed_size, ignore_label=-1), |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# https://github.com/attardi/wikiextractor が使いやすく,かつ,日本語も適切に扱ってくれることが判明しましたので, | |
# このスクリプトは,今後のメンテナンスの予定はありません. | |
import argparse | |
import codecs | |
import logging | |
import os.path |
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 __future__ import print_function | |
from chainer import cuda | |
cudnn = cuda.cudnn | |
libcudnn = cuda.cudnn.cudnn | |
print(libcudnn.getVersion()) |
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
# perldoc や man などを参照していて、lv をページャに使っていると、以下のように ESC sequence が | |
# 表示される症状に悩まされるようになった.いつからかは不明.Debian Stretch 以後? | |
# | |
# ESC[1mNAMEESC[0m | |
# Config::Simple - simple configuration file class | |
# | |
# 以下のように、LV 環境変数を明示的に指定すると症状が改善された. | |
LV=-c | |
export LV |
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
use constant PRIMITIVES => join( '', 0 .. 9, 'a' .. 'z', 'A' .. 'Z' ); | |
sub encode_base62 { | |
my( $num ) = @_; | |
my @c; | |
do { | |
push( @c, substr( PRIMITIVES, $num % length(PRIMITIVES), 1 ) ); | |
$num = int( $num / length(PRIMITIVES) ); | |
} while( $num ); | |
join( '', reverse @c ); |
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
#!/bin/bash | |
usage(){ | |
cat <<EOF | |
Usage: remote-sudo host0 host1 ... hostN -- command arg0 arg1 ... argN | |
EOF | |
} | |
ALLHOSTS=(node0 node1 node2 node3 node4 node5 node6 node7 node8 node9) | |
DOMAIN=example.jp |
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
#!/bin/sh | |
usage(){ | |
cat <<EOF | |
This script converts the 2-up PDF file into the single page PDF file. | |
For example, http://www.city.yokohama.lg.jp/kankyo/midoriup/jigyo/mori/guidebook.pdf | |
is a PDF file which consists of A3 16 pages, each A3 page contains 2 | |
A4 pages. In order to print the above PDF as a brochure, do the | |
following procedure. |
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
Package: libnccl-dev | |
Pin: version *cuda9.1 | |
Pin-Priority: 999 | |
Package: libnccl-dev | |
Pin: version *cuda9.0 | |
Pin-Priority: 999 | |
Package: libnccl2 | |
Pin: version *cuda9.1 |
OlderNewer