Skip to content

Instantly share code, notes, and snippets.

TARGET = kagiroi
SRC_DIR = src
SRCS = $(shell find . -name '*.cc')
DEPS = $(SRCS:.cc=.d)
OBJS = $(SRCS:.cc=.o)
CPPFLAGS = -MMD -MP -I$(SRC_DIR)
CXXFLAGS = -Wall -std=c++1y -O3
import numpy as np
import matplotlib.pyplot as plt
from pymc import Binomial, MCMC, Matplot, Uniform
n_iter = 10000
n_problem = 30
n_problem_pass = 18
score = [26, 28, 25, 22, 25]
@etheriqa
etheriqa / mapM.py
Created March 13, 2015 15:57
mapM and mapM_ in Python
# open 0.txt, 2.txt, ..., 9.txt
# list comprehension
fs = [open('{0}.txt'.format(i)) for i in range(10)]
[f.close() for f in fs]
# map
fs = map(lambda i: open('{0}.txt'.format(i)), range(10))
map(lambda f: f.close(), fs)
@etheriqa
etheriqa / innodb-lock.md
Created March 12, 2013 19:22
[InnoDB] 非ユニークキーによる行ロックの範囲についてちょっと調べた

[InnoDB] 非ユニークキーによる行ロックの範囲についてちょっと調べた

バージョン

% mysql --version
mysql  Ver 14.14 Distrib 5.5.29, for debian-linux-gnu (x86_64) using readline 6.2

調査方法

@etheriqa
etheriqa / Worker.php
Last active August 9, 2023 08:40
Parallel processing on PHP using stream_select()
<?php
interface Worker
{
public function getCommand();
public function done($stdout, $stderr);
public function fail($stdout, $stderr, $status);
}