Skip to content

Instantly share code, notes, and snippets.

View nojima's full-sized avatar
o_O

Yusuke Nojima nojima

o_O
View GitHub Profile
unbind-key C-b
set-option -g prefix C-t
set-window-option -g mode-keys vi
set-option -g history-limit 9999
set -s escape-time 1
set -g status-bg blue
set-window-option -g window-status-current-bg cyan
bind -r C-k select-pane -U
bind -r C-j select-pane -D
@nojima
nojima / aoj.rb
Last active January 1, 2016 22:09
#!/usr/bin/env ruby
require 'colored'
require 'optparse'
require 'open3'
def compile(problem_id)
puts "======== Compile ========".bold.green
cmd = "g++ -Wall -Wextra -Wno-unused-result -O2 -g -std=c++0x #{problem_id}.cpp"
output, status = Open3.capture2e(cmd)
output.each_line do |line|
wget http://www.lua.org/ftp/lua-5.2.3.tar.gz
tar xvpf lua-5.2.3.tar.gz
mv lua-5.2.3 ~/opt/lua
cd ~/opt/lua
make linux
mkdir lib
mv src/liblua.a lib
mkdir include
cd include
for f in ../src/*.h ../src/*.hpp; do ln -s $f $(basename $f); done
@nojima
nojima / exam.tsv
Last active January 4, 2016 11:39
ロジスティック回帰
合否 内申点 模試偏差値
0 3.6 60.1
1 4.1 52.0
0 3.7 62.5
0 4.9 60.6
1 4.4 54.1
0 3.6 63.6
1 4.9 68.0
0 4.8 38.2
1 4.1 59.5
@nojima
nojima / heka.md
Last active January 4, 2016 21:49

Heka メモ

ビルド

$ sudo apt-get install cmake git mercurial build-essential

# Install Go
@nojima
nojima / hdfs.md
Last active August 29, 2015 13:55

HDFS メモ

インストール

準備

# Java のインストール
$ sudo apt-get install openjdk-7-jdk

# hadoop ユーザの作成

Build Hadoop

Install packages

sudo apt-get install wget build-essential openjdk-7-jdk cmake maven pkg-config libssl-dev

Install protobuf

wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
package main
import "bufio"
import "flag"
import "fmt"
import "log"
import "os"
import "strings"
import "sync"
import "github.com/tpjg/goriakpbc"
description "Twitter Timeline Logger"
author "Yusuke Nojima"
start on runlevel[2345]
stop on runlevel[016]
chdir /opt/timeline-logger
exec bin/timeline-logger --config etc/config.yml >> /var/log/timeline.log
respawn

C++メモリモデル

1.10 Multi-thread executions and data aces

  • Thread of execution (or thread) は flow of control のひとつ.
    • 特定のトップレベル関数の呼び出しを含む.
    • そのスレッドが呼び出す関数をすべて含む.
    • どのスレッドも潜在的にはプログラム内のすべてのオブジェクトと関数にアクセスする可能性がある.
    • C++プログラムは複数のスレッドを並列に実行できる.
  • 処理系はすべての unblocked なスレッドが eventually make progress することを保証すべき.