Skip to content

Instantly share code, notes, and snippets.

View BOOtak's full-sized avatar

Kirill Leyfer BOOtak

View GitHub Profile
db = connect("localhost:27017/thesis");
deviceIds = db.gestures.distinct("deviceId");
// new Date(ISODate().getTime() - 1000 * 60 * 18) - 18 minutes ago
one_finger_touches = db.gestures.aggregate(
[
{"$match": {
"deviceId": deviceIds[0],
"timestamp": {"$gte": new ISODate("2016-01-10T00:00:00Z")}
import java.util.Random;
public class HelloWorld{
public static String randomString(int i)
{
Random ran = new Random(i);
StringBuilder sb = new StringBuilder();
while (true)
{
@BOOtak
BOOtak / amps_parity.py
Last active August 29, 2015 14:23
AMPS parity
#!/usr/bin/python3
import sys
def update_crc(data, crc):
temp = data
for i in range(0, 12):
crc = crc << 1
if temp & 0x800 != 0:
private boolean okToShow(ActivityRecord r) {
return r.userId == mCurrentUser
|| (r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0;
}
....
mService.mWindowManager.addAppToken(addPos, r.userId, r.appToken,
r.task.taskId, r.info.screenOrientation, r.fullscreen,
(r.info.flags & ActivityInfo.FLAG_SHOW_ON_LOCK_SCREEN) != 0);
class X:
@staticmethod
@classmethod
__init__
@property
methods
subclassed methods
__magic_methods__
import sys
from PyQt5.QtCore import Qt, QEvent
from PyQt5.QtWidgets import QWidget, QApplication
class TransparentWidget(QWidget):
def __init__(self):
super(TransparentWidget, self).__init__()
def changeEvent(self, e):