Skip to content

Instantly share code, notes, and snippets.

View walkingmask's full-sized avatar
💩
Unchi

Kazuki NAGAMINE walkingmask

💩
Unchi
View GitHub Profile
@walkingmask
walkingmask / send_email_with_gmail.py
Created December 15, 2017 13:56
A example of sending email with gmail.
# -*- coding: utf-8 -*-
from email.mime.text import MIMEText
from email.utils import formatdate
import smtplib
addr = ""
pswd = ""
subj = ""
body = ""
// 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) {
# python でランダムな数列リストを出力するワンライナー
python -c 'num=5;import random;print(random.sample(range(1,num+1),num))'
#!/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"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
import math
import nist_nlp01_1
def test_entropy(document, unigram):
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
from collections import defaultdict
def train_unigram(file_name):
my_dict = defaultdict(int)
#!/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)
# 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
#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);
#!/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