Skip to content

Instantly share code, notes, and snippets.

View yuokada's full-sized avatar

Yukihiro Okada (Yuki) yuokada

  • Tokyo, Japan
  • 16:03 (UTC +09:00)
View GitHub Profile
@yuokada
yuokada / convert.py
Last active May 22, 2018 16:26 — forked from foomin10/seiyuu_jisyo.tsv.txt
声優名の辞書ファイル。<http://tomoch.s28.xrea.com/ime.cgi> からコピーして自分の知ってる人だけ大雑把に抽出。
#!/usr/bin/env python3.6
import jaconv
if __name__ == '__main__':
filename = 'ime.cgi'
with open(filename, 'r') as f:
for ln in f.readlines():
parts = ln.strip().split()
kana = jaconv.hira2kata(parts[0])
#!/usr/bin/env python3
"""
【概要】
簡単なナンプレの問題を解くプログラムを書いてみましょう。
【問題】
次のようなナンプレがあります。
・2x2のマス(Box)が縦横ふたつずつ並んだ4x4のマスがある
・それぞれのマスには1~4の数字が入り、それらは行/列の4つのマスに同じ数字がくることはない(行/列の合計は10となる)
・2x2のマス(Box)にも同じ数字がくることはなく、合計は10となる
@yuokada
yuokada / demo.log
Last active February 14, 2018 02:59
% curl -s "http://b.hatena.ne.jp/entry/json/http://www.hatena.ne.jp/" |jq ".bookmarks[].comment" |sort |uniq -c |sort -nr |head
3052 ""
86 "はてな"
23 "hatena"
16 "test"
13 "はてなブックマーク"
12 "テスト"
9 "ソーシャルブックマーク"
7 "はてなトップ"
7 "hoge"
// Package ldap provides a simple ldap client to authenticate,
// retrieve basic information and groups for a user.
package ldap
import (
"crypto/tls"
"errors"
"fmt"
"gopkg.in/ldap.v2"
@yuokada
yuokada / RESTAPI.md
Created March 15, 2017 11:09 — forked from descico/presto-code-split.md
Presto の話。ただし最近ほとんど触っていなかったので情報は古いので注意せよ。

REST API

curl -H "X-Presto-Schema:default" -H "X-Presto-Catalog:hive" -H "X-Presto-User:bob" -d "select count(*) from users" http://presto-coordinator:8080/v1/statement
  • 以下の手順で使うことになる
  1. クエリを /v1/statement に POST する
  2. レスポンスの nextUri を見る。終わっていればここに結果が入る。
  3. 2.のレスポンスの nextUri を見る。これをやると 1. の nextUri は見れなくなる。
{{ EVENT_NAME }}に参加予定の皆様にご案内申し上げます。
予定通り、明日11月25日(金)に本イベントを開催いたします。
18:30より開場いたしますので、弊社ヤフー株式会社の17階コワーキングスペース LODGE までお越しください。
また、ご参加が難しくなった場合、connpass上で「 キャンセル 」いただけますと、
補欠の方が繰り上がりますので、お手数ですがご対応をお願いします。
不明点などありましたら、以下のメールアドレスまでお問い合わせください。
{{ MAIL_TO }}
From 7dadd3549e90d57468b54d68dc39f3067457089b Mon Sep 17 00:00:00 2001
From: sso <sso@yahoo-corp.jp>
Date: Fri, 26 Aug 2016 14:48:48 +0900
Subject: [PATCH] Add config properties for S3-compatible storage
---
presto-docs/src/main/sphinx/connector/hive.rst | 5 +++
.../presto/hive/HdfsConfigurationUpdater.java | 11 +++++++
.../com/facebook/presto/hive/HiveClientConfig.java | 26 +++++++++++++++
.../facebook/presto/hive/PrestoS3FileSystem.java | 11 +++++++
@yuokada
yuokada / example.toml
Created May 8, 2016 06:33 — forked from mzgoddard/example.toml
TOML Grammers
# A TOML example. Unlike JSON it supports comments.
[player]
particles = [
[ 0.0, -5.0 ],
[ 4.330127018922194, -2.4999999999999996 ],
[ -4.330127018922194, -2.4999999999999996 ]
]
# Unlike YAML, there is only one way to write arrays.
# There is only one way to write tables too.
# This reduces implementation complexity for a TOML parser.
@yuokada
yuokada / file0.go
Last active November 7, 2015 19:05
一定時間だけ立ち上がるサーバーを書いた ref: http://qiita.com/uokada/items/c30e26cd8bdee7dfe7eb
func main() {
go runServer()
t := time.Tick(time.Duration(duration) * time.Second)
et := time.Tick(time.Duration(1) * time.Second)
go func() {
for {
select {
case <-t:
ch <- true
@yuokada
yuokada / file0.txt
Last active January 15, 2017 05:16
ブラウザのPOODLE脆弱性を調べるための簡単なサーバー ref: http://qiita.com/uokada/items/bebf6f03fd4a31a8ce14
$ ls
server.key server.crt server.go