Skip to content

Instantly share code, notes, and snippets.

View keydown_test.html
<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 Apr 28, 2016
部分集合を算出する
View Combinator.scala
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 Apr 10, 2015
MogeneratorでSwiftのクラスを出力する
View mogenerator.sh
mogenerator --template-var arc=true -m XXX.xcdatamodeld -O ./TARGET_DIR/ --swift
@tomoumi-n
tomoumi-n / oauth2table.sql
Created Mar 12, 2015
SQL to add oauth2 table to aipo-database org001
View oauth2table.sql
-- 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 Mar 12, 2015
Script for full build
View aipobuild.sh
# 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