This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./ls.sh "*.jpg" | |
./1.jpg | |
./2.jpg | |
./3.jpg |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# angle units in degrees | |
def tky2wgs_approx(lon_tky, lat_tky, degree=2): | |
L = lon_tky - 135 | |
B = lat_tky - 35 | |
if degree == 1: | |
dL = -2.80641517e-3 - 4.98891541e-5*B - 8.33469263e-5*L | |
dB = 3.20321021e-3 - 1.15452990e-4*B + 2.47032059e-5*L | |
elif degree == 2: | |
a00,a01,a02,a03,a04,a05,a10,a11,a12,a13,a14,a15 = -2.79648156e-03, -3.64571151e-05, -1.00958714e-06, -8.83091873e-05, -8.33002662e-07, 3.54561248e-07, 3.19774649e-03, -1.13997082e-04, -7.51313530e-07, 2.34640477e-05, 6.06731757e-07, 3.28340222e-07 | |
dL = a00+a01*B+a02*B**2+a03*L+a04*B*L+a05*L**2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./print_html.py > temp.html | |
$ cat temp.html | |
<script src="pako.min.js"></script> | |
<script> | |
var jsonz = "789cab56caad54b252502a2e2d482d52d251502a0033ac14a24d4ccd74144ccdcc63818289e5a9c5f9b9a920850589d9f94ab500bf3b1015"; | |
console.log(parse(jsonz)); | |
function parse(hexstr) { | |
return JSON.parse(pako.inflate(unhexlify(hexstr), {to: 'string'})); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./viterbi.py 1 2 4 4 2 1 | |
0. transition: [0] | |
1. transition: [0, 0] | |
2. transition: [1, 1, 1, 1] | |
3. transition: [3, 3, 2, 3] | |
4. transition: [1, 3] | |
5. transition: [1] | |
minimum_cost_path = [0, 1, 3, 3, 1, 0] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ wget https://download.geofabrik.de/asia/japan-latest.osm.pbf | |
$ wget https://download.geofabrik.de/asia/japan.poly |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### default value | |
nmax=4 | |
### | |
for OPT in "$@" | |
do | |
case "$OPT" in | |
-n* ) | |
nmax="$(echo $1 | sed 's/^-n//')" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ nkf --guess * | grep -e MIXED\ NL -e CR | awk -F: '{print $1}' | xargs nkf -Lu -d --overwrite | |
$ nkf --guess * | grep -e EUC-JP -e Shift_JIS | awk -F: '{print $1}' | xargs nkf -Lu --overwrite | |
$ nkf --guess * | awk '{$1=""; print $0}' | sort | uniq | |
ASCII | |
ASCII (LF) | |
BINARY | |
UTF-8 (LF) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./pip_search.sh gdal | |
using pip pip3 | |
GDAL (2.2.3) - GDAL: Geospatial Data Abstraction Library | |
INSTALLED: 2.2.3 (latest) | |
GDAL (2.2.3) - GDAL: Geospatial Data Abstraction Library | |
INSTALLED: 2.2.3 (latest) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loading county.geo.json 1325 ms | |
parsing 195.67 MB 9515 ms | |
indexing 3221 features | |
with 7384329 vertexes and 0 points | |
adding to map 17426 ms |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ pip install netgraph |