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
let fibonacci = { | |
[Symbol.iterator]() { | |
let pre = 0, cur = 1; | |
return { | |
next(p) { | |
console.log(p); | |
pre = cur | |
cur = pre + cur | |
//[pre, cur] = [cur, pre + cur]; | |
if (cur < 100) { |
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/env python | |
from os import listdir | |
from os.path import isfile, join | |
from subprocess import Popen, PIPE, STDOUT, call | |
import MySQLdb | |
import MySQLdb.cursors | |
import types | |
import warnings |
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 threading, logging, traceback | |
import sys, time | |
class LiveThread(threading.Thread): | |
def __init__(self, function_to_quit_the_process, thread_wait_in_seconds=1, | |
clean_up_wait_in_seconds=1, group=None, target=None, name="LiveThread", | |
args=(), kwargs={}, verbose=None, clean_up=None): | |
threading.Thread.__init__(self, group=group, target=target, name=name, | |
args=args, kwargs=kwargs, verbose=verbose) | |
self._function_to_quit_the_process = function_to_quit_the_process |
NewerOlder