Skip to content

Instantly share code, notes, and snippets.

View serihiro's full-sized avatar

Kazuhiro Serizawa serihiro

View GitHub Profile
@serihiro
serihiro / memo.md
Created August 24, 2016 01:00
緑本メモ

調べる

  • オフセット項
  • ロジスティック回帰における交互作用項
@serihiro
serihiro / README.md
Last active October 18, 2016 04:30
jqっぽくrubyでjsonをシュッとしたいときに使うなにか。
echo '{"a":1,"b":2}' | ./jr 'puts json.select{|k,v|v == 2}.keys.last'
@serihiro
serihiro / quicksort_without_swap.rb
Created January 11, 2017 12:15
quicksort without swap
class QuickSort
class << self
def sort_by_division_with_pivot(array)
return array unless array.length > 0
pivot = array[0]
left = []
right = []
i = 1
while i < array.length do
@serihiro
serihiro / ikaho.md
Created March 15, 2017 22:22
伊香保温泉に関して

3月18日(土)

集合時間

  • 10:00

集合場所

  • 大宮駅の 改札を出たところにある みどりの窓口前

default

@serihiro
serihiro / sort.c
Last active June 16, 2017 04:09
パタヘネ用サンプルコード
#include <stdio.h>
void swap(int v[], int k){
int temp;
temp = v[k];
v[k] = v[k+1];
v[k+1] = temp;
}
void sort(int v[], int n){
@serihiro
serihiro / manifest.json
Last active July 1, 2017 14:25
Delete Niconico news chrome extension
{
"name": "DeleteNiconicoNewsBar",
"version": "0.0.1",
"manifest_version": 2,
"description": "The exntension which deletes a niconicoo news bar.",
"content_scripts": [
{
"matches": ["http://www.nicovideo.jp/watch/*"],
"js": ["script.js"],
"run_at": "document_idle"
@serihiro
serihiro / error_log.md
Created July 14, 2017 02:33
googleauth-0.5.1
F, [2017-07-14T02:27:00.455957 #27196] FATAL -- : execution expired (Faraday::TimeoutError)
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `initialize'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `new'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:611:in `create_socket'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:755:in `block in connect'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/2.3.0/timeout.rb:101:in `timeout'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:748:in `connect'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:511:in `query'
/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/httpclient-2.8.3/lib/httpclient/session.rb:177:in `query'
@serihiro
serihiro / note.md
Last active July 15, 2017 12:18
Embulk input pluginを書いてみたときの備忘録

環境

$ javac -version
javac 1.8.0_91

$ embulk --version
embulk 0.8.27
@serihiro
serihiro / sed.sh
Created July 28, 2017 09:40
前処理
# http://archive.ics.uci.edu/ml/datasets/NSF+Research+Award+Abstracts+1990-2003
find . -print | grep -i '.*[.]txt' | xargs cat | sed -ne '/^Abstract\s\{1,\}:$/, $p' | sed -ne '3, $p' > merged.txt