Profile | download (kb/s) | upload (kb/s) | latency (ms) |
---|---|---|---|
Native | 0 | 0 | 0 |
GPRS | 50 | 20 | 500 |
56K Dial-up | 50 | 30 | 120 |
Mobile EDGE | 240 | 200 | 840 |
2G Regular | 250 | 50 | 300 |
2G Good | 450 | 150 | 150 |
3G Slow | 780 | 330 | 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import os, pygame, random | |
pygame.init() | |
pygame.mouse.set_visible(False) | |
BACKGROUND = (0,0,0) | |
INTERVAL = os.getenv('INTERVAL', 60) | |
IMAGEFOLDER = os.getenv('IMAGEFOLDER', 'images') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// QRImage.swift | |
// QRCodeSample | |
// | |
// Created by ing.conti on 08/06/2019. | |
// Copyright © 2019 ing.conti. All rights reserved. | |
// | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension DispatchQueue { | |
class func mainSyncSafe(execute work: () -> Void) { | |
if Thread.isMainThread { | |
work() | |
} else { | |
DispatchQueue.main.sync(execute: work) | |
} | |
} | |
class func mainSyncSafe<T>(execute work: () throws -> T) rethrows -> T { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Fuzzy string-matching algorithm | |
// Implementation of algorithm described at: http://blog.notdot.net/2007/4/Damn-Cool-Algorithms-Part-1-BK-Trees | |
// Essentially builds an index of strings by levenshtein distance (N-ary tree) on which you can run range queries. | |
// The root node can be chosen arbitrarily. Each node holds a string and a collection of edges, representing distance to other strings, which then have their own children and so on, building a complete index. | |
// See https://github.com/vy/bk-tree for (impressive) performance statistics despite this tending to create an unbalanced N-ary tree | |
class BKTreeNode { | |
var value: String | |
var edges: Dictionary<Int, BKTreeNode> |