Skip to content

Instantly share code, notes, and snippets.

@kashitan
kashitan / city_list.cv
Last active January 29, 2016 00:14
地域コード一覧
pref_code,city_code,city
01,01101,札幌市中央区
01,01102,札幌市北区
01,01103,札幌市東区
01,01104,札幌市白石区
01,01105,札幌市豊平区
01,01106,札幌市南区
01,01107,札幌市西区
01,01108,札幌市厚別区
01,01109,札幌市手稲区
@kashitan
kashitan / sample.iim
Last active January 28, 2016 23:57
境界データ自動ダウンロードマクロ
VERSION BUILD=8340723 RECORDER=CR
SET !REPLAYSPEED SLOW
SET !TIMEOUT_STEP 30
URL GOTO=http://e-stat.go.jp/SG2/eStatGIS/page/download.html
TAG POS=1 TYPE=DIV ATTR=ID:contents
TAG POS=1 TYPE=SELECT ATTR=ID:censusclass_list CONTENT=%国勢調査
TAG POS=1 TYPE=SELECT ATTR=ID:census_list CONTENT=%A002005212010
TAG POS=1 TYPE=INPUT:CHECKBOX ATTR=ID:step2_T000572 CONTENT=YES
TAG POS=2 TYPE=INPUT:BUTTON ATTR=*
TAG POS=1 TYPE=SELECT ATTR=ID:pref_list CONTENT=%13
@kashitan
kashitan / elasticsearch.repo
Last active February 1, 2016 01:33
yumのelasticsearchリポジトリ
[elasticsearch-1.4]
name=Elasticsearch repository for 1.4.x packages
baseurl=http://packages.elastic.co/elasticsearch/1.4/centos
gpgcheck=1
gpgkey=http://packages.elastic.co/GPG-KEY-elasticsearch
enabled=1
[elasticsearch-2.x]
name=Elasticsearch repository for 2.x packages
baseurl=http://packages.elastic.co/elasticsearch/2.x/centos
@kashitan
kashitan / load.R
Created November 30, 2015 05:34
Python Machine Learning Chapter.3
X <- iris[, c('Petal.Length','Petal.Width')] # or iris[, 3:4](pythonの配列の添字は0始まりなので1ずつずれる)
y <- iris$Species # or iris[, 5]
@kashitan
kashitan / similar.R
Last active November 20, 2015 11:45
FindSimilarFaces APIのサンプル
library(httr)
res <- POST(url = 'https://api.projectoxford.ai/face/v0/findsimilars',
add_headers('Content-Type' = 'application/json',
'Ocp-Apim-Subscription-Key' = '[Subscription key]'),
body = '{
"faceId":"[比較元のFace ID]",
"faceIds": [
"[比較先のFace ID]",
"[比較先のFace ID]",
@kashitan
kashitan / follow_link.R
Last active November 10, 2015 23:18
rvest::follow_linkサンプル
@kashitan
kashitan / verification.R
Last active November 20, 2015 10:11
Verification APIのサンプル
library(httr)
res <- POST(url = 'https://api.projectoxford.ai/face/v0/verifications',
add_headers('Content-Type' = 'application/json',
'Ocp-Apim-Subscription-Key' = '[Subscription key]'),
body = '{
"faceId1":"[比較元のFace ID]",
"faceId2":"[比較先のFace ID]"
}'
)
@kashitan
kashitan / detection.R
Last active November 9, 2015 06:16
Detection API実行サンプル(JSON版)
library(httr)
# ネット上の画像の場合はJSONでURLをPOST
res <- POST(url = 'https://api.projectoxford.ai/face/v0/detections',
query = list(analyzesFaceLandmarks=TRUE,
analyzesAge=TRUE,
analyzesGender=TRUE,
analyzesHeadPose=TRUE),
add_headers('Content-Type' = 'application/json',
'Ocp-Apim-Subscription-Key' = '[Subscription key]'),
@kashitan
kashitan / detection.R
Last active November 9, 2015 06:17
Detection API実行サンプル
library(httr)
img <- upload_file([画像ファイルのパス])
res <- POST(url = 'https://api.projectoxford.ai/face/v0/detections',
query = list(analyzesFaceLandmarks=FALSE,
analyzesAge=TRUE,
analyzesGender=TRUE,
analyzesHeadPose=FALSE),
add_headers('Content-Type' = 'application/octet-stream',
@kashitan
kashitan / ipython_config.py
Created August 4, 2015 00:23
Jupyter notebookのconfigファイル
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 9999 # or whatever you want; be aware of conflicts with CDH
PWDFILE='パスワードファイルのパス'
c.NotebookApp.password = open(PWDFILE).read().strip()
c.NotebookApp.base_url = '/jupyter/'
c.NotebookApp.webapp_settings = {'static_url_prefix':'/jupyter/static/'}
c.NotebookApp.certfile = u'証明書ファイル(*.pem)のパス'