Skip to content

Instantly share code, notes, and snippets.

View neka-nat's full-sized avatar
🐻‍❄️
rebooting...

k-tanaka neka-nat

🐻‍❄️
rebooting...
View GitHub Profile
@neka-nat
neka-nat / sample1.py
Created October 10, 2022 13:30
csp test
import constraint as cst
problem = cst.Problem()
problem.addVariable("a", [1,2,3,4,5])
problem.addVariable("b", [4,5,6])
problem.addConstraint(cst.FunctionConstraint(lambda a, b: a > b + 10), ["a", "b"])
print(problem.getSolution())
@neka-nat
neka-nat / rakuten_currency.py
Last active September 4, 2017 17:40
Get information of currencies from Rakuten
#!/usr/bin/python
# -*- coding: utf-8 -*-
import urllib
import datetime
_DATA_INDEX = ['USDJPY', 'EURJPY', 'EURUSD',
'GBPJPY', 'AUDJPY', 'NZDJPY',
'ZARJPY', 'CADJPY', 'CHFJPY',
'GBPUSD', 'AUDUSD', 'HKDJPY',
'SGDJPY', 'NZDUSD', 'USDCHF',
@neka-nat
neka-nat / calc_path.py
Created February 2, 2017 04:14
Astar path calculation using networkx
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import networkx as nx
import matplotlib.pyplot as plt
EPS = 1.0e-9
def add_cross_edge(gp, shape):
"""