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
import json | |
from httplib2 import Http | |
from oauth2client.client import SignedJwtAssertionCredentials | |
from apiclient.discovery import build | |
SERVICE_ACCOUNT_EMAIL = '**********@developer.gserviceaccount.com' | |
PROJECT_NUMBER = '**********' | |
KEYFILE='******************.p12' | |
with open(KEYFILE) as f: |
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
import math | |
import numpy as np | |
def pois_mean_diff_test(k1, k2, n1=1, n2=1, d=0.0): | |
x1_seq = range(0, k1 + 1) | |
x2_seq = range(0, k2 + 1) | |
l2k = (k1+k2)/(n1+n2) - d*n1/(n1+n2) | |
p_value = sum([math.exp(-n1*(l2k+d)) * np.prod([n1*(l2k+d)/i for i in range(1, x1+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
npm install aws-api-gateway-client |
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/python | |
import smbus | |
import time | |
import sys | |
import requests | |
from datetime import datetime | |
api_key='' |
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/python | |
import csv | |
import sys | |
import re | |
fps=10 | |
filename=sys.argv[1] | |
start_unixtime=int(re.search(r'(\d+)\.txt', filename).group(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
int intersection(Point2i p1, Point2i p2, Point2i p3, Point2i p4) { | |
// Store the values for fast access and easy | |
// equations-to-code conversion | |
int x1 = p1.x, x2 = p2.x, x3 = p3.x, x4 = p4.x; | |
int y1 = p1.y, y2 = p2.y, y3 = p3.y, y4 = p4.y; | |
int d = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4); | |
// If d is zero, there is no intersection | |
if (d == 0) return 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
var passport = require('passport'); | |
// passportモジュールをLoad | |
require('./passport')(app); | |
// session用のmiddlewaresを有効化 | |
app.use(passport.initialize()); | |
app.use(passport.session()); |
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
# Install CUDA Toolkit 9.1 including NVIDIA Driver | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb | |
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
sudo apt-get update | |
sudo apt-get install cuda | |
# Install Docker CE | |
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common |
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
import os | |
import glob | |
from PIL import Image, ImageOps | |
path_list = glob.glob('*.png') | |
for path in path_list: | |
filename, ext = os.path.splitext( os.path.basename(path) ) | |
im = Image.open(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
#!/usr/local/bin/python3 | |
import glob | |
import numpy as np | |
import cv2 | |
import sys | |
import os | |
import shutil | |
label='Ossicle' |
OlderNewer