Skip to content

Instantly share code, notes, and snippets.

View andrhua's full-sized avatar
🐛

Andrey Yugai andrhua

🐛
  • Saint-Petersburg, Russia
View GitHub Profile
@andrhua
andrhua / поцеловать рому.
Last active January 5, 2019 21:28
breakup date generator
import datetime
import numpy as np
from scipy.interpolate import InterpolatedUnivariateSpline
if __name__ == '__main__':
# days elapsed from meeting to first copulation
xi = np.array([2*7, 2*30])
# days elapsed from meeting to breakup
yi = np.array([3*7, 6*30])
s = InterpolatedUnivariateSpline(xi, yi, k=xi.shape[0] - 1)
@andrhua
andrhua / piss_and_cry.py
Last active March 30, 2019 14:33
Shit and cum
import numpy as np
def gauss(A, B):
n = len(A)
def argmax(A):
i, m = 0, A[0]
for j, a in enumerate(A):
if a > m:
@andrhua
andrhua / in_my_heart.py
Last active March 31, 2019 16:50
deep down
import numpy as np
from sympy import *
from sympy.parsing.sympy_parser import parse_expr
def newton(f, x0, eps):
x = Symbol('x')
sym_f = parse_expr(f)
f = lambdify(x, sym_f)
df = lambdify(x, diff(sym_f, x))
while 1: