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 subprocess | |
import threading | |
class Command(object): | |
def __init__(self, cmd, out, timeout): | |
self.cmd = cmd | |
self.out = out | |
self.timeout = timeout | |
self.__event = threading.Event() | |
self.proc = None |
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
class Node: | |
def __init__(self, value): | |
self.value = value | |
self.next = None | |
self.prev = None | |
class Deque: | |
def __init__(self): | |
self.head = None |
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
# ~/.pip/pip.conf | |
[global] | |
index-url = http://mirrors.aliyun.com/pypi/simple/ | |
trusted-host = mirrors.aliyun.com |
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 java.io.IOException; | |
import java.lang.management.ManagementFactory; | |
import java.util.Set; | |
import javax.management.MBeanServer; | |
import javax.management.ObjectName; | |
/** | |
* Print the Collector used in the program. | |
* @author khotyn |
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
def two(path): | |
tmp = {} | |
with open(path) as f: | |
for line in f: | |
k, v = line.split(',') | |
k = k.strip() | |
v = float(v) | |
s, c = tmp.get(k, (0, 0)) | |
tmp[k] = (s+v, c+1) | |
for k, (s, c) in tmp.items(): |
OlderNewer