- 博客(294)
- 收藏
- 关注
原创 ubuntu关闭自动更新
ubuntu中关闭自动更新的方法:1、打开终端;2、输入命令打开/etc/apt/apt.conf.d/10periodic配置文件;3、在配置文件中修改设置进行关闭即可。2、输入以下命令打开/etc/apt/apt.conf.d/10periodic配置文件。2、然后在弹出的窗口中将选项前面的钩去掉,实现从不更新,保存设置关闭即可。1、菜单栏点击“系统”→ 选择“首选项”→ 启动应用程序 → 更新提示。3、在配置文件中修改以下设置进行关闭即可。在图形界面中,可通过以下操作步骤关闭。
2023-08-24 10:07:57
107
原创 【Error】pytorch训练网络时报错:RuntimeError: received 0 items of ancdata
【Error】pytorch训练网络时报错:RuntimeError: received 0 items of ancdata
2023-03-31 17:55:49
66
原创 python使用cv2读取图片时报错:cv2.error: OpenCV(4.5.5) D:\a\opencv-python\opencv-
cv2中英文路径解决办法
2023-03-02 01:14:51
676
原创 os.walk能识别软连接目录吗
默认情况下,os.walk 不会遍历软链接指向的子目录,若有需要请将followlinks设定为true Python中os.walk()的使用方法
2023-02-16 10:32:03
99
原创 coco数据集分析
voc格式中xmin,ymin,xmax,ymax,是xyxy格式, 左上角坐标加右下脚坐标 , int整数。原始json格式中是xywh, 左上角坐标加框的宽高, float浮点数;bbox: yolo系列是cxcywhn, 中心点加宽高加图片宽高归一化, float浮点数;
2023-01-30 10:43:08
250
原创 TypeError: can‘t pickle _thread.RLock object
python 多线程时报错:TypeError: cannot pickle ‘_thread.lock‘ object使用进程池时遇到的坑... TypeError: can‘t pickle _thread.lock objectspython 中 多进程报错:TypeError: can't pickle _thread.lock objects TypeError: can't pickle _thread.RLock objects使用pickle时遇到TypeError: can't pick
2022-12-12 19:01:14
725
原创 leetcode297. Serialize and Deserialize Binary Tree
Serialize and Deserialize Binary Tree
2022-12-04 16:41:55
75
原创 Handling a thread’s exception in the caller thread in Python
python多线程中,主线程中如果捕获子线程的异常,笔者查阅了相关资料,有一种方式是使用队列(queue)将子线程的异常写入队列,然后主进程中去遍历异常消息队列,这种方式不近需要额外引入一个q对象,要同时遍历队列和判断线程状态,实现上上非常丑陋,后来发现如下方式,通过继承threading.Thread后,重写run和join方法,优雅地实现了线程方法的异常“上抛”,可以在主线程中轻松捕获子线程的异常信息。
2022-11-17 02:26:13
78
原创 CMakeLists.txt编写
cmake_minimum_required(VERSION 3.23)project(RPC)include_directories( ./include)link_directories( ./lib)set(CMAKE_CXX_STANDARD_REQUIRED ON)set(CMAKE_CXX_STANDARD 11)set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -pthread -fopenmp").
2022-04-22 19:47:20
375
原创 CMake 交叉编译demo
# the name of the target operating systemset(CMAKE_SYSTEM_NAME Linux)# which C and C++ compiler to useset (CMAKE_C_COMPILER /home/alex/eldk-mips/usr/bin/mips_4KC-gcc)set (CMAKE_CXX_COMPILER /home/alex/eldk-mips/usr/bin/mips_4KC-g++)# location .
2022-04-02 23:58:06
455
原创 日常 liunx使用笔记
1vim全局路径替换命令:%s#/home/szs/stb/stsdk/A36/rpmbuild/BUILD#/home/yinjiabin/qt#g解释:将/home/szs/stb/stsdk/A36/rpmbuild/BUILD替换为/home/yhinjiabin/qt2. autotool编译工具,常用参数./configure CC=gcc CXX=g++ --host=x86_64-pc-linux-gnu --enable-shared=no --enable-static.
2022-03-30 00:17:59
1619
原创 定义指针变量高32位清零的宏COMPAT_POINTER
/* 定义指针变量高32位清零的宏COMPAT_POINTER */#define HI_COMPAT_POINTER(ptr, type) \do { \hi_ulong ulAddr = (hi_ulong)ptr; \hi_u32 u32Addr = (hi_u32)ulAddr; \ptr = (type)(hi_ulong)u32Addr; \} while (0)
2022-03-28 09:22:23
395
转载 ubuntu 连接无线路由
Ubuntu18.04下小米、TPLink、腾达USB无线网卡跳坑记录_zhanghm1995的博客-CSDN博客_腾达u12
2022-02-04 01:36:30
220
原创 获取指定文件md5
#include <stdio.h>#include <stdlib.h>#include <pthread.h>#include <dirent.h>#include <string.h>#include <signal.h>#define FilePath "./include/"/*******************************************************************.
2022-01-21 15:54:38
1355
原创 # 68. 文本左右对齐
class Solution: def fullJustify(self, words: List[str], maxWidth: int) -> List[str]: res = [] line = [] length = 0 for word in words: if len(word) + length > maxWidth: spaces = maxWidth.
2021-11-23 07:39:02
279
原创 # 65. 有效数字
from enum import Enumclass Solution: def isNumber(self, s: str) -> bool: State = Enum("State", [ "STATE_INITIAL", "STATE_INT_SIGN", "STATE_INTEGER", "STATE_POINT", "STATE_POINT_W.
2021-11-23 07:10:30
283
原创 # 64. 最小路径和
class Solution: def minPathSum(self, grid: List[List[int]]) -> int: m = len(grid) n = len(grid[0]) fn = [[0] * n for _ in range(m)] fn[0][0] = grid[0][0] for i in range(1, m, 1): fn[i][0.
2021-11-23 07:07:36
174
原创 # 63. 不同路径 II
class Solution: def uniquePathsWithObstacles(self, obstacleGrid: List[List[int]]) -> int: m = len(obstacleGrid) n = len(obstacleGrid[0]) fn = [[0] * n for _ in range(m)] for i in range(m): if obstacle.
2021-11-23 06:30:33
168
原创 # 62. 不同路径
class Solution: def uniquePaths(self, m: int, n: int) -> int: fn = [[0] * n for _ in range(m)] for i in range(m): for j in range(n): if i == 0 or j == 0: fn[i][j] = 1 e.
2021-11-22 23:44:45
44
原创 # 60. 排列序列
暴力解法:class Solution: def getPermutation(self, n: int, k: int) -> str: nums = [str(i+1) for i in range(n)] if(len(nums) == 0): return "" tmp = [] res = [] flag = [0] * len(nums) def back.
2021-11-22 23:17:14
61
原创 #51. N 皇后
class Solution: def solveNQueens(self, n: int) -> List[List[str]]: res = [] board = [['.'] * n for _ in range(n)] def backtrace(rowIndex: int) -> None: if(rowIndex == len(board)): res.append(se.
2021-11-22 22:56:34
36
原创 #47. 全排列 II
class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: if(len(nums) == 0): return [] nums.sort() tmp = [] res = [] flag = [0] * len(nums) def backtrace(): .
2021-11-22 22:14:12
189
原创 #46. 全排列
class Solution: def permute(self, nums: List[int]) -> List[List[int]]: if(len(nums) == 0): return [] tmp = [] res = [] flag = [0] * len(nums) def backtrace(): if (len(tmp) == len(nums).
2021-11-22 22:03:15
49
原创 # 55. 跳跃游戏
class Solution: def canJump(self, nums: List[int]) -> bool: n, rightmost = len(nums), 0 for i in range(n): if i <= rightmost: rightmost = max(rightmost, i + nums[i]) if rightmost >= .
2021-11-22 21:41:02
2649
原创 #45. 跳跃游戏 II
class Solution: def jump(self, nums: List[int]) -> int: fn = [len(nums) + 1] * len(nums) fn[0] = 0 for i in range(len(nums)): for j in range(1, nums[i]+1, 1): if (i + j >= len(nums)): .
2021-11-22 21:21:25
2364
原创 #44. 通配符匹配
class Solution: def isMatch(self, s: str, p: str) -> bool: m, n = len(s), len(p) dp = [[False] * (n + 1) for _ in range(m + 1)] dp[0][0] = True for i in range(1, n + 1): if p[i - 1] == '*': .
2021-11-22 02:36:27
175
原创 # 42. 接雨水
暴力解法class Solution: def trap(self, height: List[int]) -> int: res = 0 for i in range(len(height)): max_left, max_right = 0, 0 for j in range(i, -1, -1): max_left = max(max_left, height[j])
2021-11-22 02:30:18
216
原创 #40. 组合总和 II
class Solution: def combinationSum2(self, candidates: List[int], target: int) -> List[List[int]]: candidates.sort() res = [] tmp = [] def backtrace(starIndex: int) -> None: if(sum(tmp) == target): .
2021-11-21 18:57:25
275
原创 #39. 组合总和
class Solution: def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]: res = [] tmp = [] def backtrace(starIndex: int) -> None: if(sum(tmp) == target): res.append(tmp..
2021-11-21 18:35:30
173
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人