Skip to content

Instantly share code, notes, and snippets.

View muxueqz's full-sized avatar

muxueqz muxueqz

View GitHub Profile
@muxueqz
muxueqz / ejabberd.cfg
Created October 8, 2013 06:13
Archipel ejabberd.cfg
%%%
%%% ejabberd configuration file
%%%
%%% The parameters used in this configuration file are explained in more detail
%%% in the ejabberd Installation and Operation Guide.
%%% Please consult the Guide in case of doubts, it is included in
%%% your copy of ejabberd, and is also available online at
%%% http://www.process-one.net/en/ejabberd/docs/
@muxueqz
muxueqz / Dpark Fetch failed for shuffle
Created May 28, 2014 06:41
Dpark Fetch failed for shuffle
2014-05-26 00:18:22,040 [INFO] [broadcast] broadcast e96a2f61-fdd6-45d9-9be7-b50931e3fc33: 291 bytes in 1 blocks
2014-05-26 00:18:22,048 [INFO] [broadcast] broadcast 14e902be-8d9b-4a47-809e-589e7a1b6a34: 5 bytes in 1 blocks
2014-05-26 00:18:22,049 [INFO] [broadcast] broadcast 5d791168-2b67-428d-95ce-b7b83981a890: 3218 bytes in 1 blocks
2014-05-26 00:18:22,087 [INFO] [scheduler] Got job 1 with 693 tasks: <FlatMappedRDD <UnionRDD 1 <UnionRDD 24 <GZipFileRDD /mfs/logs/out-2014052500.log.gz> ...> ...>>
2014-05-26 00:19:41,069 [INFO] [job ] Job 1 finished in 79.0s: min=1.4s, avg=5.4s, max=9.2s, maxtry=1
2014-05-26 00:19:41,128 [INFO] [scheduler] Got job 2 with 441 tasks: <MappedRDD <FilteredRDD <MappedRDD <ShuffledRDD <FlatMappedRDD <UnionRDD 1 <UnionRDD 24 <GZipFileRDD /mfs/logs/out-2014052500.log.gz> ...> ...>>>>>>
2014-05-26 00:19:41,132 [INFO] [scheduler] Got job 3 with 441 tasks: <MappedRDD <FilteredRDD <MappedRDD <Shuffl
def curry(x)
u = bigObj(x)
def f1(y);
def f(a, b):
pass
return f(u, 10)
curr(10)(1) # 局部变量 u 会被创建
curr(10)(2) # 这是 u 会重新被创建,还是使用上一个语句 u 的缓存
#!/usr/bin/env python
def curry(x):
u = bigObj(x)
def f1(y);
def f(a, b):
pass
return f(u, 10)
@muxueqz
muxueqz / log
Created April 13, 2015 10:39
日志系统架构
#当前架构
heka(日志收集器) -> ElasticSearch(分布式搜索引擎,相当于数据库) -> Kibana(界面展现)
##Heka
- 日志收集服务
- Mozilla出品
- Golang编写
- 轻量却功能强大
- 灵活易用
- Go/Lua扩展
worddict = set()
with open ('words.txt') as fh:
lines = fh.readlines()
for element in lines:
words = element.rstrip()
worddict.add(words)
print '{0} words in spelling words'.format(len(worddict))
with open ('3-2_example.txt') as ex:
year_input = raw_input('Please enter a 4-digit year: ')
mylist = []
with open('F-F_Research_Data_Factors_daily.txt') as fh:
lines = fh.readlines()
slicedline = lines[6:-2]
header = lines[5].split()
for element in slicedline:
yearstr.mkt.smb.hml.rf = element.split()
@muxueqz
muxueqz / fh.py
Last active August 29, 2015 14:23
#!/usr/bin/env python2
try:
year_input = int(raw_input('Please enter a 4-digit year: '))
except:
exit('1st arg must be 4-digit year between 1926 and 2012')
factor_input = raw_input('please enter a Fama-French factor: ')
mylist = []
with open('F-F_Research_Data_Factors_daily.txt') as fh:
year_input = raw_input('Please enter a 4-digit year: ')
mylist = []
with open('F-F_Research_Data_Factors_daily.txt') as fh:
lines = fh.readlines()
slicedline = lines[6:-2]
header = lines[5].split()
for element in slicedline:
yearstr = element.split()[0]
#!/usr/bin/env python2
import urllib
import urllib2
import json
data = {'test': 'value'}
data = json.dumps(data)
url = "http://10.20.72.96:8181/api/send/5556?gm_url=http://192.168.65.156:9002/sendmail&menu_id=1"
#data = urllib.urlencode(data)