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
Show hidden characters
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: | |
// https://github.com/microsoft/vscode-dev-containers/tree/v0.205.2/containers/ruby | |
{ | |
"name": "rubydata/datascience", | |
"image": "rubydata/datascience-notebook:latest", | |
// Set *default* container specific settings.json values on container create. | |
"settings": {}, | |
// Add the IDs of extensions you want installed when the container is created. |
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 cloudfront_log_parser import parse # https://github.com/heynemann/cloudfront-log-parser | |
import sqlite3 | |
import glob | |
import urllib.parse | |
def create_table(cursor): | |
create_table = ''' | |
create table if not exists cloudfront_logs ( | |
timestamp NUMERIC, | |
http_method TEXT, |
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
// 5桁自治体コードを6桁コードに変換する | |
function code5to6(code5){ | |
var code5str = code5.toString(10) | |
var code5array = code5str.split('') | |
var digit = code5array.length + 1 | |
var sum = code5array.reduce(function(pre,cur,i){ | |
return pre + parseInt(cur,10)*(digit-i) | |
}, 0) | |
var check = (11 - (sum % 11)) % 10 | |
return ("000000"+code5str+check).substr(-6) |