Skip to content

Instantly share code, notes, and snippets.

View max-kov's full-sized avatar

Max Kovalovs max-kov

View GitHub Profile
num = int(input())
verteces = int(input())
data = [[-1]*(verteces+1) for i in range(verteces+1)]
for i in range(num):
indata = [int(i) for i in input().split()]
data[indata[0]][indata[1]] = indata[2]
current = 1
@max-kov
max-kov / parse.py
Last active October 11, 2017 20:49
Letter parser for text files
from string import ascii_lowercase
from collections import Counter
import matplotlib.pyplot as plt
import operator
import numpy as np
import glob
my_counter = Counter()
# for filename in glob.iglob(/home/max/*.txt):
@max-kov
max-kov / analysis.py
Last active May 21, 2020 18:15
Cambridge colleges admissions scraper and analyser
import colorsys
import pandas as pd
from scipy.stats import beta
from matplotlib import pyplot as plt
import math
import numpy as np
import matplotlib.patches as mpatches
@max-kov
max-kov / scraper.py
Created July 16, 2017 18:13
dr frost maths python point farmer
import requests
from BeautifulSoup import BeautifulSoup
import dryscrape
import time
url = "http://www.drfrostmaths.com/homework/do-question.php?aaid=161230"
sess = dryscrape.Session()
sess.visit("http://www.drfrostmaths.com/homework/login.php")
name = sess.at_xpath('//*[@name="login-email"]') # Where <input name="username">
name.set("email here")
@max-kov
max-kov / maxs_bot.py
Created June 22, 2017 18:01
my bot for discord i made, sensitive data replaced with --...--
from cleverwrap import CleverWrap
import discord
from discord.ext.commands import Bot
import wolframalpha
at_max_id = "--MY ID--"
at_bot_id = "--BOT ID--"
cb = CleverWrap("--cb id--")
token = "--chat token--"
my_bot = Bot(command_prefix="!")
@max-kov
max-kov / main.py
Last active May 21, 2020 18:16
The two guy problem
import pygame
import math
start_x = 50
start_y = 150
start_dist = 300
top_guy = [start_x,start_dist+start_y]
bottom_guy = [start_x,start_y]
vel = 0.1
angle = 0
@max-kov
max-kov / csanalysis.tex
Created May 9, 2017 20:49
my cs analysis in latex
\documentclass{article}
\usepackage{titlesec}
\titleformat{\section}{\huge\bfseries}{}{}{}
\setlength{\parindent}{4em}
\setlength{\parskip}{1em}
\begin{document}
\author{Maksims Kovalovs}
\title{Computer science programming project}
@max-kov
max-kov / circles3
Created March 21, 2017 22:45
circle rolling in another circle
import pygame
import numpy as np
# change these values
points = 50000
radius1 = 100.0
radius2 = 70.0
point_disp = 100.0
angle_ratio =radius1/radius2
@max-kov
max-kov / circles2.py
Created March 21, 2017 22:23
drawing circles on a circle (which is moving)
import pygame
import numpy as np
# change these values
points_temp = 1000
radius1 = 100
radius2 = 100
angular_speed_1 = 0.01
angular_speed_2 = 0.0002
import pygame
import numpy as np
# change these values
points = 10000
circles = 30.0
radius = 200.0
resolution = np.array([1000, 500])