Skip to content

Instantly share code, notes, and snippets.

View stdk's full-sized avatar

Victor stdk

  • Larch Networks
  • Kiev
View GitHub Profile
import copy
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.QtWebKit import *
class FlickData(object):
Steady = 0
Pressed = 1
ManualScroll = 2
@stdk
stdk / MouseGestureRecognizer.py
Created October 16, 2013 22:15
Now pythonic!
from PyQt4.QtCore import *
from PyQt4.QtGui import *
class MouseGestureRecognizer(QGestureRecognizer):
Up = 0
Down = 1
Left = 2
Right = 3
AnyHorizontal = 4
@stdk
stdk / algorithm_x.py
Last active December 23, 2015 18:29
Knut's Algorithm X for python
from numpy import matrix,array
import numpy as np
from time import clock
def has_overlap(m):
for i in xrange(m.shape[0]):
for j in xrange(m.shape[1]):
if m[i,j] > 1:
return True
return False