Skip to content

Instantly share code, notes, and snippets.

View hfm's full-sized avatar

Okumura Takahiro hfm

View GitHub Profile
@hfm
hfm / gmm.py
Created November 5, 2012 16:42 — forked from phelrine/gmm.py
混合ガウス分布のパラメータ推定
import numpy as np
import numpy.random as rand
import matplotlib.pyplot as plt
def dnorm(x, m, s):
return np.exp(-((x - m) ** 2) / (2 * s)) / np.sqrt(2 * np.pi * s)
def EM(data, init, iter):
@hfm
hfm / gist:4671472
Created January 30, 2013 07:38
A benchmark test for SD card "Lexar SDHCcard Class10 UHS-1 32GB LSD32GBJ200"
$ iozone -t 2 -s 512M -r 128K -i 0 -i 1 -i 2
Iozone: Performance Test of File I/O
Version $Revision: 3.413 $
Compiled for 64 bit mode.
Build: macosx
Contributors:William Norcott, Don Capps, Isom Crawford, Kirby Collins
Al Slater, Scott Rhine, Mike Wisner, Ken Goss
Steve Landherr, Brad Smith, Mark Kelly, Dr. Alain CYR,
@hfm
hfm / mlt_proc_test.py
Created March 10, 2013 02:38
Tested module of multiprocessing at python 3.3.0. My mac is, * OS X 10.8.3 * Python 3.3.0 * 2.3 GHz Intel Core i7 * 16GB 1600 MHz DDR3
import numpy as np
import multiprocessing as mlp
import time
def main(X):
print("Data Length\t\t\t:", len(X))
spd = time.clock()
calc_map(X)
spd = time.clock() - spd
@hfm
hfm / clearfix.css
Last active December 16, 2015 12:38
css snippets
.clearfix:after{display:block;visibility:hidden;clear:both;height:0;content:".";font-size:0}.clearfix{display:inline-table;min-height:1%}
@hfm
hfm / sample.html
Last active December 16, 2015 12:38
HTML5 Markup Sample
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="content-language" content="ja">
<meta charset="UTF-8">
<meta name="author" content="****">
<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
<meta property="og:title" content="YOUR NAME">
<meta property="og:type" content="article/website/book/profile/etc.">
@hfm
hfm / gist:5513478
Last active December 16, 2015 23:19
.gitignore: my frequently-used
# OSX ------------------------
.DS_Store
## Thumbnails
._*
## Files that might appear on external disk
.Spotlight-V100
.Trashes
@hfm
hfm / logrotate.conf
Last active December 17, 2015 00:49
logrotate setting
weekly
rotate 4
start 1
dateext
dateformat -%Y-%m-%d
missingok
create
compress
include /usr/local/etc/logrotate.d
@hfm
hfm / .zlogin
Created May 11, 2013 09:33
zsh prefs.
echo "> Hello, Z World"
@hfm
hfm / gitignore_reloaded.sh
Last active December 17, 2015 08:49
script for gitignore reloaded.
#!/bin/sh
git status > /dev/null 2>&1
if [ $? -eq 0 ]; then
cat << "EOS"
_ _ _
__ _(_| |_(_) __ _ _ __ ___ _ __ ___
/ _` | | __| |/ _` | '_ \ / _ \| '__/ _ \
| (_| | | |_| | (_| | | | | (_) | | | __/
\__, |_|\__|_|\__, |_| |_|\___/|_| \___|
@hfm
hfm / shuffle.pl
Created May 23, 2013 01:29
席替えスクリプト for ppb 13' engineer.
use strict;
use List::Util;
my @name_list = ( "おっくん", "きたけー", "たけお", "ぐっさん" );
my @s_name_list = List::Util::shuffle @name_list;
print join(", ", @s_name_list);