自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(125)
  • 资源 (4)
  • 收藏
  • 关注

原创 2021-03-25

1.段错误 core文件2.写异常,kdb show exception dmesg3.既没有段错误(规则计数错误,平台与底层不一致),有没有写异常 分析代码优先级抢占激烈的情况,可能导致计数已添加,但规则没添加

2021-03-25 18:48:38 140

原创 IPV6掩码计算

ip->s6_addr32[0]&=ip_mask->s6_addr32[0]

2021-03-19 09:37:56 3736

原创 2021-03-18

show interface briefrx速率为0内核打印netstate…hz=1000,用户态vtyou打印netstate.hz是0原因,代码合入时,用户态netstate结构体和疒核态大小不一致,导致没有把内核态的hz成员拷贝到用户态

2021-03-18 08:42:17 110

原创 记一次静态内联函数调用函数指针引起的问题

此静态内联函数定义在头文件中,函数中的函数指针,被初始化时展开一次,此后不在调用函数指针指向的函数

2021-03-08 21:22:32 194

原创 用户态 调用头文件中的宏如何调试

gdb,初步判断是头文件中的宏,使用了函数指针没生效

2021-02-20 07:37:19 136

原创 计数跟并发有关,memcmp导致kdb

整机容量,业务容量均相同的情况下,先加一条ruleID为1的规则,再加一条ruleID相同的其他类型的规则,导致kdb。有可能会挂,因为若内存有用。若比较的长度多于rule1,但,后边多比较的那段内存没有用,则不会挂。...

2021-01-15 18:24:50 118

原创 2021-01-03

精确规则下发速度跟什么有关?rcp下规则 为什么计数比实际下发数量少一点?rcp不停下发规则为什么会有不命中的?

2021-01-03 16:57:56 75

原创 c语言中的短路规则,在项目中的影响

写法一:(不能得到想要的结果)spn_kern_get_ifindex_by_fpga_xaui_index(slot, chip, (port_index || 25 == port_index) ? 0: 8, &outifindex[0]);写法二:(可以得到想要的结果)spn_kern_get_ifindex_by_fpga_xaui_index(slot, chip, (1 == port_index || 25 == port_index) ? 0: 8, &outif.

2020-09-10 11:36:07 348

原创 svn 冲突示例

<<<<<<< .mine if (board_info->type[slot_index] != DPX_BOARD_16_16 && board_info->type[slot_index] != DPX_BOARD_8_20 && board_info->type[slot_index] != DPX_BOARD_2_24)||||||| .r117045 if (board_info->.

2020-07-08 16:49:21 211

原创 将VOC2012数据集转换为tfrecord格式,遇到的问题

要运行的文件:models-master\research\object_detection\dataset_tools\create_pascal_tf_record.py1、设置run edit configurations--&gt;Script parameters:--data_dir C:\Users\XX\Downloads\models-master\research\object...

2018-04-16 09:22:46 3582 13

原创 DecisionTree笔记

-----------------csvobj.next()-->next(csbobj)---------AttributeError: '_csv.reader' object has no attribute 'next' 我在使用pyhon3.4运行以下代码时报错:AttributeError:解决方案:For version 3.2 and aboveChange: cs

2017-11-29 17:40:20 292

原创 加减乘除计算器Demo

# @time:2017/11/2520:13""""""import redef mulfunc(a, b): return str(a * b)def chufunc(a, b): return str(a / b)def addfunc(a, b): return str(a + b)def minfunc(a, b):

2017-11-26 22:04:05 379

转载 Python数据类型之间的转换 函数 描述 int(x [,base]) 将x转换为一个整数 long(x [,base] ) 将x转换为一个长整数 float(x) 将x转换到一个浮点数

Python数据类型之间的转换函数描述int(x [,base])将x转换为一个整数long(x [,base] )将x转换为一个长整数float(x)将x转换到一个浮点数complex(real [,imag])创建一个复数str(x

2017-11-26 13:34:56 3045

转载 sys.path.append

如图所示,几乎每个文件中都有这几行代码(个人认为不太优雅)有什么好处? 坏处?如果真的要像图中那么做,更加优雅点的方法是?PS: 之所以把该整个项目的package导入到sys.path中,主要是因为「方便使用,如同导入标准库一样」答案对人有帮助,有参考价值1答案没帮助,是错误的答案,答非所

2017-11-24 10:19:06 378

原创 省会城市小测验

8章练习#coding:utf-8import randomcapitals={'广东':'广州','福建':'福州','浙江':'杭州','江苏':'南京','山东':'济南','河北':'石家庄','河南':'郑州'}tmpList=list(capitals)title='''Name:Date:Period:'''for i in range(7): s

2017-11-24 08:44:49 379

原创 Python 正则表达式

import recustomRegex1 = re.compile(r'\d\d\d-\d\d\d-\d\d\d\d') #r1 = customRegex1.search('455-456-9889')print(r1.group())customRegex2 = re.compile(r'\d{3}-\d{3}-\d{4}') # 用花括号表示重复次数r2 = customR

2017-11-07 22:48:21 210

原创 Python装饰器

1、装饰器(无参数)import timedef detecator_test(func): def inner(): start = time.time() func() end = time.time() print('耗时:', end - start) return inner@detecator_

2017-11-03 00:05:39 143

原创 day2-作业 shell sed 字符串替换

import sysfind_str=sys.argv[1]replace_str=sys.argv[2]with open('test.txt','r') as f: with open('test1.txt','w') as f2: for line in f: if find_str in line:

2017-11-02 00:21:24 241

转载 yield函数测试

'''①my.send(None): 意思为启动协程,此步会返回第一个yield后面的data值。②send一次,运行的代码是两个yield之间的代码,最后返回后一个yield后面的data值,若缺少后一个yield语句,则会报错“Stoplteration”③r = yield data r 为my.send('传入的数据') 传入的数据 data为此段运行完返回的数据''

2017-11-01 11:25:10 433

原创 6.4处理剪切板中的字符串

'''在编辑一篇维基百科的文章时,你可以创建一个无序列表,即让每个列表项占据一行, 并在前面放置一个星号。但是假设你有一个非常大的列表, 希望添加前面的星号。你可以在每一行开始处输入这些星号, 一行接一行。或者也可以用一小段Python 脚本, 将这个任务自动化。bulletPointAdder.py 脚本将从剪贴板中取得文本, 在每一行开始处加上星号和空格, 然后将这段新的文本贴回到

2017-11-01 11:21:16 300

原创 6.7将嵌套列表按表格打印

'''编写一个名为 printTable()的函数, 它接受字符串的列表的列表,将它显示在组织良好的表格中, 每列右对齐。假定所有内层列表都包含同样数目的字符串。例如,该值可能看起来像这样:tableData = [['apples', 'oranges', 'cherries', 'banana'],['Alice', 'Bob', 'Carol', 'David'],['dogs'

2017-11-01 11:17:41 875

原创 模拟进度条

import time ,sysfor i in range(20): sys.stdout.write('#') time.sleep(0.1) sys.stdout.flush()

2017-10-30 22:38:41 422

原创 模拟密码管理箱

import sysimport pyperclippwdic={'email':'123456','blog':'654321'}if len(sys.argv)<2: print('用法不正确') exit()account=sys.argv[1]if account in pwdic: pyperclip.copy(pwdic[account])

2017-10-30 22:37:53 213

原创 模拟购物车

模拟用户购物data=dict()salary=4000with open('D:/products.txt','r') as productlsit: #将商品信息显示给用户 for line in productlsit: (k,v)=line.strip('\n').split(':') data[k]=v print('{n

2017-10-30 22:33:34 284

原创 修改商品价格

# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2915:53import jsonnew_product={}mod_product={}data={}while True: selected=input('add:添加商品,mod:修改价格,q:退出') if sel

2017-10-29 23:20:59 892

翻译 模拟购物车

# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2816:29products=[{"aaa":"700"},{"bbb":"400"},{"ccc":"200"},{"ddd":"100"}]cart=[]salary = int(input('请输入工资:'))print(produc

2017-10-28 23:39:27 271

原创 Python 猜数字与模拟登陆

猜数字程序:# @Author Jonathon# @Software: PyCharm Community Edition# @time:2017/10/2319:59age=56count=0while count<3: age111 =int(input('age:')) if age111==age: print('you are right'

2017-10-23 23:44:20 262

原创 字符串拼接

name=input('name:')age=input('age:')salary=input('salary:')info1='''---------user info(拼接)------name:'''+name+'''\nage:'''+age+'''\nsalary:'''+salaryinfo2='''----------user info----(占位符)---

2017-10-22 23:16:43 224

转载 Python注释详解

来源:http://www.jb51.net/article/85629.htm注释用于说明代码实现的功能、采用的算法、代码的编写者以及创建和修改的时间等信息。注释是代码的一部分,注释起到了对代码补充说明的作用。Python注释Python单行注释以#开头,单行注释可以作为单独的一行放在被注释的代码行之上,也可以放在语句或者表达式之后。?

2017-10-22 20:17:05 1957 1

原创 Remove Element

Given an array and a value, remove all occurrences of that value in place and return the new length.The order of elements can be changed, and the elements after the new length don't matter.

2017-10-22 01:19:49 250

转载 Python实现删除列表中满足一定条件的元素示例(转)

Python实现删除列表中满足一定条件的元素示例

2017-10-22 01:04:58 5870 3

转载 Using table loop for filter

Using table loop for filter

2017-10-21 10:39:44 190

转载 Displaying multiple records in one row

Displaying multiple records in one row

2017-10-20 16:35:42 220

转载 WM_CONCAT字符超过4000的处理办法

oracle WM_CONCAT字符超过4000的处理办法

2017-10-20 16:17:27 1530

原创 线程:红绿灯

import threadingimport timeevent=threading.Event()def lighter(): counter=0 while True: if counter>3 and counter<=6: print("\33[1;41;m red") time.sleep(1)

2017-10-20 00:35:43 558

原创 numpy数组基本操作

import numpy as npaaa=np.arange(24).reshape(2,3,4)print(aaa,'\n----------------')print(aaa.sum(axis=0),'\n--------------')#表示全部平面上的对应位置print(aaa.sum(axis=1),'\n-------------')#每一个平面的每一列print(aa

2017-10-19 23:13:50 259

原创 判断字符串是否是回文

class Solution: def isPalindrome(self,ss): if not ss: return True startflag,endflag=0,len(ss)-1 while startflag<endflag: if not ss[startflag].isal

2017-10-19 20:46:05 395 1

原创 Python学习笔记

1、多维数组转置2、a = np.array([[[1, 2, 3],[4, 5, 6],[7, 8, 9]]])b=a.T()TypeError: 'numpy.ndarray' object is not callableT()用法不对3、列表数据类型转换后,dtype显示没变的原因arr = np.array([2.3, 3.2, -1.4, 2.3]) arr.

2017-10-16 19:43:20 334

转载 PMP认证申请流程

PMP认证申请流程是: 1、在PMI网站做PMP英文注册报名 2、在外专局项目管理培训中心网站上做PMP中文注册报名 3、在线支付PMP考试费 4、按照规定时间参加PMP考试

2017-10-16 16:02:12 561

转载 Python: NumPy中的多维数组ndarray

Python中的数组

2017-10-15 20:28:40 95583 4

FPN.pdf Feature Pyramid Networks

FPN.pdf Feature Pyramid Networks

2021-02-13

Git教程.docx

Git教程.docx

2021-02-13

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除