Skip to content

Instantly share code, notes, and snippets.

View barusan's full-sized avatar

バル barusan

  • Tokyo/東京
View GitHub Profile
@barusan
barusan / UnixBench5.1.3.mavericks.patch
Last active September 28, 2021 06:52
Patch for UnixBench 5.1.3 on Mac OS X Mavericks (10.9)
diff -ur UnixBench.default/Makefile UnixBench/Makefile
--- UnixBench.default/Makefile 2011-01-18 15:44:53.000000000 +0900
+++ UnixBench/Makefile 2014-04-18 18:27:32.000000000 +0900
@@ -58,7 +58,7 @@
# OPTIMISATION SETTINGS:
## Very generic
-#OPTON = -O
+OPTON = -O -Wall
@barusan
barusan / pdftk-2.02-Makefile-OSX-10.11.patch
Last active October 6, 2015 10:48
$ diff -U1 Makefile.OSX-10.{6,11}
--- Makefile.OSX-10.6 2013-07-25 03:27:36.000000000 +0900
+++ Makefile.OSX-10.11 2015-10-06 19:47:39.000000000 +0900
@@ -22,4 +22,4 @@
# need direct path to libgcj for gcjh (starting in gcj 4.1.2 per Aurélien GÉRÔME)
-TOOLPATH=/sw/lib/gcc4.5/bin/
-export VERSUFF=-fsf-4.5
+TOOLPATH=/usr/local/bin/
+export VERSUFF=-5
export CXX= $(TOOLPATH)g++$(VERSUFF)
@@ -28,3 +28,3 @@
@barusan
barusan / pdftk-2.02-java-Makefile.patch
Last active October 6, 2015 11:20
$ diff -U1 Makefile{.bak,}
--- Makefile.bak 2015-10-06 19:21:14.000000000 +0900
+++ Makefile 2015-10-06 20:20:03.000000000 +0900
@@ -18,2 +18,4 @@
export GCJHFLAGS+= --classpath="$(LIBGCJ):$(JAVALIBPATH):."
+export JAVACFLAGS+= -encoding UTF8 -classpath "$(LIBGCJ):$(JAVALIBPATH):."
+export JAVAHFLAGS+= -classpath "$(LIBGCJ):$(JAVALIBPATH):."
@@ -43,6 +45,6 @@
%.class : %.java
- $(GCJ) $(GCJFLAGS) -C $<
@barusan
barusan / pdftk-2.02-Makefile-Base.patch
Created October 6, 2015 11:41
$ diff -U1 Makefile.Base{.bak,}
--- Makefile.Base.bak 2015-10-06 20:31:18.000000000 +0900
+++ Makefile.Base 2015-10-06 20:37:07.000000000 +0900
@@ -30,5 +30,5 @@
-all : javalib pdftk
+all : pdftk
-javalib :
+$(JAVALIB) :
$(MAKE) -f Makefile -iC $(JAVALIBPATH) all
@barusan
barusan / fitting.py
Created March 22, 2016 03:57
Polynomial curve fitting example
#!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Polynomial curve fitting example
import sys
import math
import itertools
import numpy as np
import numpy.random as rand
@barusan
barusan / gaussian_mle.py
Last active April 20, 2016 10:14
experiment of unbiased variance over normally-distributed data
#!/usr/bin/env python2
#-*- coding: utf-8 -*-
import math
import numpy as np
import matplotlib.pyplot as plt
MEAN = 0.0
VARIANCE = 1.0
NTRIAL = 1000
@barusan
barusan / gaussian_mle.r
Created April 3, 2016 07:58
experiment of unbiased variance over normally-distributed data
#!/usr/local/bin/Rscript
# run on Mac OS X, homebrew R
library(ggplot2)
# sample sizes
sizes <- c(2, 5, 10, 20, 50, 100, 200, 500, 1000)
# return (x - 1) / x
ratio <- function(x) { (x - 1) / x }
@barusan
barusan / jmadata.py
Created May 11, 2016 09:58
気象庁 過去の気象データ CSV
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
気象庁から過去の気象データを CSV 形式でダウンロードする。
API が提供されていないので、ウェブページを参考にスクリプトを作成した。
http://www.data.jma.go.jp/gmd/risk/obsdl/index.php
とりあえず時別値のダウンロードのみ対応。
@barusan
barusan / requirements.md
Last active April 26, 2017 10:38
Greenplum Prerequisites for Debian 8 (jessie)
$ sudo apt-get install build-essential libperl-dev libpython-dev libreadline-dev libxml2-dev \
    zlib1g-dev libapr1-dev libevent-dev libcurl4-openssl-dev libbz2-dev libyaml-dev bison flex \

python-psutil python-lockfile python-paramiko python-setuptools python-epydoc

@barusan
barusan / autoplait_wrapper.py
Last active September 25, 2017 14:25
Python3 wrapper for autoplait
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
"""
Python3 wrapper for Autoplait
=============================
Original:
Yasuko Matsubara, Yasushi Sakurai, Christos Faloutsos,
"AutoPlait: Automatic Mining of Co-evolving Time Sequences",