Skip to content

Instantly share code, notes, and snippets.

<meta charset="utf-8">
<title>keydownのテスト</title>
<p id="label"></p>
<script>
document.onkeydown = function(e) {
var elem = document.getElementById("label");
if(elem.innerHTML == "") {
elem.innerHTML = "aaa";
} else {
elem.innerHTML = "";
@tomoumi-n
tomoumi-n / Combinator.scala
Created April 28, 2016 17:44
部分集合を算出する
def combination[T](set: Set[T], size: Int): Set[Set[T]] = {
def solve[T](list: List[T], size: Int): Set[Set[T]] = {
if(list.size < size) {
Set.empty[Set[T]]
} else {
if(size == 1) {
list.map(item => Set(item)).toSet
} else {
def loop(remain: List[T], set: Set[Set[T]] = Set.empty[Set[T]]): Set[Set[T]] = {
remain match {
@tomoumi-n
tomoumi-n / mogenerator.sh
Created April 10, 2015 02:22
MogeneratorでSwiftのクラスを出力する
mogenerator --template-var arc=true -m XXX.xcdatamodeld -O ./TARGET_DIR/ --swift
@tomoumi-n
tomoumi-n / oauth2table.sql
Created March 12, 2015 01:24
SQL to add oauth2 table to aipo-database org001
-- oauth2_token table query
CREATE TABLE OAUTH2_TOKEN
(
TOKEN_ID INTEGER NOT NULL,
USER_ID VARCHAR(255) NOT NULL,
TOKEN VARCHAR(255) NOT NULL,
CREATE_DATE TIMESTAMP NOT NULL,
EXPIRE_TIME TIMESTAMP NOT NULL,
SCOPE VARCHAR(255),
@tomoumi-n
tomoumi-n / aipobuild.sh
Created March 12, 2015 01:22
Script for full build
# set in aipo-opensocial dir
# aipo is set in same dir
echo 'full build start!'
cd ../aipo
mvn clean
cd ../aipo-opensocial
mvn clean
mvn install
cd ../aipo
mvn install