(a)
- ExtractMin: 堆顶元素依然是最小值,取出后Heapify一次。时间复杂度:O(logdn*d(注意logdn中d是底数)
- DecreaseKey:减少一个节点的值可能使这个值比它的父亲更小,需要递归的与它当前的父亲比较和交换,直到当前父亲的值更小。时间复杂度O(logdn)
- Heapify:比较当前子堆的堆顶是否比它的儿子小,若不是就将它最小的儿子交换,递归下去。时间复杂度:O(logdn*d)
| import csv | |
| import os | |
| class M15(object): | |
| '''Every 15mins data''' | |
| def __init__(self): | |
| self.size = 0 |
(a)
ps aux | grep <这个agent的名字>,kill -15 <pid> 停掉这个agent。:~/local/flume/flume-ng/conf/<agent>/<pkg_name>.propertiescat ~/local/flume/flume-ng/start.sh后,找到对应agent的启动命令。比如Main的agent:nohup bin/flume-ng agent --conf conf/main --conf-file conf/main/Main.properties --name Main -Dflume.monitoring.type=http -Dflume.monitoring.port=30005 > /dev/null 2>&1 </dev/null &| #!/env/python | |
| # coding: utf-8 | |
| from subprocess import check_output, PIPE, Popen | |
| import sys | |
| import re | |
| BADREV = "0000000000000000000000000000000000000000" |
| diff --git a/Gemfile b/Gemfile | |
| index 195de7b..84bb745 100644 | |
| --- a/Gemfile | |
| +++ b/Gemfile | |
| @@ -164,7 +164,7 @@ gem "jquery-ui-rails", "2.0.2" | |
| gem "raphael-rails", "~> 2.1.2" | |
| gem 'bootstrap-sass', '~> 3.0' | |
| gem "font-awesome-rails", '~> 3.2' | |
| -gem "gitlab_emoji", "~> 0.0.1.1" | |
| +gem "gemoji", "~> 1.3.0" |
| import os | |
| from subprocess import check_call | |
| filenames = list(os.walk("."))[0][2] | |
| for filename in filenames: | |
| if filename.endswith(".java"): | |
| classname = filename.partition(".java")[0] | |
| check_call(["git", "add", filename]) |