Author Archives: Robins

[Solved] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection…

USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: The devices connected to the system are not functioning.

When executing automated tests in python + selenium + pytest, I encountered the following error.

[25612:15512:0220/162104.300:ERROR:device_event_log_impl.cc(211)] [16:21:04.299] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection:
 The devices connected to the system are not functioning.(0x1F)

At present, the reason has not been found and can only be solved by violence:

Add the following options when starting chrome:

option = webdriver.chromeOptions()

# Prevent printing some useless logs
option.add_experimental_option("excludeSwitches", ['enable-automation', 'enable-logging'])
driver = webdriver.Chrome(chrome_options=option)

 

Supplement

For this statement

driver = webdriver.Chrome(chrome_options=option)

For chrome browsers, chrome_options=option, preferably written as options=option, that is:

driver = webdriver.Chrome(options=option)

Or you’ll see it in terminal

DeprecationWarning: use options instead of chrome_options
  driver = webdriver.Chrome(chrome_options=option)

[Solved] VScode powershell Run ts-node Error: Unable to load file xxxx…

vscode powershell running ts-node reports an error

Recurrence : In window10, ts-node is installed globally on the external CMD , and execution of ts-node -v shows that the version number is installed successfully. Open the terminal in vscode , create a new ts file and use ts-node test.ts to report an error.

ts-node : Unable to load file xxxx because running scripts is prohibited on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.

Location Line: 1 Character: 1

+ ts-node 07.ts

+ ~~~~~~~

    + CategoryInfo : SecurityError: (:)[], PSSecurityException

+ FullyQualifiedErrorId : UnauthorizedAccess

Reason : The script running on cmd cannot run on powershell , and the execution policy of powershell restricts its execution.

Solution : View the execution policy of powershell and change the execution policy for the user

Execute the command to view the execution policy:  Get-ExecutionPolicy -List

Briefly explain:

userPolicy — Computer current user group policy settings

Process —   This scope only affects the current powershell session, the execution policy is not saved in the registry, and it is deleted when it is closed. (Refer to sessionStorage to understand)

CurrentUser — The execution policy affects only the current user, which is stored in the HKEY_CURRENT_USER registry

LocalMachine — Execution policy affects all users on the current computer and is saved in the registry

 

Change the execution policy of CurrentUser

Set-ExecutionPolicy -ExecutionPolicy <PolicyName> -Scope <scope>

Change CurrentUser to RemoteSigned here .

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Review the execution strategy again

 

It’s ok now

/www/server/php/56/sbin/php-fpm:error while loading shared libraries:libssl.so.1.0. 0:cannot open shared object file:No such file or directory

When opening PHP, you need to use libssl.so.1.0.0 or libcrypto.so.1.0.0 but since most of them do not have the 1.0.0 version, I solved it based on the link, taking libcrypto.so.1.0.0 as an example

1. First check what versions of libcrypto.so are in the current system files

ll /usr/lib64/libcrypto.so.*

2. It is true that there is no such thing libcrypto.so.1.0.0, but there is this/usr/lib64/libcrypto.so.1.0.2k,so you can create the connection

sudo ln -s /usr/lib64/libcrypto.so.1.0.2k /usr/lib64/libcrypto.so.1.0.0

[Solved] ./my_cmake_exe: error while loading shared libraries: libswresample.so.4: cannot open shared object file: No such file or directory

The compile command I use is as follows:

 gcc  demuxing_decoding.c  -o demuxing_decoding -g -I ./ffmpeg-5.0.1/include -L ./ffmpeg-5.0.1/lib/ \
          -l avcodec -l avutil -l avformat -l swresample  -lm -Wl,-rpath=./ffmpeg-5.0.1/lib/                                    

The directory ./ffmpeg-5.0.1/lib/ clearly has the library libswresample.so.4, but it is suggested that the dynamic library cannot be found.
It is best to have no choice. You can only follow the method commonly used on the Internet: /etc/ld Add the directory where the library libswresample.so.4 is located in .so.conf, and execute the command ldconfig.

[Solved] Spring Nature latex Error: Getting the error “Missing $ inserted” in LaTeX

I have been using the template of IJICAI and NeurIPS before, but when I moved the content to the latex template of spring nature today, there was a format error:

Getting the error “Missing $ inserted” in LaTeX

source:

 

 

recompile:

 

 After inspection, it was found that there was a problem with the representation of the absolute value symbol “|”:

 When using \vert instead of “|” for absolute values:

 

 

recomplie:

 

 This method has been proven to be effective.

[Solved] Vue3 Install vuetify Error: Error: You cannot call “get” on a collection with no paths.

Problem Description

After creating a project with vue3, add vuetify to the error message ERROR Error: You cannot call “get” on a collection with no paths. Instead, check the “length” property first to verify at least 1 path exists.

vue create vuetify-demo
cd vuetify-demo
vue add vuetify

Analysis of the cause of the problem

The analysis is because vuefiy does not adapt to vue3 cli, which will result in an error when adding directly.

Solution

1. Build the project with vue2, then add vuetify

2. Create a project with vue3 and change main.js

Before changing:

import { createApp } from 'vue'
import App from './App.vue'

createApp(App).mount('#app')

After changing:

import Vue from 'vue'
import App from './App.vue'

new Vue({
    render: h => h(App)
}).$mount('#app');

After using the vue add vuetify command, the main.js content becomes:

import Vue from 'vue'
import App from './App.vue'
import vuetify from './plugins/vuetify'

new Vue({
    vuetify,
    render: h => h(App)
}).$mount("#app")

[Solved] fatal error: jemalloc/jemalloc.h: No such file or directory

In the Linux system, sometimes when compiling and installing software, it will prompt: /bin/sh: cc: command not found, indicating that there is no gcc environment for compiling the code. Generally, we will install gcc first. The command is as follows:

yum -y install gcc gcc-c++

After installing gcc, continue to compile and install the original software, the error is as follows:

In file included from adlist.c:34:0:
zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory
#include <jemalloc/jemalloc.h>
^
compilation terminated.

The reason for the error is because the last compilation failed, there are residual files, we need to clean it up, and then recompile it.

Solution:

make distclean && make

[Solved] lightdb oracle_fdw Error: ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle

Error Messages:

create server oradb foreign data wrapper oracle_fdw options (dbserver '//10.20.30.199:1521/test');
create user mapping for USER server oradb options (user 'scott', password 'scott');
GRANT USAGE ON FOREIGN DATA WRAPPER oracle_fdw TO CURRENT_USER;
GRANT USAGE ON FOREIGN SERVER oradb TO CURRENT_USER;

create foreign table haha
( id int)
SERVER oradb OPTIONS (schema 'scott', table 'haha


[lightdb@hs-10-20-30-199 ~]$ ltsql -p 5435 -U scott -d scott
ltsql (13.3-22.2)
Type "help" for help.

scott@scott=# select * from haha;
ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle
DETAIL:
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=#
scott@scott=# select * from haha;
ERROR: error connecting to Oracle: OCIEnvCreate failed to create environment handle
DETAIL:

 

Solution:
Install the oracle light client. The oracle client can be downloaded from https://www.oracle.com/database/technologies/instant-client/downloads.html .
export ORACLE_HOME=/home/lightdb/instantclient_21_6
export LD_LIBRARY_PATH=$ORACLE_HOME:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
Restart lightdb, the problem is solved.

[Solved] vue3vite Error: Failed to resolve import “@vue/server-renderer from “src\App.vue“. Does the file exist

Project scenario:

In the process of testing 3D effects, there was a problem with vite suddenly. I found many methods on the Internet and didn’t know where the problem was.

Problem description

This is the error code of VSC. The error code running on HBx is different from this.


Solution:

Use after downloading yarn

yarn install

After reinstalling the dependency, you can run it

I don’t know why, because NPM run serve will also fail to get after vite is packaged

npm run build
npm run serve

You can build first and then serve.

How to Solve Ubuntu18 Compile Kalibr Error (Various Errors)

Opencv-3.4.13 is too new, and errors will be encountered during the compilation of kalibr. The summary is as follows:

Error 1: sudo pip install python-igraph –upgrade failed

Solution:

sudo apt-get install python-igraph

Error 2:

Could not find a package configuration file provided by “code_utils” with
any of the following names:
code_utilsConfig.cmake
code_utils-config.cmake```

Solution:

  1. You need to put the following sentence in the sumpixel_test.cpp file
    #include “backward.hpp”
    to this line
    #include “code_utils/backward.hpp”
  2. Put code_utils into the workspace first, then catkin_ws once, then put imu_utils, then compile

 

Error 3: catkin build -DCMAKE_BUILD_TYPE=Release -j4 errors during compilation

3-1 error reporting:

 error: ‘CV_GRAY2RGB’ was not declared in this scope
     cv::cvtColor(imageCopy1, imageCopy1, CV_GRAY2RGB);
    
 error: ‘CV_TERMCRIT_ITER’ was not declared in this scope
         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));

error: ‘CV_TERMCRIT_EPS’ was not declared in this scope
         cv::TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));

3-1 solution: add a header file to the corresponding file:

#include <opencv2/imgproc/types_c.h>

##############################################################################################################

3-2 cvstartwindowthread() error:

Change 3-2 to:

cv::startWindowThread()

3-3 CV_LOAD_IMAGE_UNCHANGED error:

3-3 changed to

cv::IMREAD_UNCHANGED

3-4 CV_LOAD_IMAGE_GRAYSCALE error:

3-4 changed to

cv::IMREAD_GRAYSCALE错误:

3-5 CV_ LOAD_ IMAGE_ Grayscale error:

Change 3-5 to

cv::IMREAD_GRAYSCALE

3-6 CV_LOAD_IMAGE_COLOR error:

Change 3-6 to

cv::IMREAD_COLOR

3-7 CV_LOAD_IMAGE_ANYDEPTH error:

3-7 changed to

cv::IMREAD_ANYDEPTH

3-8 CV_MINMAX error:

3-8 changed to

    NORM_MINMAX

3-9 CV_FONT_HERSHEY_SIMPLEX error:

3-9 changed to

cv::FONT_HERSHEY_SIMPLEX```

3-10 CV_WINDOW_AUTOSIZE error:

3-10 changed to

cv::WINDOW_AUTOSIZE

3-11 error: error: aggregate ‘std::ofstream out_t’ has incomplete type and cannot be defined std::ofstream out_t;
3-11 Solution: add the header file as below:

#include <fstream>

[Solved] JPA Create Sheet error at the First time: Cant DROP [xxx];check that column/key exists

Main contents of error reporting information:

        Cant DROP [xxx]; check that column/key exists


Error reporting information reference data:

A configuration as follows:

package org.hibernate.tool.schema.internal;

public abstract class AbstractSchemaMigrator implements SchemaMigrator {
    …………

    private UniqueConstraintSchemaUpdateStrategy uniqueConstraintStrategy;
}

The reason for the locking problem is that the default configuration is: delete + first and then create.

Then the solution of the problem should consider using the second one: RECREATE_QUIETLY, try to create it directly and ignore the exception.


Problem-solving:

Configure the above mentioned configuration in application.yml, but since this configuration was not prompted, after a query, it was found in.

package org.hibernate.cfg;


public interface AvailableSettings extends org.hibernate.jpa.AvailableSettings {
    ……
    /*
        In most dialects, unique constraints are used for unique columns and unique keys. SchemaUpdate needs to create these constraints, but DB support for finding existing constraints is extremely inconsistent. In addition, non-explicitly named unique constraints use randomly generated characters. Therefore, choose from these strategies. org.hibernate.tool.hbm2ddl.UniqueConstraintSchemaUpdateStrategy.DROP_RECREATE_QUIETLY (default): Attempt to delete and then (re)create each unique constraint. Ignore any exceptions thrown. org.hibernate.tool.hbm2ddl.UniqueConstraintSchemaUpdateStrategy.RECREATE_QUIETLY : Attempts to (re)create the unique constraint, ignoring any exceptions thrown if the constraint already exists org.hibernate.tool. hbm2ddl.UniqueConstraintSchemaUpdateStrategy.SKIP : Don't try to create unique constraint structure updates
    */
    String UNIQUE_CONSTRAINT_SCHEMA_UPDATE_STRATEGY = "hibernate.schema_update.unique_constraint_strategy";

    ……
}

Configurate in application.yml:

spring:
  ## jpa configuration
  jpa:
    hibernate:
      ddl-auto: ${JPA_HIBERNATE_DDL_AUTO:update}
    open-in-view: ${JPA_OPEN_IN_VIEW:true}
    show-sql: ${JPA_SHOW_SQL:false}
    properties:
      hibernate:
        schema_update:
          ## This configuration is the focus of this blog post, after setting, the error report no longer appears
          unique_constraint_strategy: RECREATE_QUIETLY