Skip to content

Instantly share code, notes, and snippets.

View jj1bdx's full-sized avatar
🏠
Working from home

Kenji Rikitake jj1bdx

🏠
Working from home
View GitHub Profile
@jj1bdx
jj1bdx / erlang-resources.md
Last active August 28, 2015 05:43 — forked from macintux/erlang-resources.md
Erlang online resources
@jj1bdx
jj1bdx / report.md
Last active August 29, 2015 02:17 — forked from koyhoge/report.md
エンジニアのための法律勉強会 #7『エンジニアと経営者が知っておきたい労働・請負・派遣の基礎知識とトラブル回避』 参加メモ

エンジニアのための法律勉強会 #7『エンジニアと経営者が知っておきたい労働・請負・派遣の基礎知識とトラブル回避』 参加メモ

イベントURL: https://coedo-dev.doorkeeper.jp/events/29764

% $R16B03_1_hipe/bin/erlc utf8_with_magic_comment.erl
% $R16B03_1_hipe/bin/erl -noshell -s utf8_with_magic_comment start -s init stop
===== format by 's'
[bytes]: あ
===== format by 'ts'
[codepoint]: \x{3042}
[bytes]: あ
[string_literal]: \x{3042}
===== format by 'ts' with io:setopts([{encoding, utf8}])
[codepoint]: あ
@jj1bdx
jj1bdx / tsv2csv.py
Last active August 29, 2015 14:15 — forked from nsonnad/tsv2csv.py
import sys
import csv
tabin = csv.reader(sys.stdin, dialect=csv.excel_tab)
commaout = csv.writer(sys.stdout, dialect=csv.excel)
for row in tabin:
commaout.writerow(row)
<!DOCTYPE html>
<title>localStorage test</title>
<body>
<h1>localStorage test</h1>
<script>
if ( ! window.console ) {
console = {
log : function( s ) {
alert( s );
}
#include <stdint.h>
#include <avr/interrupt.h>
#include <avr/wdt.h>
byte sample = 0;
boolean sample_waiting = false;
byte current_bit = 0;
byte result = 0;
void setup() {
@jj1bdx
jj1bdx / gist:738946
Created December 13, 2010 12:31 — forked from voluntas/gist:737963
Corporations using Erlang/OTP
* Bluetail/Alteon/Nortel (distributed, fault tolerant email system, SSL accelerator)
* Cellpoint (Location-based Mobile Services)
* Corelatus (SS7 monitoring).
* dqdp.net (in Latvian) (Web Services).
* Facebook (Facebook chat backend)
* Finnish Meteorological Institute (Data acquisition and real-time monitoring)
* IDT corp. (Real-time least-cost routing expert systems)
* Kreditor (Electronic payment systems)
* Mobilearts (GSM and UMTS services)
{erl_opts, [fail_on_warning, debug_info]}.
{xref_checks, [undefined_function_calls]}.
%% {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}.
{cover_enabled, true}.
{clean_files, [".eunit", "ebin/*.beam"]}.
{dialyzer_opts,
[{warnings,
[no_return,
no_unused,
no_improper_lists,
@jj1bdx
jj1bdx / riak.md
Created May 30, 2012 13:09 — forked from taichi/riak.md
some suggestion to riak.

(Note: this is a rough translation added to the original Japanese. No warranty.)

RpbErrorResp の errcode はより適切な値が設定されるべきである。(The errcode of RpbErrorResp should be set to more appropriate value.)

PBC API ではエラーが起きると、RpbErrorRespが返るがRIAKC_ERR_GENERALが常に設定されており意味がないのでREST APIと同等の値が設定されているべきです。 (When an error occurs on the PBC API, the value of RpbErrorResp is returned, though RpbErrorResp is always set to RIAKC_ERR_GENERAL so that the recipient cannot find what the real cause is. The value should be set the same as with the REST API.)

例えば、get operation において、notfound が返るのは多くの場合クライアント側にとって特に問題ないので、コストの高い例外処理がトリガーされない事が望ましい。
一方で、modifiedが返る場合、データのリペアをトリガするべきか、単に再度getするべきかはアプリケーションの設計の問題である。 (For example, on get operation the clients will find no problem when notfound is returned - exceptions of higher cost should not be triggered. On the other hand, if modified is returned, it is up to how the application is designed to trigger the repairment of the data, or to re-execute the get operation.)

errmsgフィールドの様にHum

@jj1bdx
jj1bdx / emacs_indent.sh
Created November 6, 2012 05:21 — forked from andrzejsliwa/emacs_indent.sh
erlang emacs-style formatting for vim
#!/usr/bin/env bash
emacs --batch --eval "
(progn (find-file \"$1\")
(if (string-equal \"darwin\" (symbol-name system-type))
(setq erlang-root-dir (car (file-expand-wildcards \"/usr/local/Cellar/erlang/R*\")))
(setq erlang-root-dir \"/usr/lib/erlang/\"))
(setq load-path (cons (car (file-expand-wildcards (concat erlang-root-dir \"/lib/erlang/lib/tools-*/emacs\"))) load-path))
(require 'erlang-start)
(erlang-mode)
(untabify (point-min) (point-max))