正则表达式引擎库汇合

news2024/11/28 8:34:49

 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);
DESCRIPTION
   POSIX regex compiling
       regcomp() 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 used
       to 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_EXTENDED
              Use POSIX Extended Regular Expression syntax when interpreting regex.  If not set, POSIX Basic Regular Expression syntax is used.

       REG_ICASE
              Do not differentiate case.  Subsequent regexec() searches using this pattern buffer will be case insensitive.

       REG_NOSUB
              Do  not  report  position of matches.  The nmatch and pmatch arguments to regexec() are ignored if the pattern buffer supplied was compiled
              with this flag set.

       REG_NEWLINE
              Match-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  execution
              flags 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 matching
       regexec()  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  in
       matching behavior described below.

       REG_NOTBOL
              The 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_NOTEOL
              The match-end-of-line operator always fails to match (but see the compilation flag REG_NEWLINE above)

   Byte offsets
       Unless 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 subexpression
       starting at the ith open parenthesis are stored in pmatch[i].  The entire regular expression's match addresses are  stored  in  pmatch[0].   (Note
       that 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 element
       indicates the end offset of the match, which is the offset of the first character after the matching text.

   POSIX error reporting
       regerror() 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 string
       buffer,  errbuf_size.   It  returns  the  size  of  the  errbuf  required to contain the null-terminated error message string.  If both errbuf and
       errbuf_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 freeing
       Supplying regfree() with a precompiled pattern buffer, preg will free the memory allocated to the pattern buffer by the  compiling  process,  reg‐
       comp().

RETURN VALUE
       regcomp() returns zero for a successful compilation or an error code for failure.

       regexec() returns zero for a successful match or REG_NOMATCH for failure.

ERRORS
       The following errors can be returned by regcomp():
      REG_BADBR
              Invalid use of back reference operator.

       REG_BADPAT
              Invalid use of pattern operators such as group or list.

       REG_BADRPT
              Invalid use of repetition operators such as using '*' as the first character.

       REG_EBRACE
              Un-matched brace interval operators.

       REG_EBRACK
              Un-matched bracket list operators.

       REG_ECOLLATE
              Invalid collating element.

       REG_ECTYPE
              Unknown character class name.

       REG_EEND
              Nonspecific error.  This is not defined by POSIX.2.

       REG_EESCAPE
              Trailing backslash.

       REG_EPAREN
              Un-matched parenthesis group operators.

       REG_ERANGE
              Invalid use of the range operator, e.g., the ending point of the range occurs prior to the starting point.

       REG_ESIZE
              Compiled regular expression requires a pattern buffer larger than 64Kb.  This is not defined by POSIX.2.

       REG_ESPACE
              The regex routines ran out of memory.

       REG_ESUBREG
              Invalid back reference to a subexpression.

3.2 pcre

3.2.1 pcre_complie-编译正则表达式

NAME
       PCRE - Perl-compatible regular expressions

SYNOPSIS

       #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);

DESCRIPTION

       This 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 the
                         regular expression to be compiled
         options       Zero or more option bits
         errptr        Where to put an error message
         erroffset     Offset in pattern where error was found
         tableptr      Pointer to character tables, or NULL to
                         use the built-in default

       The option bits are:
         PCRE_ANCHORED           Force pattern anchoring
         PCRE_AUTO_CALLOUT       Compile automatic callouts
         PCRE_BSR_ANYCRLF        \R matches only CR, LF, or CRLF
         PCRE_BSR_UNICODE        \R matches all Unicode line endings
         PCRE_CASELESS           Do caseless matching
         PCRE_DOLLAR_ENDONLY     $ not to match newline at end
         PCRE_DOTALL             . matches anything including NL
         PCRE_DUPNAMES           Allow duplicate names for subpatterns
         PCRE_EXTENDED           Ignore white space and # comments
         PCRE_EXTRA              PCRE extra features
                                   (not much use currently)
         PCRE_FIRSTLINE          Force matching to be before newline
         PCRE_JAVASCRIPT_COMPAT  JavaScript compatibility
         PCRE_MULTILINE          ^ and $ match newlines within data
         PCRE_NEWLINE_ANY        Recognize any Unicode newline sequence
         PCRE_NEWLINE_ANYCRLF    Recognize CR, LF, and CRLF as newline
                                   sequences
         PCRE_NEWLINE_CR         Set CR as the newline sequence
         PCRE_NEWLINE_CRLF       Set CRLF as the newline sequence
         PCRE_NEWLINE_LF         Set LF as the newline sequence
         PCRE_NO_AUTO_CAPTURE    Disable numbered capturing paren-
                                   theses (named ones available)
         PCRE_NO_UTF16_CHECK     Do not check the pattern for UTF-16
                                   validity (only relevant if
                                   PCRE_UTF16 is set)
         PCRE_NO_UTF32_CHECK     Do not check the pattern for UTF-32
                                   validity (only relevant if
                                   PCRE_UTF32 is set)
         PCRE_NO_UTF8_CHECK      Do not check the pattern for UTF-8
                                   validity (only relevant if
                                   PCRE_UTF8 is set)
         PCRE_UCP                Use Unicode properties for \d, \w, etc.
         PCRE_UNGREEDY           Invert greediness of quantifiers
         PCRE_UTF16              Run in pcre16_compile() UTF-16 mode
         PCRE_UTF32              Run in pcre32_compile() UTF-32 mode
         PCRE_UTF8               Run in pcre_compile() UTF-8 mode

         PCRE 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 different
       version 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 pattern
         extra        Points to an associated pcre[16|32]_extra structure,
                        or is NULL
         subject      Points to the subject string
         length       Length of the subject string, in bytes
         startoffset  Offset in bytes in the subject at which to
                        start matching
         options      Option bits
         ovector      Points to a vector of ints for result offsets
         ovecsize     Number of elements in the vector (a multiple of 3)
  
The options are:

         PCRE_ANCHORED          Match only at the first position
         PCRE_BSR_ANYCRLF       \R matches only CR, LF, or CRLF
         PCRE_BSR_UNICODE       \R matches all Unicode line endings
         PCRE_NEWLINE_ANY       Recognize any Unicode newline sequence
         PCRE_NEWLINE_ANYCRLF   Recognize CR, LF, & CRLF as newline sequences
         PCRE_NEWLINE_CR        Recognize CR as the only newline sequence
         PCRE_NEWLINE_CRLF      Recognize CRLF as the only newline sequence
         PCRE_NEWLINE_LF        Recognize LF as the only newline sequence
         PCRE_NOTBOL            Subject string is not the beginning of a line
         PCRE_NOTEOL            Subject string is not the end of a line
         PCRE_NOTEMPTY          An empty string is not a valid match
         PCRE_NOTEMPTY_ATSTART  An empty string at the start of the subject
                                  is not a valid match
         PCRE_NO_START_OPTIMIZE Do not do "start-match" optimizations
         PCRE_NO_UTF16_CHECK    Do not check the subject for UTF-16
                                  validity (only relevant if PCRE_UTF16
                                  was set at compile time)
         PCRE_NO_UTF32_CHECK    Do not check the subject for UTF-32
                                  validity (only relevant if PCRE_UTF32
                                  was set at compile time)
         PCRE_NO_UTF8_CHECK     Do not check the subject for UTF-8
                                  validity (only relevant if PCRE_UTF8
                                  was set at compile time)
         PCRE_PARTIAL           ) Return PCRE_ERROR_PARTIAL for a partial
         PCRE_PARTIAL_SOFT      )   match if no full matches are found
         PCRE_PARTIAL_HARD      Return PCRE_ERROR_PARTIAL for a partial match
                                  if 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' 函数的返回值,可以判断正则表达式是否成功匹配目标字符串,以及获取匹配的
子串数量等信息。在实际使用中,可以根据返回值来进行适当的处理和错误检测。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1562584.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

012——LED模块驱动开发(基于I.MX6uLL)

目录 一、 硬件原理图 二、 驱动程序 三、 应用程序 四、 Makefile 五、操作 一、 硬件原理图 又是非常经典的点灯环节 &#xff0c;每次学新语言第一步都是hello world&#xff0c;拿到新板子或者学习新的操作系统&#xff0c;第一步就是点灯。 LED 的驱动方式&#xff0…

bugku-web-聪明的php

传递一个参数&#xff0c;提示flag的文件名随意 这里就是要传递参数filename&#xff0c;其值随意 直接得到内部逻辑代码 <?php include(./libs/Smarty.class.php); echo "pass a parameter and maybe the flag files filename is random :>"; $smarty new S…

蓝队面经速查手册

文章目录 常见安全设备溯源应急响应&#xff0b;入侵排查思路日志文件安全加固常用排查命令主机后门webshell的排查思路Webshell工具的流量特征Linux 的 Selinuxwindows 日志分析工具Linux 日志分析技巧命令安全基线规范检查中间件基线规范&#xff08;APACHE&#xff09;中间件…

验证码项目(java实现)

1、Kaptcha详细配置 配置项 配置说明 默认值 kaptcha.border 图⽚边框&#xff0c;合法值&#xff1a;yes , no yes kaptcha.border.color 边框颜⾊&#xff0c;合法值&#xff1a; r,g,b (and optional alpha) 或者 white,black,blue black kaptcha.image.width 图⽚宽 200…

golang语言系列:Scrum、Kanban等敏捷管理策略

云原生学习路线导航页&#xff08;持续更新中&#xff09; 本文是 golang语言系列 文章&#xff0c;主要对编程通用技能 Scrum、Kanban等敏捷管理策略 进行学习 1.什么是敏捷开发 敏捷是一个描述软件开发方法的术语&#xff0c;它强调增量交付、团队协作、持续规划和持续学习。…

ZKFair 创新之旅,新阶段如何塑造财富前景

在当前区块链技术的发展中&#xff0c;Layer 2&#xff08;L2&#xff09;解决方案已成为提高区块链扩容性、降低交易成本和提升交易速度的关键技术&#xff0c;但它仍面临一些关键问题和挑战&#xff0c;例如用户体验的改进、跨链互操作性、安全性以及去中心化程度。在这些背景…

基于springboot+vue+Mysql的某银行OA系统

开发语言&#xff1a;Java框架&#xff1a;springbootJDK版本&#xff1a;JDK1.8服务器&#xff1a;tomcat7数据库&#xff1a;mysql 5.7&#xff08;一定要5.7版本&#xff09;数据库工具&#xff1a;Navicat11开发软件&#xff1a;eclipse/myeclipse/ideaMaven包&#xff1a;…

JimuReport积木报表 v1.7.4 正式版本发布,免费的JAVA报表工具

项目介绍 一款免费的数据可视化报表&#xff0c;含报表和大屏设计&#xff0c;像搭建积木一样在线设计报表&#xff01;功能涵盖&#xff0c;数据报表、打印设计、图表报表、大屏设计等&#xff01; Web 版报表设计器&#xff0c;类似于excel操作风格&#xff0c;通过拖拽完成报…

Php_Code_challenge16

题目&#xff1a; 答案&#xff1a; 解析&#xff1a; 所以科学计数法绕过即可。

AI预测福彩3D第23弹【2024年4月1日预测--第5套算法开始计算第5次测试】

今天&#xff0c;咱们继续进行本套算法的测试&#xff0c;本套算法目前也已命中多次。今天为第五次测试&#xff0c;仍旧是采用冷温热趋势结合AI模型进行预测。好了&#xff0c;废话不多说了。直接上结果~ 仍旧是分为两个方案&#xff0c;1大1小。 经过人工神经网络计算并进行权…

element-ui alert 组件源码分享

今日简单分享 alert 组件源码实现&#xff0c;主要从以下四个方面来分享&#xff1a; 1、alert 组件的页面结构 2、alert 组件的属性 3、alert 组件的 slot 4、alert 组件的方法 一、alert 组件的页面结构 二、alert 组件的属性 2.1 title 属性&#xff0c;标题&#xff…

python爬虫+django新闻推荐系统可视化分析

1. 安装python3.7.0 2. 更新pip 控制台执行 python -m pip install -U pip 3. 安装依赖库 pip install -r requirements.txt 4. 更改mysql数据库配置 修改newsServer/settings.py中的数据库连接配置&#xff0c;比如修改下方PASSWORD密码为本机mysql密码&#xff1…

网络套接字补充——TCP网络编程

六、TCP网络编程 6.1IP地址字符串和整数之间的转换接口 //字符串转整数接口 #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> int inet_aton(const char *cp, struct in_addr *inp); int inet_pton(int af, const char *strptr, …

Golang 哈希表底层实现原理

1、本文讨论Golang的哈希表 Golang哈希表的实现&#xff0c;底层数据结构是数组单链表&#xff0c;链表节点由8个key、value和键的高八位组成的。为了方便理解&#xff0c;先简单看一个图快速理解。 我们来看一下Golang哈希表的结构体定义 简单介绍一下结构体中几个关键的…

提高三维模型的立面出图技术

提高三维模型的立面出图技术 摘要&#xff1a;立面出图是三维模型应用中常见的需求&#xff0c;它能够将三维模型呈现为平面立面图&#xff0c;用于建筑设计、室内装饰等领域。本文将介绍几种常用的立面出图技术&#xff0c;包括投影法、剖面法和渲染技术&#xff0c;并分析它们…

C语言动态内存讲解+通讯录2.0

文章目录 前文malloc和freecallocrealloc枚举常量的简单说明及使用 通讯录2.0动态开辟通讯录,满了就扩容保存数据和载入数据 通讯录2.0演示推荐好用的软件 前文 本文主要介绍动态开辟的几个函数,以及改进之前的通讯录。 我们局部变量等是在栈区上开辟空间的,而我们动态开辟的空…

Python学习笔记 - 如何在google Colab中显示图像?

这里是使用的opencv进行图片的读取&#xff0c;自然也是想使用opencv的imshow方法来显示图像&#xff0c;但是在google Colab中不可以使用&#xff0c;所以寻找了一下变通的显示方法。 方法1&#xff1a;使用matplotlib 使用plt需要交换一下r、b通道&#xff0c;否则显示不正常…

conda使用记录

linux 使用conda创建新一个新的python环境过程 conda create -n recommendation_env python3.8.18 # 指定python版本 conda env list # 查看所有的环境 conda activate recommendation_env # 激活创建的新环境 pip install flask # 安装依赖 或者 pip install flask版本号 或者…

鸿蒙(HarmonyOS)ArkTs语言基础教程开发准备

本文档适用于HarmonyOS应用开发的初学者。通过构建一个简单的具有页面跳转/返回功能的应用&#xff08;如下图所示&#xff09;&#xff0c;快速了解工程目录的主要文件&#xff0c;熟悉HarmonyOS应用开发流程。 在开始之前&#xff0c;您需要了解有关HarmonyOS应用的一些基本概…

Intel FPGA (4):状态机

Intel FPGA (4)&#xff1a;状态机 前提摘要 个人说明&#xff1a; 限于时间紧迫以及作者水平有限&#xff0c;本文错误、疏漏之处恐不在少数&#xff0c;恳请读者批评指正。意见请留言或者发送邮件至&#xff1a;“Email:noahpanzzzgmail.com”。本博客的工程文件均存放在&am…