This file contains 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
/********** | |
* foo.php * | |
***********/ | |
<?php | |
// Connection | |
$username = 'my_username'; | |
$password = 'my_password'; | |
$options = array( | |
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', | |
); |
This file contains 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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<!-- Required meta tags --> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<!-- Bootstrap CSS --> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> |
This file contains 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
#!/usr/bin/env python3 | |
"""Normalizes the textual content of text or CSV files into NFKC format.""" | |
import argparse | |
import csv | |
import subprocess | |
from pathlib import Path | |
from unicodedata import normalize | |
# Constants |
This file contains 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
from unicodedata import normalize | |
from datetime import datetime | |
import re | |
def cal_conv_jg(jp_cal: str) -> datetime: | |
"""Convert Japanese Cal to Gregorian Cal""" | |
cal_in = jp_cal | |
cal_in = normalize('NFKC', cal_in) | |
cal_in = re.split(r'[\-.,/]', cal_in) # List: gy, m, d |
This file contains 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
from datetime import datetime | |
T_BEG = datetime.strptime('1912-07-30', '%Y-%m-%d') # Taisho | |
T_END = datetime.strptime('1926-12-25', '%Y-%m-%d') | |
S_BEG = datetime.strptime('1926-12-25', '%Y-%m-%d') # Showa | |
S_END = datetime.strptime('1989-01-07', '%Y-%m-%d') | |
H_BEG = datetime.strptime('1989-01-08', '%Y-%m-%d') # Heisei | |
H_END = datetime.strptime('2019-04-30', '%Y-%m-%d') | |
R_BEG = datetime.strptime('2019-05-01', '%Y-%m-%d') # Reiwa |
This file contains 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
# -*- coding: utf-8 -*- | |
import requests | |
from bs4 import BeautifulSoup | |
import os | |
from urllib.parse import urljoin | |
from pathlib import Path | |
from pprint import pprint | |
import time | |
This file contains 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
#!/usr/bin/env python | |
# coding: utf-8 | |
import pandas as pd | |
from pathlib import Path | |
def excel_cat(my_dir): | |
"""Concatenates Exel files into a DataFrame""" | |
# Make a list of Excel files in the file path |
This file contains 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
/Applications/MAMP/Library/bin/mysql -uUsername -pPassword |
This file contains 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
%s/\(\d\d\d\)\(\d\d\)\(\d\d\) \(\d\d\)\(\d\d\) \(\d\d\)\(\d\d\)/2020-\4-\5T\6:\7:00,\1,\2,\3/g |
This file contains 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
INSERT INTO state_code | |
(iso_3166_2, code_eoj, subdiv_cat, subdiv_name_en, subdiv_name_ja, geo_area) | |
VALUES | |
('ID-JW','JW','geographical unit','Jawa','ジャワ','ID-JW'), | |
('ID-SM','SM','geographical unit','Sumatera','スマトラ','ID-SM'), | |
('ID-BT','BT','province','Banten','バンテン州','ID-JW'), | |
('ID-JB','JB','province','Jawa Barat','西ジャワ州','ID-JW'), | |
('ID-JI','JI','province','Jawa Timur','東ジャワ州','ID-JW'), | |
('ID-JK','JK','capital district','Jakarta Raya','ジャカルタ首都特別州','ID-JW'), | |
('ID-JT','JT','province','Jawa Tengah','中部ジャワ州','ID-JW'), |