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
# coding: utf-8 | |
import random | |
import bisect | |
# 手本: http://qiita.com/methane/items/045982489cd7cf3720b3 | |
# 変更点: append のメソッドを追加。 | |
class WeightChoice(object): | |
def append(self, item, score): |
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
# coding: utf-8 | |
from __future__ import unicode_literals, print_function | |
import sqlite3 | |
import itertools | |
import types | |
import uuid | |
def table(connection, iterable, name=None): | |
if name is None: |
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
UPPER_LINE_SYMMETRY = 'ABCDEHIKMOTUVWXY' | |
HORIOZANAL_LINE_SYMMETRY = 'BCDEHIKOX' | |
VERTICAL_LINE_SYMMETRY = 'AHIMOTUVWXY' | |
POINT_SYMMETRY = 'HINOSXZ' | |
BOTH_SYMMETRY = 'HIOX' | |
MIRROR_PAIR = 'MW' | |
ROTATION_PAIR = 'NZ' |
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
# coding: utf-8 | |
from __future__ import print_function | |
# kwargs にドメイン名による名前空間作っていろいろさせると捗る | |
def printer(x, *args, **kwargs): | |
print(x) | |
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>ここにタイトルを入れる</title> | |
<!-- <script src="http://code.jquery.com/jquery-latest.js"></script>--> | |
<style> | |
.simple { | |
margin: 0 auto; | |
font-family: "Courier New", monospace; | |
width: 50%; min-width: 80em; |
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
笑わせようと必死過ぎて笑えないお笑い芸人 | |
ゆるキャラ競争の激化 |
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
#!/bin/sh | |
ulimit -c 0 | |
ulimit -d 8 | |
ulimit -l 64 | |
ulimit -m 0 | |
ulimit -n 100 | |
ulimit -p 8 | |
ulimit -s 120 | |
ulimit -t 1 | |
ulimit -v 30000 |
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
sudo apt-get update | |
sudo apt-get install -y language-pack-ja | |
sudo apt-get install -y curl | |
sudo apt-get install -y python-pip virtualenvwrapper python-dev |
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
$ seq 1 10 | xargs -P 1 -L 2 echo | |
# 出力結果 | |
1 2 | |
3 4 | |
5 6 | |
7 8 | |
9 10 |
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
#!/bin/sh | |
exec < $1 | |
shift | |
exec >> $1 | |
shift | |
exec $* |