Skip to content

Instantly share code, notes, and snippets.

View tomoki's full-sized avatar

Tomoki Imai tomoki

View GitHub Profile
@tomoki
tomoki / main.cpp
Created March 28, 2017 14:14
あのキーボード
#include "mbed.h"
#include "USBKeyboard.h"
// これをコンパイルするには、 mbed のオンラインコンパイラを使います。
// あと https://developer.mbed.org/handbook/USBKeyboard が必要で、
// 具体的には USBKEyboard_Hello_World なるプロジェクトを↑のページから
// import して、このプログラムを main.cpp に上書きすればいいと思う。
//USBKeyboard
USBKeyboard keyboard;
@tomoki
tomoki / merge_mono_to_full.py
Last active January 27, 2016 13:22
merge_mono_to_full.py
#!/usr/bin/env python
import sys
timing = []
phoms = []
with open(sys.argv[1]) as i:
for line in i:
splitted = line.strip().split(" ")
timing.append((splitted[0], splitted[1]))
@tomoki
tomoki / from_phonemes_demo_mono.py
Created January 27, 2016 13:08
from_phonemes_demo_mono.py
#!/usr/bin/env python
import sys
timing = []
phoms = []
with open(sys.argv[1]) as i:
for line in i:
splitted = line.strip().split(" ")
timing.append((float(splitted[0]), float(splitted[1])))
#!/usr/bin/env python
import sys
phoms = []
with open(sys.argv[1]) as i:
for line in i:
phoms.append(line.strip().split(" ")[2])
m = {
@tomoki
tomoki / conv_atr503.py
Created January 27, 2016 09:11
ATR503 sentence.txt converter for Julius segmentation kit
#!/usr/bin/env python3
import sys
import os
with open(sys.argv[1], encoding="euc-jp") as f:
for line in f:
(n, k, y) = line.strip().split(":")
with open(os.path.join(sys.argv[2], str(n) + ".txt"), "w", encoding="utf-8") as t:
if(y[-1] == '。'):
[B] map[A,B](from: [A]&, func: A => B):
let dist: [B]
to.reserve(v.size())
for a in from:
to.push_back(func(a))
return to
bool cango_sub(n: int, x: [int]&, d: int, i: int, l: int):
Require Import Classical.
Theorem Peirce: forall (P Q: Prop), ((P -> Q) -> P) -> P.
Proof.
intros.
apply NNPP.
set nosmoothscroll
set autoupdategist
let completionengines = ["google"]
let searchalias g = "google"
map d closeTab
map u lastClosedTab
map <C-n> nextTab
map <c-p> previousTab
@tomoki
tomoki / gist:4e196f1cfd5ae8c6664e
Created November 2, 2014 14:32
Code runner yosen B
// #ifdef DEBUG
// #define _GLIBCXX_DEBUG
// #endif
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
@tomoki
tomoki / gist:56ccd7db6d2033ea29df
Created November 2, 2014 10:56
Code runner yosen A
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>