Skip to content

Instantly share code, notes, and snippets.

View hristo-vrigazov's full-sized avatar

Hristo Vrigazov hristo-vrigazov

View GitHub Profile
import asyncio, evdev
from mouse_handlers import left_mouse_down, left_mouse_up
from mouse_handlers import right_mouse_down, right_mouse_up
from evdev import ecodes
mouse_file = '/dev/input/event6'
keyboard_file = '/dev/input/event9'
down = 1
@hristo-vrigazov
hristo-vrigazov / k_means.py
Created July 22, 2016 07:47
Simple k means implementation to solve Coursera's quiz
import math
import statistics
import copy
centroids = [(2, 2), (-2, -2)]
data_points = [ \
(-1.88, 2.05), \
(-0.71, 0.42), \
(2.41, -0.67), \
(1.85, -3.80), \