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
#!/usr/bin/python | |
import socket, os, select, time, threading | |
DATA = """*3\r\n$4\r\nHSET\r\n$8\r\ntest_key\r\n$10\r\ntest value\r\n""" | |
TOTAL_TIME = 0 | |
TOTAL_TESTS = 0 | |
class Client(threading.Thread): | |
def __init__(self, mutex): | |
threading.Thread.__init__(self) |
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
#!/usr/bin/python | |
import socket, os, select, time | |
sockets = {} | |
epoll = select.epoll() | |
data = """*3\r\n$4\r\nHSET\r\n$8\r\ntest_key\r\n$10\r\ntest value\r\n""" | |
for i in range(50): | |
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
s.connect("/tmp/socks") | |
epoll.register(s.fileno(), select.EPOLLOUT) |
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
#!/usr/bin/python | |
import socket, os | |
data = """*3\r\n$4\r\nHSET\r\n$8\r\ntest_key\r\n$10\r\ntest value\r\n""" | |
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) | |
s.connect("/tmp/socks") | |
for i in range(5): | |
s.send(data) | |
data = s.recv(1024) | |
s.close() |
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
масштаб_времени = 0,0001 | |
класс эмуляция_времени(): | |
конструктор класса(): | |
свойство время_начала = количество_секунд_с_фиксированного_момента_в_прошлом + доли_секунд | |
вывести "Время начала" + время_начала | |
получить_текущее_время(): | |
разница_времени = время_начала - (количество_секунд + доли_секунд) | |
текущее_время = разница_времени / масштаб_времени |
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
#!/usr/bin/python | |
import time | |
import optparse | |
from datetime import datetime, timedelta | |
import string | |
import random | |
import sys | |
minute = 60 | |
hour = 60 * minute |
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
#!/usr/bin/python | |
import time | |
import optparse | |
from datetime import datetime, timedelta | |
import string | |
import random | |
import sys | |
minute = 60 | |
hour = 60 * minute |
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
#!/usr/bin/python | |
import time | |
import optparse | |
from datetime import datetime, timedelta | |
import string | |
import random | |
import sys | |
minute = 60 | |
hour = 60 * minute |
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 socket | |
import select | |
class ChatServer: | |
def __init__( self, port ): | |
self.port = port; |
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
import sys | |
from OpenGL.GL import * | |
from PyQt4 import QtGui, QtCore | |
from PyQt4.QtOpenGL import * | |
obj = "points" | |
class WfWidget(QGLWidget): | |
def __init__(self, parent = None): | |
super(WfWidget, self).__init__(parent) |