Skip to content

Instantly share code, notes, and snippets.

View kuenishi's full-sized avatar
🎴

UENISHI Kota kuenishi

🎴
View GitHub Profile

Wrapper shell script:

$ cat ./riak_cs_inspector.sh
#!/bin/bash
ERL_LIBS=dev/dev1/lib dev/dev1/erts-5.9.3.1/bin/escript \
    dev/dev1/lib/riak_cs/priv/tools/internal/riak_cs_inspector.erl $*

Usage:

Presto connector development 1

One of the very good design decisions Presto designers made is that it's loosely coupled from storages.

Presto is a distributed SQL executor engine, and doesn't manager schema or metadata of tables by itself. It doesn't manage read data from storage by itself. Those businesses are done by plugins called Connector. Presto comes with Hive connector built-in, which connects Hive's metastore and HDFS to Presto.

We can connect any storages into Presto by writing connector plugins.

Plugin Architecture

#include <stdio.h>
#include <stdlib.h>
#include "charfb.h"
static int block_char_map[] = {
0x0020,
0x2598,
0x259d,
0x2580,
0x2596,
@kuenishi
kuenishi / Erlang_risk.md
Last active December 14, 2015 09:09 — forked from repeatedly/d_risk.md

ついに顕在化し始めてもいない「Erlang/OTPリスク」

英語圏ではかなり前からErlang/OTPを開発し続けることのリスクについて語られていたが,具体的な弊害が出て来たので,単なるメモ.日本では起こり得ない未来だと思う.

若手エンジニアの不足

COBOLのように需要が逼迫しているのに人材の供給が増えず需給ミスマッチが起っているわけでは無く,需要も供給も増えないという状況下でわずかながら需要が上回っている質の悪い状況がErlang/OTPに起きている.特に深刻なのは高価な若手エンジニアの採用が絶望的に難しいという現実だ.Haskellが台頭して数年経ちScalaがメインストリームの先頭を突っ走る2013年において全く別の関数型言語もどきを勉強しようとする若者はよほどの物好きしかいない.20~30歳のErlang/OTPエンジニアを雇うのはそれほど難しい上にコストがかかる.優秀な30代前半の若手エンジニアを雇いたいという企業の思いとは裏腹にErlang/OTP新たに学ぶ若者は絶滅寸前だ.

とても優秀な若手を雇用できるチャンスが巡って来た.採用担当者はこう尋ねる.「Erlang/OTPは習得していますか?」「もちろんRuby/Scalaはお手の物です.Haskellもある程度可能です」「もう一度伺いますがErlang/OTPまたはCは習得していますか?」「申し訳ございません 未習得です」

@kuenishi
kuenishi / gist:3813121
Created October 1, 2012 17:17 — forked from jugyo/gist:3521894
Vagrant の使い方
@kuenishi
kuenishi / gist:3785578
Created September 26, 2012 02:04 — forked from ymotongpoo/gist:1342656
extract AAC audio from flv, and convert aac to mp3 using ffmpeg
# using libfaac on Mac OS X 10.6.8
# -vn : not copying video
# -acodec : specify codec used in flv file
# -ac : channels. 1 is for mono, 2 is for stereo
# -ab : specify bitrate for output file (note that rate is not kbps but bps)
# -ar : sampling frequency (Hz)
# -threads: number of threads for encoding
# "-strict experimental" is necessary to use libfaac
ffmpeg -y -i xxxxxxxxxxx.flv -vn -acodec aac -ac 2 -ab 128000 -ar 44100 -threads 4 -strict experimental xxxxx.m4a
<div id="qs-erlang" class="qs">
<h4>Erlang</h4>
<ul class="hlist">
<li><a href="http://msgpack.org/edoc/">API Reference</a></li>
<li><a href="http://github.com/msgpack/msgpack-erlang">Repository</a></li>
</ul>
<p>Write into your <a href="http://github.com/basho/rebar">rebar</a>.config:</p>
<pre class="prettyprint">{deps, [
{erl_msgpack, ".*", {git, "git://github.com/msgpack/msgpack-erlang.git", "HEAD"}}
]}.
@kuenishi
kuenishi / buildout.cfg
Created December 16, 2011 01:42 — forked from shimizukawa/buildout.cfg
sphinx japanese patch ver
[buildout]
parts = app docutils
extensions = gp.vcsdevelop
vcs-extend-develop = hg+http://bitbucket.org/uchida/sphinx/@tip#egg=sphinx
vcs-update = true
[app]
recipe = z3c.recipe.scripts
eggs =
#include <inttypes.h>
#include <time.h>
#include <unistd.h>
#include <stdio.h>
int diff(struct timespec* ts_prev, struct timespec* ts){
return (ts->tv_sec - ts_prev->tv_sec) * 1000 + (ts->tv_nsec - ts_prev->tv_nsec) / 1000000;
}
%% A
F = fun() ->
mnesia:table_info(store, size)
end,
Result = mnesia:activity(async_dirty, F, [], mnesia_frag).
%% B
Result = mnesia:activity(async_dirty,
fun() ->
mnesia:table_info(store, size)