Skip to content

Instantly share code, notes, and snippets.

View serihiro's full-sized avatar

Kazuhiro Serizawa serihiro

View GitHub Profile
@serihiro
serihiro / bug.md
Created August 10, 2016 01:44
wheneverのバグ
  • commandとouputの指定を組み合わせるとクォートがおかしくなる
  • whenever --update-crontab --set key1=value1&key2=value2 記法が正しくCLIでパースされないのでもう使えなくなっている。 --set key1=value1 --set key2=value2は正常に使える
@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 / note.md
Last active December 23, 2021 00:53
パタヘネ 2.10 32ビットの即値およびアドレスに対するMIPSのアドレシング方式
  • MIPSの命令は32ビット固定であるがゆえに32ビットの定数やアドレスを格納することはできない
  • しかし扱えた方が便利な場合がある。そのMIPSにおける解決策を示す

32ビットの即値オペランド

  • 定数は大体が16ビットに収まる(表現できる)が、超えることもある
  • MIPSには16ビットを超える定数の上位16ビットを指定したレジスタの上位16bitに格納するための命令 lui がある
  • 命令フォーマットは Iフィールド で OP(6) + rs(5) + rt(5) + 即値16ビット

例題

@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