USB键盘实现——设备限定描述符(五)
文章目录
- 设备限定描述符
- 仓库地址
- 设备限定描述符介绍
- 设备限定描述符结构体定义
- 获取设备限定描述符的请求
- 标准设备请求
- USB 控制端点收到的数据
- 设备限定描述符返回
- 附 STM32 枚举日志
设备限定描述符
设备限定描述符内容解析和 HID鼠标 一致。
仓库地址
仓库地址
设备限定描述符介绍
设备限定描述符(Device Qualifier Descriptor)说明了能进行高速操作的设备在其他速度时产生的变化信息。例如,如果设备当前在全速下操作,设备限定描述符返回它如何在高速运行的信息。
如果设备既支持全速状态又支持高速状态,那么就必须含有设备限定描述符(Device Qualifier Descriptor)。设备限定描述符(Device Qualifier Descriptor)中含有当前没有使用的速度下这些字段的取值。
设备限定描述符(Device Qualifier Descriptor)不包含标准设备描述符中的厂商、产品、设备、制造厂商、产品和序列号场,因为在所有支持的速度下设备的这些信息都是常数。这个描述符的版本号至少是2.0(0200H)。
如果只能进行全速(full-speed)操作的设备(设备描述符的版本号等于0200H)接收到请求设备限定符的Get Descriptor请求,它必须用请求错误响应,回复STALL来响应。
主机端只能在成功取得设备限定描述符(Device Qualifier Descriptor)之后,才能请求其他速度配置(other_speed_configuration)描述符。
- bLength:0x0a
- 设备限定描述符的长度。
- bDescriptorType:0x06
- 设备限定描述符类型,为DEVICE_QUALIFIER (0x06)。
- bcdUSB:版本号
- 是设备所符合的USB规范的版本号,该值采用BCD(用二进制编码的十进制数)格式。USB 2.0是0x0200;USB 2.1是0x0210。
- bDeviceClass类码
- 这个字段为那些在设备层次定义功能的设备规定了它们所属的类。
- bDeviceSubClass子类码
- 这个字段规定一个类的子类
- bDeviceProtocol协议码
- 这个字段为所选的类和子类规定一个协议。
- bMaxPacketSize0
- 为其他速度(Other-speed)的端点0最大包大小。
- bNumConfigurations
- 为其他速度(Other-speed)配置的数量。
设备限定描述符结构体定义
typedef struct __attribute__ ((packed))
{uint8_t bLength ; ///< Size of descriptoruint8_t bDescriptorType ; ///< Device Qualifier Typeuint16_t bcdUSB ; ///< USB specification version number (e.g., 0200H for V2.00)uint8_t bDeviceClass ; ///< Class Codeuint8_t bDeviceSubClass ; ///< SubClass Codeuint8_t bDeviceProtocol ; ///< Protocol Codeuint8_t bMaxPacketSize0 ; ///< Maximum packet size for other speeduint8_t bNumConfigurations ; ///< Number of Other-speed Configurationsuint8_t bReserved ; ///< Reserved for future use, must be zero
}usb_desc_device_qualifier_t;
获取设备限定描述符的请求
标准设备请求
typedef struct __attribute__ ((packed)){union {struct __attribute__ ((packed)) {uint8_t recipient : 5; ///< Recipient type usb_request_recipient_t.uint8_t type : 2; ///< Request type usb_request_type_t.uint8_t direction : 1; ///< Direction type. usb_dir_t} bmRequestType_bit;uint8_t bmRequestType;};uint8_t bRequest;uint16_t wValue;uint16_t wIndex;uint16_t wLength;
} usb_control_request_t;
USB 控制端点收到的数据
0x80 0x6 0x0 0x6 0x0 0x0 0xa 0x0
- bmRequestType:0x80
- 数据传输方向为 1,device-to-host
- 标准请求
- 请求的接收者为设备
- bRequest:0x06
- GET_DESCRIPTOR 获取描述符请求
- wValue:0x0006(LSB)
- 低位:0x06 设备限定描述符
- 高位:0x00 索引号
- wIndex:0x0000(LSB)
- 低位:0x00
- 高位:0x00
- wLength:0x0a
- 低位:0x0a 请求返回的字节数为 0x0a,设备限定描述符的长度为 0x0a
- 高位:0x00
设备限定描述符返回
由于当前只能进行全速(full-speed)操作(设备描述符的版本号等于0200H),设备接收到请求设备限定符的 Get Descriptor 请求,它必须用请求错误响应,回复 STALL 来响应。
USB 传输日志片段如下:
output ep int
h->d: 0x80 0x6 0x0 0x6 0x0 0x0 0xa 0x0
send xfer complete event
get device qualifier
stall ep0
如果需要返回设备限定描述符,设备限定描述符的实现如下(当前未使用)
usb_desc_device_qualifier_t const desc_device_qualifier =
{.bLength = sizeof(usb_desc_device_qualifier_t),.bDescriptorType = USB_DESC_DEVICE_QUALIFIER,.bcdUSB = USB_BCD,.bDeviceClass = 0x00,.bDeviceSubClass = 0x00,.bDeviceProtocol = 0x00,.bMaxPacketSize0 = USBD_ENDPOINT0_SIZE,.bNumConfigurations = 0x01,.bReserved = 0x00
};
附 STM32 枚举日志
HID 键盘枚举日志
suspend int
bus reset int
enum done int
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x40 0x0
dcd xfer 12
input ep int
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
bus reset int
output ep int
send xfer complete event
enum done int
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x0 0x5 0x4 0x0 0x0 0x0 0x0 0x0
dcd xfer 0
input ep int
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0
dcd xfer 12
input ep int
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int
send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0xff 0x0
dcd xfer 22
input ep int
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32 0x9 0x4 0x0 0x0 0x1 0x3 0x1 0x1 0x0 0x9 0x21 0x11 0x1 0x0 0x1 0x22 0x41 0x0 0x7 0x5 0x81 0x3 0x8 0x0 0xa
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x3 0x3 0x9 0x4 0xff 0x0
send xfer complete event
dcd xfer e
input ep int
d->h :0xe 0x3 0x31 0x0 0x32 0x0 0x33 0x0 0x34 0x0 0x35 0x0 0x36 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x3 0x0 0x0 0xff 0x0
send xfer complete event
dcd xfer 4
input ep int
d->h :0x4 0x3 0x9 0x4
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x2 0x3 0x9 0x4 0xff 0x0
send xfer complete event
dcd xfer 1e
input ep int
d->h :0x1e 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x6 0x0 0x0 0xa 0x0
send xfer complete event
get device qualifier
stall ep0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x1 0x0 0x0 0x12 0x0
dcd xfer 12
input ep int
d->h :0x12 0x1 0x0 0x2 0x0 0x0 0x0 0x40 0xfe 0xca 0x8 0x40 0x0 0x1 0x1 0x2 0x3 0x1
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0x9 0x0
send xfer complete event
dcd xfer 9
input ep int
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x2 0x0 0x0 0x22 0x0
send xfer complete event
dcd xfer 22
input ep int
d->h :0x9 0x2 0x22 0x0 0x1 0x1 0x0 0xa0 0x32 0x9 0x4 0x0 0x0 0x1 0x3 0x1 0x1 0x0 0x9 0x21 0x11 0x1 0x0 0x1 0x22 0x41 0x0 0x7 0x5 0x81 0x3 0x8 0x0 0xa
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x0 0x9 0x1 0x0 0x0 0x0 0x0 0x0
send xfer complete event
edpt open
dcd xfer 0
input ep int
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x21 0xa 0x0 0x0 0x0 0x0 0x0 0x0
dcd xfer 0
input ep int
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x81 0x6 0x0 0x22 0x0 0x0 0x81 0x0
dcd xfer 40
input ep int
d->h :0x5 0x1 0x9 0x6 0xa1 0x1 0x5 0x7 0x19 0xe0 0x29 0xe7 0x15 0x0 0x25 0x1 0x95 0x8 0x75 0x1 0x81 0x2 0x95 0x1 0x75 0x8 0x81 0x1 0x5 0x8 0x19 0x1 0x29 0x5 0x95 0x5 0x75 0x1 0x91 0x2 0x95 0x1 0x75 0x3 0x91 0x1 0x5 0x7 0x19 0x0 0x2a 0xff 0x0 0x15 0x0 0x26 0xff 0x0 0x95 0x6 0x75 0x8 0x81 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 1
input ep int
d->h :0xc0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int
send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x21 0x9 0x0 0x2 0x0 0x0 0x1 0x0
dcd xfer 1
rxflvl int
output ep int
send xfer complete event
dcd xfer 0
input ep int
edpt int send xfer complete event
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x0 0x3 0x0 0x0 0xff 0x0
dcd xfer 4
input ep int
d->h :0x4 0x3 0x9 0x4
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x1 0x3 0x9 0x4 0xff 0x0
send xfer complete event
dcd xfer 10
input ep int
d->h :0x10 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
setup packed recvd
setup packed done
output ep int
h->d: 0x80 0x6 0x2 0x3 0x9 0x4 0xff 0x0
send xfer complete event
dcd xfer 1e
input ep int
d->h :0x1e 0x3 0x74 0x0 0x79 0x0 0x75 0x0 0x73 0x0 0x74 0x0 0x6c 0x0 0x69 0x0 0x20 0x0 0x44 0x0 0x65 0x0 0x76 0x0 0x69 0x0 0x63 0x0 0x65 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 0
rxflvl int
output ep int
send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x4 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
dcd xfer 8
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
input ep int
d->h :0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
turn off txfe
input ep int
edpt int send xfer complete event
相关文章:
USB键盘实现——设备限定描述符(五)
文章目录设备限定描述符仓库地址设备限定描述符介绍设备限定描述符结构体定义获取设备限定描述符的请求标准设备请求USB 控制端点收到的数据设备限定描述符返回附 STM32 枚举日志设备限定描述符 设备限定描述符内容解析和 HID鼠标 一致。 仓库地址 仓库地址 设备限定描述符…...
【C++】map和set(一文拿捏,包教包会)
目录 1.关联式容器和序列式容器 2.键值对 3.树型结构的关联式容器 4.set 5.multiset 6.map 7.multimap 1.关联式容器和序列式容器 set:关联式容器——数据之间关联紧密 线性表(vector,list,deque):序…...
爬虫Day2 正则表达式
爬虫Day2 正则表达式 一、正则表达式 1. 正则的作用 正则表达式是一种可以让复杂的字符串变得简单的工具。 写正则表达式就是用正则符号来描述字符串规则 # 案例1:判断一个字符串是否是一个合法的手机号码 tel 23297293329# 方法1:不用正则 if len…...
LeetCode-0324~28
leetCode1032 思路:想的是维护一个后缀数组,然后用Set去判断一下,结果超时了,去看题解,好家伙AC自动机,没办法,开始学。 正确题解: class ACNode{public ACNode[] children;publi…...
Vue2自己封装的基础组件库或基于Element-ui再次封装的基础组件库,如何发布到npm并使用(支持全局或按需引入使用),超详细
最终效果如下 一、先创建vue2项目 1、 可以用vue-cli自己来创建;也可以直接使用我开源常规的vue2后台管理系统模板 以下我以 wocwin-admin-vue2 项目为例 修改目录结构,最终如下 2、修改vue.config.js文件 module.exports { // 修改 src 目录 为 exam…...
【开发】中间件——MongoDB
MongoDB是一个基于分布式(海量数据存储)文件存储的数据库。 MongoDB是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的,它支持的数据结构非常松散,是类似json…...
C++进阶 — 【C++11】
目录 一、 C11简介 二、 统一的列表初始化 1.{}初始化 2. initializer_list 三、声明 1. auto 2. decltype 3. nullptr 四、范围for循环 五、STL中一些变化 1. 提供了一些新容器 2.容器中增加了一些新方法 六、右值引用和移动语义 1. 左值引用和右…...
Mac安装Homebrew
1.前往Homebrew官网,复制官网的安装命令 https://brew.sh/ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"安装结束后,记得仔细看脚本执行最后的提示,需要我们复制两行命令执…...
【详细】利用VS2019创建Web项目,并发送到IIS,以及IIS与ASP.NET配置
一、打开VS2019选择创建新项目【最好以管理员身份运行VS2019,后面发布网站时需要以管理员身份,避免后面还要重启,可以一开始就以管理员身份运行】 二、选择语言为C#,然后选择“ASP.NET Web应用程序(.NET Framework&…...
FasterRcnn,Yolov2,Yolov3中的Label Assignment机制 和 ATSS
一般把anchor到gt之间如何匹配的方法称为label assignment,也就是给预设的anchor打上正负样本等标签,方便我们后续进一步回归。 其实RPN和Yolo有各自的label assignment方法, 在Faster rcnn,yolo,RetinaNet中…...
使用Java技术WebSocket创建聊天、群聊,实现好友列表,添加好友,好友分组,聊天记录查询功能。
文章目录 引入依赖主要代码配置WebSocket创建通讯完整后台项目代码下载WebSocket的由来: 之前只有一个http协议,http协议是请求响应,存在缺陷,就是请求只能由客户端发起,然后请求到服务器,服务器做响应,但是如果服务器状态做了改变,客户端并不能即使的更新,之前的是按照…...
【Redis07】Redis基础:Bitmap 与 HyperLogLog 相关操作
Redis基础学习:Bitmap 与 HyperLogLog 相关操作继续进行 Redis 基础部分的学习,今天我们学习的是两种另外的数据类型。说是数据类型,但其实它们实际上使用的都是 String 类型做为底层基础,只不过是在存储的时候进行了一些特殊的操…...
华为路由器 VRRP主备配置
组网需求 如下图所示,PC1通过SW1双归属到R1和R2。为保证用户的各种业务在网络传输中不中断,需在R1和R2上配置VRRP主备备份功能。 正常情况下,主机以R1为默认网关接入Internet,当R1故障时,R2接替R1作为网关继续进行工作…...
docker容器安装ES
1.拉取镜像 docker pull elasticsearch:6.5.42.修改别名 docker tag [容器ID] es65:6.5.42.启动应用 docker run -it -d -p 9200:9200 -p 9300:9300 --name es -e ES_JAVA_OPTS"-Xms128m -Xmx128m" es65:6.5.43.拷贝配置文件到宿主机 docker cp es:/usr/share/ela…...
Python Module — prompt_toolkit CLI 库
目录 文章目录目录prompt_toolkit示例化历史记录热键自动补全多行输入Python 代码高亮自定义样式prompt_toolkit prompt_toolkit 是一个用于构建 CLI 应用程序的 Python 库,可以让我们轻松地构建强大的交互式命令行应用程序。 自动补全:当用户输入命令…...
springboot mybatis-plus 调用 sqlserver 的 存储过程 返回值问题
问题: 在使用 mybatis-plus 调用sqlserver 存储过程 没有返回值 经过资料查找 注意点 此处使用Map传参,原因在于存储过程的返回值,通常在参数定义中实现,如In 入参、out 出参。 这样当执行后有结果返回时,则可以将结…...
【0180】PG内核读取pg_hba.conf并创建HbaLine记录(1)
文章目录 1. pg_hba.conf文件是什么?2. postmaster何时读取pg_hba.conf?2.1 pg内核使用pg_hba.conf完成客户端认证的原理2.2 读取pg_hba.conf的几个模块3. pg内核读取pg_hba.conf过程3.1 VFD机制获取文件描述符3.2 根据fd读取文件内容相关阅读: 【0178】DBeaver、pgAdmin I…...
【原型设计工具】上海道宁为您提供Justinmind,助力您在几分钟内形成原型,并现场测试,无需编写任何代码
Justinmind是用于 Web和应用程序的原型制作工具 在几分钟内形成原型 并在现场进行测试 无需编写任何代码 单击一下即可轻松在线获取您的设计 并与整个团队共享 享受高效的沟通和快速反馈 以实现持续改进和利益相关者的支持 开发商介绍 JustinMind是由西班牙JustinMind公…...
计算机网络中---HDLP协议和PPP协议
目录 HDLC协议PPP协议HDLC协议和PPP协议HDLC协议 HDLC协议【高级数据链路控制协议】是一种数据链路层协议,用于在两个节点之间传输数据。以下是HDLC协议的重点知识: HDLC协议定义了一种标准的帧格式,包括起始标志、地址字段、控制字段、信息字段、校验字段和结束标志。HDLC…...
k8s之节点kubelet预留资源配置
k8s之kubelet预留资源配置1 前言2 预留资源Kube-reservedSystem-reservedEviction Thresholds实施节点可分配约束3 Pod优先级4 生产应用配置文件重启kubelet服务查看节点资源1 前言 最近k8s在使用过程中遇到这样一个问题 由于Pod没有对内存及CPU进行限制,导致Pod在…...
[2025CVPR]DeepVideo-R1:基于难度感知回归GRPO的视频强化微调框架详解
突破视频大语言模型推理瓶颈,在多个视频基准上实现SOTA性能 一、核心问题与创新亮点 1.1 GRPO在视频任务中的两大挑战 安全措施依赖问题 GRPO使用min和clip函数限制策略更新幅度,导致: 梯度抑制:当新旧策略差异过大时梯度消失收敛困难:策略无法充分优化# 传统GRPO的梯…...
理解 MCP 工作流:使用 Ollama 和 LangChain 构建本地 MCP 客户端
🌟 什么是 MCP? 模型控制协议 (MCP) 是一种创新的协议,旨在无缝连接 AI 模型与应用程序。 MCP 是一个开源协议,它标准化了我们的 LLM 应用程序连接所需工具和数据源并与之协作的方式。 可以把它想象成你的 AI 模型 和想要使用它…...
pam_env.so模块配置解析
在PAM(Pluggable Authentication Modules)配置中, /etc/pam.d/su 文件相关配置含义如下: 配置解析 auth required pam_env.so1. 字段分解 字段值说明模块类型auth认证类模块,负责验证用户身份&am…...
Objective-C常用命名规范总结
【OC】常用命名规范总结 文章目录 【OC】常用命名规范总结1.类名(Class Name)2.协议名(Protocol Name)3.方法名(Method Name)4.属性名(Property Name)5.局部变量/实例变量(Local / Instance Variables&…...
Leetcode 3577. Count the Number of Computer Unlocking Permutations
Leetcode 3577. Count the Number of Computer Unlocking Permutations 1. 解题思路2. 代码实现 题目链接:3577. Count the Number of Computer Unlocking Permutations 1. 解题思路 这一题其实就是一个脑筋急转弯,要想要能够将所有的电脑解锁&#x…...
Kafka入门-生产者
生产者 生产者发送流程: 延迟时间为0ms时,也就意味着每当有数据就会直接发送 异步发送API 异步发送和同步发送的不同在于:异步发送不需要等待结果,同步发送必须等待结果才能进行下一步发送。 普通异步发送 首先导入所需的k…...
前端中slice和splic的区别
1. slice slice 用于从数组中提取一部分元素,返回一个新的数组。 特点: 不修改原数组:slice 不会改变原数组,而是返回一个新的数组。提取数组的部分:slice 会根据指定的开始索引和结束索引提取数组的一部分。不包含…...
深入浅出WebGL:在浏览器中解锁3D世界的魔法钥匙
WebGL:在浏览器中解锁3D世界的魔法钥匙 引言:网页的边界正在消失 在数字化浪潮的推动下,网页早已不再是静态信息的展示窗口。如今,我们可以在浏览器中体验逼真的3D游戏、交互式数据可视化、虚拟实验室,甚至沉浸式的V…...
如何通过git命令查看项目连接的仓库地址?
要通过 Git 命令查看项目连接的仓库地址,您可以使用以下几种方法: 1. 查看所有远程仓库地址 使用 git remote -v 命令,它会显示项目中配置的所有远程仓库及其对应的 URL: git remote -v输出示例: origin https://…...
Canal环境搭建并实现和ES数据同步
作者:田超凡 日期:2025年6月7日 Canal安装,启动端口11111、8082: 安装canal-deployer服务端: https://github.com/alibaba/canal/releases/1.1.7/canal.deployer-1.1.7.tar.gz cd /opt/homebrew/etc mkdir canal…...
