当前位置: 首页 > news >正文

linux shell 入门学习笔记15 shell 条件测试

概念

shell的条件测试目的是得出真和假。

shell 提供的条件测试语法
test 命令
[] 中括号命令

语法*:
条件测试

test条件测试

test命令用来评估一个表达式,他的结果是真,还是假,如果条件为真,那么命令执行状态结果就为0,否则就是不为0,通过$?取值。

test命令参数
============检测给定文件名是否存在
-e 判断该文件是否存在,(普通文件,目录),存在就为真,否则为假
============检测给定文件名的类型
-f 判断该文件名是否为文件
-d 判断该文件名是否为目录
-b 判断该文件名是否为块设备
-c 判断该文件名是否为字符设备
-s 判断该文件名是否为socket
-p 判断该文件名是否为管道FIFO
-L 判断该文件名是否为连接
============检测文件的权限
-r 判断该文件名是否可读
-w 判断该文件名是否可写
-x 判断该文件名是否可运行
-u 判断该文件名是否有SUID属性
-g 判断该文件名是否有SGID属性
-k 判断该文件名是否有Sticky bit属性
-s 判断该文件名是否为空白文件
============文件比较 如test file1 -nt file2
-nt (newer than)判断file1是否比file2新
-ot(older than)判断file1是否比file2旧
-ef 判断file1与file2是否为同一个文件,可用在判断hard link的判定上,主要意义在判定两个文件是否均指向同一个inode
============整数之间判定
-eq 两数值相等
-ne 两数值不等
-gt n1大于n2 (greater than)
-lt n1小于n2(less than)
-ge n1大于等于n2 (greater than or equal)
-le n1小于等于n2(less than or equal)
============判定字符串数据
-z 判断字符串是否为0,若字符串为空,则为true
-n 判断字符串是否为非0,若字符串为非空,则为true
= 判断str1与str2是否相等,相等则为true
!= 判断str1与str2是否不想等,不相等则为true
============多重条件判断
-a (and)两状态同时成立,则返回true
-o (or)两状态任意一个成立,则返回true
! 反向状态

test命令实践

-e演示

xiao123@xiao123:~/Downloads/shscripts$ test -e del_data.sh
xiao123@xiao123:~/Downloads/shscripts$ echo $?
0
xiao123@xiao123:~/Downloads/shscripts$ test -e del_data.sh12
xiao123@xiao123:~/Downloads/shscripts$ echo $?
1
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ test -e del_data.sh && echo 文件已存在
文件已存在
xiao123@xiao123:~/Downloads/shscripts$ test -e del_data.sh12 && echo 文件已存在
xiao123@xiao123:~/Downloads/shscripts$ test -e del_data.sh12 || echo 文件不存在
文件不存在
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ test -e hello && echo 该文件/目录已存在,不再执行创建动作 || mkdir hello
xiao123@xiao123:~/Downloads/shscripts$ test -e hello && echo 该文件/目录已存在,不再执行创建动作 || mkdir hello
该文件/目录已存在,不再执行创建动作
xiao123@xiao123:~/Downloads/shscripts$

-f演示

xiao123@xiao123:~/Downloads/shscripts$ ls
calculation.sh           chaochao_5_finished.png  index.html.11  index.html.2   index.html.28  index.html.6
chaochao_1_finished.png  chaochao_5.jpg           index.html.12  index.html.20  index.html.29  index.html.7
chaochao_1.jpg           del_data.sh              index.html.13  index.html.21  index.html.3   index.html.8
chaochao_2_finished.png  expr_test1.sh            index.html.14  index.html.22  index.html.30  index.html.9
chaochao_2.jpg           expr_test.sh             index.html.15  index.html.23  index.html.31  let_test.sh
chaochao_3_finished.png  hello                    index.html.16  index.html.24  index.html.32
chaochao_3.jpg           index.html               index.html.17  index.html.25  index.html.33
chaochao_4_finished.png  index.html.1             index.html.18  index.html.26  index.html.4
chaochao_4.jpg           index.html.10            index.html.19  index.html.27  index.html.5
xiao123@xiao123:~/Downloads/shscripts$ test -f hello && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$

-d演示

xiao123@xiao123:~/Downloads/shscripts$ ls
calculation.sh           chaochao_5_finished.png  index.html.11  index.html.2   index.html.28  index.html.6
chaochao_1_finished.png  chaochao_5.jpg           index.html.12  index.html.20  index.html.29  index.html.7
chaochao_1.jpg           del_data.sh              index.html.13  index.html.21  index.html.3   index.html.8
chaochao_2_finished.png  expr_test1.sh            index.html.14  index.html.22  index.html.30  index.html.9
chaochao_2.jpg           expr_test.sh             index.html.15  index.html.23  index.html.31  let_test.sh
chaochao_3_finished.png  hello                    index.html.16  index.html.24  index.html.32
chaochao_3.jpg           index.html               index.html.17  index.html.25  index.html.33
chaochao_4_finished.png  index.html.1             index.html.18  index.html.26  index.html.4
chaochao_4.jpg           index.html.10            index.html.19  index.html.27  index.html.5
xiao123@xiao123:~/Downloads/shscripts$ test -d hello && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$

-z/-n演示

xiao123@xiao123:~/Downloads/shscripts$ test -d hello && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$ test -z "" && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$ test -z " " && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ test -n "" && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ test -n " " && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$

中括号条件测试

脚本中经常进行条件测试,用的最多的都是中括号。
test和[]的作用是一样的。
注意点:中括号前后都要有空格[ ]

[ -n “${filename}” ]
注意在条件测试中,使用变量必须要添加双引号""

xiao123@xiao123:~/Downloads/shscripts$ file=del_data.sh
xiao123@xiao123:~/Downloads/shscripts$ [ -f "${file}" ] && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$ file=del_data.sh12
xiao123@xiao123:~/Downloads/shscripts$ [ -f "${file}" ] && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$

双中括号条件测试

双中括号增加了正则表达式的支持,其他与中括号相同。

变量测试

把字符串写入变量中
对变量测试,必须要加双引号

xiao123@xiao123:~/Downloads/shscripts$ file1="鸡你太美.jpg"
xiao123@xiao123:~/Downloads/shscripts$ [[ -f "${file1}" ]] && echo "我是两年半的练习生,鸡你太美" || echo "我是个好人"
我是个好人
xiao123@xiao123:~/Downloads/shscripts$ [[ -f "${file1}" ]] && echo "我是两年半的练习生,鸡你太美" || echo "我是个好人"
我是个好人
xiao123@xiao123:~/Downloads/shscripts$ touch "鸡你太美.jpg"
xiao123@xiao123:~/Downloads/shscripts$ [[ -f "${file1}" ]] && echo "我是两年半的练习生,鸡你太美" || echo "我是个好人"
我是两年半的练习生,鸡你太美
xiao123@xiao123:~/Downloads/shscripts$
字符串测试

比较两个字符串变量的值,是否相等,不等的情况。

= 判断是否相等
!= 判断不相等
! 取结果的反义,颠倒黑白

注意:
对于字符串变量的比较一定要给变量添加双引号
使用等于号判断,左右两边必须有空格

演示

xiao123@xiao123:~/Downloads/shscripts$ [ ! -f "糖果超甜组合.txt" ] && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$ [ -f "糖果超甜组合.txt" ] && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$
数值比较测试

操作方式
数值计算

  1. 在中括号以及test中数值比较的用法

在中括号中,使用数学比较符号,请添加转义符号

xiao123@xiao123:~/Downloads/shscripts$ [ 2 > 1 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 1 > 2 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 1 \> 2 ] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$
xiao123@xiao123:~/Downloads/shscripts$ [ 2 \= 2 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 2 != 2 ] && echo yes || echo no
no   #不等于可以不用添加转义
xiao123@xiao123:~/Downloads/shscripts$ [ 3 != 2 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 3 \!= 2 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 3 \!\= 2 ] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [ 3 \!\= 3 ] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$
  1. 双中括号
    对中括号的补充,双中括号还支持正则处理。
    在双中括号中不要转义字符。
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 > 6 ]] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 < 6 ]] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 = 6 ]] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 != 6 ]] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 -ge 6 ]] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 -le 6 ]] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 -gt 6 ]] && echo yes || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [[ 5 -lt 6 ]] && echo yes || echo no
yes
xiao123@xiao123:~/Downloads/shscripts$
逻辑操作符号测试

&& -a 与运算, 两边都为真,结果才为真
|| -o 或运算,两边有一个为真,结果为真
逻辑操作

中括号逻辑运算比较

xiao123@xiao123:~/Downloads/shscripts$ file1=/etc/init.d/rsync
xiao123@xiao123:~/Downloads/shscripts$ file2=/etc/hostname
xiao123@xiao123:~/Downloads/shscripts$ [ -f "${file1}" -a -f "${file2}" ] && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$ file1=/tmp/sqqqq
xiao123@xiao123:~/Downloads/shscripts$ [ -f "${file1}" -a -f "${file2}" ] && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [ -f "${file1}" -o -f "${file2}" ] && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$

双中括号运算比较

xiao123@xiao123:~/Downloads/shscripts$ str1=""
xiao123@xiao123:~/Downloads/shscripts$ str2="yuyu"
xiao123@xiao123:~/Downloads/shscripts$ [[ -n "${str1}" && -n "${str2}" ]] && echo ok || echo no
no
xiao123@xiao123:~/Downloads/shscripts$ [[ -n "${str1}" || -n "${str2}" ]] && echo ok || echo no
ok
xiao123@xiao123:~/Downloads/shscripts$

脚本开发

要求:接收用户输入,判断它是否等于某个数字。

xiao123@xiao123:~/Downloads/shscripts$ bash ./test_input.sh
Please input a char: 3
脚本出错,必须输入1和2
xiao123@xiao123:~/Downloads/shscripts$ bash ./test_input.sh
Please input a char: 1
1
xiao123@xiao123:~/Downloads/shscripts$ bash ./test_input.sh
Please input a char: 2
2
xiao123@xiao123:~/Downloads/shscripts$ cat ./test_input.sh
#! /bin/bashread -p "Please input a char: " var1[ "${var1}" -eq "1" ] && {echo ${var1}exit 0
}[[ "${var1}" = "2" ]] && {echo ${var1}exit 0
}[ "${var1}" != 2 -a "${var1}" != 1 ] && {echo "脚本出错,必须输入1和2"exit 1
}
xiao123@xiao123:~/Downloads/shscripts$

要求:安装lnmp/lamp脚本开发。

xiao123@xiao123:~/Downloads/shscripts$ mkdir test
xiao123@xiao123:~/Downloads/shscripts$ echo "echo LAMP is installed" > ./test/lamp.sh
xiao123@xiao123:~/Downloads/shscripts$ echo "echo LNMP is installed" > ./test/lnmp.sh
xiao123@xiao123:~/Downloads/shscripts$ chmod +x ./test/lamp.sh
xiao123@xiao123:~/Downloads/shscripts$ chmod +x ./test/lnmp.sh
xiao123@xiao123:~/Downloads/shscripts$

源码

xiao123@xiao123:~/Downloads/shscripts$ cat ./test_install.sh
#! /bin/bashpath=./test[ ! -d  "${path}" ] && mkdir ${path} -pcat << END1. [install lamp]2. [install lnmp]3. [exit]please input the num you want:
ENDread numexpr ${num} + 1 &>/dev/null[ $? -ne 0 ] && {echo "input number must be {1|2|3}"exit 1
}[ ${num} -eq 1 ] && {echo "Strating installing lamp.....waiting..."sleep 2[ -x ${path}/lamp.sh ] || {echo "The file does not exist or can't be execut."exit 1}${path}/lamp.shexit $?
}[ ${num} -eq 2 ] && {echo "Strating installing lnmp.....waiting..."sleep 2[ -x ${path}/lamp.sh ] || {echo "The file does not exist or can't be execut."exit 1}${path}/lnmp.shexit $?
}[ ${num} -eq 3 ] && {echo "byebye"exit 3
}[[ ! ${num} =~ [1-3] ]] && {echo "The number input must be {1|2|3}"exit 4
}
xiao123@xiao123:~/Downloads/shscripts$

运行结果

xiao123@xiao123:~/Downloads/shscripts$ bash ./test_install.sh1. [install lamp]2. [install lnmp]3. [exit]please input the num you want:
e
input number must be {1|2|3}
xiao123@xiao123:~/Downloads/shscripts$ bash ./test_install.sh1. [install lamp]2. [install lnmp]3. [exit]please input the num you want:
3
byebye
xiao123@xiao123:~/Downloads/shscripts$ bash ./test_install.sh1. [install lamp]2. [install lnmp]3. [exit]please input the num you want:
1
Strating installing lamp.....waiting...
LAMP is installed
xiao123@xiao123:~/Downloads/shscripts$ bash ./test_install.sh1. [install lamp]2. [install lnmp]3. [exit]please input the num you want:
2
Strating installing lnmp.....waiting...
LNMP is installed
xiao123@xiao123:~/Downloads/shscripts$

相关文章:

linux shell 入门学习笔记15 shell 条件测试

概念 shell的条件测试目的是得出真和假。 shell 提供的条件测试语法 test 命令 [] 中括号命令 语法*&#xff1a; test条件测试 test命令用来评估一个表达式&#xff0c;他的结果是真&#xff0c;还是假&#xff0c;如果条件为真&#xff0c;那么命令执行状态结果就为0&…...

Apollo(阿波罗)分布式配置安装详解

Apollo&#xff08;阿波罗&#xff09; Apollo&#xff08;阿波罗&#xff09;是携程框架部门研发的分布式配置中心&#xff0c;能够集中化管理应用不同环境、不同集群的配置&#xff0c;配置修改后能够实时推送到应用端&#xff0c;并且具备规范的权限、流程治理等特性&#…...

Vue3之组件

何为组件 组件化的概念已经提出了很多年了&#xff0c;但是何为组件呢&#xff1f;组件有啥优势&#xff1f;本文将会做出解答&#xff0c;首先我们需要弄清楚何为组件。在VUE的官网中的解释是&#xff1a; 组件允许我们将 UI 划分为独立的、可重用的部分&#xff0c;并且可以对…...

【网络】套接字 -- UDP

&#x1f941;作者&#xff1a; 华丞臧. &#x1f4d5;​​​​专栏&#xff1a;【网络】 各位读者老爷如果觉得博主写的不错&#xff0c;请诸位多多支持(点赞收藏关注)。如果有错误的地方&#xff0c;欢迎在评论区指出。 推荐一款刷题网站 &#x1f449; LeetCode刷题网站 文章…...

Lambda原理及应用

Lambda原理及应用 Lambda介绍 Lambda 是 JDK8 以后版本推出的一个新特性&#xff0c;也是一个重要的版本更新&#xff0c;利用 Lambda 可以简化内部类&#xff0c;可以更方便的进行集合的运算&#xff0c;让你的代码看起来更加简洁,也能提升代码的运行效率。 Lambda语法 非…...

运动耳机推荐、最值得入手的运动耳机清单共享

现在市面上各式各样的运动蓝牙耳机着实让人挑花了眼,怎样才能从纷繁复杂的市场中挑选出专业性、安全性、舒适性等各个方面都做地可圈可点的运动蓝牙耳机可真不是一件易事啊&#xff0c;甚至连不少老朋友都会踩坑&#xff0c;为了能让大家挑到真正的运动蓝牙耳机&#xff0c;为此…...

c盘爆满--如何清理电脑C盘

问题 c盘饱满很多天了&#xff0c;今天终于忍无可忍&#xff0c;开始展开对c盘的处理 c盘的基本处理有两步&#xff0c; 第一步&#xff0c;电脑系统清理 1,c盘右键属性&#xff0c;有个磁盘清理&#xff0c;好像是系统更新的一些缓存资源&#xff0c;可以直接清理 当然这只…...

Nginx配置web服务器及部署反向代理

Nginx配置web服务器及部署反向代理配置web服务器location语法部署反向代理代理转发配置web服务器 项目部署到linux上的静态文件代理给Nginx处理。当访问服务器IP时&#xff0c;可以自动返回静态文件主页。 主配置文件中server块对应的次配置include /etc/nginx/conf.d/*.conf…...

mvvm和mvc

mvvm是model-view-viewmodel的缩写&#xff0c;前端开发的架构模式 m&#xff1a; model&#xff1a;模型&#xff0c;指的是数据和交互业务逻辑 v&#xff1a; view&#xff1a;视图&#xff0c;用户看到的ui界面 vm&#xff1a; viewmodel&#xff1a;视图模型&#xff0…...

JavaScript while 循环

JavaScript while 循环的目的是为了反复执行语句或代码块。只要指定条件为 true&#xff0c;循环就可以一直执行代码块。while 循环while 循环会在指定条件为真时循环执行代码块。语法while (条件){需要执行的代码 }实例本例中的循环将继续运行&#xff0c;只要变量 i 小于 5&a…...

CMU15-445 Project.0总结

在线测试 本地测试 Project #0 - C Primer 以下是Project #0的网址&#xff0c;2022FALL的Project #0本质上是实现一棵字典树&#xff0c;关于字典树的相关内容可以参考C实现字典树。 在本题中&#xff0c;为了存储对应着字符串的任意类型值&#xff0c;题目设计了一个Tri…...

计算机网络题库---错题本

&#xff08;一&#xff09;老生常谈 第一章&#xff1a; 1.什么是计算机网络&#xff1f;其主要功能是什么&#xff1f; 解答&#xff1a; 利用通信设备和线路&#xff0c;将分布在地理位置不同的、功能独立的多个计算机系统连接起来&#xff0c;以功能完善的网络软件实现网…...

【react】react创建项目与引入AntD组件库:

文章目录一、初始化项目&#xff1a;【1】创建项目【2】暴露项目配置文件【3】安装依赖【4】配置less二、快捷键&#xff1a;【1】rcctab三、安装AntD组件库&#xff1a;【1】安装【2】index.js【3】问题&#xff1a;【4】效果&#xff1a;一、初始化项目&#xff1a; 【1】创…...

hook与mixin

看完vue3就开始看vue3的源码&#xff0c;表示很懵~ 刚把rollup打包搞完&#xff0c;这不响应式就接着来了&#xff01;&#xff0c;还是写篇直接使用vue3的博客清清脑吧&#xff01; 什么是hook、mixin&#xff1f; mixin: Vue2中多个组件内存在重复JS业务逻辑&#xff0c;使…...

【C语言】自定义类型

一、什么是自定义类型C语言提供了丰富的内置类型&#xff0c;常见的有int, char, float, double, 以及各种指针。除此之外&#xff0c;我们还能自己创建一些类型&#xff0c;这些类型称为自定义类型&#xff0c;如数组&#xff0c;结构体&#xff0c;枚举类型和联合体类型。二、…...

没有上司的舞会(C++,树形DP)

题目描述 某大学有 nnn 个职员&#xff0c;编号为 1…n1\ldots n1…n。 他们之间有从属关系&#xff0c;也就是说他们的关系就像一棵以校长为根的树&#xff0c;父结点就是子结点的直接上司。 现在有个周年庆宴会&#xff0c;宴会每邀请来一个职员都会增加一定的快乐指数 ri…...

【java基础】static和final关键字的作用及其用法详解

文章目录static关键字静态字段静态方法静态代码块静态内部类final关键字final字段final方法final类static关键字 这个关键字表示静态的&#xff0c;用于不同地方意思不一样 静态字段 如果我们将其作用到字段上&#xff0c;那么该字段为类所拥有&#xff0c;我们使用new关键字…...

#集成学习#:bagging、boosting、stacking和blending

集成学习是一种机器学习方法&#xff0c;旨在提高单个模型的性能和鲁棒性。它基于这样一个假设&#xff1a;通过结合多个模型的预测结果&#xff0c;可以获得更好的预测性能&#xff0c;因为每个模型都可能从数据中提取不同的信息&#xff0c;因此他们的错误也可能是不同的&…...

NCRE计算机等级考试Python真题(一)

第一套试题1、关于数据的存储结构&#xff0c;以下选项描述正确的是A.数据所占的存储空间量B.数据在计算机中的顺序存储方式C.数据的逻辑结构在计算机中的表示D.存储在外存中的数据正确答案&#xff1a; C2、关于线性链表的描述&#xff0c;以下选项中正确的是A.存储空间不一定…...

C#协变逆变

文章目录协变协变接口的实现逆变里氏替换原则协变 协变概念令人费解&#xff0c;多半是取名或者翻译的锅&#xff0c;其实是很容易理解的。 比如大街上有一只狗&#xff0c;我说大家快看&#xff0c;这有一只动物&#xff01;这个非常自然&#xff0c;虽然动物并不严格等于狗…...

知识向量化实战指南:从模型选型到混合检索优化

1. 知识向量化的核心价值与应用场景 第一次接触知识向量化这个概念时&#xff0c;我也是一头雾水。直到在医疗知识库项目中亲眼看到"糖尿病治疗"和"血糖控制方案"这两个看似不同的查询&#xff0c;通过向量化后获得了0.92的相似度评分&#xff0c;才真正理…...

三步解锁QQ空间历史说说备份:数据留存与管理实用指南

三步解锁QQ空间历史说说备份&#xff1a;数据留存与管理实用指南 【免费下载链接】GetQzonehistory 获取QQ空间发布的历史说说 项目地址: https://gitcode.com/GitHub_Trending/ge/GetQzonehistory QQ空间数据备份是许多用户保存青春记忆和重要记录的需求。GetQzonehist…...

上周刚把三菱PLC+MCGS的电机测速课设收尾,趁着热乎劲把细节唠唠,顺便把踩过的坑也记一下,省得下次忘光

No.1235 基于三菱 PLC和MCGS组态电机测速系统控制设计这个项目说白了就是用三菱PLC算电机的转速&#xff0c;再用MCGS组态屏把转速实时显示出来&#xff0c;用到的东西挺基础&#xff1a;FX3U PLC、1000线增量式编码器、直流减速电机、MCGS组态屏&#xff0c;再加一根USB转RS48…...

使用Perfetto进行Settings中网络热点开启后anr分析的整体流程记录

目录 一.背景 二.Perfetto使用流程 阶段一&#xff1a;抓取 Perfetto Trace 文件 1. 指令核心解析 2. 数据源功能详解 (这些是抓取的“维度”) 3. 该指令的作用场景 阶段二&#xff1a;导入并认识 Perfetto UI 面板 1. 致命异常&#xff1a;Duration: (Did not end) 2…...

图灵奖得主LeCun团队悄然引动世界模型革新!世界模型终于不崩了!48倍加速!15M参数单GPU端到端训练!自发涌现物理理解!

近日&#xff0c;杨立昆与其团队在新发布的论文《LeWorldModel&#xff1a;基于像素的稳定端到端联合嵌入预测架构》中&#xff0c;介绍了一种新的世界模型LeWorldModel(LeWM) &#xff0c;这一模型可以端到端的训练&#xff0c;无需任何技巧&#xff0c;同时拥有15M参数、能在…...

Cartographer实战:如何用Velodyne 32E激光雷达跑通GraphSLAM(附避坑指南)

Cartographer实战&#xff1a;Velodyne 32E激光雷达的GraphSLAM全流程解析与性能调优 当Velodyne 32E激光雷达遇上Cartographer的GraphSLAM算法&#xff0c;如何在复杂环境中实现厘米级建图精度&#xff1f;本文将拆解从硬件配置到算法调优的完整落地流程&#xff0c;分享我在大…...

从Address Editor入手:在Block Design中精准调整Bram存储深度的实战解析

1. 当Bram存储深度无法修改时&#xff0c;你该怎么做&#xff1f; 第一次在Vivado中使用Block Design搭建系统时&#xff0c;很多人都会遇到一个奇怪的现象&#xff1a;明明在Bram IP核的参数设置界面看到了"Depth"这个选项&#xff0c;但无论如何点击都无法修改。这…...

HertzBeat与Prometheus兼容性详解:平滑迁移和生态整合终极指南

HertzBeat与Prometheus兼容性详解&#xff1a;平滑迁移和生态整合终极指南 Apache HertzBeat是一款功能强大的开源实时监控系统&#xff0c;与Prometheus生态系统完美兼容&#xff0c;提供无代理、高性能集群和自定义监控功能。&#x1f680; 作为新一代监控工具&#xff0c;H…...

低延迟多场景的Windows音频捕获解决方案:win-capture-audio实战指南

低延迟多场景的Windows音频捕获解决方案&#xff1a;win-capture-audio实战指南 【免费下载链接】win-capture-audio An OBS plugin that allows capture of independant application audio streams on Windows, in a similar fashion to OBSs game capture and Discords appli…...

Angular Flex-Layout终极指南:掌握fxLayout、fxFlex、fxLayoutAlign核心指令

Angular Flex-Layout终极指南&#xff1a;掌握fxLayout、fxFlex、fxLayoutAlign核心指令 【免费下载链接】flex-layout Provides HTML UI layout for Angular applications; using Flexbox and a Responsive API 项目地址: https://gitcode.com/gh_mirrors/fl/flex-layout …...