Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
from faker import Factory
fake = Factory.create('ja_JP')
import math
import csv
# shape
import fiona
@motokazu
motokazu / setup-cross.sh
Created January 19, 2013 04:31
Setup files : cross compile node.js for ARM in Linux.
#!/bin/sh -e
# some vars to specifcify our toolchain. Don't need to export
CROSS_BASE=/usr
CROSS_INCLUDE=/usr/include
CROSS_CC=${CROSS_BASE}/bin/arm-linux-gnueabi-gcc
PREFIX_BIN=$CROSS_BASE/bin/arm-linux-gnueabi
export CSTOOLS=$CROSS_BASE/bin
@motokazu
motokazu / common.gypi.disable-macosx-version-min.patch
Last active December 10, 2015 19:58
Node v0.8.16 Cross Compile for SheevaPlug on MacOSX
*** common.gypi.org 2012-12-13 07:44:54.000000000 +0900
--- common.gypi 2013-01-07 23:38:47.000000000 +0900
***************
*** 194,200 ****
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'GCC_VERSION': '4.2',
'PREBINDING': 'NO', # No -Wl,-prebind
! 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
*** common.gypi.org 2012-12-13 07:44:54.000000000 +0900
--- common.gypi 2013-01-07 23:38:47.000000000 +0900
***************
*** 194,200 ****
'GCC_THREADSAFE_STATICS': 'NO', # -fno-threadsafe-statics
'GCC_VERSION': '4.2',
'PREBINDING': 'NO', # No -Wl,-prebind
! 'MACOSX_DEPLOYMENT_TARGET': '10.5', # -mmacosx-version-min=10.5
'USE_HEADERMAP': 'NO',
'OTHER_CFLAGS': [
@motokazu
motokazu / setup-cross_4sheevaplug.sh
Last active December 10, 2015 17:18
Setup Cross Compile Environment for SheevaPlug
#!/bin/sh -e
# some vars to specifcify our toolchain. Don't need to export
CROSS_BASE=/opt/cross_arm
CROSS_CC=${CROSS_BASE}/bin/arm-none-linux-gnueabi-gcc
PREFIX_BIN=${CROSS_BASE}/bin/arm-none-linux-gnueabi
export CSTOOLS=${CROSS_BASE}/bin
# cross library directory, should include stdc++:
@motokazu
motokazu / gcc-4.3.3-Make-lang.in-for-lion.patch
Created January 5, 2013 12:07
patch for Make-lang.in to compile gcc 4.3.3 with Lion.
*** gcc/cp/Make-lang.in.org 2008-12-05 08:00:19.000000000 +0900
--- gcc/cp/Make-lang.in 2013-01-05 19:59:32.000000000 +0900
***************
*** 73,79 ****
CXX_C_OBJS = attribs.o c-common.o c-format.o c-pragma.o c-semantics.o c-lex.o \
c-dump.o $(CXX_TARGET_OBJS) c-pretty-print.o c-opts.o c-pch.o \
c-incpath.o cppdefault.o c-ppoutput.o c-cppbuiltin.o prefix.o \
! c-gimplify.o c-omp.o tree-inline.o
# Language-specific object files for C++ and Objective C++.
@motokazu
motokazu / tools-gyp_node-path.patch
Created January 4, 2013 18:05
nodejs v0.8.16 , patch for make failed when exec tools/gyp_node command. this patch bypasses path problem.
*** tools/gyp/pylib/gyp/generator/make.py.org Thu Jan 5 02:34:42 2012
--- tools/gyp/pylib/gyp/generator/make.py Thu Jan 5 02:57:10 2012
***************
*** 1870,1876 ****
gyp_binary = os.path.join('.', gyp_binary)
root_makefile.write(
"quiet_cmd_regen_makefile = ACTION Regenerating $@\n"
! "cmd_regen_makefile = %(cmd)s\n"
"%(makefile_name)s: %(deps)s\n"
"\t$(call do_cmd,regen_makefile)\n\n" % {
@motokazu
motokazu / couchdb-guide-patch-21.diff
Created September 22, 2011 18:35
Patch for CouchDB-JP/couchdb-guide the issue #21
diff --git editions/1/ja/cookbook.html editions/1/ja/cookbook.html
index 743a3f0..748cfeb 100644
--- editions/1/ja/cookbook.html
+++ editions/1/ja/cookbook.html
@@ -123,7 +123,7 @@ ALTER TABLE
</pre>
<p>It is a list of rows sorted by the value of <code>key</code>. The <code>id</code> is added automatically and refers back to the document that created this row. The <code>value</code> is the data you’re looking for. For example purposes, it’s the girl’s age.
-<p><code>key</code>の値に基づく並び替えされた行のリストです。
+<p>これは、<code>key</code>の値でソートされた行のリストです。<code>id</code>は自動的に追加され、その行を作成したドキュメントを指しています。<code>value</code>はあなたが求めているデータです。この例においては、それは女の子の年齢です。
@motokazu
motokazu / gist:1235229
Created September 22, 2011 16:22
Patch for CouchDB-JP/couchdb-guide the issue #12
diff --git editions/1/ja/btree.html editions/1/ja/btree.html
index 50ee344..9465cf2 100644
--- editions/1/ja/btree.html
+++ editions/1/ja/btree.html
@@ -59,7 +59,7 @@
<p>本書の前半では、MVCCでどのようにドキュメントの <code>_rev</code> の値を使って、ドキュメントへのバージョン更新は同時にただ一人だけということを保証しているかを示しました。既存の <code>_rev</code> の値を比較のために見るためにB木を利用します。書き込みが受け入れられる前に、データが受理できる状態になっていることが期待できます。
<p>Since old versions of documents are not overwritten or deleted when new versions come in, requests that are reading a particular version do not care if new ones are written at the same time. With an often changing document, there could be readers reading three different versions at the same time. Each version was the latest one when a particular client started reading it, but new versions were being written. From the point when a new version is <em>committed</em>, new readers will read the new version while old readers keep reading the old version.
-<p>ドキュメントの古いバージョンは上書きされるか新しいバージョンによって削除されてから、特定のバージョンに対する読み込み要求は、同時に起きる書き込みを許容します。頻繁に更新されるドキュメントに対しても、3通りの過
@motokazu
motokazu / couchdb-guide-patch-5.diff
Created September 11, 2011 15:03
Patch for CouchDB-JP/couchdb-guide the issue #5
diff --git a/editions/1/ja/consistency.html b/editions/1/ja/consistency.html
index 09d0e47..6761026 100644
--- a/editions/1/ja/consistency.html
+++ b/editions/1/ja/consistency.html
@@ -14,29 +14,29 @@
<h2 id="consistency">結果整合性</h2>
<p>In the previous chapter, we saw that CouchDB’s flexibility allows us to evolve our data as our applications grow and change. In this chapter, we’ll explore how working “with the grain” of CouchDB promotes simplicity in our applications and helps us naturally build scalable, distributed systems.
-<p>前章では CouchDB の柔軟性が、我々のアプリケーションに拡張と変化を可能にするってことをみてきた。この章では、CouchDBの原料から動作を概観し、我々のシステムを自然とスケーラブルな分散システムにする事に役立つ「シンプルさ」について説明する。
+<p>前章では CouchDB の柔軟性が、我々のアプリケーションに拡張と変化を可能にするってことをみてきました。この章では、CouchDBの原料から動作を概観し、システムを自然とスケーラブルな分散システムにする事に役立つ「シンプルさ」について説明します。