Tag Archives: back-end

[Solved] com.highgo.jdbc.util.PSQLException:bad value for long

environment
system platform: Galaxy Kirin u system (CPU Feiteng) 4
version: 4.3.4.5
symptom
application error:

com.highgo.jdbc.util.PSQLException:bad value for long:{"w":1341,"h":700,"widgets":[{"id":1,"c":1,"r":1,"x":24,"y":27},{"id":2,"c":25,"r":1,"x":51,"y":54},{"id":3,"c":25,"r":55,"x":51,"y":32},{"id":4,"c":1,"r":28,"x":24,"y":27},{"id":5,"c":76,"r":1,"x":25,"y":26},{"id":6,"c":76,"r":55,"x":25,"y":32},{"id":7,"c":76,"r":27,"x":25,"y":28},{"id":8,"c":1,"r":55,"x":24,"y":32}]}

Cause of the problem
MyBatis in the query for select mapping, the return type can be used resultTy, investigation and analysis found that the customer’s program to return the field type is longvarchar, so take the jar package within the tolong method, causing errors.

Solution
Modify the return field type longvarchar to varchar in the program.

Error code

com.highgo.jdbc.util.PSQLException:bad value for long

[Solved] igb Compile Error: igb_main.c:10044:7: error: implicit declaration of function ‘isdigit’

Recently, the IGB compiler driver found this problem:

zacha@Superman:~/igb/igb-5.7.2/src$ make
#@+ echo "*** The target kernel has CONFIG_MODULE_SIG_ALL enabled, but" ; echo "*** the signing key cannot be found. Module signing has been" ; echo "*** disabled for this build." ; make  ccflags-y="" -C "/lib/modules/4.15.0-142-generic/build" CONFIG_IGB=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL= M="/home/zacha/igb/igb-5.7.2/src"   modules  
make -C /home/zacha/yulong810/kernel M=/home/zacha/igb/igb-5.7.2/src CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
make[1]: Entering directory '/home/zacha/yulong810/kernel'
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_main.o
/home/zacha/igb/igb-5.7.2/src/igb_main.c: In function ‘igb_get_os_driver_version’:
/home/zacha/igb/igb-5.7.2/src/igb_main.c:10044:7: error: implicit declaration of function ‘isdigit’ [-Werror=implicit-function-declaration]
   if(!isdigit(*c) && *c != '.')
       ^~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:303: recipe for target '/home/zacha/igb/igb-5.7.2/src/igb_main.o' failed
make[2]: *** [/home/zacha/igb/igb-5.7.2/src/igb_main.o] Error 1
Makefile:1519: recipe for target '_module_/home/zacha/igb/igb-5.7.2/src' failed
make[1]: *** [_module_/home/zacha/igb/igb-5.7.2/src] Error 2
make[1]: Leaving directory '/home/zacha/yulong810/kernel'
Makefile:88: recipe for target 'default' failed
make: *** [default] Error 2

There are also solutions online:
https://github.com/geerlingguy/raspberry-pi-pcie-devices/issues/3

Solution:

Add #include <linux/ctype.h> inigb)main.c
then compile and generate IGB.ko

zacha@Superman:~/igb/igb-5.7.2/src$ make
#@+ echo "*** The target kernel has CONFIG_MODULE_SIG_ALL enabled, but" ; echo "*** the signing key cannot be found. Module signing has been" ; echo "*** disabled for this build." ; make  ccflags-y="" -C "/lib/modules/4.15.0-142-generic/build" CONFIG_IGB=m CONFIG_MODULE_SIG=n CONFIG_MODULE_SIG_ALL= M="/home/zacha/igb/igb-5.7.2/src"   modules  
make -C /home/zacha/yulong810/kernel M=/home/zacha/igb/igb-5.7.2/src CROSS_COMPILE=arm-linux-gnueabihf- ARCH=arm
make[1]: Entering directory '/home/zacha/yulong810/kernel'
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_main.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_api.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_ethtool.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_hwmon.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_mbx.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_mac.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_manage.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_nvm.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_param.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_phy.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_procfs.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_vmdq.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_82575.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/e1000_i210.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_debugfs.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/igb_ptp.o
  CC [M]  /home/zacha/igb/igb-5.7.2/src/kcompat.o
  LD [M]  /home/zacha/igb/igb-5.7.2/src/igb.o
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/zacha/igb/igb-5.7.2/src/igb.mod.o
  LD [M]  /home/zacha/igb/igb-5.7.2/src/igb.ko
make[1]: Leaving directory '/home/zacha/yulong810/kernel'

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).

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] Django project locally Open Error: importerror: couldn’t import Django

There is a mature Django project. After it is opened locally, an error is reported: importerror: couldn’t import Django Are you sure it’s installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?
solution step 1: because this Django project uses python2.7. My local configuration environment variable is 3.7.7. After importing the Django project locally, the python compiler has been modified to 2.7

but an error is still reported after execution
solution step 2: open the teminal terminal of pycharm

execute the command: source venv/bin/activate
start the Django project: Python manage Py runserver

the Django project was started successfully and the problem was solved perfectly.

[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!!

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