Skip to content

Instantly share code, notes, and snippets.

View SeavantUUz's full-sized avatar
💭
I may be slow to respond.

AprocySanae SeavantUUz

💭
I may be slow to respond.
View GitHub Profile
# coding: utf-8
__author__ = 'AprocySanae'
class TreeNode(object):
def __init__(self, x):
self.val = x
self.left = None
self.right = None
def __str__(self):
import time
from threading import Event
from queue import Queue
import threading
q1 = Queue()
q2 = Queue()
class H(object):
def __init__(self):
<div class="l-content">
<div class="pricing-tables pure-g">
<div class="pure-u-1 pure-u-md-1-4">
<button type="button" class="button-success pure-button" onclick="test_start()">启动</button>
</div>
<div class="pure-u-1 pure-u-md-1-4">
<button type="button" class="button-error pure-button" onclick="test_stop()">停止</button>
</div>
function createXHR(){
if (typeof XMLHttpRequest != "undefined"){
return new XMLHttpRequest();
}
else {
throw new Error("No XHR object available");
}
}
# coding: utf-8
__inspired__ = 'jimmyislive <https://github.com/jimmyislive/hg-pylint-commit-hook>'
__author__ = 'AprocySanae'
import os
import subprocess
from hgapi import hgapi
import re
from StringIO import StringIO
# coding: utf-8
from tornado.ioloop import IOLoop
import tornado.web
from tornado import gen
import time
import settings as Settings
class TestHandler(tornado.web.RequestHandler):
@gen.coroutine
<!DOCTYPE html>
<head>
<script type="text/javascript">
var evtSrc = new EventSource("/test");
evtSrc.onmessage = function(e) {
console.log(e.data);
};
function send(){
var xhr = new XMLHttpRequest();
def func_environment():
env = dict()
def symbol(identify, bp=0, auto_commit = True):
try:
s = env[identify]
except Exception:
class s(Token):
pass
if auto_commit:
s.__name__ = 'symbol-{}'.format(identify)
def line_resize(lines, width):
count = len(lines)
index = 0
while index < count:
line = lines[index]
line_lenth = len(line)
if line_lenth > width:
s_width = 0
while s_width < line_lenth:
yield line[s_width:s_width+width]
from BasePool import BasePool
class TaskPool(BasePool):
def __init__(self, *args, **kwargs):
from gevent import spawn_raw
from gevent.pool import Pool
self.Pool = Pool
super(TaskPool, self).__init__(*args, **kwargs)
def on_start(self):