This file contains hidden or 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
import subprocess | |
import signal | |
import os | |
import sys | |
import time | |
import termios | |
old_settings = termios.tcgetattr(sys.stdin) | |
import readchar |
This file contains hidden or 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
public static T[] RemoveAt<T>(this T[] source, int index) | |
{ | |
T[] dest = new T[source.Length - 1]; | |
if( index > 0 ) | |
Array.Copy(source, 0, dest, 0, index); | |
if( index < source.Length - 1 ) | |
Array.Copy(source, index + 1, dest, index, source.Length - index - 1); | |
return dest; |
This file contains hidden or 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
import pyglet | |
from pyglet.gl import * | |
# REQUIRES: AVBin | |
pyglet.options['audio'] = ('alsa', 'openal', 'silent') | |
key = pyglet.window.key | |
# xfce4-notifyd | |
class main(pyglet.window.Window): | |
def __init__ (self): |
This file contains hidden or 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
import pyglet, math | |
from pyglet.gl import * | |
key = pyglet.window.key | |
from pyglet import app | |
from pyglet.libs.win32 import _user32 | |
from pyglet.libs.win32.constants import * | |
from pyglet.libs.win32.winkey import * | |
from pyglet.libs.win32.types import * |
This file contains hidden or 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
from time import time | |
theList = [1, 2, True, False, False] | |
for y in range(3): | |
start = time() | |
for i in range(1000000): | |
result = [x for x in theList if type(x) is bool] | |
end = time() |
This file contains hidden or 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
from threading import * | |
from time import sleep | |
import uuid | |
class worker(Thread): | |
def __init__(self): | |
Thread.__init__(self) | |
self.start() | |
def run(self): |
This file contains hidden or 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
#Definerer databasene og | |
database = {'Andreas' : 'Password1', | |
'Andy' : 'Password2'} | |
#Definerer funksjonene | |
def godkjent(): | |
print ('Halla ' +bruker) | |
def ikkegodkjent(): | |
print ('Beklager ' +bruker+ ', du har ikke tilgang her') |
This file contains hidden or 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
from time import time | |
from random import random | |
# Without checking the dictionary | |
x = {} | |
s = time() | |
for i in range(10000000): | |
x[round(random(), 6)] = True | |
e = time() | |
print(e-s, len(x), 'Using dict() for inserts') |
This file contains hidden or 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
from urllib3 import HTTPConnectionPool | |
pool = HTTPConnectionPool('www.google.se', maxsize=1) | |
ret = pool.request('GET', '/') | |
print(ret.status) | |
ret_two = pool.request('GET', '/search', fields={'q' : 'python'}) | |
print(ret_two) |
This file contains hidden or 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
# -*- mode: python -*- | |
block_cipher = None | |
# > pyinstaller.exe --onefile filetegrity.py | |
a = Analysis(['filetegrity.py'], | |
pathex=['C:\\Users\\anthvo\\Desktop'], | |
binaries=None, | |
datas=None, |