Category Archives: How to Fix

Error in pom.xml file of sub module of Maven aggregation project

Today, when writing a sub module of a project, I found that the pom.xml of the sub module has been reporting errors. I checked that the jar package in the warehouse has been successfully downloaded. Other reasons have been eliminated, but I can’t find the reason. So Baidu searched for a method useful for my project (the development tool is eclipse). First, select the parent project of the aggregation project, right-click – run as – maven clean
then, after running successfully, you can see a build success message on the console
. Then, right-click – run as – Maven install

again, After running successfully, you can see that the console also has a build success message

finally, right click the parent project – maven – update project, and the error of pom.xml of the child project is successfully solved

reference website: https://blog.csdn.net/weixin_ 42428357/article/details/82014472

Linux environment setup – Update https://apt.repos.intel.com report errors

Linux environment setup – Update https://apt.repos.intel.com report errors

Problem description and solution

Problem description

After sudo apt get update, the https://apt.repos.intel.com Error message

Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/multiverse Translation-en
Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/restricted Translation-en
Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/universe Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com binary/ Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com binary/ Translation-en_US
Ign https://apt.repos.intel.com binary/ Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/intelpython/binary/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/ipp/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/ipp/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/tbb/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/tbb/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/daal/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/daal/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mpi/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mpi/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

E: Some index files failed to download. They have been ignored, or old ones used instead.

Solution

sudo rm intelproducts.list -rf
sudo rm intel-mkl.list intel-mkl.list.save -rf

Error reporting of OpenCV and Darknet under Python 2.7

Error reporting of OpenCV and Darknet under Python 2.7

Python 2.7 is run by default during the whole ROS. I don’t know how to adjust it, so Yolo can’t run. The following error is reported

Gtk-ERROR **: GTK+ 2.x symbols detected. Using GTK+ 2.x and GTK+ 3 in the same process is not supported

The solution is to recompile opencv in the following order

cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D WITH_TBB=ON -D BUILD_NEW_PYTHON_SUPPORT=ON -D WITH_V4L=ON -D INSTALL_C_EXAMPLES=ON -D INSTALL_PYTHON_EXAMPLES=ON -D BUILD_EXAMPLES=ON -D WITH_QT=ON -D WITH_GTK=ON -D WITH_OPENGL=ON ..

sudo make install

When C language refers to a user-defined type as a parameter, an error segmentation fault is reported

Problem Description:

In the data structure operation, a function to initialize the table is written:


#define InitSize 100
#define ElemType int

typedef struct {
    ElemType* list;
    int len;
    int size;
} sql_;


int sql_init(sql_ *head) {
    (*head).list = (ElemType*)malloc(InitSize*sizeof(ElemType));
    (*head).len = 0;
    (*head).size = InitSize;

    return 1;
}

int main() {
    sql_ L1;
    sql_init(&L1);

    sql_*L2;
    sql_init(L2);

    system("pause");
}

However, an error is reported at runtime: segmentation fault

  After entering the debugging interface, it is found that L1 has been initialized successfully, but there is a problem when it comes to L2. What is the difference between L1 and L2 initialization codes?

Analyze the problem:

    sql_ L1;
    sql_init(&L1);

    sql_*L2;
    sql_init(L2);

It can be seen that L1 is declared as SQL_ Type; L2 is declared as SQL*_ Type.

There is no warning in vscode, but there is a warning and error in vs2019, and it can not even be compiled. So what’s the reason?

Through network retrieval, we get such an article: int * a in C + +; int & a; int & * a; int * & a_ Tianya Mingyue Dao blog – CSDN blog

Inspired by the quoted concepts mentioned in the article, we made the following attempts:

sql_ L;
    sql_*L2 = &L;
    sql_init(L2);

  After such processing, the initialization can be completed successfully. Therefore, the following guess is made:

When defining a macro type, only SQL is declared_ Type, but for SQL_* The type is not declared, so it is declared in main   sql_  *  L1; The compiler can’t find the prototype, so it can’t reference SQL when declaring parameters_* Type, so vs the more stringent compiler found this problem and told L2 that memory could not be allocated.

resolvent:

Using predefined SQL_ Type declaration, use its reference when parameters need to be passed & amp; L as SQL_* Arguments of type, that is, the method of initializing L1 mentioned earlier:

    sql_ L1;
    sql_init(&L1);

Errors encountered when integrating activiti6 with springboot

There is also a spring-boot-autoconfigure-2.0.. release.jar in the start of 2.0 by default. If you also refer to activiti’s activiti-spring-boot-starter-rest-api.jar package, you need to exclude securityautoconfiguration.class in both packages

Write it in the startup class

@SpringBootApplication(exclude={
  org.activiti.spring.boot.SecurityAutoConfiguration.class,
  SecurityAutoConfiguration.class
})

Redhat8 make nginx error reporting solution

1. Enter the objs folder and modify the makefile

Remove – werror, and the modification result is shown in the figure below

 

Error Src/OS/Unix/NGX_ user.c:26:7: error: ‘struct crypt_ data’ has no member named ‘current_ salt

Search current_ Salt, after commenting out this line, make & amp; make install

Junit4 unit test reports an error invalid project specified

Junit4 unit test reports an error invalid project specified.

During the unit test the day before yesterday, an invalid project specified error was reported. After checking, it was found that the problem was the project name. If there are illegal characters such as’ – ‘or space in the project name, an error invalid project specified will be reported when running

ed.

Ultimate solution to error reporting of sudo rosdep init of ROS

Error reporting solution for sudo rosdep init of ROS
when installing ROS, the sudo rosdep init command reports an error:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

In the process of installing ROS, I encountered the problem of sudo rosdep init reporting an error. I searched many tutorials and couldn’t solve it. Later, I referred to the tutorial at the end of the article and couldn’t deal with it. Later, I realized that the installation failed because the installation source corresponding to rosdep couldn’t be opened directly in China. Based on the principle that others will encounter their own problems, Stick to the search and finally find the corresponding source file in gitee (you can also search in chinacode). Therefore, refer to the tutorial at the end of the article. Only when the final file of the tutorial is modified, the original source file will be added to the link( https://raw.github.com/ros/rosdistro/master/ )Replace with the link in chinacode:( https://gitee.com/BlicNet/rosdistro/ )When you try to follow the tutorial again, The problem is solved and posted in memory.

1. If a version of other versions of ROS system has been installed before, delete the existing initialization file according to the prompt:

sudo rm /etc/ros/rosdep/sources.list.d/20-default.list

2. Add the content/ROS/rosdep/sources.list.d/20-default.list in the/etc directory again

cd /etc/ros/rosdep/sources.list.d
sudo gedit 20-default.list

On some computers, there may be an error that MKDIR cannot create the package… The problem occurs because there is no permission to open related files. You can use the Chmod command to obtain permission

sudo chmod 777 /etc
    re execute the above command, open the 20-default.list file, copy the following contents into it, and save

    # os-specific listings first
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/osx-homebrew.yaml osx
    
    # generic
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/base.yaml
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/python.yaml
    yaml https://gitee.com/BlicNet/rosdistro/rosdep/ruby.yaml
    gbpdistro https://gitee.com/BlicNet/rosdistro/releases/fuerte.yaml fuerte
    
    # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead
    

    4. Open the terminal on the desktop and execute the command:

    rosdep update
    

    Solve the problem and keep working hard!

    Reference link

    Link: https://blog.csdn.net/qq_ 41058594/article/details/102970901.
    link: https://www.cnblogs.com/JuiceCat/p/12000953.html.

Error reporting and resolution of #selector above swift5

Error reporting and resolution of #selector above swift5

The version of swift has changed a lot recently. If you add an event to a button, you must be very skilled in OC. How do you define functions and pass parameters in
swift

 let btn = UIButton()
 btn.tag = 2
 btn.addTarget(self, action: #selector(buttonClick(button:)), for: .touchUpInside)

  @objc func buttonClick(button: UIButton) {
       button.isSelected = true
       print(btn.tag!)
        print("\(btn.tag)")
 }

The custom method must be preceded by @ objc to follow the OC mechanism, otherwise an error will be reported