This file contains 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
var bot = new twitter({ | |
consumer_key : '', | |
consumer_secret : '', | |
access_token_key : '', | |
access_token_secret : '' | |
}); | |
bot.post('statuses/update', {status: 'I am a tweet'}, function(error, tweet, response){ | |
if (!error) { | |
console.log(tweet); |
This file contains 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 -*- | |
import cv2 | |
import numpy as np | |
print u'OpenCV Version:'+cv2.__version__ | |
import sys | |
print u'Python Version:'+str(sys.version_info) | |
img = cv2.imread('../query/test21.jpg') |
This file contains 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 -*- | |
import cv2 | |
import numpy as np | |
print u'OpenCV Version:'+cv2.__version__ | |
import sys | |
print u'Python Version:'+str(sys.version_info) | |
img = cv2.imread('./test_data/image000001.png') |
This file contains 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
n <- 100 # num. of mesh | |
a <- 1.0 # x-axis param | |
b <- 1.0 # y-axis param | |
r <- 2.5 # when r is 2.5, it's superelipse | |
x <- seq( -a, a, length = n ) | |
y <- seq( -b, b, length = n ) | |
z <- matrix(0, n, n) | |
for (i in 1:n) { | |
for (j in 1:n) { | |
# superelipse |
This file contains 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 | |
import numpy as np | |
import cv2 | |
# mean + diff | |
def WaveletTransformAxisY(img): | |
tmp = img.astype(np.uint16) | |
row, col = tmp.shape[:2] | |
size = row/2 | |
dst = np.zeros(tmp.shape[:2], np.uint16) |
This file contains 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 -*- | |
''' | |
adjust contrast based on human's property | |
Inverse S curve | |
see also: http://ci.nii.ac.jp/els/110007380719.pdf?id=ART0009242456&type=pdf&lang=jp&host=cinii&order_no=&ppv_type=0&lang_sw=&no=1437772911&cp= | |
''' | |
import sys | |
import numpy as np | |
import cv2 |
This file contains 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
(function() { | |
var title = document.getElementsByTagName("title")[0].innerHTML; | |
title = title.replace(/(^\s*)|(\s*$)/g, ''); | |
var url = document.URL; | |
var forpukiwiki="[[" + title + ">" + url + "]]"; | |
function ev(e) { | |
e.preventDefault(); | |
e.clipboardData.setData('text/plain', url); | |
} | |
document.addEventListener('copy', (function(){ |
This file contains 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
#!/bin/sh | |
# see also http://mizti.hatenablog.com/entry/2013/01/27/204343 | |
usage() { | |
echo "実行するには2個の引数が必要です。 | |
第一引数: 監視対象ファイル名 | |
第二引数: 監視対象ファイルが更新された際に実行されるコマンド | |
例: ./autoexec.sh a.cpp 'g++ a.cpp && ./a.cpp'" | |
} | |
update() { | |
echo `openssl sha256 -r $1 | awk '{print $1}'` |
This file contains 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
(ql:quickload '(:drakma :plump :clss :babel :guess)) | |
(defun charset-to-encoding (charset) | |
(cond | |
((string= charset "EUC-JP") :eucjp) | |
((string= charset "UTF-8") :utf-8) | |
((string= charset "SJIS") :cp932))) | |
(defun guess-encoding (input-vector) | |
(charset-to-encoding (guess:CES-GUESS-FROM-VECTOR input-vector :jp))) |
This file contains 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
(use srfi-19) | |
(define (runtime) | |
(time->seconds (current-time))) | |
(define (find-divisor n test-divisor) | |
(cond ((> (square test-divisor) n) n) | |
((divides? test-divisor n) test-divisor) | |
(else (find-divisor n (+ test-divisor 1))))) | |
(define (divides? a b) (= (remainder b a) 0)) |