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 email.mime.text import MIMEText | |
| from email.utils import formatdate | |
| import smtplib | |
| addr = "" | |
| pswd = "" | |
| subj = "" | |
| body = "" |
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
| // Google Calendar Line Bot | |
| // Main | |
| // Post処理するやつ | |
| function doPost(e) { | |
| var json = JSON.parse(e.postData.contents); | |
| var message = json.events[0].message.text; | |
| if (message != null) { |
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
| # python でランダムな数列リストを出力するワンライナー | |
| python -c 'num=5;import random;print(random.sample(range(1,num+1),num))' |
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 bash | |
| set -eu | |
| if [ $# -lt 2 ] || [ $# -gt 2 ]; then | |
| echo "Usage: $0 /PATH/TO/INPUT_DIR /PATH/TO/OUTPUT_DIR" | |
| exit 1 | |
| fi | |
| if [ ! -d "$1" ]; then | |
| echo "No such directory $1" |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| import math | |
| import nist_nlp01_1 | |
| def test_entropy(document, unigram): |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| from collections import defaultdict | |
| def train_unigram(file_name): | |
| my_dict = defaultdict(int) |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| import sys | |
| from collections import defaultdict | |
| def count_words(file_name): | |
| file_open = open(file_name, 'r') | |
| my_dict = defaultdict(int) |
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
| # brew install cliclick | |
| # Require window position adjustment | |
| cliclick c:300,180 c:450,620; sleep 2; for i in `seq 100`;do cliclick -w1 c:310,600;done |
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 <stdio.h> | |
| int len1, len2, i, counts[32], result; | |
| char s[131072], t[131072]; | |
| int main(void){ | |
| // input | |
| scanf("%d %d", &len1, &len2); | |
| scanf("%s", s); |
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 python3 | |
| # -*- coding: utf-8 -*- | |
| # fishnumv1.py | |
| # 2016/10/11(火) | |
| # walkingmask | |
| # http://b.hatena.ne.jp/entry/www.slideshare.net/DoomKobayashi/ver1-png | |
| def machineA(x): | |
| return x+1 |