Skip to content

Instantly share code, notes, and snippets.

View lan496's full-sized avatar

Kohei Shinohara lan496

View GitHub Profile
# -*- coding: utf-8 -*-
from requests_oauthlib import OAuth1
import requests
import json
from datetime import datetime,timedelta
import secret
def streaming():
consumerKey=secret.twDict['consumer_key']
consumerSecret=secret.twDict['consumer_secret']
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long double ld;
////////////////////////////////////////////////////////////////////////
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import random
import math
######################################
#h^5 order
h=0.05
n=5
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import numpy as np
import random
#parameter
n = 10
mu = 10.0
p_0 = 0.01
# -*- coding: utf-8 -*-
import json
import datetime
import os
def loadSchedule():
f = open('schedule.json','r')
pDict = json.load(f)
f.close()
d = datetime.datetime.now()
# -*- coding: utf-8 -*-
from requests_oauthlib import OAuth1
import requests
import json
import re
from datetime import datetime,timedelta
import secret
def streaming(minutes):
#include<iostream>
long long dfs(int pos,int n,bool crd[][100],int y,int x){
if(pos==n) return 1;
int dy[]={0,1,0,-1};
int dx[]={1,0,-1,0};
long long res=0;
for(int k=0;k<4;k++){
int yk=y+dy[k];
int xk=x+dx[k];
//Ford-Fulkerson's algorithm
struct edge{int to,cap,rev;};
const int INF=1e9;
//g[e.to][e.rev] で逆辺を操作できる
void addEdge(vector<vector<edge> > &g,int from,int to,int cap){
g[from].push_back((edge){to,cap,(int)g[to].size()});
g[to].push_back((edge){from,0,(int)g[from].size()-1});
}
int dfs(vector<vector<edge> > &g,vector<bool> &used,int v,int t,int f){
(define (min x y)
(cond
((> x y) y)
((= x y) x)
((< x y) x)
)
)
(define (3-min x y z)
(min
@lan496
lan496 / sqrt
Last active August 29, 2015 14:20
(define (square x) (* x x))
(define (abs x)
(if (< x 0)
(- x)
x
)
)
(define (average x y)