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
@nojima
nojima / build_hadoop.sh
Created March 5, 2014 03:32
Build Hadoop 2.2.0 in Ubuntu
#!/bin/sh
set -xe
sudo apt-get update
sudo apt-get install -y wget build-essential openjdk-7-jdk cmake maven pkg-config libssl-dev
# install protobuf
cd
wget https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz

C++メモリモデル

1.10 Multi-thread executions and data aces

  • Thread of execution (or thread) は flow of control のひとつ.
    • 特定のトップレベル関数の呼び出しを含む.
    • そのスレッドが呼び出す関数をすべて含む.
    • どのスレッドも潜在的にはプログラム内のすべてのオブジェクトと関数にアクセスする可能性がある.
    • C++プログラムは複数のスレッドを並列に実行できる.
  • 処理系はすべての unblocked なスレッドが eventually make progress することを保証すべき.
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
package main
import "bufio"
import "flag"
import "fmt"
import "log"
import "os"
import "strings"
import "sync"
import "github.com/tpjg/goriakpbc"

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
@nojima
nojima / hdfs.md
Last active August 29, 2015 13:55

HDFS メモ

インストール

準備

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

# hadoop ユーザの作成
@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 / 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
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 / 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|