Skip to content

Instantly share code, notes, and snippets.

We couldn’t find that file to show.
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
class Node:
def __init__(self, value):
self.value = value
self.next = None
self.prev = None
class Deque:
def __init__(self):
self.head = None

安装pyenv

  1. 安装git yum -y install git
  • 安装pyenv curl -L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

  • 配置环境变量, 在 ~/.bash_profile里增加如下内容

    export PATH="~/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"

eval "$(pyenv virtualenv-init -)"

安装ipython 和 jupyter

  • pip install ipython
  • pip install jupyter

启动jupyter notebook

  • jupyter notebook --ip=0.0.0.0 --no-browser
# ~/.pip/pip.conf
[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com
@comynli
comynli / GarbageCollectors.java
Created July 17, 2017 03:50 — forked from khotyn/GarbageCollectors.java
Garbage collectors used in HotSpot JVM under different VM Options
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
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():