- 博客(76)
- 收藏
- 关注
原创 新买笔记本误删office2021解决方法
前情:本来想装下学校免费的visio 卸载完预装office 才发现学校visio要求win专业版 而笔记本默认安装windows11家庭版 不想重装系统 只能把office装回来了解决方法:在网上找了一下一般都是在微软官网订阅里再下回来 然鹅我账号的订阅里除了让我买Microsoft365之外毛都没有以下是可行的解决方法1. 需要知道电脑预装的office版本,然后按照版本下载回来, 例如我电脑预装office 家庭和学生版2021. 安装包比较大,下载时间很长下载链接百度网盘 请输入
2022-03-30 15:28:45 6769 4
原创 httprunner3.x源码阅读
-loader.py核心代码:将载入的yaml/json文件转化为字典,字典转化为testcase对象def load_testcase_file(testcase_file: Text) -> TestCase: """load testcase file and validate with pydantic model""" testcase_content = load_test_file(testcase_file) testcase_obj = load
2022-03-30 15:06:44 7279
原创 记一个golang安装坑
本来想直接homebrew安装一个低版本的1.12,结果出现~ % brew install go@1.12Updating Homebrew...Error: go@1.12 has been disabled because it is not supported upstream!没搜到解决办法
2021-08-18 18:34:28 4143
转载 httprunner mac安装locust报错
httprunner集成了locust 使用locusts命令时出现***@C02FRJYXMD6M ~ % locustsLocust is not installed, install first and try again.install with pip:$ pip install locust然后使用pip3安装 报错 ERROR: Command errored out with exit status 1: command: /Library/Framewo
2021-08-05 10:30:17 259
原创 HTTPRunner新手踩坑 httprunner.cli:main_run:49 - No valid testcases found, exit 1.
由于新建了Python文件作为testcase 文件名命名为test1.py,这样HttpRunner无法将其检测为testcase,需要将文件名更改为test1_test.py
2021-08-04 18:15:23 1162
转载 Mac配置flask 出现zsh: command not found: flask
解决:1.找到目录/Library/Frameworks/Python.framework/Versions/3.9/bin.拖入终端 cd2.vim ~/.bash_profile按i插入PATH="/Library/Frameworks/Python.framework/Versions/3.9/bin:${PATH}"export PATHesc退出 source ~/.bash_profile保存3.vim ~/.zshrc写入source ~/.bash_prof
2021-07-29 17:05:26 679
原创 github push本地文件到远程仓库
一、在要push的文件夹下git bash here二、git init三、git add .四、git commit -m “first commit”五、git remote add origin + github地址六、git pull --rebase origin master七、git push origin master八、输入账号密码。...
2020-09-14 11:59:57 167
原创 HTTPSConnectionPool(host=‘***‘, port=443): Read timed out.
https://blog.csdn.net/qq_38251616/article/details/81813793尝试1:仍会发生连接错误try: requests.adapters.DEFAULT_RETRIES = 5 html = requests.post(self.base_url, data=formdata,headers=self.headers,timeout=(3,7)).text parse_html =.
2020-09-10 14:22:49 1117
原创 爬虫:xpath定位不到列表元素原因
可能是由于列表未展开 元素展开elements展开如图:sources如图,可以到pageToolbar下面没有列表标签了因此,在xpath定位时"//*[@id='page']/div[2]/div/ul/li[2]/text()" 并不能获取到列表的text,就很无语还未找到解决方法,求教知道的大佬。。。...
2020-09-07 11:51:45 1479 3
原创 Xpath text()爬取表格 其中一个标签为空导致列表长度不一致
需求:想要获取列表["null","00"],但是使用text()只能得到["00"] 解决 如果是Xpath2.0的话,可以使用 contents4=selector.xpath('//li[@class = "tag_1"]//td/split(.)') 但是相信大多数人使用lxml,貌似仅仅支持Xpath1.0的亚子,因此只能先用//td获取td标签列表,再针对标签列表中每个标签调用.text html = ''' <li class="tag_1">
2020-09-03 20:58:51 1011
原创 搜索旋转排序数组
搜索旋转排序数组解题思二分法找到旋转数组最小值nums[i] 然后根据判断条件选择两边中的一边进行二分搜索时间复杂度O(2logN)代码在这里插入代码片class Solution { public int search(int[] nums, int target) { if(nums==null||nums.length==0) return -1; int i=0,j=nums.length-1; while(
2020-08-17 19:16:29 105
原创 Python csv文件中文写入乱码
解决乱码问题网上很多博客说encoding=‘utf-8-sig’,亲身尝试并无卵用。目前正解:encoding=‘gb18030’,权限‘wt’#python3with open(r"D:/spyder_py3/test.csv",'wt',encoding='gb18030',newline='') as f: writer=csv.writer(f) header1=['你','是', '个','好', '人'] writer.writerow(header1)发现写入c
2020-08-04 13:57:48 274
原创 Springboot2.x 链接mySql 报java.sql.SQLException: The server time zone value的错
在application.properties中在数据库url后添加serverTimezone=Asia/Shanghai因为默认情况下serverTimezone=UTC,比我们北京时间早8小时,写入数据库更新时间和系统时间不一致可能会报错spring.datasource.url=jdbc:mysql://localhost:3306/test?serverTimezone=Asia/Shanghai...
2020-07-21 15:07:54 121
原创 Mysql忘记密码 解决方法——重置密码(Win10)
参考:https://jingyan.baidu.com/article/ff411625efbd2012e4823730.html 如果不是以管理员身份运行cmd执行命令net stop mysql会报“发生系统错误5 拒绝访问” 重新以管理员身份运行cmd,输入net stop mysql 停止MySQL服务 打开一个cmd窗口输入mysqld --skip-grant-tables,注意这个cmd命令窗口不要关闭 重新打开一个cmd窗口,
2020-07-21 13:50:51 797
原创 Springboot helloworld. Failed to execute goal org.springframework.boot:spring-boot-maven-plugin..
问题一: 报错后面出现from/to 阿里云镜像链接,猜测是maven配置出了问题命令行输入mvn help:system果不其然出现错误No goals have been specified for this build. You must specify a valid lifec... build failure排查setting.xml没发现问题最后只好重装大法,删除maven的文件和本地仓库,重新解压配置,具体参考这个老哥的博客:https://www.cnblogs..
2020-07-17 13:59:34 310
原创 java 两个字符串日期差多少天|正则匹配日期
//计算两日期相差天数 public static long DayDiff(String date1, String date2,String format) { if (null == date1 || null == date2) { return -1; } SimpleDateFormat formater = new SimpleDateFormat(format); long diff = 0;.
2020-06-29 16:23:28 229
转载 畅通工程 -并查集
题目描述:任意两个城镇间都可以实现交通(不一定直接连接),问最少雪妖建设多少条路#include<iostream>#include<string.h>#include<string>#include<math.h>using namespace std;int path[1000];int findroot(int x,in...
2018-09-10 14:52:47 313
转载 大数相加 string
#include<iostream>#include<string.h>#include<string>#include<math.h>using namespace std;//char num1[1002], num2[1002];//char tmp[1002];string num1, num2,tmp;int main(...
2018-09-04 17:17:05 293
原创 整除问题
题目描述解法是求出n!和a所有共同的素因数e1=e2;其中e1的幂p1,e2的幂p2满足p1>=k*p2,找出所有共同素因数中满足条件的最小k;思想还是挺难想出来的,毕竟不是用数学思维思考的人。。#include<iostream>#include<string.h>#include<math.h>using namespace ...
2018-08-26 19:57:30 597
原创 素因数分解
#include<iostream>#include<string.h>#include<math.h>using namespace std;int a[100001];//0未知 1素数 2非素数int main(){ memset(a, 0, sizeof(a)); for (int i = 2; i < 10000...
2018-08-18 19:02:29 890
原创 素数筛法
#include<iostream>#include<string.h>#include<math.h>using namespace std;int a[10001];//0未知 1素数 2非素数int main(){ memset(a, 0, sizeof(a));//预处理 for (int i = 2; i <...
2018-08-18 17:58:28 175
原创 求素数
#include<iostream>#include<string.h>#include<math.h>using namespace std;int main(){ int n,flag; while (cin >> n) { flag = 0; if (n <= 1) ...
2018-08-18 17:22:44 189
原创 最小公倍数
与两数乘积/最大公约数等价#include<iostream>#include<string.h>using namespace std;int gcd(int a, int b){ if (b == 0)return a; else return gcd(b, a%b);}int main(){ int a, b; whi...
2018-08-18 17:11:14 519
原创 求最大公约数
定理 当a,b不为0时,a和b的最大公约数与b和amodb的最大公约数相同;当a和b其中一个为0时,另一个非零值则为最大公约数#include<iostream>#include<string.h>using namespace std;int main(){ int a, b; while (cin >> a >> b...
2018-08-18 17:00:52 209
原创 n进制转m进制
#include<iostream>#include<string.h>using namespace std;char in[1000],out[1000];char *tmp;int *size;//10进制转m进制void _10tom(int m,int num){ //确保数为0时至少执行一次 do { i...
2018-08-17 18:40:29 1571
原创 10进制转m进制
1<m<10#include<iostream>#include<string.h>using namespace std;int a[1000],i;//10进制转m进制void _10tom(int m,long long num){ //确保数为0时至少执行一次do { a[i++] = num%m; ...
2018-08-17 17:43:43 338
原创 特殊乘法 %
题目:求两个小于十亿的数,按位相乘再相加如12*45=1*4+1*5+2*4+2*5法1:#include<iostream>#include<string.h>using namespace std;char a[10], b[10];int main(){ while (cin >> a >> b) { ...
2018-08-17 17:16:06 328
转载 两棵树是否相同
核心是任意两种包括中序遍历的遍历结果相同,则树相同理解了一点指针的用法#include<iostream>#include<string.h>using namespace std;struct Node{ Node* lch; Node* rch; int num;}tree[110];int k,l;Node* creat...
2018-08-17 16:35:46 488
原创 华为2018笔试前两道
1、将原始字符串中去掉相同字符,按原有顺序输出(100分)//#include<stdio.h>//#include<string>//#include<iostream>//using namespace std;////char str[10000];//void main()//{// while (cin >> st...
2018-08-15 20:39:59 970 1
转载 建立二叉树
//根据输入的值顺序不同 树不唯一//输出前序遍历、中序遍历、后序遍历#include<stdio.h>#include<string>//using namespace std;struct Node{ Node *lch; Node *rch; int c;}tree[101];int n;//静态内存中已经分配的节点个数...
2018-08-15 18:36:08 307
转载 二叉树 前序+中序>>后序
#include<stdio.h>#include<string>//using namespace std;struct Node{ Node *lch; Node *rch; char c;}tree[50];int n;//静态内存中已经分配的节点个数Node *create(){//申请节点空间并返回其指针 tree[...
2018-08-15 17:59:37 196
原创 标准库函数求解 哈法曼树带权路径长度和
#include <iostream>#include <algorithm>#include<string>#include<queue>#include<functional>using namespace std;//使用优先队列实现最小堆priority_queue<int, vector<int&g...
2018-08-14 22:21:42 461
转载 九度 27 简单计算器 栈
不知道为啥这个会报错deque iterator not dereferencable#include <iostream>#include <algorithm>#include<string>#include<stack>using namespace std;char str[210];int prio[5][5] = { ...
2018-08-14 21:27:09 243
原创 九度26 括号匹配问题
//从左向右将(压入栈,遇到)则将栈顶匹配给它,由于栈的特性相当于从内向外匹配#include <iostream>#include <algorithm>#include<string>#include<stack>using namespace std;stack<int> s;char str[101];char...
2018-08-14 18:28:04 177
原创 九度18 二分查找
#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include<string>using namespace std;struct s{ char num[10]; char name[10]; ch...
2018-08-13 18:54:25 158
原创 九度 14排版
#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include<string>using namespace std;char a[3001][3001];void main(){ int n; whil...
2018-08-13 17:15:15 163
原创 九度oj 11 简单hash
//增加条件后可以输入相同的值;#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include<string>#define offset 500000using namespace std;int a[1000001]...
2018-08-13 16:57:01 218
原创 杭电2074 叠框
坑挺多的,首先是n=1的情况要特殊考虑其次是输出格式,气哭我了,它是要求除第一次外输入一行就换行,再输出,我一直是输出后再换行,很窒息我的做法是确定中心,然后确定中间那行,根据中间那行向上、下递推#include <iostream>#include <algorithm>#include <cstdio>#include <cstrin...
2018-08-09 22:51:33 576
转载 2073
#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include<string>using namespace std;void main(){ int n; while (cin >> n) ...
2018-08-09 18:40:55 237
转载 2072 数单词 set
//采用set容器,因为其内容唯一性,可以获得set容器的数目以得到单词数目#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include<string>#include<set>using namespa...
2018-08-09 17:05:22 249
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人