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
View sum.py
import time
import psyco
psyco.full()
print "No,time"
for i in xrange(9):
t0 = time.clock()
N = pow(10,i)
a = 0
for j in xrange(N):
View sumfloat.py
import sys
import time
import psyco
psyco.full()
print "No,time"
for i in xrange(8):
t0 = time.clock()
N = pow(10,i)
a = 0.0
@shiumachi
shiumachi / detect_us_phone_number.sh
Created Jan 12, 2011
detect us phone number using regexp
View detect_us_phone_number.sh
#!/bin/sh
grep -H -e "^\(([0-9]\{3\})\|[0-9]\{3\}-\)[0-9]\{3\}-[0-9]\{4\}$" test.in
@shiumachi
shiumachi / make_install_apache_devel.sh
Created Feb 8, 2011
make and install apache (and APR)
View make_install_apache_devel.sh
#!/bin/bash
DEVEL_DIR=${HOME}/devel
cd srclib/apr
./buildconf
./configure --prefix=${DEVEL_DIR}/apr
make
make install
cd ../..
@shiumachi
shiumachi / sphinx-pdfja.patch
Created Jan 7, 2012
patch which makes sphinx enable to generate Japanese pdf file
View sphinx-pdfja.patch
diff --git quickstart.py quickstart.py
index 86dc047..267d31f 100755
--- quickstart.py
+++ quickstart.py
@@ -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
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
shiumachi / nn_parse.py
Created Aug 25, 2012
simple NN log parser (pyfes LT 2012.08 sample code)
View nn_parse.py
# pyfes LT 2012.08 用ソースコード
# namenode のログをパースして ログレベルをカウントするだけのコード
# ソースコードに日本語でコメント入れるのは多分初めて
#
import sys
# 1行毎のパース処理はここ
def parse(line):
arr = line.strip().split()
View wait_seconds.sh
function wait_seconds()
{
func_name="wait_seconds"
if ! expr "$1" : '[0-9]*' > /dev/null ;
then
echo "${func_name} ERROR: argument is not number"
return
fi
for i in `seq $1`; do
echo "wait for `expr $1 + 1 - ${i}` seconds..."
@shiumachi
shiumachi / code_line_count.sh
Created Jan 24, 2013
コードの行数を数える via cocoatomo
View code_line_count.sh
find . -name "*.java" -exec wc -l {} \; | awk '{s+=$1}END{print s}'
You can’t perform that action at this time.