Author Archives: Robins

[Solved] TypeError: xx takes 1 positional argument but 4 were given

The problem is that there is an error when the thread transmits data. For example, the following sentence will report an error when it runs

threading.Thread(target=intent, args=([1, 2, 3, 4])).start()

The solution is to add a comma to the last face, as follows

    threading.Thread(target=intent, args=([1, 2, 3, 4],)).start()
    # or
    threading.Thread(target=intent, args=[[1, 2, 3, 4], ]).start()

[Solved] Ubuntu20.04 Error: “Failed to install the following Android SDK packages as some licences have not..“error

After installing Android studio under Ubuntu, importing the project and building, the following error appears:

The problem is that licenses are not matched well

There are only two steps to solving the problem:

1. Open file – & gt; Settings

After the settings interface appears, enter appearance – & gt; System Settings -> Android SDK -> SDK Tools

Download Android SDK command line tools (latest) in SDK tools interface

2. After downloading, CMD line tools will be installed in the SDK directory ~/Android/SDK by default. If your directory is different, you need to modify it accordingly

Execute on the command line

yes | sudo ~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager --licenses

The problem is solved. Build can run normally

Note: 1. In some articles, you can directly run the sdkmanager under ~/Android/SDK/tools/bin /, which will report an error

 java.lang.NoClassDefFoundError

The reason is that Ubuntu 20.04 installs OpenSDK 11 by default, which will conflict with the JRE that comes with Android Studio.
Uninstalling OpenSDK 11 and installing a lower version of JavaSDK is more troublesome.

Eslint Error:“Identifier xxx is not in camel case“

In the. Eslintrc. JS file: close the rules for verifying hump naming (camelCase: ‘off’).

// eslintrc.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: [
    'plugin:vue/essential',
    '@vue/standard',
    '@vue/typescript/recommended'
  ],
  parserOptions: {
    ecmaVersion: 2020
  },
  rules: {
    '@typescript-eslint/ban-types': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/member-delimiter-style': ['error',
      {
        multiline: {
          delimiter: 'none'
        },
        singleline: {
          delimiter: 'comma'
        }
      }],
    '@typescript-eslint/no-explicit-any': 'off',
    '@typescript-eslint/no-var-requires': 'off',
    camelcase: 'off',
    'no-console': process.env.NODE_ENV === 'production' ?'warn' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ?'error' : 'off',
    'space-before-function-paren': ['error', 'never'],
    'vue/array-bracket-spacing': 'error',
    'vue/arrow-spacing': 'error',
    'vue/block-spacing': 'error',
    'vue/brace-style': 'error',
    'vue/camelcase': 'error',
    'vue/comma-dangle': 'error',
    'vue/component-name-in-template-casing': ['error', 'kebab-case'],
    'vue/eqeqeq': 'error',
    'vue/key-spacing': 'error',
    'vue/match-component-file-name': 'error',
    'vue/object-curly-spacing': 'error'
  },
  overrides: [
    {
      files: [
        '**/__tests__/*.{j,t}s?(x)',
        '**/tests/unit/**/*.spec.{j,t}s?(x)'
      ],
      env: {
        jest: true
      }
    }
  ]
}

[Solved] Mongo Error: cant post the change to mongodb there is transaction error

Mongo database
Edit, add data error:
can post the change to mongodb there is transaction error

submit transaction error:

add set error in query:

prompt: not master

Reason:
the slave node used in Mongo master-slave only has read permission by default, and the slave node connected by itself
solution:
setting in Mongo allows the slave node to be writable, or directly connects to the IP address of the master node

openlayers — Cannot read property ‘slice‘ of null—Map cannot be loaded

When loading the GeoServer WMS service, the map could not be loaded with an error:

View.js:1552 Uncaught TypeError: Cannot read property 'slice' of null
at xs (View.js:1552)
at e.applyOptions_ (View.js:378)
at new e (View.js:330)
at test.html:115

My code to load the service is:


		var imagery = new ol.layer.Image({
	            source: new ol.source.ImageWMS({
	                ratio: 1,
	                url: 'http://localhost:8999/geoserver/dem/wms',
	                params: {
	                    'FORMAT': 'image/jpeg',//'image/jpeg',//
	                    'VERSION': '1.1.1',
	                    "STYLES": '',
	                    "LAYERS": 'dem:hhu_fill_dem',
	                    "exceptions": 'application/vnd.ogc.se_inimage',
	                },
	                crossOrigin:''
	            })
	    });
		var projection = new ol.proj.Projection({
		            code: 'EPSG:3857',
		            units: 'm',
		            global: true
		    });

       	var map = new ol.Map({
            controls: ol.control.defaults({
                attribution: false
            }).extend([mousePositionControl]),
            target: container,
            layers: [
                imagery
            ],
            view: new ol.View({
                projection: projection,
            }),
            
        });

The error is loading the view View: new ol.view ({projection: projection}), . After eliminating the problem step by step, we find that the problem is in:

var projection = new ol.proj.Projection({
		            code: 'EPSG:3857',
		            units: 'm',
		            global: true
		    });

There is a problem with Global: true , and the default attribute of Global is false . Comment it out, and the map can be loaded normally if no error is reported

Whether the projection is valid for the whole globe.

However, in the source code of GeoServer loading the service, global is set to true and loaded successfully. It is not clear why??

[Solved] Selenium python send_key error: list object has no attribute

Learning selenium positioning element, the teacher wrote send_ Key (), but I didn’t click in this method. I kept prompting
selenium Python send_ Key error: list object has no attribute
therefore, both methods can be used to solve the problem.
PS: [0] I don’t know what it means. I’ll come back to understand it when I’m in-depth learning

driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
userID = driver.find_elements(By.ID,"kw")[0]
userID.send_keys("123")
driver = webdriver.Chrome()
driver.get("https://www.baidu.com")
driver.find_element(By.ID,"kw").send_keys("456")

[Solved] Error in executing mysqld — initialize command

D:\develop\mysql-5.7.27-winx64\bin>mysqld –initialize
mysqld: Can’t create directory ‘D:\mysql-5.7.27-winx64\data’ (Errcode: 2 – No such file or directory)
2021-06-27T11:23:41.634820Z 0 [ERROR] Can’t find error-message file ‘D:\mysql-5.7.27-winx64\share\errmsg.sys’. Check error-message file location and ‘lc-messages-dir’ configuration directive.
2021-06-27T11:23:41.638039Z 0 [ERROR] Aborting

Solution:
Just modify the path in the my.ini configuration file

[Solved] SpringBoot Integrating Oracle reports errors: ORA-12504, TNS:listener was not given the SID in CONNECT_DATA

Obviously, an error is reported here, saying that Sid cannot be obtained. Obviously, the path is wrong. Check whether the path is completely written?

The error is as follows

java.sql.SQLException: Listener refused the connection with the following error:
ORA-12504, TNS:listener was not given the SID in CONNECT_DATA
 
	at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:70) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:133) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:199) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:480) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:413) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:508) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:203) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:510) ~[ojdbc-11.2.0.3.jar:Oracle JDBC Driver version - "11.1.0.7.0-Production"]
	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) [HikariCP-4.0.3.jar:na]
	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) [HikariCP-4.0.3.jar:na]
	at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:330) [spring-jdbc-5.3.8.jar:5.3.8]
	at org.springframework.boot.jdbc.EmbeddedDatabaseConnection.isEmbedded(EmbeddedDatabaseConnection.java:184) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.jdbc.init.DataSourceScriptDatabaseInitializer.isEmbeddedDatabase(DataSourceScriptDatabaseInitializer.java:64) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.isEnabled(AbstractScriptDatabaseInitializer.java:87) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.initializeDatabase(AbstractScriptDatabaseInitializer.java:74) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.sql.init.AbstractScriptDatabaseInitializer.afterPropertiesSet(AbstractScriptDatabaseInitializer.java:65) [spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1845) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) [spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944) ~[spring-beans-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.8.jar:5.3.8]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:338) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343) ~[spring-boot-2.5.1.jar:2.5.1]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1332) ~[spring-boot-2.5.1.jar:2.5.1]

solve

jdbc:oracle:thin:@xxx:1521:orcl/xe

MySQL Build table error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ……

syntax error:

Because varchar needs to specify the length, varchar (32) checks whether the corresponding types of all fields need to add length or precision, because MySQL keywords are used. For example, using ID as the field name needs to be enclosed in quotation marks

Vue ElementUI el-dropdown Error: Uncaught TypeError: Cannot read property ‘disabled‘ of null

Inadvertently shield El dropdown menu and report an error when you click the page at will, causing confusion of the whole HTML elements! Reported a very strange mistake!

Uncaught TypeError: Cannot read property ‘disabled’ of null
You have to have children….

<el-dropdown>
  <span class="el-dropdown-link">
    Dropdown menu<i class="el-icon-arrow-down el-icon---right"></i>
  </span>
  <! -- <el-dropdown-menu slot="dropdown">
    <el-dropdown-item>goldencake</el-dropdown-item>
    <el-dropdown-item>Lion's Head</el-dropdown-item>
    <el-dropdown-item> Spiral noodles</el-dropdown-item>
    <el-dropdown-item disabled>Double-skinned milk</el-dropdown-item>
    <el-dropdown-item divided>Oyster Omelet</el-dropdown-item>
  </el-dropdown-menu> -->
</el-dropdown>