Author Archives: Robins

JS uses the and or operator, and an error is reported: uncaught rangeerror: maximum call stack size exceeded

The or operator is used when the routing guard of the Vue item is in progress,

router.beforeEach((to,from,next) => {
  store.commit('cookie/getToken')
  let token = store.state.cookie.token
  if(!token && to.name === 'PersonalHome'||'Edit'||'EditBlog'||'EditDraft') {
      next('login')
  } else {
      next()
  }
})

Browser error:

solution:
wrap or calculate with ()

if(!token && to.name === ('PersonalHome'||'Edit'||'EditBlog'||'EditDraft')) {
      next('login')
  } else {
      next()
  }

The idea code pushes to GitHub and reports an error fatal: unable to access

Error:

fatal: unable to access ‘ https://github.com/ …


terms of settlement:

1. Execute SSH keygen – t RSA on the idea terminal and press enter to generate the public key and private key. By default, it is saved in the. SSH directory under the user directory of Disk C
2. Find settings in the GitHub homepage, as shown in the figure below. Create a new SSH
note: when creating a new SSH, fill in the ID_ Contents in rsa.pub
3. Set the private key in idea


Reference link: https://blog.csdn.net/qianlixiaomage/article/details/114681364

QT + MySQL generates an EXE file and reports an error “driver not loaded”. Solution steps

My environment is win10. Exe files are generated by qt5.12.6 + MySQL 5.7.29.

Run exe to find that the database cannot be connected, and the error is as follows:

QSqlDatabase:QMYSQL driver not loaded

QSqlDatabase:available drivers:

Open datatabase error:”Driver not loaded Driver not loaded”

I watched it online for two days and tried it for two days, but there was no change. But after a comprehensive analysis, it will be solved.

Specific steps:

1. Copy libmysql.dll under D: \ MySQL \ mysql-5.7.29-winx64 \ lib to the directory of. Exe;

2. Copy the D: \ QT \ qt5.12.6 \ 5.12.6 \ SRC \ qtbase \ SRC \ plugins \ sqldrivers \ plugins \ sqldrivers folder to the directory of. Exe.

The above paths are different according to the actual situation of individuals, and are based on their own local.

After completing the above steps, EXE can connect to the database.

reference resources:

weixin_ thirty million three hundred and ninety-nine thousand eight hundred and twenty-one

weixin_ forty-five million seven hundred and thirty-eight thousand two hundred and eighteen

No matching distribution found for exceptions when Python installs docx package

Python installation docx package runs with errors

ERROR: No matching distribution found for exceptions

reason

Docx package is a third-party library developed with Python 2 for Word 2007. With the upgrading of word, especially the upgrading of Python version, it is no longer applicable. You can install a new word processing package to solve the problem.

pip install python-docx

Resolve the idea error unable to Ping server at localhost: 1099 exception

Unable to Ping server at localhost: 1099
the solutions mentioned on the Internet are the first two, but mine is the third. I hope small partners can avoid the pit
1. The version of Tomcat and JDK matches
port 2 is occupied
3 check the idea configuration Tomcat. VM options cannot have spaces before and after the equals sign
(if there are spaces before and after the equals sign, there will always be an error.)

Java.lang.ClassNotFoundException: sun.jdbc.odbc.JdbcOdbcDriver [How to Solve]

Java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver error reporting solution

Error report description problem description cause analysis solution operation results

Error reporting description

java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver reports an error


Problem description

when learning the contents of Java database, because the old version of teaching materials are used, and the Java version has been updated and some functions have been deleted, an error message prompted by java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver appears when reading the database: 

try {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        } catch (ClassNotFoundException e) {
            System.out.println(e);
        }

Error message: java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcdriver


Cause analysis

since JDK1.8, the JDBC ODBC bridge has been deleted, so the ODBC driver cannot be used </ font>


Solution

 

    1. Step 1: install the old version of JDK. I install the download link of version 1.7 here: just click the next step for the jdk1.7 installation step. Step 2: change the Java environment

 

    1. friends using eclipse can refer to this blog:

 

    1. java.lang.classnotfoundexception: sun.jdbc.odbc.jdbcodbcodbcdriver solution 2.1 I use the integrated development environment of idea, The method is as follows:

 

    1. in file – project structure

    1. in project settings, select the JDK version downloaded for you by project SDK (here is 1.7)

 

    1. and click apply to run


Operation results

run smoothly ^ ^

Error when pychart terminal runs pytest: file not found:

When you execute pytest on the pycharm terminal, an error is reported and the file cannot be found
because the path opened by terminal is not necessarily the directory of your current file, To switch to the directory where the file is located
Click

in the upper right corner of pycharm to copy the path in the working directory
enter the working directory path just copied from CD in terminal
run pytest again

How to solve the resource temporarily unavailable error of the Linux host?

Reason: the current user has limited the number of processes
solution:
Su root
(if the switch fails due to resource temporarily unavailable, you can log in with another user)
CD/etc/security/limits. D
VI 90 nproc. Conf
add a new line of current user with unlimited number of processes
note: you need to log in again after modification