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 -*- | |
__author__ = 'Shinichi Nakagawa' | |
class Stats(object): | |
def __init__(self): | |
pass |
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
def to_pythagoras_data(r, ra, g) | |
# r :得点 | |
# ra:失点 | |
# g :試合数 | |
return (g.to_f * (r.to_f ** 2 / (r.to_f ** 2 + ra.to_f ** 2))).to_i | |
end |
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
- hosts: retrosheet | |
user: vagrant | |
sudo: yes | |
vars: | |
host: "localhost" | |
mysql_database: "retrosheet" | |
mysql_schema_sql: "/vagrant/schema.sql" | |
vars_prompt: | |
mysql_root_db_password: "MySQL root password" | |
mysql_app_db_password: "MySQL app password" |
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
< ,RES_PIT_ID varchar(8) | |
< ,RES_PIT_HAND_CD varchar(1) | |
--- | |
> ,RESP_PIT_ID varchar(8) | |
> ,RESP_PIT_HAND_CD varchar(1) |
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
[database] | |
engine = pymysql # PyMySQLを指定 | |
host = 192.168.33.xx # サーバーのアドレス | |
database = retrosheet | |
schema = retrosheet | |
user = app | |
password = app_no_password | |
[download] | |
directory = files |
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
# ENGINEにPyMySQLの接続文字列を追加(4,5行目) | |
if ENGINE == 'sqlite': | |
dbString = ENGINE + ':///%s' % (DATABASE) | |
elif ENGINE == 'pymysql': | |
dbString = 'mysql+' + ENGINE + '://%s:%s@%s/%s' % (USER, PASSWORD, HOST, DATABASE) | |
else: | |
if USER and PASSWORD: | |
dbString = ENGINE + '://%s:%s@%s/%s' % (USER, PASSWORD, HOST, DATABASE) |
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 -*- | |
__author__ = 'Shinichi Nakagawa' | |
class Stats(object): | |
def __init__(self): | |
pass |
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 -*- | |
__author__ = 'Shinichi Nakagawa' | |
import json | |
import urllib.request | |
from bs4 import BeautifulSoup | |
from configparser import ConfigParser | |
from geopy.geocoders import Nominatim |
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 geopy.geocoders import Nominatim | |
>>> geolocator = Nominatim() | |
>>> geolocator.geocode("Tokyo Dome") | |
Location(東京ドーム (Tokyo Dome), 牛込小石川線, 飯田橋, 東京都, 関東地方, 112-8555, 日本, (35.70556965, 139.751887568794, 0.0)) |
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 -*- | |
__author__ = 'Shinichi Nakagawa' | |
from sqlalchemy import create_engine | |
from sqlalchemy.orm import sessionmaker | |
from tables import Park, Base | |
from bottle import route, run, template |
OlderNewer