Category Archives: How to Fix

Compile QT source code error causes and Solutions

Qt source code compilation error:
1. Source code path contains Chinese font
2. No such file or directory can be found at compile time.
Solution:
1. Change to English path
2. When compiling the source code, add QT += widgets at the bottom of the project file. Pro.

Baidu Answer Question 2:
Write in the pro qt + = widgets QtWidget this module, introduced said, qmake will help you to generate a makefile, set up the include path and lib path, when the link set libs.
include

QApplication> Only the declaration is introduced, but there is no lib, so the link will fail.

MySQL error operation should contain 1 column (s)


1. An error
ERROR 1241 (21000): Operand should contain 1 column(s)
2. The reason for the error
This statement occurs mostly because the result set of a SELECT is wrapped in (). ()code> s>t
in pare>select * from

select 
 pit_key
,employee_code
,department_id
,value_date
from pit_employee_department ped
where ped.employee_code = 'GSCQ3349'
and ped.value_date < date_format(date_sub(curdate(), interval day(curdate()) - 1 day),'%Y%m%d')
and ped.pit_key not in
(	select 
	pit_key
	,value_date
	from pit_employee_department ped_1
	inner join 
	(
		select 
		max(value_date) as max_date
		from pit_employee_department ped

		where ped.value_date <= date_format(date_sub( date_sub(curdate(), interval day(curdate()) - 1 day),interval 1 month),'%Y%m%d')
		and employee_code = 'GSSH0039'
	)ped_2
	on ped_1.value_date < ped_2.max_date
	and ped_1.employee_code = 'GSSH0039'
);

pit_key not in (...) pit_keyd v>_date pit_key not in (...) , field inconsistency causes error.
3. Solutions
Make changes for different reasons.

json.load (file) error

1. Problem description
in running a very simple code:

 with open(json_file) as anno_file:
        anno = json.load(anno_file)

, an error:
json. The decoder. JSONDecodeError: Extra data: line 1 column 57054 char (57053)

 
Reason 2.
according to the prompt, the reason should be the json file of each line there is a limit to the number character (not more than 57053), but my line too much content
 

>
>
>
>
>
>
>

 with open(file_write, "w+") as f:
        for infor in dict_w[index]:
            dict_w1 = {infor: dict_w[index][infor]}
            json.dump(dict_w1, f)
            f.write("\n")

 
4. Further problems
run again at the beginning of reading and an error while reading code:
json. The decoder. JSONDecodeError: Extra data: line 2 column 1 (135) char

 

on. Load does not support decoding multiple JSON objects: Json. Loads , and json. The load ) does not decode multiple json object.

https://stackoverflow.com/questions/21058935/python-json-loads-shows-valueerror-extra-data
to fill: What are the JSON objects?

6. The solution of the problem further
way 1: put the object in a list to write again, and then load.

but in my practice, such a line of words too much, there will be 1 mentioned to
problem 2: read line by line, and add a list

When Linux installs redis, it executes make install and reports an error: Make: * * [server. O] error 1 (solved)

Reason:
the Redis’s official website to download version of the 6.0 version of make the installation
This is because the GCC version is too low. The GCC installed in YUM is 4.8.5. Therefore, GCC needs to be upgraded. The upgrade process is as follows:

yum -y install centos-release-scl

yum -y install devtoolset-9-gcc devtoolset-9-gcc-c++ devtoolset-9-binutils

scl enable devtoolset-9 bash

echo "source /opt/rh/devtoolset-9/enable" >> /etc/profile

gcc -v

Can.

Android studio reported an error in the release package: Lint found fatal errors while assembling a release target

Today, I upgraded Android Studio and found that the code can run, but there is an error in the release package. The error is as follows

Lint found fatal errors while assembling a release target.
To proceed, either fix the issues identified by lint, or modify your build script as follows:
...
android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

The error provides us with the above two kinds of repair way of version
a: repair
Lint to check out the problem 2: in the build of the module. The gradle add the following code, so you can ignore these problems, the normal packaging

android {
    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }
}

The second method is convenient, but it’s not recommended to ignore the problem, according to the website

In addition to testing the Android application to make sure it meets its functional requirements, you must also make sure that the code has no structural problems. Disorganized code affects the reliability and efficiency of an Android application and makes it harder to maintain the code.

Lint check problems is to prevent the above problems, so the way we use the following method to solve this problem
in the error above only hint Lint has a problem But didn’t tell me about any problem. Can use the android studio to see these errors

in the menu bar

can complete inspection can also specify folder check, click OK to wait for a while can see the test result, and then the error of the test results to solve can normal packing up

Reference links
https://developer.android.google.cn/studio/write/lint?hl=zh-CN