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 / latency.markdown
Created October 13, 2016 01:31 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

; east asian ambiguous settings
(defun set-east-asian-ambiguous-width (width)
(cond ((= emacs-major-version 22) (set-east-asian-ambiguous-width-22 width))
((> emacs-major-version 22) (set-east-asian-ambiguous-width-23 width))))
; for emacs 22
(defun set-east-asian-ambiguous-width-22 (width)
(if (= width 2)
(utf-translate-cjk-set-unicode-range
1. スタート→設定→更新とセキュリティ→開発者向けで、「開発者モード」を選択。
2. スタート→設定→アプリと機能→プログラムと機能→Windowsの機能の有効化または無効化で、「Windows Subsystem for Linux (Beta)」にチェック。OK、再起動。
3. cmd.exeを起動、プロパティを表示、「従来のコンソールを使う」チェックを外す。cmd.exeを終了。
4. スタート→bashを起動。初回だけ、Ubuntuをインストールするよ!って言われるので「y」って返事をする。
@jj1bdx
jj1bdx / walker_alias.erl
Created June 15, 2016 11:56 — forked from seriyps/walker_alias.erl
Walker alias method implemented in Erlang
%%% @author Sergey Prokhorov <[email protected]>
%%% @copyright (C) 2013, Sergey Prokhorov
%%% @doc
%%% @license Apache License Version 2.0
%%%
%%% Walker alias method - efficient random selection with defined probabilities.
%%% <http://en.wikipedia.org/wiki/Alias_method>
%%%
%%% > ProbabilityValueList = [{10, a}, {20, b}, {30, c}, {40, d}],
%%% > WalkerVectors = walker_alias:build(ProbabilityValueList),
@jj1bdx
jj1bdx / dblatex.rb
Last active April 8, 2017 01:37 — forked from dustinschultz/dblatex.rb
Homebrew dblatex patched
require 'formula'
class Dblatex < Formula
env :userpaths
url 'http://downloads.sourceforge.net/project/dblatex/dblatex/dblatex-0.3.10/dblatex-0.3.10.tar.bz2'
homepage 'http://dblatex.sourceforge.net'
sha256 '6fd696b740e0044ae1caf843d225d98c01b6ed916550384544e7e31c0c6a2cfa'
def install
system "python", "setup.py", "install", "--prefix=#{prefix}", "--install-scripts=#{bin}"
@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

@jj1bdx
jj1bdx / erlang-resources.md
Last active August 28, 2015 05:43 — forked from macintux/erlang-resources.md
Erlang online resources
#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() {
<!DOCTYPE html>
<title>localStorage test</title>
<body>
<h1>localStorage test</h1>
<script>
if ( ! window.console ) {
console = {
log : function( s ) {
alert( s );
}