Skip to content

Instantly share code, notes, and snippets.

View akira-okumura's full-sized avatar

Akira Okumura akira-okumura

View GitHub Profile
import graphviz
import datetime
def reformat(line):
values = line.split('\t')
case_number = int(values[0])
if values[3] == '春日市':
# 春日市 format e.g., case 659
#!/usr/bin/env python3
import ROOT
def readSK(fname, batch=False):
global nt
nt = ROOT.TNtuple('nt', 'nt', 'ch:pe:t:x:y:z')
nt.ReadFile(fname)
if not batch:
nt.SetMarkerStyle(20)
@akira-okumura
akira-okumura / corona.py
Last active April 14, 2020 02:47
COVID-19 route map
import graphviz
import datetime
import json
from urllib import request
cases = {}
def register_cases(pref):
response = request.urlopen('https://www.ctv.co.jp/covid-19/data/%s.csv' % pref)
lines = response.readlines()
function make_preference_panel() {
html = '<strong>Name Style</strong> <form>' +
'<input type="radio" name="long_short" onChange="author_list()" id="long" value="long">Use full name ' +
'<input type="radio" name="long_short" onChange="author_list()" id="short" value="short" checked="checked">Use initial' +
'</form><br>';
html += '<strong>Journal Style</strong> <form>' +
'<input type="radio" name="style" onChange="author_list()" id="HTML" value="HTML" checked="checked">HTML ' +
'<input type="radio" name="style" onChange="author_list()" id="PoS" value="PoS">PoS ' +
'<input type="radio" name="style" onChange="author_list()" id="AIP" value="AIP">AIP' +
function author_list(useShortNames, journal, category) {
/* Change these three options yourself */
/* useShortNames --- true: A.~Okumura , false: Akira~Okumura */
/* journal --------- POS: Proceedings of Science (e.g., ICRC2015)
HTML: HTML output for Word users
AIP: American Institute of Physics
APP: Astroparticle Physics (not supported yet)
APJ: Astrophysical Journal (not supported yet) */
/* category ------- GCT, Science, Camera, Optics, TCS, or MC */
# Original shell script was written by Adam Stankiewicz (@sheerun)
# https://gist.github.com/sheerun/3885694
#
# Added on/off of "Web Proxy (HTTP)" for GlimmerBlocker users.
[[ -n "$1" ]] || { echo "Usage: proxy user@example.com"; exit 1; }
# get service GUID and NAME (like Wi-Fi) to set SOCKS proxy
SERVICE_GUID=`printf "open\nget State:/Network/Global/IPv4\nd.show" | \
$ ssh -D 1080 MY_ACCOUNT@foo.bar.com
$ g++ -c Logger.cc -o Logger.o -Wall -Wextra -O2 -DBOOST_LOG_DYN_LINK
$ g++ -c main.cc -o main.o -Wall -Wextra -O2 -DBOOST_LOG_DYN_LINK
$ g++ Logger.o main.o -o logger -L/opt/local/lib -lboost_log-mt -lboost_thread-mt -lboost_system-mt
$ ./logger
3 2014/12/14 23:51:46.462308 (UTC) [WARNING] This is a WARNING output
4 2014/12/14 23:51:46.462322 (UTC) [ERROR] This is an ERROR output
5 2014/12/14 23:51:46.462336 (UTC) [FATAL] This is a FATAL output
$ cat debug.log
1 2014/12/14 23:51:46.462186 (UTC) [DEBUG] This is a DEBUG output
2 2014/12/14 23:51:46.462300 (UTC) [INFO] This is a INFO output
#include "Logger.h"
int main()
{
MyProject::Logger logFile("debug.log");
logFile.SetFilterLevel(MyProject::Logger::kDebug);
MyProject::gLogger.Debug("This is a DEBUG output");
MyProject::gLogger.Info("This is a INFO output");
MyProject::gLogger.Warning("This is a WARNING output");
#ifndef MY_PROJECT_LOGGER_H_
#define MY_PROJECT_LOGGER_H_
#include <fstream>
#include <stdio.h>
#include <stdarg.h>
#include <string>
#include <boost/smart_ptr/shared_ptr.hpp>
#include <boost/smart_ptr/make_shared_object.hpp>
#include <boost/phoenix/bind.hpp>