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

正则表达式引擎库汇合

 1.总览表格

一些正则表达式库的对比
index库名编程语言说明代码示例编译指令
1Posix正则C语言是C标准库中用于编译POSIX风格的正则表达式库
 
posix-re.cgcc posix-re.c 
2PCRE库C语言提供类似Perl语言的一个正则表达式引擎库。

一般系统上对应/usr/lib64/libpcre.so这个库文件,它 是PCRE(Perl Compatible Regular Expressions)库的动态链接库文件,通常用于在Linux系统中提供对正则表达式的支持。PCRE库是由 Philip Hazel 开发的,提供了对Perl风格正则表达式的支持,包括编译、执行和处理正则表达式的功能。

test-pcre.cgcc test-pcre.c  -lpcre
3RE2C++RE2是google开源的正则表达式一厍,田Rob Pike和 Russ Cox 两位来自google的大牛用C++实现。它快速、安全,线程友好,是PCRE、PERL 和Python等回溯正则表达式引擎(backtracking regularexpression engine)的一个替代品。RE2支持Linux和绝大多数的Unix平台。

2.代码示例

2.1 posix-re.c

#include <stdio.h>
#include <regex.h>int main() {regex_t regex;int ret;char str[] = "hello world";// 编译正则表达式ret = regcomp(&regex, "hello", REG_EXTENDED);if (ret != 0)  {   printf("Error compiling regex\n");return 1;}   // 执行匹配ret = regexec(&regex, str, 0, NULL, 0); if (ret == 0) {printf("Match found\n");} else if (ret == REG_NOMATCH) {printf("No match found\n");} else {printf("Error executing regex\n");}   // 释放正则表达式regfree(&regex);return 0;
}

2.2 test-pcre.c

#include <stdio.h>
#include <string.h>
#include <pcre.h>int main() {const char *pattern = "hello (\\w+)";const char *subject = "hello world";const int subject_length = strlen(subject);const char *error;int error_offset;pcre *re = pcre_compile(pattern, 0, &error, &error_offset, NULL);if (re == NULL) {printf("PCRE compilation failed at offset %d: %s\n", error_offset, error);return 1;}   int ovector[3];int rc = pcre_exec(re, NULL, subject, subject_length, 0, 0, ovector, 3); if (rc < 0) {printf("PCRE execution failed with error code %d\n", rc);pcre_free(re);return 1;}   printf("Match found: ");for (int i = ovector[2]; i < ovector[3]; i++) {printf("%c", subject[i]);}   printf("\n");pcre_free(re);return 0;
}

3.接口说明

3.1 posix-re

       #include <sys/types.h>#include <regex.h>int regcomp(regex_t *preg, const char *regex, int cflags);int regexec(const regex_t *preg, const char *string, size_t nmatch,regmatch_t pmatch[], int eflags);size_t regerror(int errcode, const regex_t *preg, char *errbuf,size_t errbuf_size);void regfree(regex_t *preg);
DESCRIPTIONPOSIX regex compilingregcomp() is used to compile a regular expression into a form that is suitable for subsequent regexec() searches.regcomp() is supplied with preg, a pointer to a pattern buffer storage area; regex, a pointer to the null-terminated string and cflags, flags usedto determine the type of compilation.All regular expression searching must be done via a compiled pattern buffer, thus regexec() must always be supplied with the  address  of  a  reg‐comp() initialized pattern buffer.cflags may be the bitwise-or of one or more of the following:REG_EXTENDEDUse POSIX Extended Regular Expression syntax when interpreting regex.  If not set, POSIX Basic Regular Expression syntax is used.REG_ICASEDo not differentiate case.  Subsequent regexec() searches using this pattern buffer will be case insensitive.REG_NOSUBDo  not  report  position of matches.  The nmatch and pmatch arguments to regexec() are ignored if the pattern buffer supplied was compiledwith this flag set.REG_NEWLINEMatch-any-character operators don't match a newline.A nonmatching list ([^...])  not containing a newline does not match a newline.Match-beginning-of-line operator (^) matches the empty string immediately after a newline, regardless  of  whether  eflags,  the  executionflags of regexec(), contains REG_NOTBOL.Match-end-of-line operator ($) matches the empty string immediately before a newline, regardless of whether eflags contains REG_NOTEOL.POSIX regex matchingregexec()  is used to match a null-terminated string against the precompiled pattern buffer, preg.  nmatch and pmatch are used to provide informa‐tion regarding the location of any matches.  eflags may be the bitwise-or of one or both of REG_NOTBOL  and  REG_NOTEOL  which  cause  changes  inmatching behavior described below.REG_NOTBOLThe match-beginning-of-line operator always fails to match (but see the compilation flag REG_NEWLINE above) This flag may be used when dif‐ferent portions of a string are passed to regexec() and the beginning of the string should not be interpreted as the beginning of the line.REG_NOTEOLThe match-end-of-line operator always fails to match (but see the compilation flag REG_NEWLINE above)Byte offsetsUnless REG_NOSUB was set for the compilation of the pattern buffer, it is possible to obtain match addressing information.  pmatch must be  dimen‐sioned  to  have  at  least  nmatch  elements.  These are filled in by regexec() with substring match addresses.  The offsets of the subexpressionstarting at the ith open parenthesis are stored in pmatch[i].  The entire regular expression's match addresses are  stored  in  pmatch[0].   (Notethat to return the offsets of N subexpression matches, nmatch must be at least N+1.)  Any unused structure elements will contain the value -1.The regmatch_t structure which is the type of pmatch is defined in <regex.h>.typedef struct {regoff_t rm_so;regoff_t rm_eo;} regmatch_t;Each  rm_so  element  that is not -1 indicates the start offset of the next largest substring match within the string.  The relative rm_eo elementindicates the end offset of the match, which is the offset of the first character after the matching text.POSIX error reportingregerror() is used to turn the error codes that can be returned by both regcomp() and regexec() into error message strings.regerror() is passed the error code, errcode, the pattern buffer, preg, a pointer to a character string buffer, errbuf, and the size of the stringbuffer,  errbuf_size.   It  returns  the  size  of  the  errbuf  required to contain the null-terminated error message string.  If both errbuf anderrbuf_size are nonzero, errbuf is filled in with the first errbuf_size - 1 characters of the error message and a terminating null byte ('\0').POSIX pattern buffer freeingSupplying regfree() with a precompiled pattern buffer, preg will free the memory allocated to the pattern buffer by the  compiling  process,  reg‐comp().RETURN VALUEregcomp() returns zero for a successful compilation or an error code for failure.regexec() returns zero for a successful match or REG_NOMATCH for failure.ERRORSThe following errors can be returned by regcomp():REG_BADBRInvalid use of back reference operator.REG_BADPATInvalid use of pattern operators such as group or list.REG_BADRPTInvalid use of repetition operators such as using '*' as the first character.REG_EBRACEUn-matched brace interval operators.REG_EBRACKUn-matched bracket list operators.REG_ECOLLATEInvalid collating element.REG_ECTYPEUnknown character class name.REG_EENDNonspecific error.  This is not defined by POSIX.2.REG_EESCAPETrailing backslash.REG_EPARENUn-matched parenthesis group operators.REG_ERANGEInvalid use of the range operator, e.g., the ending point of the range occurs prior to the starting point.REG_ESIZECompiled regular expression requires a pattern buffer larger than 64Kb.  This is not defined by POSIX.2.REG_ESPACEThe regex routines ran out of memory.REG_ESUBREGInvalid back reference to a subexpression.

3.2 pcre

3.2.1 pcre_complie-编译正则表达式

NAMEPCRE - Perl-compatible regular expressionsSYNOPSIS#include <pcre.h>pcre *pcre_compile(const char *pattern, int options,const char **errptr, int *erroffset,const unsigned char *tableptr);pcre16 *pcre16_compile(PCRE_SPTR16 pattern, int options,const char **errptr, int *erroffset,const unsigned char *tableptr);pcre32 *pcre32_compile(PCRE_SPTR32 pattern, int options,const char **errptr, int *erroffset,const unsigned char *tableptr);DESCRIPTIONThis function compiles a regular expression into an internal form. It is the same as pcre[16|32]_compile2(), except for the absence of the errorcodeptr argument. Its arguments are:pattern       A zero-terminated string containing theregular expression to be compiledoptions       Zero or more option bitserrptr        Where to put an error messageerroffset     Offset in pattern where error was foundtableptr      Pointer to character tables, or NULL touse the built-in defaultThe option bits are:PCRE_ANCHORED           Force pattern anchoringPCRE_AUTO_CALLOUT       Compile automatic calloutsPCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLFPCRE_BSR_UNICODE        \R matches all Unicode line endingsPCRE_CASELESS           Do caseless matchingPCRE_DOLLAR_ENDONLY     $ not to match newline at endPCRE_DOTALL             . matches anything including NLPCRE_DUPNAMES           Allow duplicate names for subpatternsPCRE_EXTENDED           Ignore white space and # commentsPCRE_EXTRA              PCRE extra features(not much use currently)PCRE_FIRSTLINE          Force matching to be before newlinePCRE_JAVASCRIPT_COMPAT  JavaScript compatibilityPCRE_MULTILINE          ^ and $ match newlines within dataPCRE_NEWLINE_ANY        Recognize any Unicode newline sequencePCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newlinesequencesPCRE_NEWLINE_CR         Set CR as the newline sequencePCRE_NEWLINE_CRLF       Set CRLF as the newline sequencePCRE_NEWLINE_LF         Set LF as the newline sequencePCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-theses (named ones available)PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16validity (only relevant ifPCRE_UTF16 is set)PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32validity (only relevant ifPCRE_UTF32 is set)PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8validity (only relevant ifPCRE_UTF8 is set)PCRE_UCP                Use Unicode properties for \d, \w, etc.PCRE_UNGREEDY           Invert greediness of quantifiersPCRE_UTF16              Run in pcre16_compile() UTF-16 modePCRE_UTF32              Run in pcre32_compile() UTF-32 modePCRE_UTF8               Run in pcre_compile() UTF-8 modePCRE must be built with UTF support in order to use PCRE_UTF8/16/32 and 
PCRE_NO_UTF8/16/32_CHECK, and with UCP support if PCRE_UCP is used.The  yield  of the function is a pointer to a private data structure that 
contains the compiled pattern, or NULL if an error was detected. Note that compiling
regular expressions with one version of PCRE for use with a differentversion is not guaranteed to work and may cause crashes.There is a complete description of the PCRE native API in the pcreapi page and 
a description of the POSIX API in the pcreposix page.

3.2.2 pcre_exec-函数参数说明

 int pcre_exec(const pcre *code, const pcre_extra *extra,const char *subject, int length, int startoffset,int options, int *ovector, int ovecsize);This function matches a compiled regular expression against a given subject string, 
using a matching algorithm that is similar to Perl's. It returns offsets to captured 
substrings. Its arguments are:code         Points to the compiled patternextra        Points to an associated pcre[16|32]_extra structure,or is NULLsubject      Points to the subject stringlength       Length of the subject string, in bytesstartoffset  Offset in bytes in the subject at which tostart matchingoptions      Option bitsovector      Points to a vector of ints for result offsetsovecsize     Number of elements in the vector (a multiple of 3)The options are:PCRE_ANCHORED          Match only at the first positionPCRE_BSR_ANYCRLF       \R matches only CR, LF, or CRLFPCRE_BSR_UNICODE       \R matches all Unicode line endingsPCRE_NEWLINE_ANY       Recognize any Unicode newline sequencePCRE_NEWLINE_ANYCRLF   Recognize CR, LF, & CRLF as newline sequencesPCRE_NEWLINE_CR        Recognize CR as the only newline sequencePCRE_NEWLINE_CRLF      Recognize CRLF as the only newline sequencePCRE_NEWLINE_LF        Recognize LF as the only newline sequencePCRE_NOTBOL            Subject string is not the beginning of a linePCRE_NOTEOL            Subject string is not the end of a linePCRE_NOTEMPTY          An empty string is not a valid matchPCRE_NOTEMPTY_ATSTART  An empty string at the start of the subjectis not a valid matchPCRE_NO_START_OPTIMIZE Do not do "start-match" optimizationsPCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16validity (only relevant if PCRE_UTF16was set at compile time)PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32validity (only relevant if PCRE_UTF32was set at compile time)PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8validity (only relevant if PCRE_UTF8was set at compile time)PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partialPCRE_PARTIAL_SOFT      )   match if no full matches are foundPCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial matchif that is found before a full match

3.2.3 pcre.h文件中的一些枚举值

这些枚举值在pcre_exec的返回值中被用到。
/* Exec-time and get/set-time error codes */#define PCRE_ERROR_NOMATCH          (-1)
#define PCRE_ERROR_NULL             (-2)
#define PCRE_ERROR_BADOPTION        (-3)
#define PCRE_ERROR_BADMAGIC         (-4)
#define PCRE_ERROR_UNKNOWN_OPCODE   (-5)
#define PCRE_ERROR_UNKNOWN_NODE     (-5)  /* For backward compatibility */
#define PCRE_ERROR_NOMEMORY         (-6)
#define PCRE_ERROR_NOSUBSTRING      (-7)
#define PCRE_ERROR_MATCHLIMIT       (-8)
#define PCRE_ERROR_CALLOUT          (-9)  /* Never used by PCRE itself */
#define PCRE_ERROR_BADUTF8         (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF16        (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF32        (-10)  /* Same for 8/16/32 */
#define PCRE_ERROR_BADUTF8_OFFSET  (-11)  /* Same for 8/16 */
#define PCRE_ERROR_BADUTF16_OFFSET (-11)  /* Same for 8/16 */
#define PCRE_ERROR_PARTIAL         (-12)
#define PCRE_ERROR_BADPARTIAL      (-13)
#define PCRE_ERROR_INTERNAL        (-14)
#define PCRE_ERROR_BADCOUNT        (-15)
#define PCRE_ERROR_DFA_UITEM       (-16)
#define PCRE_ERROR_DFA_UCOND       (-17)
#define PCRE_ERROR_DFA_UMLIMIT     (-18)
#define PCRE_ERROR_DFA_WSSIZE      (-19)
#define PCRE_ERROR_DFA_RECURSE     (-20)
#define PCRE_ERROR_RECURSIONLIMIT  (-21)
#define PCRE_ERROR_NULLWSLIMIT     (-22)  /* No longer actually used */
#define PCRE_ERROR_BADNEWLINE      (-23)
#define PCRE_ERROR_BADOFFSET       (-24)
#define PCRE_ERROR_SHORTUTF8       (-25)
#define PCRE_ERROR_SHORTUTF16      (-25)  /* Same for 8/16 */
#define PCRE_ERROR_RECURSELOOP     (-26)
#define PCRE_ERROR_JIT_STACKLIMIT  (-27)
#define PCRE_ERROR_BADMODE         (-28)
#define PCRE_ERROR_BADENDIANNESS   (-29)
#define PCRE_ERROR_DFA_BADRESTART  (-30)
#define PCRE_ERROR_JIT_BADOPTION   (-31)
#define PCRE_ERROR_BADLENGTH       (-32)
#define PCRE_ERROR_UNSET           (-33)

3.2.4 pcre_exec-源码实现

源码在pcre_exec.c文件中。

3.2.5 pcre_exec-函数返回值说明

该函数的返回值是一个整数,代表了匹配的结果。具体来说,
(1)返回值大于等于 0:
如果返回值为非负数,表示成功匹配,且返回值是匹配的子串数量加1。
这表示正则表达式成功匹配目标字符串,并且返回了匹配的子串数量。
返回值为0时,表示正则表达式成功匹配了目标字符串,但没有返回任何子串,即没有捕获组。(2)返回值小于0:
返回值是负数,表示匹配失败或发生了错误。
返回值为 -1('PCRE_ERROR_NOMATCH')时,表示正则表达式未能匹配目标字符串。
其他负数返回值表示发生了其他错误,可能是由于正则表达式本身的问题、目标字符串格式问题或者
内存分配问题等。
根据 'pcre_exec' 函数的返回值,可以判断正则表达式是否成功匹配目标字符串,以及获取匹配的
子串数量等信息。在实际使用中,可以根据返回值来进行适当的处理和错误检测。

相关文章:

正则表达式引擎库汇合

1.总览表格 一些正则表达式库的对比 index库名编程语言说明代码示例编译指令1Posix正则C语言是C标准库中用于编译POSIX风格的正则表达式库 posix-re.cgcc posix-re.c 2PCRE库C语言提供类似Perl语言的一个正则表达式引擎库。 一般系统上对应/usr/lib64/libpcre.so这个库文件&am…...

eBay买家号注册下单容易死号?是什么原因导致?

随着电子商务的迅猛发展&#xff0c;跨境电商平台eBay日益成为众多消费者和商家的首选。然而&#xff0c;自去年下半年以来&#xff0c;eBay推出的新规则给买家号的注册带来了前所未有的挑战。许多新用户反映&#xff0c;在注册eBay买家号后&#xff0c;往往遭遇刚注册就被冻结…...

【Linux】-进程知识铺垫①计算机硬件的组织:冯诺依曼体系结构详细解读②关于操作系统对软硬件及用户的意义

目录 ​编辑 1.关于计算机的体系结构 1.1 冯诺依曼体系结构的诞生 2.冯诺依曼体系结构 2.1 cpu:运算器&#xff1a;更多的是让cpu具有特殊的数据计算功能&#xff1a; 2.2 控制器 2.3输入设备 2.4输出设备 3.计算机各个硬件设备之间的关系 4.内存与计算机效率 5.关于为什么总说…...

让ECC升级S/4HANA一步到位的“全面升级方案包”

SAP最新一代商务套件S/4HANA比ECC系统拥有更高性能的存储数据库HANA、更个性化的Fiori用户界面设计系统&#xff0c;能够大大提升系统效率&#xff0c;带来便捷、高效、良好的用户体验。但企业原先使用的ECC系统里面保存了积累多年的关键流程和数据&#xff0c;让企业面对系统升…...

AutoGluon

官网 amazon (base) PS C:\Users\gg葱> conda env list # conda environments: # pytorch1 C:\Users\gg葱\.conda\envs\pytorch1 base * D:\ANCDD:\Documents\LMm\env\pytorch2(base) PS C:\Users\gg葱> conda create --prefixD:/Doc…...

【网站项目】少儿编程管理系统

&#x1f64a;作者简介&#xff1a;拥有多年开发工作经验&#xff0c;分享技术代码帮助学生学习&#xff0c;独立完成自己的项目或者毕业设计。 代码可以私聊博主获取。&#x1f339;赠送计算机毕业设计600个选题excel文件&#xff0c;帮助大学选题。赠送开题报告模板&#xff…...

基于C语言的数据结构--顺序表讲解及代码函数实现展示

本篇文章是数据结构的开篇&#xff0c;所以我们先来了解一下什么是数据结构。 什么是数据结构 数据结构是由“数据”和“结构”两个词组合而来&#xff0c;自然要以两个词分别去阐述。 首先&#xff0c;什么是数据&#xff1f;数据(data)是事实或观察的结果&#xff0c;是对客…...

(学习日记)2024.03.31:UCOSIII第二十八节:消息队列常用函数

写在前面&#xff1a; 由于时间的不足与学习的碎片化&#xff0c;写博客变得有些奢侈。 但是对于记录学习&#xff08;忘了以后能快速复习&#xff09;的渴望一天天变得强烈。 既然如此 不如以天为单位&#xff0c;以时间为顺序&#xff0c;仅仅将博客当做一个知识学习的目录&a…...

DLC原理解析及其优化思考

1. 引言 Discreet Log Contract (DLC) 是由麻省理工学院的Tadge Dryja在2018年提出的一套基于预言机的合约执行方案。DLC 允许两方根据预定义的条件进行有条件付款。各方确定可能的结果并进行预签名&#xff0c;并在预言机签署结果时使用这些预签名来执行支付。 因此&#xff…...

tigramite教程(七)使用TIGRAMITE 进行条件独立性测试

文章目录 概述1 连续数值变量1.1 ParCorr 偏相关&#xff08;ParCorr类&#xff09;1.2 鲁棒偏相关&#xff08;RobustParCorr&#xff09;非线性检验1.3 GPDC1.4 CMIknn 2a. 分类/符号时间序列2b. 混合分类/连续时间序列多变量X和Y的测试 概述 这个表格概述了 X ⊥ Y ∣ Z X\…...

【DevOps工具篇】使用Ansible部署Keycloak oauth2proxy 和 单点登录(SSO)设置

【DevOps工具篇】使用Ansible部署Keycloak oauth2proxy 和 单点登录(SSO)设置 目录 【DevOps工具篇】使用Ansible部署Keycloak oauth2proxy 和 单点登录(SSO)设置Ansible 基础知识部署 Keycloak创建 OIDC-客户端创建 oauth2proxy 部署顶级 Ansible PlaybookHost.iniplayboo…...

鸿蒙OS开发实例:【应用状态变量共享】

平时在开发的过程中&#xff0c;我们会在应用中共享数据&#xff0c;在不同的页面间共享信息。虽然常用的共享信息&#xff0c;也可以通过不同页面中组件间信息共享的方式&#xff0c;但有时使用应用级别的状态管理会让开发工作变得简单。 根据不同的使用场景&#xff0c;ArkT…...

C#清空窗体的背景图片

目录 一、涉及到的知识点 1.设置窗体的背景图 2.加载窗体背景图 3.清空窗体的背景图 二、 示例 一、涉及到的知识点 1.设置窗体的背景图 详见本文作者的其他文章&#xff1a;C#手动改变自制窗体的大小-CSDN博客 https://wenchm.blog.csdn.net/article/details/137027140…...

Qt 实现的万能采集库( 屏幕/相机/扬声器/麦克风采集)

【写在前面】 之前应公司需要&#xff0c;给公司写过一整套直播的库( 推拉流&#xff0c;编解码)&#xff0c;类似于 libobs。 结果后来因为没有相关项目&#xff0c;便停止开发&维护了。 不过里面很多有用的组件&#xff0c;然后也挺好用的&#xff0c;遂开源出来一部分。…...

将写好的打印机代码打包成jar包然后直接注册成windows服务,然后通过调用插件的接口地址将流传到接口实现解析并无需预览直接通过打印机直接打印PDF文件

实现文件流PDF不需要预览直接调用打印机打印实现方案就是&#xff0c;将写好的打印机代码打包成jar包然后直接注册成windows服务&#xff0c;然后通过调用插件的接口地址将流传到接口实现解析并无需预览直接通过打印机直接打印PDF文件。源码地址...

加密软件VMProtect教程:使用脚本-功能

VMProtect是新一代软件保护实用程序。VMProtect支持德尔菲、Borland C Builder、Visual C/C、Visual Basic&#xff08;本机&#xff09;、Virtual Pascal和XCode编译器。 同时&#xff0c;VMProtect有一个内置的反汇编程序&#xff0c;可以与Windows和Mac OS X可执行文件一起…...

51单片机入门_江协科技_21.1_开发板USB口连接建议

1. 目前我自己用的普中A2版本的开发板&#xff0c;操作失误导致在开发板连接电脑并通电的情况下误将跳线帽触碰到开发板的3.3V与GND&#xff0c;导致USB口浪涌&#xff0c;2个电脑上面的USB口烧毁&#xff0c;开发板暂时没有任何问题&#xff0c;电脑USB口现在只是接通后有电&a…...

基于Spring Boot 3 + Spring Security6 + JWT + Redis实现登录、token身份认证

基于Spring Boot3实现Spring Security6 JWT Redis实现登录、token身份认证。 用户从数据库中获取。使用RESTFul风格的APi进行登录。使用JWT生成token。使用Redis进行登录过期判断。所有的工具类和数据结构在源码中都有。 系列文章指路&#x1f449; 系列文章-基于SpringBoot3…...

Kubernetes(k8s):精通 Pod 操作的关键命令

Kubernetes&#xff08;k8s&#xff09;&#xff1a;精通 Pod 操作的关键命令 1、查看 Pod 列表2、 查看 Pod 的详细信息3、创建 Pod4、删除 Pod5、获取 Pod 日志6、进入 Pod 执行命令7、暂停和启动 Pod8、改变 Pod 副本数量9、查看当前部署中使用的镜像版本10、滚动更新 Pod11…...

【随笔】Git 高级篇 -- 相对引用2(十三)

&#x1f48c; 所属专栏&#xff1a;【Git】 &#x1f600; 作  者&#xff1a;我是夜阑的狗&#x1f436; &#x1f680; 个人简介&#xff1a;一个正在努力学技术的CV工程师&#xff0c;专注基础和实战分享 &#xff0c;欢迎咨询&#xff01; &#x1f496; 欢迎大…...

xilinx AXI CAN驱动开发

CAN收发方案有很多&#xff0c;常见的解决方案通过是采用CAN收发芯片&#xff0c;例如最常用的SJA1000,xilinx直接将CAN协议栈用纯逻辑实现&#xff0c;AXI CAN是其中一种&#xff1b; 通过这种方式硬件上只需外接一个PHY芯片即可 上图加了一个电平转换芯片 软件设计方面&…...

Python:百度AI开放平台——OCR图像文字识别应用

一、注册百度AI开放平台 使用百度AI服务的步骤为&#xff1a; 注册&#xff1a;注册成为百度AI开放平台开发者&#xff1b;创建AI应用&#xff1a;在百度API开放平台上创建相关类型的的AI应用&#xff0c;获得AppID、API Key和Secret Key&#xff1b;调用API&#xff1a;调用…...

OpenEuler/Centos制作离线软件源

需求背景&#xff1a; 一般线上服务器都是不能连接外网&#xff0c;服务器安装好系统之后就需要部署相关软件&#xff0c;此时因为无法联网导致无法下载软件&#xff0c;所以都会做一个本地的离线软件源&#xff0c;本文简单介绍如何快速利用已经下载好的rpm包&#xff0c;制作…...

论文笔记:基于多粒度信息融合的社交媒体多模态假新闻检测

整理了ICMR2023 Multi-modal Fake News Detection on Social Media via Multi-grained Information Fusion&#xff09;论文的阅读笔记 背景模型实验 背景 在假新闻检测领域&#xff0c;目前的方法主要集中在文本和视觉特征的集成上&#xff0c;但不能有效地利用细粒度和粗粒度…...

攻防世界 xff_referer 题目解析

xff_referer 一&#xff1a;了解xxf和Referer X-Forwarded-For:简称XFF头&#xff0c;它代表客户端&#xff0c;也就是HTTP的请求端真实的IP&#xff0c;只有在通过了HTTP 代理或者负载均衡服务器时才会添加该项。 一般的客户端发送HTTP请求没有X-Forwarded-For头的&#xff0…...

open-cd框架调试记录

源于论文Changer: Feature Interaction Is What You Need forChange Detection 源码位置&#xff1a;open-cd/README.md at main likyoo/open-cd (github.com) 同样是基于MMSegmentation框架的代码&#xff0c;不符合本人编程习惯所以一直也没有研究这东西&#xff0c;近期打…...

【算法刷题day17】Leetcode:110.平衡二叉树、257. 二叉树的所有路径、404.左叶子之和

文章目录 Leetcode 110.平衡二叉树解题思路代码总结 Leetcode 257. 二叉树的所有路径解题思路代码总结 Leetcode 404.左叶子之和解题思路代码总结 草稿图网站 java的Deque Leetcode 110.平衡二叉树 题目&#xff1a;** 110.平衡二叉树** 解析&#xff1a;代码随想录解析 解题思…...

Linux云计算之Linux基础2——Linux发行版本的安装

目录 一、彻底删除VMware 二、VMware-17虚拟机安装 三、MobaXterm 安装 四、Centos 发行版 7.9的安装 五、rockys 9.1的安装 六、ubuntu2204的安装 一、彻底删除VMware 在卸载VMware虚拟机之前&#xff0c;要先把与VMware相关的服务和进程终止 1. 在windows中按下【Windo…...

C++:赋值运算符(17)

赋值也就是将后面的值赋值给变量&#xff0c;这里最常用的就是 &#xff0c;a1那么a就是1&#xff0c;此外还包含以下的赋值运算 等于int a 1; a10 a10加等于int a 1; a1;a2-减等于int a 1; a-1;a0*乘等于int a 2; a*5;a10/除等于int a 10; a/2;a5%模等于int a 10; a%…...

Spring Boot | Spring Boot的“数据访问“、Spring Boot“整合MyBatis“

目录: 一、Spring Boot”数据访问概述“二、Spring Boot”整合MyBatis”1. 基础环境搭建 (引入对应的“依赖启动器” 配置数据库的“相关参数”)① 数据准备 (导入Sql文件)② 创建项目&#xff0c;引入相应的启动器&#xff0c;编写数据库对应的“实体类”③额外添加pom.xml文…...

邓亚萍近况 做网站败光20亿/宁德市疫情最新消息

Edit笔记内容&#xff1a;Python3 OS 文件/目录方法 笔记日期&#xff1a;2017-11-12Python3 OS 文件/目录方法os 模块提供了非常丰富的方法用来处理文件和目录。常用的方法如下表所示&#xff1a;声明&#xff1a;转自以下网址&#xff1a; http://www.runoob.com/python3/pyt…...

服务网站开发/信息流优化师

项目介绍 随着我国大学生数量的不断增加&#xff0c;如果能够让大学生更好的养成对应的消费习惯&#xff0c;并且能够自控的管理好自己的收支情况&#xff0c;是很多教育工作者研究的一个主要问题之一&#xff0c;本系统的开发主要是为了在一定程度上帮助大学生养成良好的收支…...

威海网站建设公司/搜狗关键词排名此会zjkwlgs

目录 1、Map接口的定义 2、HashMap子类 3、Hashtable子类&#xff08;旧的子类&#xff09; 4、排序的子类&#xff1a;TreeMap 5、利用Iterator输出Map集合 6、自定义Map中的key 7、总结 1、Map接口的定义 Map保存的是二元偶对象&#xff0c;简单说就是两个值&#xf…...

如何删除在凡科上做的网站/网站排名英文

概述 tcpdump语法图解 常用过滤规则 其实就是ip&#xff0c;端口过滤。 基于ip地址过滤(host/dst/src) 案例1&#xff1a;捕获特定主机192.168.0.108的主机收到的和发出的所有的数据包。 tcpdump host 192.168.0.108只捕获源ip、目的ip为host的报文。 如果你非常明确哪个主…...

网站维护费用包括哪些/seo网站自动发布外链工具

分析 JUnit 框架源代码 理解 JUnit 测试框架实现原理和设计模式 文档选项打印本页 将此页作为电子邮件发送 级别&#xff1a; 中级 何 正华 , 软件工程师, IBM徐 晔 (yexucn.ibm.com ), 软件工程师, IBM, Software Group 2009 年 5 月 31 日 本文细致地描述了 JUnit 的代码实现…...

深圳 高端网站建设宝安/优化关键词规则

PV操作的核心就是 PV操作可以同时起到同步与互斥的作用。 1.同步就是通过P操作获取信号量&#xff0c;V操作释放信号量来进行。 2.互斥其实就是&#xff0c;同时操作P操作&#xff0c;结束后进行V操作即可做到。 Java上实现PV操作可以通过Semaphore来实现。 package com.multit…...