Skip to content

Instantly share code, notes, and snippets.

@srctaha
srctaha / myworkplaces.md
Last active April 14, 2024 23:43
Information about my workplaces

Details

法人番号 商号又は名称 読み方 郵便番号 住所 電話番号 資本金 従業員数
2011001026329 グラクソスミスクライン株式会社 グラクソスミスクラインカブシキガイシャ 107-0052 東京都港区赤坂1丁目8番1号 03-4231-5000 20億円以上 2500人以上
6010001201383 株式会社KPMG Ignition Tokyo ケーピーエムジーイグニショントウキョウカブシキガイシャ 100-0004 東京都千代田区大手町1-6-1大手町ビルヂング7階 03-3548-5144
@srctaha
srctaha / lex.fix.csv
Created February 24, 2021 14:38
`grep (BSD grep) 2.5.1-FreeBSD`: `grep -Ev '^([A-Za-zA-Za-z]|[0-90-9]*),' lex.csv`
We can't make this file beautiful and searchable because it's too large.
/,18255,20453,-705,補助記号,一般,*,*,*,*,*,/,/,*,/,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,81022745596535296,294759
¡,18255,20453,-705,補助記号,一般,*,*,*,*,*,¡,¡,*,¡,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23700256638247424,86221
¢,18255,20453,-705,補助記号,一般,*,*,*,*,*,¢,¢,*,¢,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23730493208011264,86331
£,18255,20453,-705,補助記号,一般,*,*,*,*,*,£,£,*,£,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23730768085918208,86332
¤,18255,20453,-705,補助記号,一般,*,*,*,*,*,¤,¤,*,¤,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23731042963825152,86333
¦,18255,20453,-705,補助記号,一般,*,*,*,*,*,¦,¦,*,¦,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23700531516154368,86222
§,18255,20453,-988,補助記号,一般,*,*,*,*,*,§,§,*,§,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23731592719639040,86335
¨,18255,20453,-705,補助記号,一般,*,*,*,*,*,¨,¨,*,¨,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23700806394061312,86223
©,18255,20453,-705,補助記号,一般,*,*,*,*,*,©,©,*,©,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23731867597545984,86336
ª,18255,20453,-705,補助記号,一般,*,*,*,*,*,ª,ª,*,ª,*,記号,*,*,*,*,*,*,補助,*,*,*,*,*,*,*,23760180021961216
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@srctaha
srctaha / preproc_squad.py
Last active April 22, 2020 02:26
Preprocess SQuAD-like training dataset
"""Preprocess SQuAD-like training dataset
Obtained and slightly modified from:
https://alaginrc.nict.go.jp/nict-bert/Experiments_on_RCQA.html
Dependencies:
python -m pip install mojimoji==0.0.10
python -m pip install mecab-python3==0.996.5
Reference:
@srctaha
srctaha / environment.yml
Created February 16, 2020 17:51
Conda env for the Line-bot.
name: wwwgis
channels:
- defaults
- conda-forge
- anaconda
dependencies:
- python=3.7
- pip=20.0.2
- requests=2.22.0
- flask=1.1.1
@srctaha
srctaha / get_city_planning.py
Last active February 16, 2020 17:59
Returns city planning information about a given location.
import geopandas as gp
from geopandas.tools import sjoin
import pandas as pd
from shapely.geometry import Point
def get_city_planning(shp_filename: str, lat: float, lng: float) -> dict:
"""Returns city planning information about a given location.
Args:
@srctaha
srctaha / is_latlng_in_jpn.py
Created February 16, 2020 16:41
Checks whether a given location is inside Japan.
def is_latlng_in_jpn(lat: float, lng: float) -> bool:
"""Checks whether a given location is inside Japan.
Args:
lat (float): Latitude of the location
lng (float): Longitude of the location
Returns:
bool: True if the pair is in Japan, False otherwise
@srctaha
srctaha / get_elevation.py
Last active February 16, 2020 09:55
Returns the elevation for a given (latitude, longitude) pair.
import json
import requests
def get_elevation(lat: float, lng: float) -> float:
"""Returns the elevation relative to the mean sea level for a given
(latitude, longitude) pair.
Args:
lat (float): Target latitude
@srctaha
srctaha / retrieve_tileblob.py
Last active February 16, 2020 09:56
Retrive target map tile from an mbtiles file.
import io
import sqlite3
from PIL import Image
def retrieve_tileblob(z: int, x: int, y: int, dbname: str):
"""Retrives target map tile from an mbtiles file.
Examples:
z = 12
@srctaha
srctaha / get_avg_eq_kpi.py
Last active February 16, 2020 16:58
Returns 30-year EQ-risk predictions of a given location.
import json
import requests
def get_avg_eq_kpi(mesh_cd: str, db_update_year: int = 2019) -> Tuple[float]:
"""Returns 30-year EQ-risk predictions of a given location.
Args:
mesh_cd (str): Mesh code of the location
db_update_year (int): Year of the predictions