Category Archives: How to Fix

Problems and solutions of error reporting in using swiper in Vue

In recent development, we encountered the problem of always reporting errors when using swiper components. Later, it was found that the problem was caused by the version

1. Download these two versions of plug-ins:
“wiper”: “^ 4.5.1”,
“Vue awesome wiper”: “^ 4.0.4”,

npm install [email protected] --save -dev
npm install swiper@4 --save -dev

2. Introduce in the component of xxxx.vue

<script>
import { swiper, swiperSlide } from "vue-awesome-swiper";
import "swiper/dist/css/swiper.css";
export default {
  name: "index",
  components: {
    swiper,
    swiperSlide
  }, 
};
</script>

3. Use in div

<swiper ref="mySwiper" v-bind:options="swiperOptions">
          <swiper-slide v-for="(item, index) in slideList" :key="index">
            <a v-bind:href="'/#/product'%20+%20'item.id'">
              <img v-bind:src="item.img" alt />
            </a>
</swiper-slide>

GCC compilation error unknown type name ‘bool’‘

Error description

unknown type name ‘bool’

Recently, using C to implement data structure encountered the following error

➜  LinkedList gcc list.c 
list.c:14:1: error: unknown type name ‘bool’; did you mean ‘_Bool’?
 bool is_empty(PNODE pHead);
 ^~~~
 _Bool
list.c:77:1: error: unknown type name ‘bool’; did you mean ‘_Bool’?
 bool is_empty(PNODE pHead)
 ^~~~
 _Bool
list.c: In function ‘is_empty’:
list.c:80:9: error: ‘true’ undeclared (first use in this function); did you mean ‘free’?
  return true;
         ^~~~
         free
list.c:80:9: note: each undeclared identifier is reported only once for each function it appears in
list.c:82:9: error: ‘false’ undeclared (first use in this function); did you mean ‘fclose’?
  return false;
         ^~~~~

Error reason

Unknown type name: ‘bool’, because there is no boolean type defined in the C language standard (C89), an error will be reported. C99 provides a header file & lt; stdbool.h> defines bool , true represents 1 and false represents 0. As long as you import stdpool. H , you can easily operate Boolean types.

resolvent

#include <stdbool.h>

"21442;" 32771;"38142;" 25509

https://www.jianshu.com/p/aa951e784e96

Oracle reports an error and lsnrctl listening cannot be started

Connecting to (description = (address = (protocol = IPC) (key = extproc))
tns-12557: TNS: protocol adapter is not loadable
  Tns-12560: protocol adapter error
  Tns-00527: the protocol adapter cannot be loaded
2. Check whether/TMP /. Oracle and/var/TMP /. Oracle directories exist
3. Check the permissions of the current user trying to start the listener on these directories
MKDIR/var/TMP /. Oracle
MKDIR/TMP /. Oracle
chown – R Oracle: oiinstall/var/TMP /. Oracle/TMP /. Oracle
Chmod – R 01777/var/TMP /. Oracle/TMP /. Oracle
4. Run the listener to solve the problem:
lsnrctl start
5. If the listener still cannot be started, grant Oracle 777 permission on/tmp directory
chmod -R 777/tmp/var/tmp

Error reported using layui $is not defined

The following error occurs when calling a function using the layui template

reason: Layu needs to be pre loaded and defined$

<script type="text/javascript" rel="script">
    layui.use(['table', 'layer', 'form','element'], function(){
        var table = layui.table;
        var layer = layui.layer;
        var form = layui.form;
        var element = layui.element;
        var $ = layui.$;

</script>

Vue install reports an error operation not allowed

Solution:

1. Permission problem
you can run CMD as an administrator or open CMD by pressing Win + x .

2. Dependency package error
generally, in this case, we need to focus on the directory after operation not allowed . Through the error prompt, the problem can be solved by correctly installing the required dependent packages globally.

3. NPM version problem
this is also similar to the previous one, because different versions sometimes have problems with dependent packages. For example, the version is too high and there is no corresponding dependent package, so it is OK to change the NPM version.

The springboot integration mybatis reported an error. The parameter cannot be found

Today, I stepped on a pit when I implemented a login page in springboot and mybatis

It always shows that the parameter cannot be found, and many blogs on the Internet have not found the reason

  Finally, it was pointed out by the leaders in the group that the @ param annotation was missing in the usermapper parameter

 

This SQL statement is used in usermapper, resulting in an error

 

  So I sorted out the usage of a wave of @ param annotations from the Internet

1. Use @ param annotation

When writing SQL statements in the following way:

    @ Select(“select column from table where userid = #{userid} “)
    public int selectColumn(int userid);

When you use the @ param annotation to declare parameters, you can use either #{} or ${}.

    @ Select(“select column from table where userid = ${userid} “)
    public int selectColumn(@Param(“userid”) int userid);

When you do not use the @ param annotation to declare parameters, you must use the use #{} method. If you use ${}, an error will be reported.

    @ Select(“select column from table where userid = ${userid} “)
    public int selectColumn(@Param(“userid”) int userid);

2. Do not use @ param annotation

··When the @ param annotation is not used, there can only be one parameter and it is a java bean. JavaBean properties can be referenced in SQL statements, and only JavaBean properties can be referenced.

    // Here ID is the attribute of user

    @ Select(“SELECT * from Table where id = ${id}”)
    Enchashment selectUserById(User user);
1

[Linux] MAC installation pyfasttext error

Reference: MacOS installation pyfasttext error reporting solution_ Kungreye CSDN blog

Mac usage  clang   Compile and change the compilation path again to successfully install (both methods are OK).

Solution:  

CXX=/usr/bin/clang CC=/usr/bin/clang pip3 install --no-cache pyfasttext

An error of 500 is reported when an item is assigned to a role

Original: void addrolesbyuserid (string [] roleids, string userid);

After modification: void addrolesbyuserid (@ param (“roleids”) string [] roleids, @ param (“userid”) string userid);

Error reason: roleides is not found, and the roleides parameter is not detected by SQL statement

Solution: add the @ param annotation to specify the parameters of the incoming SQL statement

An error occurred when installing pytorch version 1.7 GPU

Error when installing 1.7 GPU version of pytorch: torch has an invalid wheel,. Dist info directory not found

the reason is that CUDA versions are inconsistent,

Solution 1:

Install torch for CPU version

pip install torch==1.7.0+cpu torchvision==0.8.1+cpu torchaudio===0.7.0 -f https://download.pytorch.org/whl/torch_stable.html

Solution 2:

conda install pytorch==1.7.0 torchvision==0.8.0 torchaudio==0.7.0 cudatoolkit=11.0 -c pytorch

Error when opening jeesite project in eclipse

Cause analysis: there is an error in the jar package. You need to re import the jar package
first click the jeesite project, and then open properties → Java build path → libraries

Then remove all jar packages that report errors, click apply and close, select all jar packages in the Lib directory, and right-click build path to re import jar packages

errors are still reported for individual files after re introduction, as follows

The reason is that some packages are not included after Java se 9.0. If they are used, they need to be imported manually
a link is given below. You can go to this website to download the required packages by yourself
http://www.java2s.com/Code/Jar/CatalogJar.htm

GeTx reports an error in the get request using getconnect

The specific error reports are as follows:

flutter/lib/ui/ui_ dart_ state.cc(209)] Unhandled Exception: type ‘int’ is not a subtype of type ‘Iterable< dynamic>’

The reason is that I use the get request and the parameters are not spliced after the URL, that is, in this form, XXX?X = 1 & amp; y=2。

But use   Map< String, dynamic>? Query a map to place parameters.

Check the source code to find the reason. If the value in query is not of string type, it will be converted to an iterator, and I put it as an int, so the conversion reports an error. The solution is to convert all the values in the query map into strings.

query?.map((key, value) => MapEntry(key, value.toString()))