Tag Archives: development language

error C4996: ‘pcl::SAC_SAMPLE_SIZE‘ [How to Solve]

Error: pcl-1.8\pcl\sample_consensus\model_types.h(99): error C4996: ‘pcl::SAC_SAMPLE_SIZE’: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class

Solution:
Open the project property page > C/C++ > General > SDL Check (set to No).

[Solved] PHP Fatal error: Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes

The environment background is docker DNMP installation of ES + PHP

Corresponding docker compose configuration and corresponding port

Port 9200 can also be accessed normally

Code

Then 500 errors are reported, including:

 PHP Fatal error:  Uncaught Elasticsearch\Common\Exceptions\NoNodesAvailableException: No alive nodes found in your cluster in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php:67
Stack trace:
#0 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(87): Elasticsearch\ConnectionPool\StaticNoPingConnectionPool->nextConnection()
#1 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Transport.php(105): Elasticsearch\Transport->getConnection()
#2 /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(275): Elasticsearch\Transport->performRequest('POST', '/my_index/my_ty...', Array, '{"testField":"a...', Array)
#3 /www/localhost/vendor/react/promise/src/FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array)
#4 /www/localhost/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Clos in /www/localhost/vendor/elasticsearch/elasticsearch/src/Elasticsearch/ConnectionPool/StaticNoPingConnectionPool.php on line 67

The reason is that the node cannot be found. The solution is as follows: find your own IP and specify the IP

Then the execution is OK

Function declare Error: Error C231: ‘delay300us’: redefinition

First of all, we know that we can’t avoid declaring sub functions when writing programs.

There was a problem during the test today:

After thinking about it, I declared the function in the previous writing, but the error “redefinition” was still reported. Later, I tried it

You need to prefix the function name with “void”.

Spring MVC project error: Namespace in turns red

Namespace in <mapper namespace> turns red

Solution:

The XML file header language should be changed to the mapper mapping instead of the config
previously used as follows:

<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-config.dtd">

Change to

<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

Create folders with different functions

[Solved] QT error: error: undefined reference to ` VTable`

Question:

QT compilation error:

error: undefined reference to `vtable ...`

 

reason:

1.Qt uses signals and slots to implement communication features.
2.Signals and slots can be used when the class is derived from QObject and the Q_OBJECT macro is added to the header file.
3.When Q_OBJECT is added to the class header file QtCreator will automatically create a moc_***.cpp file that implements the code for signal and slot communication.
4.However, sometimes when we create a class through QtCreator without selecting the IDE option to derive it from the QObject class, but add it later, QtCreator will not automatically create the moc_***.cpp file. In this case it will report an error: undefined reference to `vtable for ***.

 

Solution:

According to various online methods, it can not be solved, nor can rebuild
mine is a small project. Just delete the build-XXX folder and rebuild it.

[Solved] python Error: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.

Python Error: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
Error Codes:

if (code in list(changed_code['Old material code'])):
            temp_index = changed_code.loc[changed_code['Old material code'] == code].index

The type of code here is float.

Cause analysis:

In this judgment method, the judged value cannot be of float type.

Solution:

Just convert float format to int format

if (int(code) in list(changed_code['Old material code'])):
            temp_index = changed_code.loc[changed_code['Old material code'] == code].index

Solve the problem, brothers, get better!!

[Solved] Matlab 2021b install activate Error: License manager error – 103

Error reporting:

Firstly, this error is not a problem with the installation or activation of MATLAB. Secondly, this occurs only when the remote desktop uses MATLAB.

Cause analysis:

This is because matlab uses FLEXlm for license management, while FLEXlm does not support remote desktop access. However, you can use the license file with a little modification.

(reprint the solution of the license manager error – 103 reported by MATLAB on the remote desktop)

Solution:

1. Enter the license file under r2021b\licenses:

2. Open with Notepad:

3. Ctrl + H enters the replacement window and replaces’ sign = ‘with’ ts’_OK SIGN=’:

After modification, save.

Directly open matlab again, you can succeed!

Qdox parseexception: syntax error [How to Solve]

preface

Recently, I saw several open source Maven plug-ins that generate Yapi documents. The basic operation is to read the comments in Java code, sort them into corresponding JSON according to the format required by Yapi, and then push them to Yapi server. On a whim, I pulled an open source code library, and then encountered many problems in the process of use, This article talks about how the code parsing library Qbox handles parsing exceptions when parsing code

Open joint

Qbox code base address: https://github.com/paul-hammant/qdox
Exception information thrown

Caused by: com.thoughtworks.qdox.parser.ParseException: syntax error @[10,1] in file:/*****/A.java
    at com.thoughtworks.qdox.parser.impl.Parser.yyerror (Parser.java:1963)
    at com.thoughtworks.qdox.parser.impl.Parser.yyparse (Parser.java:2085)
    at com.thoughtworks.qdox.parser.impl.Parser.parse (Parser.java:1944)
    at com.thoughtworks.qdox.library.SourceLibrary.parse (SourceLibrary.java:232)
    at com.thoughtworks.qdox.library.SourceLibrary.parse (SourceLibrary.java:209)
    at com.thoughtworks.qdox.library.SourceLibrary.addSource (SourceLibrary.java:159)
    at com.thoughtworks.qdox.library.SortedClassLibraryBuilder.addSource (SortedClassLibraryBuilder.java:174)
    at com.thoughtworks.qdox.JavaProjectBuilder.addSource (JavaProjectBuilder.java:151)
    at com.thoughtworks.qdox.JavaProjectBuilder$2.visitFile (JavaProjectBuilder.java:224)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:103)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.walk (DirectoryScanner.java:91)
    at com.thoughtworks.qdox.directorywalker.DirectoryScanner.scan (DirectoryScanner.java:81)
    at com.thoughtworks.qdox.JavaProjectBuilder.addSourceTree (JavaProjectBuilder.java:218)
    at com.thoughtworks.qdox.JavaProjectBuilder.addSourceTree (JavaProjectBuilder.java:205)

Parse exception code file

//package com.example.test.proxy;
//
///**
// *  MyClass
// *
// * @author you_name 2021-12-21 20:02
// */
//public class A {
//}  // line 9  line 10 is blank line

 

Solution:

        JavaProjectBuilder builder = new JavaProjectBuilder();
        builder.setErrorHandler((e) -> log.warn(e.getMessage()));

Optimize it.

		JavaProjectBuilder builder = new JavaProjectBuilder();
        builder.setErrorHandler((e) -> {
            if (e.getClass().isAssignableFrom(ParseException.class)) {
                log.warn(e.getMessage());
                return;
            }
            throw e;
        });

[Solved] Error: Please select a valid Python interpreter

Before that

First download Python and configure environment variables

Win11python download and environment variable configuration

Text

Reference link:
Python learning notes – error: Please select a valid Python interpreter

Question

The following error occurs when running: Please select a valid Python interpreter
the English meaning of this sentence: “please select a valid Python interpreter”

In fact, it’s because you just downloaded pychar, and you haven’t done its basic configuration yet. The error is normal ~

Solution:

First, Download python (again)

Open the DOS command line window,

ah, with ~

Then, the parser selects the problem, opens settings (Ctrl + Alt + s) or file & gt; settings, and opens the configuration box, as shown in the following figure:

Just follow the steps:

The results are shown in the figure below:

Then you can!

[Solved] Error: error getting chaincode bytes: ‘go list‘ failed with: cannot find module providing package


Execute the packing command.
peer lifecycle chaincode package sacc.tar.gz
–path github.com/hyperledger/fabric-cluster/chaincode/go/
–label sacc_1

Error Messages:

Error: error getting chaincode bytes: ‘go list’ failed with: cannot find module providing package github.com/hyperledger/fabric-cluster/chaincode/go: working directory is not part of a module: exit status 1

Solution:

The command go env -w GO111MODULE=auto solves this problem