#master

# -*- coding: utf-8 -*-
import sys
#reload(sys)
sys.setdefaultencoding("utf-8") import pymongo import random, time, Queue
from multiprocessing import freeze_support
from multiprocessing.managers import BaseManager global connetion
connetion=pymongo.MongoClient('192.168.30.79',27017)
#connection=pymongo.MongoClient('mongodb://10.10.5.216:27017')
dbs=connetion.database_names()
for i in dbs:
print("mongdb connect successful")
print (i+"\n")
db=connetion.get_database('5wdomian_0519')
table11=db.get_collection('DeviceData')
table12=db.get_collection('DeviceDataSource')
table13=db.get_collection('Device')
# ####################################################################
# 发送任务的队列:
task_queue = Queue.Queue(maxsize=100)
# 接收结果的队列:
result_queue = Queue.Queue() # 从BaseManager继承的QueueManager:
class QueueManager(BaseManager):
pass def return_task_queue():
global task_queue
return task_queue def return_result_queue():
global result_queue
return result_queue def test():
# 把两个Queue都注册到网络上, callable参数关联了Queue对象:
# QueueManager.register('get_task_queue', callable=lambda: task_queue)
# QueueManager.register('get_result_queue', callable=lambda: result_queue)
QueueManager.register('get_task_queue', callable=return_task_queue)
QueueManager.register('get_result_queue', callable=return_result_queue) # 绑定端口5000, 设置验证码'abc':
manager = QueueManager(address=('192.168.30.72', 5001), authkey=b'abc')
# 启动Queue:
manager.start()
# 获得通过网络访问的Queue对象:
task = manager.get_task_queue()
result = manager.get_result_queue()
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
type='type'
sourceId='sourceId'
devId='devId'
content='content'
fileId='fileId'
subName='subName'
name='name'
aa=[]
bb=[]
cc=[]
#aa=list(type1[:])
config='config'
cdpTable='cdpTable'
routeTable='routeTable'
showCommand='showCommand'
arpTable='arpTable'
stpTable='stpTable'
macTable='macTable'
commonTable='commonTable'
nctTable='nctTable'
bgpNbrTable='bgpNbrTable'
dis_benchID='0d537ee8-ecec-4f45-9d52-e5660300d92d'
k=0
type1=table11.find({sourceId:dis_benchID},{type:1,sourceId:1,devId:1,content:1,fileId:1,subName:1,name:1},no_cursor_timeout=True)
type2=[]
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
# 放几个任务进去:
try:
for i in type1: type2.append(i)
if len(type2)==5:
print (len(type2))
task.put(type2)
type2=[]
#print (i)
k+=5
print (k)
print ('queue size is'+str(task.qsize()))
if len(type2)!=0:
task.put(type2)
except Exception as e:
print (e)
# 从result队列读取结果:
type1.close()
print('Try get results...')
#for i in range(100):
r=result.get()
#print (r)
# print('Result: %s' % r)
# 关闭:
while r=='done':
manager.shutdown()
print('master exit.') if __name__ == '__main__':
freeze_support()
test() #worker
# -*- coding : utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding("utf-8")
import os
import pymongo
import datetime
from gridfs import GridFS import time, sys, Queue
from multiprocessing.managers import BaseManager
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
global connetion
connetion=pymongo.MongoClient('192.168.30.79',27017)
path='C:\\soft'
#connection=pymongo.MongoClient('mongodb://10.10.5.216:27017')
dbs=connetion.database_names()
for i in dbs:
print("mongdb connect successful")
print (i+"\n")
db=connetion.get_database('5wdomian_0519')
#table11=db.get_collection('DeviceData')
table12=db.get_collection('DeviceDataSource')
table13=db.get_collection('Device')
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% class QueueManager(BaseManager):
pass QueueManager.register('get_task_queue')
QueueManager.register('get_result_queue')
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
type='type'
sourceId='sourceId'
devId='devId'
content='content'
fileId='fileId'
subName='subName'
name='name'
aa=[]
bb=[]
cc=[]
#aa=list(type1[:])
config='config'
cdpTable='cdpTable'
routeTable='routeTable'
showCommand='showCommand'
arpTable='arpTable'
stpTable='stpTable'
macTable='macTable'
commonTable='commonTable'
nctTable='nctTable'
bgpNbrTable='bgpNbrTable'
dis_benchID='79aa8379-5bf4-42a7-9682-c71cf95f9873' #type1=table11.find({},{type:1,sourceId:1,devId:1,content:1,fileId:1,subName:1,name:1},no_cursor_timeout=True)
#%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% server_addr = '192.168.30.72'
print('Connect to server %s...' % server_addr) m = QueueManager(address=(server_addr, 5001), authkey=b'abc') try:
m.connect()
except :
print('please start task_master.py!')
sys.exit("sorry, goodbye!"); task = m.get_task_queue()
result = m.get_result_queue() try:
while True:
if not task.empty():
b=task.get()
for a in b:
print (a)
key1=a.keys()
if fileId not in key1:
if sourceId not in key1:
if not os.path.exists(path+"\\errdata"):
os.mkdir(path+"\\errdata")
else:
with open(path+"\\errdata\\errdata.txt",'a') as fe:
fe.write(str(a)+"\n")
else: #bb=list(table22[:]) #cc=list(table33[:])
table22=table12.find({},{'startTime':'True','srcType':'True'},no_cursor_timeout=True)
table33=table13.find({},{'name':'True','mip':'True'},no_cursor_timeout=True)
for b in table22:
if(a[u'sourceId']==b[u'_id']):
b1=(str(b[u'startTime'])+str(b[u'srcType'])).replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
path1=path+"\\"+b1
if not os.path.exists(path1):
os.mkdir(path1)
ty=str(a[u'type']) l1=len(str(ty))
if (ty[(l1-4):]=='Orig'):
if(ty[0:(l1-4)]==arpTable):
typename='ArpTable'
elif(ty[0:(l1-4)]==cdpTable):
typename='CdpTable'
elif(ty[0:(l1-4)]==bgpNbrTable):
typename='BGPAdRoutingTable'
elif(ty[0:(l1-4)]==routeTable):
typename='RoutingTable'
elif(ty[0:(l1-4)]==config):
typename='ConfigFile'
elif(ty[0:(l1-4)]==showCommand):
typename='ShowCommand'
elif(ty[0:(l1-4)]==stpTable):
typename='StpTable'
elif(ty[0:(l1-4)]==macTable):
typename='MacTable'
elif(ty[0:(l1-4)]==nctTable):
typename='CommonTable'
else:typename='unkown'+ty
path2=path1+"\\"+typename
if not os.path.exists(path2):
os.mkdir(path2) for c in table33:
if (a[u'devId']==c[u'_id']):
if(ty[0:(l1-4)]==arpTable):
if "subName" in key1:
hostname1=str(c[u'name']+"$management.txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
else:
hostname1=str(c[u'name']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==cdpTable):
hostname1=str(c[u'name']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==routeTable):
hostname1=str(c[u'name'])
if "subName" in key1:
hostname_file=str(hostname1+"$"+a[u'subName']['vrf']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
else:
hostname_file=str(hostname1+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content']) elif(ty[0:(l1-4)]==showCommand):
hostname1=str(c[u'name']+"$0$"+a[u'name']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==config):
hostname1=str(c[u'name']+".config").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'wb') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==macTable):
hostname1=str(c[u'name']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==stpTable):
hostname1=str(c[u'name']+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname1
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==bgpNbrTable):
if "subName" in key1:
hostname1=str(c[u'name'])
hostname_ip=a[u'subName']['peIp']
key2=a[u'subName'].keys()
if "vrf" in a[u'subName'].keys():
hostname_vrf=a[u'subName']['vrf']
hostname_file=str(hostname1+"$"+hostname_ip+"$"+hostname_vrf+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
else:
hostname_file=str(hostname1+"$"+hostname_ip+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content']) else:
hostname1=str(c[u'name'])
hostname_ip=c[u'mip']
hostname_file=str(hostname1+"$"+hostname_ip+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content'])
elif(ty[0:(l1-4)]==nctTable): hostname1=str(c[u'name'])
hostname_name=a[u'name'] hostname_file=str(hostname1+"$$"+hostname_name+".txt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname2=path2+"\\"+hostname_file
with open(hostname2,'w') as f1:
f1.write(a[u'content']) else:
if(ty==arpTable):
typename='ArpTable'
elif(ty==cdpTable):
typename='CdpTable'
elif(ty==bgpNbrTable):
typename='BGPAdRoutingTable'
elif(ty==routeTable):
typename='RoutingTable'
elif(ty==config):
typename='ConfigFile'
elif(ty==showCommand):
typename='ShowCommand'
elif(ty==stpTable):
typename='StpTable'
elif(ty==macTable):
typename='MacTable'
elif(ty==nctTable):
typename='CommonTable'
else:typename='unkown'+ty
path2=path1+"\\"+typename
if not os.path.exists(path2):
os.mkdir(path2)
for c in table33:
if (a[u'devId']==c[u'_id']):
if(ty==arpTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_vrf=a[u'subName']['vrf']
filename=str(hostname+"$"+hostname_vrf+"$"+"default-live.oat").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$$"+"default-live.oat").replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==cdpTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_vrf=a[u'subName']['vrf']
filename=str(hostname+"$"+hostname_vrf+"$"+"default-live.cdp").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$$"+"default-live.cdp").replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==routeTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_vrf=a[u'subName']['vrf']
filename=str(hostname+"$"+hostname_vrf+"$"+"default-live.ort").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$$"+"default-live.ort").replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==showCommand):
hostname=str(c[u'name'])
hostname_vrf=str(a[u'name'])
filename=str(hostname+"$0$"+hostname_vrf+".txt").replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==config):
hostname=str(c[u'name']).replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF') filename=hostname+".config"
hostname4=path2+"\\"+filename
with open(hostname4,'wb') as f2:
f2.write(a[u'content'].decode('utf8'))
elif(ty==macTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_vrf=a[u'subName']['vrf']
filename=str(hostname+"$"+hostname_vrf+"$"+"default-live.omt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$$"+"default-live.omt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==stpTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_vrf=a[u'subName']['vrf']
filename=str(hostname+"$"+hostname_vrf+"$"+"default-live.stp").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$$"+"default-live.stp").replace("*","XD").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==bgpNbrTable):
hostname=str(c[u'name'])
if "subName" in key1:
hostname_ip=a[u'subName']['peIp']
if "vrf" in a[u'subName'].keys():
hostname_vrf=a[u'subName'][u'vrf']
filename=str(hostname+"$"+hostname_ip+"$"+"default-live"+"$"+hostname_vrf+".obgprt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
else:
filename=str(hostname+"$"+hostname_ip+"$"+"default-live.obgprt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content']) else:
hostname_ip=c[u'mip'] filename=str(hostname+"$"+hostname_ip+"$"+"default-live.obgprt").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
elif(ty==nctTable):
hostname=str(c[u'name']) hostname_name=a[u'name'] filename=str(hostname+"$$"+hostname_name+".csv").replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
hostname4=path2+"\\"+filename
with open(hostname4,'w') as f2:
f2.write(a[u'content'])
table33.close()
table22.close()
else:
if a[u'fileId']!=None:
fs=GridFS(db)
table22=table12.find({},{'startTime':'True'})
bb=list(table22[:])
table33=table13.find({},{'name':'True'})
cc=list(table33[:])
for b in bb:
if(a[u'sourceId']==b[u'_id']):
b1=str(b[u'startTime']).replace("X","XX").replace("*","XD").replace("/","XA").replace(":","XC").replace("<","XG").replace(">","XH").replace("|","XI").replace("\\","XB").replace("?","XE").replace('"','XF')
path1=path+"\\"+b1
if not os.path.exists(path1):
os.mkdir(path1)
fileid=a[u'fileId']
print (fileid)
path2=path1+"\\"+str(fileid)+'.big'
f=fs.get(fileid).read()
with open(path2,'w') as f3:
f3.write(f)
#time.sleep(1)
else:
break
except Queue.Empty:
print('task queue is empty.')
#result.put('done') time.sleep(10)
print('worker exit...') if __name__ == '__main__':
pass

python+rabbitmq实现分布式的更多相关文章

  1. Python RabbitMQ消息队列

    python内的队列queue 线程 queue:不同线程交互,不能夸进程 进程 queue:只能用于父进程与子进程,或者同一父进程下的多个子进程,进行交互 注:不同的两个独立进程是不能交互的.   ...

  2. python—Celery异步分布式

    python—Celery异步分布式 Celery  是一个python开发的异步分布式任务调度模块,是一个消息传输的中间件,可以理解为一个邮箱,每当应用程序调用celery的异步任务时,会向brok ...

  3. Python之路-python(rabbitmq、redis)

    一.RabbitMQ队列 安装python rabbitMQ module pip install pika or easy_install pika or 源码 https://pypi.pytho ...

  4. python RabbitMQ队列/redis

    RabbitMQ队列 rabbitMQ是消息队列:想想之前的我们学过队列queue:threading queue(线程queue,多个线程之间进行数据交互).进程queue(父进程与子进程进行交互或 ...

  5. python RabbitMQ队列使用(入门篇)

    ---恢复内容开始--- python RabbitMQ队列使用 关于python的queue介绍 关于python的队列,内置的有两种,一种是线程queue,另一种是进程queue,但是这两种que ...

  6. python RabbitMQ队列使用

    python RabbitMQ队列使用 关于python的queue介绍 关于python的队列,内置的有两种,一种是线程queue,另一种是进程queue,但是这两种queue都是只能在同一个进程下 ...

  7. RabbitMQ解决分布式事务

    案例:经典案例,以目前流行点外卖的案例,用户下单后,调用订单服务,让后订单服务调用派单系统通知送外卖人员送单,这时候订单系统与派单系统采用MQ异步通讯. RabbitMQ解决分布式事务原理: 采用最终 ...

  8. RabbitMq解决分布式事物

    一.RabbitMQ解决分布式事务思路: 案例: 经典案例,以目前流行点外卖的案例,用户下单后,调用订单服务,让后订单服务调用派单系统通知送外卖人员送单,这时候订单系统与派单系统采用MQ异步通讯. 二 ...

  9. 使用RabbitMQ实现分布式事务

    RabbitMQ解决分布式事务思路: 案例: 经典案例,以目前流行点外卖的案例,用户下单后,调用订单服务,让后订单服务调用派单系统通知送外卖人员送单,这时候订单系统与派单系统采用MQ异步通讯. Rab ...

随机推荐

  1. python对象类型----数字&字符串

    一数据类型:      float: 1.3e-3  1.3*10的负三次方 print (1.3e-3)    bin()  #转换为二进进制    oct() #转换为8进制    hex()#转 ...

  2. 跨平台移动开发_Windows 8平台使用 PhoneGap 方法

    原文地址: Using PhoneGap in Windows 8 Store Applications 下载phonegap 2.9.1 下载地址: https://codeload.github. ...

  3. Es6 export default 的用法

    export 之后加上default意指默认接口的意思,在一个文件里面默认的只能有一个 其区别就是{} 在export中 引入需要用{}来盛放 //这是设置入口var a='my name is xi ...

  4. strspn() 和 strcspn() 函数【转】

    本文转载自:https://flyer103.wordpress.com/2011/06/03/strspn-%E5%92%8C-strcspn-%E5%87%BD%E6%95%B0/ 前几天在看一本 ...

  5. Docker 监控平台Prometheus

    Prometheus 是一个强大的监控平台,提供了监控数据搜集.存储.处理.可视化和告警一套完整的解决方案. 官方网站:https://prometheus.io

  6. Centos6.5下Hbase安装

    下载 http://mirror.bit.edu.cn/apache/hbase/hbase-0.94.26/hbase-0.94.26.tar.gz 2.  解压 tar -zxvf hbase-0 ...

  7. java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

    java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction问题 1.问题描述 执行了几条update语句 ...

  8. SolrCloud 5.5.5 + Zookeeper + HDFS使用

    安装sol r 三个节点192.168.1.231,192.168.1.234,192.168.1.235 下载安装包solr.tar.gz 解压 tar -zxvf solr.tar.gz 配置ZK ...

  9. hdoj1004--Let the Balloon Rise

    Problem Description Contest time again! How excited it is to see balloons floating around. But to te ...

  10. numpy中的matrix与array的区别

    Numpy matrices必须是2维的,但是 numpy arrays (ndarrays) 可以是多维的(1D,2D,3D····ND). Matrix是Array的一个小的分支,包含于Array ...