Skip to content

Instantly share code, notes, and snippets.

@kkdd
kkdd / 01.cmake
Last active August 29, 2015 14:05
pgrouting 2.0.0 did not build (homebrew)
-- The C compiler identification is AppleClang 5.1.0.5030040
-- The CXX compiler identification is AppleClang 5.1.0.5030040
-- Check for working C compiler: /usr/local/Library/ENV/4.3/clang
-- Check for working C compiler: /usr/local/Library/ENV/4.3/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/Library/ENV/4.3/clang++
-- Check for working CXX compiler: /usr/local/Library/ENV/4.3/clang++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 1. in line 5.
x,y,UTF-8_(日本語=Japanese)
1.1,1.2,1.3
2.1,2.2,2.3
3.1,3.2,3.3
4.1,4.2,4.3
# $ nkf --guess UTF-8.csv
# UTF-8 (LF)
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 3 columns, instead of 1. in line 5.
x,y,Shift_JIS_(���{��=Japanese)
1.1,1.2,1.3
2.1,2.2,2.3
3.1,3.2,3.3
4.1,4.2,4.3
# $ nkf --guess Shift_JIS.csv
# Shift_JIS (LF)
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:13
bash-3.2 のパッチ for Mac OS X ref: http://qiita.com/kkdd/items/206364ef2ea4244c14cd
- CVE-2014-6271 ✔
- CVE-2014-7169 ✔
- CVE-2014-7186 ✔
- CVE-2014-7187 ?
- CVE-2014-6277 ✔
- CVE-2014-6278 ✔
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:13
Safari のリーダー表示機能のカスタマイズ(Mac OS X) ref: http://qiita.com/kkdd/items/020987923b8a1268bf12
$ sudo patch -b -p0 < Reader.html.patch
@kkdd
kkdd / checkv.rb
Last active August 29, 2015 14:16
一括でコマンド(複数)のバージョンを表示 ref: http://qiita.com/kkdd/items/8088362ce9113f1a992b
#!/usr/bin/ruby
require 'yaml'
$prompt = "% "
$commands_to_be_checked_yml = <<EOS
"":
- "uname -a"
- "sw_vers"
- "hostinfo"
- "mdimport -L"
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:17
jsonデコード(go-simplejson利用) ref: http://qiita.com/kkdd/items/f54d35a3b5538307f506
$ go run json2str.go "{\"key\": {\"country\": \"日本\", \"n\": 0}, \"values\": [1,2]}"
{"key":{"country":"日本","n":0},"values":[1,2]}
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:17
mongodb に OpenStreetMap データを取り込み(goosm利用)+近傍検索 ref: http://qiita.com/kkdd/items/92a95caf54e6792bcbd6
$ wget http://download.geofabrik.de/asia/japan-latest.osm.bz2
$ go run goosm.go -f japan-latest.osm.bz2 -db osm
[6時間以上かかった]
$ mongo osm_ways
MongoDB shell version: 3.0.1
connecting to: osm_ways
> show dbs
local 0.000GB
osm_nodes 5.479GB
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:18
mongodb に geojson データを読み込み(mongoimport、jq 利用)+近傍検索 ref: http://qiita.com/kkdd/items/85ee5a6de8f168f0c5b1
$ cat points.json
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [139.710001, 35.690283]
},
@kkdd
kkdd / file0.txt
Last active August 29, 2015 14:21
経緯度点列データを与えOpenStreetMapデータから道路を特定してみる ref: http://qiita.com/kkdd/items/de8b52f6ab66f43f80f6
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import simplejson
import textwrap
from pymongo import MongoClient
client = MongoClient('localhost')