Skip to content

Instantly share code, notes, and snippets.

Sho Shimauchi shiumachi

Block or report user

Report or block shiumachi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
import time
import psyco
print "No,time"
for i in xrange(9):
t0 = time.clock()
N = pow(10,i)
a = 0
for j in xrange(N):
import sys
import time
import psyco
print "No,time"
for i in xrange(8):
t0 = time.clock()
N = pow(10,i)
a = 0.0
shiumachi /
Created Jan 12, 2011
detect us phone number using regexp
grep -H -e "^\(([0-9]\{3\})\|[0-9]\{3\}-\)[0-9]\{3\}-[0-9]\{4\}$"
shiumachi /
Created Feb 8, 2011
make and install apache (and APR)
cd srclib/apr
./configure --prefix=${DEVEL_DIR}/apr
make install
cd ../..
shiumachi / sphinx-pdfja.patch
Created Jan 7, 2012
patch which makes sphinx enable to generate Japanese pdf file
View sphinx-pdfja.patch
diff --git
index 86dc047..267d31f 100755
@@ -392,6 +392,7 @@ help:
\t@echo " epub to make an epub"
\t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
\t@echo " latexpdf to make LaTeX files and run them through pdflatex"
+\t@echo " latexpdfja to make LaTeX files and run them through platex and dvipdfmx"
\t@echo " text to make text files"
shiumachi / gist:3285804
Created Aug 7, 2012
cdh-user-jp@ のバグテスト用Hiveスクリプト
View gist:3285804
drop table test_table;
drop table test_table1;
drop table test_table2;
CREATE TABLE test_table (id INT, name STRING);
set hive.metastore.warehouse.dir=/tmp/warehouse;
CREATE TABLE test_table1 (id INT, name STRING);
set hive.metastore.warehouse.dir=/tmp/warehouse2;
CREATE TABLE test_table2 (id INT, name STRING);
View anything_setup.el
;; anything.el
(require 'anything)
(require 'anything-config)
(require 'recentf)
(setq recentf-max-saved-items 1000)
(recentf-mode 1)
shiumachi /
Created Aug 25, 2012
simple NN log parser (pyfes LT 2012.08 sample code)
# pyfes LT 2012.08 用ソースコード
# namenode のログをパースして ログレベルをカウントするだけのコード
# ソースコードに日本語でコメント入れるのは多分初めて
import sys
# 1行毎のパース処理はここ
def parse(line):
arr = line.strip().split()
function wait_seconds()
if ! expr "$1" : '[0-9]*' > /dev/null ;
echo "${func_name} ERROR: argument is not number"
for i in `seq $1`; do
echo "wait for `expr $1 + 1 - ${i}` seconds..."
shiumachi /
Created Jan 24, 2013
コードの行数を数える via cocoatomo
find . -name "*.java" -exec wc -l {} \; | awk '{s+=$1}END{print s}'
You can’t perform that action at this time.