C Reference Manual Reading Notes: 010 Definition and Replacement

java对csv文件进行读写操作 使用java对csv文件进行读写操作的源代码,包含javacsv.jar 立即下载

1. synopsis

    The #define preprocessor command causes a name (identifier) to become defined as a macro to the preprocessor.  A sequences of tokens, called the body of the macro, is associated with the name. When the name of the macro is recognized in the program source text or in the arguments of certain other preprocessor commands, it is treated as a call to that macro; the name is effectively replaced by a copy of body. If the macro is defined to accept arguments, then the actual arguments following the macro name are substituted for formal parameters in the macro body.

Example:

    If a macro sum with two arguments is defined by

        #define sum(x,y)   ((x)+(y))

    then the preprocessor replaces the source program line

        result = sum(5,a*b)

    with the simple (and perhaps unintended) text substitution

        result = ( (5) + (a*b) );


    Since the preprocessor does not distinguish reserved words from other identifiers, it is possible, in principle, to use a C reserved word as the name of a preprocessor macro, but to do so is usually bad programming practice. Macro names are never recognized within comments, string or character constants, or #include file names.


2. Objectlike Macro Definitions

    The #define command has two forms depending on whether a left parenthesis immediately follows the name to be defined. The simpler, objectlike form has no left parenthesis:

        #define name sequence-of-tokens(optional)

    An objectlike macro takes no arguments. It is invoked merely by mentioning its name. When the name is encountered in the source program text, the name is replaced by the body (the associated sequence-of-tokens, which may be  empty). The syntax of the #define command does not require an equal sign or any other special delimiter token after the name being defined. The body starts right after the name.

    The objectlike macro is particularly useful for introducing named constant into a program, so that a "magic number" such as the length of a table may be written in exactly one place and then refered to elsewhere by name. This makes it easier to change the number later.

    Another important use of objectlike macro is isolate implementation-dependent restrictions on the name of externally defined functions and variables.

Example:

    When a C compiler permits long internal identifiers, but the target computer require short external names, the preprocessor may be used to hide these short names:

        #define error_handler eh73

        extern void error_handler();

    and can be used like as:

        error_handler(...);


    Here are some typical macro definitions:

        #define BLOCK_SIZE    0x100

        #define TRACK_SIZE    (16*BLOCK_SIZE)

    A common programming error is to include an extraneous equal sign:

       #define NUMBER_DRIVERS = 5              /* probably wrong */

    This is a valid definition, but it causes the name NUMBER_DRIVERS to be defined as "=5" rather than "5". If one were then to write the code fragment

        If( count != NUMBER_DRIVERS ) ...

    it would be expanded to

        if ( count != = 5 ) ...

    which is syntactically invalid. For similar resons, also be careful to avoid an extraneous semicolon:

        #define NUMBER_DRIVERS    5;    /* probably wrong */


3. Defining Macros with Parameters

    The more complex, functionlike macro definition declares the names of formal parameters within parentheses separated by commas:

        #define name( identifier-list(optional) ) sequence-of-tokens(optional)

    where identifier-list is a comma-separated list of formal parameter names. In C99, an ellipsis(...; three periods) may also appera after identifier-list to indicate a variable argument list.

    The left parenthesis must immediately follow the name of the macro with no intervening whitespace. If whitespace separates the left parenthesis from the macro name, the definition is considered to define a macro that takes no arguments and has a body beginning with a left parenthesis.

    The names of the formal parameters must be identifiers, no two the same. There is no requirement  that any of the parameter names must be mentioned in the body(although normally they are mentioned). A functionlike macro can have an empty formal parameter list(i.e. zero formal parameters). This kind of macro is useful to simulate a function that takes no arguments.

    A functionlike macro takes as many actual parameters as there are formal parameters. The macro is invoked by writing its name, a left parenthesis, then one actual argument token sequence for each formal parameter, then a right parenthesis. The actual argument token sequences are separated by commas. (When a functonlike macro with no formal parameters is invoked, an empty actual argument list must be provided.) When a macro is invoked, whitespace may appear between the macro name and the left parenthesis or in the actual arguments. (Some older and deficient preprocessor implementations do not permit the actual argument token list to extend across multiple lines unless the lines to be continued end with a /.)

    A acutal argument token sequence may contain parenthesis if they are properly nested and balanced, and it may contain commas if each comma appears within a set of parentheses. (This restriction prevents confusion with the commas that separate the actual arguments.) Braces and subscripting brackets likewise may appear within macro arguments, but they cannot contain commas and do not have to balance. Parentheses and commas appearing with character-constant and string-constant tokens are not counted in the balancing of parentheses and the delimiting of actual arguments.

    In C99, arguments to macro can be empty, that is, consist of no tokens.

Example:

    Here is the definition of a macro that multiplies its two arguments:

        #define product(x,y) ((x)*(y))

    It is invoked twice in the following statement:

        x = product(a+3,b) + product(c,d);

    The arguments to the product macro could be function(or macro) calls. The commas within the function argument list do not affect the parsing of the macro arguments:

        return product( f(g,b), g(a,b) );  /* OK */


    The getchar() macro has an empty parameter list:

        #define getchar()  getc(stdin)

    When it is invoked, an empty argument list is provided:

        while( (c=getchar()) != EOF ) ...

    (Note: getchar(), stdin, and EOF are defined in the standard header stdio.h.)


    We can also define a macro takes as its argument an arbitrary statement:

        #define insert(stmt)    stmt

    The invocation

        insert({a=1; b=1;})

    works properly, but if we change the two assignment statements to a single statement containing two assignment expressions:

        insert({a=1, b=1;})

    then the preprocessor will complain that we have too many macro assignments for insert. To fix the problem, we could have to write:

        insert( {(a=1, b=1);} )


    Definition functionlike macro to be used in statement contexts can be trickly. The following macro swaps the values int its two arguments, x and y, which are assumed to be of a type whose value can be converted to unsigned long and back without change, and to not involve the identifier _temp.

        #define swap(x,y)  {unsigned long _temp = x; x=y; y=_temp;}

    The problem is that it is natural to want to place a semicolon after swap, as you would if swap were really a function:

        if ( x > y ) swap (x, y);    /* whoops*/

        else x = y;

    This will result an error since the expansion includes an extra semicolon. We put the expanded statements on separate lines next to illustrate the problems more clearly:

        if ( x > y ) { unsigned long _temp = x; x = y; y = _temp; }

        ;

        else x = y;

    A clever way to avoid the problem is to define the macro body as a do-while statement, which consumes the semicolon:

        #define swap(x, y )  /

                 do { unsigned long _temp = x; x = y; y = _temp; }while(0)


    When a functionlike macro call is encountered, the entire macro call is replaced, after parameter processing, by  a process copy of the body. Parameter processing preoceeds as follows. Actual argument tokens strings are associated with the corresponding formal parmeter names. A copy of the body is then made in which every occurence of a formal parameter name is replaced by a copy of the actual argument token sequence associated with it. This copy the body then replaces the macro call. The entire process of replacing a macro call with the processed copy of itd body is called macro expansion; the processed copy of the body is called the expansion of the macro call.


Example:

    Consider this macro definition, which provides a convenient way to make a loop that counts from a given value up to(and including) some limit:

        #define incr(v,low,high) /

              for( (v) = (low); (v) <= (high); ++(v) )

    To print a table of the cubes of the integers from 1 to 20, we could write:

        #include <stdio.h>

         int main()

         {

              int j;

              incr(j,1,20)

                   printf("%2d  %6d/n",j, j*j*j);


              return 0;

         }

    The call to the macro incr is expanded to produce this loop:

         for( (j) = (1); (j) <= (20); ++(j) )

    The liberal use of parentheses ensures that complicated acutal arguments are not be misinterpreted by the compiler.


4. Rescanning of Macro Expressions

    Once a macro call has been expanded, the scan for macro calls resumes at the beginning of the expansion so that names of macros may be recognized within the expansion for the purpose of futher macro replacement. Macro replacement is not performed on any part of a #define command, not even the body, at the time the command is processed and the macro name defined. Macro names are recognized within the body only after the body has expanded for some particular macro call.

    Macro replacement is also not performed within the actual argument token string of a functionlike macro call at the time the macro call is being scanned. Macro names are recognized within actual argument token strings only during the rescanning of the expansion, assuming that the corresponding formal parameter in fact occurred one or more times within the body(thereby causing the actual argument token string to appear one or more times in the expansion).


Example:

     Giving the following definitions:

         #define plus(x,y)  add(y,x)

         #define add(x,y)   ((x)+(y))

    The invocation

        plus(plus(a,b),c)

    is expanded as shown next.

                                 Step                           Result

                       1.     original                 plus(plus(a,b),c)

                       2.                                 add(c, plus(a,b))

                       3.                                 ((c)+(plus(a,b)))

                       4.                                 ((c)+(add(b,a)))

                       5.      final                    ((c)+(((b)+(a))))


    Macros appearing in their own expansion--either immediately or through some intermediate sequence of nested macro expansions--are not reexpanded in Standard C. This permits a programmer to redefine a function in terms of its old function. Older C preprocessors traditionally do not detect this recursion, and will attempt to continue the expansion until they are stopped by some system error.


Example:

    The following macro changes the definition of the square root function to handle negative arguments in  a different fashion than is normal:

        #define sqrt(x)    ( (x) < 0 ? sqrt(-x) : sqrt(x) )

    Except that it evaluates its argument more than once, this macro work as intended in Standard C, but might cause an error in older compilers. Similarly:

        #define char unsigned char


5. Predefined Macros

    Preprocessors for Standard C are required to define certain objectlike macros. The name of each begins and ends with two underscore characters. None of these predefined may be undefined (#undef) or redefined by the programmer.

    The __LINE__ and __FILE__ macros are useful when printing certain kinds of error messages. The __DATE__ and __TIME__ macros can be used to record when a compilation occured. The values of __TIME__ and __DATE__ remain constant throughout the compilation. The values of __FILE__ and __LINE__ macros are established by implementation, but are subject to alteration by the #line directive(like as #line 300 or #line 500 "cppgp.c"). The C99 predefined identifier __func__ is similar in purpose to __LINE__, but is actually a block-scope variable, not a macro. It supplies the name of the enclosing function.

    The __STDC__ and __STDC_VERSION__ macros are useful for writing code compatible with Standard and non-Standard C implementations. The __STDC_HOSTED__ macro was introduced in C99 to distinguish hosted from freestanding implementations. The remaining C99 macros indicate whether the implementation's floating-point and wide character facilities adhere to other relevant international standards(Adherence is recommended, but not required)

    Implementation routinely define additional macros to communicate information about the enviroment, such as the type of computer for which the program is being compiled. Exactly which macros are defined is implementation-dependent, although UNIX implementations customarily predefine unix. Unlike the built-in macros, these macros may be undefined. Standard C requires implementation-specific macro names to begin with a leading underscore followed by either an uppercase letter or another underscore.(The macro unix does not meet that criterion.)

    And the example about the predefined macros will be appended the next subject.


6. Undefining and Redefining Macros

    The #undef command can be used to make a name be no longer defined:

        #undef name

    This command causes the preprocessor to forget any macro definition of name. It is not an error to undefine a name currently not defined. Once a name has been undefined, it may then be given a completely new definition(using #define) without error. Macro replacement is not performed within #undef commands.

    The benign redefinition of macros is allowed in Standard C and many other implementations. That is, a macro may be redefined if the new definition is the same, token for token, as the existing definition. The redefinition must include whitespace in the same locations as in the original definition, although the particular whitespace characters can be different. We think programmers should avoid depending on benign redefinitions.  It is generally better style to have a single point of definition for all program entities, including macros. (Some older implementations of C may not allow any kind of redefinition.)

Example:

    In the following definitions, the redefinition of NULL is allowed, but neither redefinition of FUNC is valid. (The first includes whitespace not in the original definition, and the second changes two tokens.)

        #define NULL 0

        #define FUNC(x)    x+4

        #define NULL    /* null pointer */ 0

        #define FUNC(x)    x + 4

        #define FUNC(y)    y+4

    (But I make a test on fedora10 platform with gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC), Both the FUNC redefinition is valid too. why ?)


    When the programmer legitimate reasons cannot tell if a previous definition exists, the #ifndef can be used to test for an existing definition so that a redefinition can be avoided.:

        #ifndef MAX_TABLE_SIZE

        #define MAX_TABLE_SIZE 1000

        #endif

    Thisidiom is particularly useful with implementations that allow macro definitions in the command that invokes the C compiler. For example, the following UNIX invocation of C provides an initial definition of the macro MAX_TABLE_SIZE as 5000. The C programmer would then check for the definition as shown before:

        cc -c -DMAX_TABLE_SIZE=5000 prog.c


    Although disallowed in Standard C, a few older preprocessor implementations handle #define and #undef so as to maintain a stack of definitions. When a name is redefined with a #define, its old definition is pushed onto a stack and then the new definition replaces the old one. When a name is undefined with #undef, the current definition is discarded and the most recent previous definition (if any) restored.


7. Precedence Errors In Macro Expansions

    Macros operate purely by textual substitution of tokens. Parsing of the body into declarations, expressions, or statements occurs only after the macro expansion process. This can lead to surprising results if care is not taken. As a rule, it is safest to always parenthesize each parameter appearing in the macro body. The entire body, if it is syntactically an expression, should also be parenthesized.


Example:

    Consider this macro definition:

        #define  SQUARE(x)    x*x

    The idea is that SQUARE takes an argument expression and produces a new expression to comput the square of that argument. For example, SQUARE(5) expands to %*5. However, the expression SQUARE(z+1) expands to z+1*z+1, which is parsed as z+(1*z)+1 rather than expected (z+1)*(z+1). A definition of SQUARE that avoids this problem is:

        #define SQUARE(x)    ((x)*(x))

    The out parentheses are needed to prevent misinterpretation of an expression such as (short)SQUARE(z+1).


8. Side Effects In Macro Arguments

    Macros can also produce problems dut to side effects. Because the macro's actual arguments may be textually replicated, they may be executed more than once, and side effects in the actual arguments may occur more than once. In contrast, a true function call--which the macro invocation resembles--evaluates argument expressions exactly once, so any side effects of the expression occur exactly once. Macros must be used with care to avoid such problems.


Example:

    Consider the macro SQUARE from the prior example and also a function square that does (almost) the same thing:

        int square(int x) { return x*x; }

    The macro can square integers or floating-point numbers; the function can square only integers. Also, calling the function is likely to be somewhat slower at run time than using the macro. But these differences are less important than the problem of side effects. In the program fragment

        a = 3;

        b = square(a++);

    the variable b gets the value 9 and the variable a ends up with the value 4. Howerver, in the superficially similar program fragment

        a = 3;

        b = SQUARE(a++);

    the variable b may get the value 12 and the variable a may end up with the value 5 because the expansion of the last fragment is

        a = 3;

        b = ((a++)*(a++));

    (Say that 12 and 15 may be the resulting values of b  and a because Standard C implementations may evaluate the expression ((a++)*(a++)) in different ways.)


9. Converting Tokens to Strings

    There is a mechanism in Standard C to convert macro parameters (after expansion) to string constants. Before this, programmers had to depend on a loophole in many C preprocessors that achieved the same result in a different way.

    In Standard C, the # token appearing within a macro definition is recognized as a unary "stringization" operator that must be followed by the name of a macro formal parameters. During macro expansion, the # and the formal parameter name are replaced by the corresponding actual argument enclosed in string quotes. When creating the string, each sequence of whitespace in the argument's token list is replaced by a single space character, and any embedded quotation or backslash character characters are preceded by a backslash character to preserve their meaning in the string. Whitespace at the beginning and end of the argument is ignored, so an empty argument (even with whitespace between the commas) expands to the empty string "".


Example:

    Consider the Standard C definition of macro TEST:

        #define TEST(a, b )    printf( #a " < " #b " = %d/n", (a)<(b) )

    The statement TEST(0, 0XFFFF);  TEST('/n', 10); would expand into

        printf("0" "<" "0xFFFF" " = %d/n", (0)<(0XFFFF));

        printf(" '//n' " "<" "10" " = %d/n", ('/n') <(10) );

    After concatenation of ajacent strings, these become:

        printf("0 < 0xFFFF = %d/n", (0) < (0XFFFF) );

        printf(" '//n' < 10 = %d/n", ('/n') <(10) );


    A number of non-standard C compilers will substitute for macro formal parameters inside string and character constants. Standard C prohibits this.

    The handling if whitespace in non-ISO implementations is likely to vary from compiler to compiler--another reason to avoid depending on this feature except in Standard C implementations.


10. Token Merging In Macro Expansions

    Merging of tokens to form new tokens in Standard C is controlled by the presence of a merging operator, ##, in macro definitions. In a macro replacement list--before rescanning for more macros--the two tokens surrounding any ## operator are combined into a single token. There must be suck tokens: ## must not appear at the begnning or end of a replacement list. If the combination does not form a valid token, the result is undefined.

        #define TEMP(i)   temp ## i

        Temp(1) = TEMP(2+k) + x;

    After preprocessing, this becomes

        temp1 = temp2 + k + x;

 

    In the previous example, a curious situation can arise whe expanding TEMP() + x. The macro definition is valid, but ## is left with no right-hand token token to combine (unless it grabs +, which we do not want). This problem is resolved by treating the formal parameter i as if it expanded to a special "empty" token just for the benefit of ##. Thus, the expansion of TEMP() + x would be temp + x as expected.

 

    Token concatenation must not be used to produce a unversal character name.

 

    As with the conversion of macro arguments to strings, programmers can obtain something like this merging capability through a loophole in many non-Standard C implementations. Although the original definition of C explicitly described macro bodies as being  sequences of tokens, not sequences of characters, nevertheless many C compilers expand and rescan macro bodies as if they were character sequences. This becomes apparent primarily in the case where the compiler also handles comments by eliminating them entirely (rather than replacing them with a space)--a situation exploited by some cleverly written programs.

 

Example:

    Consider the following example:

        #defi n e INC    ++

        #define TAB    internal_table

        #define INCTAB table_of_increments

        #define CONC(x,y) x/**/y

        CONC(INC,TAB)

    Standard C interprets the body of CONC as two tokens, x and y, separated by a space.(Comments are converted to a space.) The call CONC(INC,TAB) expands to the two tokens INC TAB. Howerver, some non-Standard implementations simply eliminate comments and rescan macro bodies for tokens; the expand CONC(INC,TAB) to the single token INCTAB.

 

    Step              1                2             3          4

    Standard          CONC(INC,TAB)    INC/**/TAB    INC TAB    ++ internal_table

    non-Standard      CONC(INC,TAB)    INC/**/TAB    INCTAB     table_of_increments

 

11. Variable Argument Lists In Macro

    In C99, a functionlike macro can have as its last or only formal parameter an ellipsis, signifying that the macro may accept a variable number of arguments:

        #define name( identifier-list, ... ) sequence-of-tokens(optional)

        #define name( ... ) sequence-of-tokens(optional)

    When such a macro is invoked, there must be at least as many actual arguments as there are identifiers in identifier-list. The trailing argument ( s), including any separating commas, are merged into a single sequence of preprocessing tokens called the variable arguments. The identifier __VA_ARGS__ appearing in the replacement list of the macro definiton as treated as if it had been a macro parameter whose argument was the merged variable arguments. That is, __VA_ARGS__ is replaced by the list of extra arguments, including their comma separators. __VA_ARGS__can only appear in a macro definition that includes ... in its parameter list.

    Macro with a variable number of arguments are often used to interface to functions that takes a variable number of arguments, such as printf. By using # stringization operator, they can also be used to convert a list of arguments to a single string without having to enclosing the arguments in parentheses.

 

Example:

    These directives create a macro my_printf that can write its arguments either to the error or standard output.

        #ifdef DEBUG

        #define my_printf( ... ) fprintf(stderr, __VA_ARGS__)

        #else

        #define my_printf( ... ) fprintf(stdout, __VA_ARGS__)

        #endif

 

    Given the definition

        #define make_em_a_string( ... ) #__VA_ARGS__

    the invocation

        make_em_a_string(a, b, c, d)

    expands to the string

        "a, b, c, d"

 

12. Other Problems

    Some non-Standard implementations do not perform stringent error checking on macro definitions and calls, including permitting an incomplete token in the macro body to be completed by text appearing after the macro call. The lack of error checking by certain implementations does not make clever exploitation of that lack legitimate. Standard C reaffirms that macro bodies must be sequences of well-formed tokens.

 

Example:

    For example, the folloing fragment in one of these non-ISO implementations:

        #define STRING_START_PART   "This is a split"

        ...

        printf(STRING_START_PART string."); /* !!!! Yuk */

    will, after preprocessing, result in the source text

        printf("This is a split string.");

DuCut_1794120730156_604.mp4 立即下载

相关推荐

【教育信息化】基于Java+Vue的微证书可信验证系统设计:职业技能成果数字化管理与防伪溯源 项目介绍 基于java+vue的职业技能微证书颁发与可信验证系统设计与实现(含模型描述及部分示例代码)

内容概要:本文介绍了一个基于Java和Vue的职业技能微证书颁发与可信验证系统的设计与实现,旨在解决传统职业证书管理中存在的信息分散、验证困难、易篡改、互认难等问题。系统通过构建统一的微证书业务管理体系,采用SHA-256摘要算法和RSA数字签名技术保障证书内容完整性与签发主体可信性,并结合二维码实现便捷的社会化验证。平台涵盖证书全生命周期管理,支持学习成果积累、能力画像构建及跨机构成果互认,具备完整的前后端分离架构与安全机制,适用于教育、培训与企业人力资源场景。; 适合人群:具备Java与Vue开发基础的软件工程师、高校计算机相关专业学生、职业教育信息化研究人员以及企业HR技术平台开发者。; 使用场景及目标:①实现职业技能微证书的数字化签发与防伪验证;②构建学习者个人能力档案,支持岗位匹配与人才评价;③推动教育机构、行业协会与企业间的技能成果互认与数据共享;④作为毕业设计或企业级认证平台的技术参考原型。; 阅读建议:此资源包含系统模型描述与核心代码示例,建议结合Spring Boot、MyBatis-Plus、JWT、Redis等技术栈进行实践,重点关注证书摘要生成、数字签名验证、权限控制与数据安全设计,并可通过提供的数据生成代码模拟真实业务场景进行测试。

记录一次Apache Commons CSV库中封装的令牌和定界符之间的字符无效

使用Apache Commons CSV库解析CSV文件时出现以下错误。 java.lang.IllegalStateException: IOException reading next record: java.io.IOException: (line 1) invalid char between encapsulated token and delimiter at org.apache.commons.csv.Lexer.parseEncapsulatedToken(Le...

Dengrz的Blog 5042

结合混合A全局规划与MPC-iLQR执行器噪声和模型不匹配(MATLAB)的差动驱动机器人导航。.zip

1.版本:matlab2014a/2019b/2024b 2.附赠案例数据可直接运行。 3.代码特点:参数化编程、参数可方便更改、代码编程思路清晰、注释明细。 4.适用对象:计算机,电子信息工程、数学等专业的大学生课程设计、期末大作业和毕业设计。

解决EasyExcel写入数据时的Invalid char错误

在项目中使用EasyExcel写入Excel数据时,遇到了Invalid char错误。该错误通常由于Excel表格命名规范不符合要求导致。Excel对工作表名有一些基本的规定,如不能超过31个字符、不能以空格开头或结尾、不能包含特殊字符(如:、/、\、?、*、[、]、、:)。为解决此问题,我们编写了一个修复方法,将不符合规范的字符替换为下划线、去除首尾空格、限制长度,并在数据写入前调用该方法。这样可确保工作表名符合Excel命名规范,解决了Invalid char错误。

君若雅的博客 2083

中国技术大败局TBL-20261107-238深度解剖报告V2.2 决策迭代版【汽车热管理】基于车速的空调内外循环控制装置:公知技术组合型伪创新专利失效分析

中国技术大败局TBL-20261107-238深度解剖报告V2.2 决策迭代版内容概要:本报告对奇瑞汽车股份有限公司申请的“一种汽车空调内外循环的控制装置及其控制方法”(专利号CN201010100392.0)进行了深度技术解剖与专利失效分析。该专利旨在通过车速信号自动切换空调内外循环,实现低速内循环防尾气、高速外循环引入新风的功能。然而,其技术方案被判定为“控制逻辑型伪创新”,核心逻辑“车速信号→阈值比较→内外循环切换”属于公知技术的常规组合,未提出新的空气质量预测模型、多源信息融合算法或预料不到的技术效果,因而不具备创造性,最终被驳回。报告指出,该专利与奇瑞多项同类专利(如184、186、207、228、231、237号)共同构成“公知信号/逻辑→公知执行器”的系统性低质量专利布局,反映出企业在技术创新路径上的重复性投入与创造性缺失。; 适合人群:企业知识产权负责人(IPR)、研发总监/CTO、投资尽调人员、专利代理机构从业者及技术研发团队。; 使用场景及目标:①识别“公知技术常规组合”类专利的创造性风险,避免无效研发投入;②指导高价值专利撰写,强调多源信息融合、动态优化模型与实证数据支撑;③为投资机构提供技术资产估值与风险甄别依据,区分低壁垒“信号替换”与高壁垒“算法创新”。; 阅读建议:此报告适用于研发与知识产权战略复盘,建议结合模块七“行业启示”与模块八“产业链坐标定位”进行系统性反思,重点关注“判距差”指标与“死海区”定位,推动企业从“功能实现”转向“模型创新”的研发范式升级。

北师大版英语词汇助手练习版-win10-不适用win7

最适合白板下的英语词汇PK工具 【百度网盘APP】北师大版英语词汇助手win10,11版本 3MB 链接:https://pan.baidu.com/s/1VO6vXt-ICCh-kAPstX8LcA  提取码:chen 【百度网盘】北师大版英语词汇助手 win 7,8,10,11可通用 60MB 链接:https://pan.baidu.com/s/15z5YN5GvvAZERqhitQcu1g  提取码:chen

EasyExcel实现execl导入导出

在实际开发中,处理 Excel 文件是一个常见的需求。EasyExcel 是一个基于 Java 的开源库,提供了简单易用的 API,可以方便地读取和写入 Excel 文件。本文将介绍如何使用 EasyExcel 实现 Excel 导入功能,以及一些相关的技巧和注意事项。

阿水的博客 1万+

改进差分进化算法及其求解柔性作业车间调度问题(Python代码实现)

内容概要:本文系统探讨了改进差分进化算法在求解柔性作业车间调度问题中的应用,并结合Python代码实现,展示了该算法相较于传统方法在全局搜索能力和收敛速度方面的优势。研究不仅聚焦于算法本身的改进策略,如变异、交叉和选择操作的优化,还深入分析了其在复杂制造环境中应对多目标、多约束调度问题的有效性。文中通过标准测试实例验证了算法性能,并与其他智能优化算法进行了对比分析,体现了其在实际工程应用中的潜力。此外,文档还关联了多无人机路径规划、电力系统状态估计、微电网优化、图像与信号处理等多个前沿技术领域,展现了智能优化算法在跨学科工程仿真与决策支持中的广泛适用性。; 适合人群:具备一定编程基础和工程背景,从事智能制造、自动化、工业工程、电气工程、控制科学与工程、计算机科学及相关领域的科研人员、高校研究生及企业研发技术人员。; 使用场景及目标:①为科研工作者提供可复现的智能优化算法代码框架,支持柔性作业车间调度、多无人机协同路径规划、电力系统优化等复杂工程问题的建模仿真;②辅助完成学术论文复现、课程设计、毕业设计或科研项目开发;③推动智能算法在生产调度、能源管理、交通规划等实际场景中的落地应用。; 阅读建议:建议读者结合文中提供的算法原理与代码实现,动手调试并验证不同参数设置对优化结果的影响,同时可参考荔枝科研社提供的完整资源包进行扩展学习与实践,以加深对算法机制与工程应用的理解。

EasyExcel实现导入功能

1.导入依赖 <!-- xls格式excel依赖包 --> <dependency> <groupId>org.apache.poi</groupId> <artifactId>poi</artifactId> <version>3.17</version> </dependency> <!--xlsx格式excel依赖包--> <dependency>

Clsrm的博客 5266

复现基于改进秃鹰算法的微电网群经济优化调度研究(Matlab代码实现)

内容概要:本文聚焦于“基于改进秃鹰算法的微电网群经济优化调度”研究,提出一种改进的秃鹰优化算法(IBOA)以解决传统智能优化算法在求解过程中易陷入局部最优、收敛速度慢等问题。通过引入自适应权重、动态搜索机制及种群多样性保持策略,显著增强了算法的全局搜索能力和收敛精度。研究构建了包含光伏发电、风力发电、储能系统、可控负荷及电网交互的微电网群多主体协同调度模型,以系统综合运行成本最小化为目标函数,综合考虑功率平衡、设备出力能力、储能荷电状态、爬坡速率等多种实际约束条件。利用Matlab平台进行仿真验证,并与标准BOA、PSO、GA等经典智能算法进行对比,结果表明所提算法在降低系统运行成本、提高可再生能源消纳率及优化调度效率方面具有明显优势。; 适合人群:适用于具备电力系统基础、优化理论知识及Matlab编程能力的高校研究生、科研人员及从事微电网、综合能源系统优化调度相关工作的工程技术人员。; 使用场景及目标:①用于微电网群或多微网系统的经济调度建模与仿真;②开展新型智能优化算法的设计、改进与性能评估;③支撑含高比例可再生能源的配电系统优化运行决策; 阅读建议:建议结合提供的Matlab代码深入理解算法实现细节与调度模型构建过程,重点分析改进策略对优化性能的影响,并可通过替换场景参数或引入其他算法进行横向对比实验,进一步掌握智能优化在能源系统中的应用方法。【复现】基于改进秃鹰算法的微电网群经济优化调度研究(Matlab代码实现)

改进-基于新扩展移相角下的双有源桥DAB变换器仿真(EPS调制、软开关、最小应力优化)(Simulink仿真实现)

内容概要:本文系统阐述了基于新扩展移相角的双有源桥(DAB)DC-DC变换器的先进仿真研究,聚焦于EPS调制策略、软开关技术实现及最小应力优化控制目标的协同设计。通过Matlab/Simulink平台构建双闭环控制系统模型,深入剖析变换器在高频隔离、双向功率传输场景下的动态响应特性与效率优化机制。该仿真方案复现了顶级EI期刊研究成果,具备高学术参考价值,并集成于一套完整的电力电子与新能源系统仿真资源体系中,涵盖微电网、PWM整流器、LLC谐振变换器、储能管理等多个关键技术方向,配套完整的仿真代码、设计文档与理论资料,支持深度学习与二次开发; 适合人群:面向电力电子、电气工程及其自动化、新能源科学与工程等领域的研究生、科研人员以及从事高性能DC-DC变换器研发的工程师,要求具备扎实的电路理论基础、电力电子拓扑分析能力及一定的Matlab/Simulink仿真实践经验; 使用场景及目标:①深入掌握DAB变换器的核心工作原理及其在EPS调制与软开关协同下的最优控制策略;②支撑高水平科研论文的复现、改进与创新性研究;③服务于硕士课题、博士研究或企业级新能源变换器产品的前期验证与算法开发; 阅读建议:建议结合文中提供的Simulink模型与引用的权威文献进行系统学习,重点理解控制架构设计、参数整定方法与优化算法实现路径,同时可横向对比其他电力电子变换器案例,拓展系统级工程思维与科研创新能力。

EasyExcel导入实战问题汇总

之前在文章中简单的介绍过EasyExcel的导出与导入方法,导出一般比较容易理解,导入的方法对于新手来说就有一些困难,接下来我介绍一下easyExcel的导入难点,展示一下工作中如何使用。 如果还不了解导入的内容,请看这篇文章 EasyExcel的导出与导入 难点一 导入的Excel有备注内容,需要忽略 解决方法:在Excel的实体映射类中,使用下面的注解,会只取表头为此值的列,其他列自动忽略。 @ExcelProperty(value = "表头1") 难点二 如何获得导入的对象列表或想要的信息 @

虚心学习,和气编码 2419

(1)大蚂蚁即时通讯

即时通讯软件BigAnt(大蚂蚁)是杭州艾朴软件推出的一个”企业级”的即时通讯平台。该平台专为企业,其他企事业单位和政府单位而设计,目的就是为了增强内部沟通能力,提高内部员工的工作效率;同时服务器就直接置于单位内部,所有信息由单位自己管理,让单位以更安全、更可伸缩和更易于管理的方式灵活方便地使用协同和通信服务的功能! BigAnt(大蚂蚁)即时通讯软件包括服务器端和客户端。客户端功能包括单位

少安的砖厂 2233

java 无效参数异常,java.io.IOException:参数无效

I have a web application running in cluster mode with a load balancer.It consists in two tomcats (T1, and T2) addressing only one DB.T2 is nfs mounted to T1. This is the only dofference between both n...

weixin_31240035的博客 1448

Emotion-LLaMA实战指南:从零构建多模态情感识别系统(附Python代码)

本文提供了Emotion-LLaMA多模态情感识别系统的实战指南。通过详细的步骤,指导读者从零搭建开发环境、运行本地Demo、理解模型架构,并完成数据处理与模型训练。该创新模型融合视觉、听觉与文本信息,实现更精准、接近人类理解的情感分析与推理,并附有完整的Python代码实现。

weixin_29094775的博客 415

RaiDrive+AList保姆级教程:5分钟搞定OneDrive/百度网盘挂载到本地(附WebDAV配置)

本文提供RaiDrive+AList的保姆级教程,5分钟内实现将OneDrive/百度网盘挂载到本地的详细步骤,包括WebDAV配置。通过AList统一转换云存储协议,RaiDrive虚拟磁盘挂载,显著提升多网盘管理效率,适合需要跨平台操作文件的用户。

weixin_28331555的博客 455

已解决:java.lang.IllegalArgumentException: Invalid character found in the request target 异常的正确解决方法

是由于URL中包含非法字符引发的异常。通过正确编码URL、严格验证输入、合理配置服务器,可以有效避免此类异常的发生。本文提供了多种解决方案和实用建议,帮助开发者快速定位并解决此异常。希望本文对您有所帮助,如有其他问题,欢迎讨论!

猿鹏探码的博客 5319

【嵌入式笔试题】C语言笔试题(4)

嵌入式C语言综合笔试题

m0_74055118的博客 1066

[pytorch修改]npyio.py 实现在标签中使用两种delimiter分割文件的行

from __future__ import division, absolute_import, print_function import io import sys import os import re import itertools import warnings import weakref from operator import itemgetter, i...

weixin_30649641的博客 2078

Mplus实战:三变量随机截距交叉滞后模型(RI-CLPM)语法详解与扩展

本文详细解析了Mplus中三变量随机截距交叉滞后模型(RI-CLPM)的构建原理与语法实现。通过将变量分解为稳定的个体间差异与动态的个体内波动,模型能更纯净地揭示多变量间的纵向交互影响。文章以工作压力、睡眠质量与工作满意度为例,提供了完整的语法模板、关键参数设置(如NOCOV命令、残差相关)及结果解读指南,帮助研究者避开常见误区,稳健分析复杂动态关系。

wdx0123456的博客 926

CMap数据库学习及结果可视化

CMap是一个生物信息学数据库和工具,旨在通过比较基因表达谱来揭示药物、基因和疾病之间的潜在关联。CMap数据库主要用于寻找药物、化合物和生物过程之间的关系,并用于药物重定位(drug repurposing)和疾病机制研究。

zfyyzhys的博客 5599

IllegalArgumentException: Invalid token character ',' in token "json, text/javascript, */*; q=0.01"

兴酣落笔摇五岳,诗成笑傲凌沧洲 昨天,在项目中加了Xss攻击过滤之后,,发现原来写的代码好多地方都报错了,错误截图如下: 最后检查发现,这些报错的地方有一个共同点,那就是都加了下面这个: @RequestMapping(value = &quot;/xxx.json&quot;, produces = &quot;application/json; charset=utf-8&quot;) @ResponseBod...

A_Runner的博客 5015

华为OD机试 - 计算数列位置N的值 - 模拟法(Python/JS/C/C++ 新系统 100分)

本专栏收录于《华为OD机试真题(Python/JS/C/C++)》。刷的越多,抽中的概率越大,私信哪吒,备注华为OD,加入华为OD刷题交流群,每一题都有详细的答题思路、详细的代码注释、3个测试用例、为什么这道题采用XX算法、XX算法的适用场景,发现新题目,随时更新。输入 M,N 两个数,则按照以下规则形成一个数列。数列的前 M 个元素的值为 1 到 M从 M+1 个元素开始,计算逻辑为如果其前 M 个元素中,存在值相同的元素,则该位置上的数值等于前 M 个数中最大数值与最小数值之和。如果其前 M 个元素中,

学Java,找哪吒 508

Python之requests错误Expecting value: line 1 column 1 (char 0)

参考文章:https://www.cnblogs.com/loveprogramme/p/9379532.html因为介绍到json模块,所以我就记录下来 0、昨天使用requests发出post请求,报了一个 Expecting value: line 1 column 1 (char 0) 1、开始想办法解决,后面打开charles,发现本来应该是放在body中的参数,全部放到url中 ...

王员外的博客 5万+

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

上一篇: C Reference Manual Reading Notes: 009 Preprocessor Lexical Conventions
下一篇: Linux总线驱动-01: 一个简单的示例
cppgp
博客等级 码龄20年 47粉丝 46原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值