Author Archives: Robins

[Solved] Vue uses webpack to package error: Createapp is not a function

Error message

_node_modules_vue_dist_vue_global_ js__WEBPACK_IMPORTED_MODULE_1___ default().createApp   is   not   a   function

There is a problem with the way Vue is introduced

The correct introduction method is

import { createApp } from 'vue';

var App = {
	data() {
		return {
			images: [{
					Picture: "img"
				},
				{
					Picture: "img2"
				}
			],
		}
	}
}
const app = createApp(App); // 将数据添加到Vue数据绑定上
const vm = app.mount("#app"); // 将数据绑定到指定id上

Flutter flutter doctor –android-licenses [How to Solve]

Error message

Solution:

In androidstuido, file – > Setting-> Appearance-> System Setting-> Check whether it is installed under the Android SDK (as shown in the figure)

if not, directly click Android stuido to download
and then run the shuttle doctor — Android licenses to select y in the whole process

result

Execute the flitter doctor to check all √ to prove that it has been arranged

Document.querySelector(‘video‘).playbackRate [How to Solve]

The reason why I send this article is because I am used to playing at 1.75 times the speed, but station B has only 1.5 and 2, which makes me a headache. I originally had a plug-in that can speed up playback by 1.75 times, but I can’t use it recently. I don’t know why. So I searched for any way to modify the video playback speed of station B. Then there is the following.

The way to find out

Press F12 to enter the following code in the console

document.querySelector("video").playbackRate="16"

It is said that this method can modify the double speed.

report errors

I reported a mistake after using it. What’s the reason?Others open the source code, which is labeled by video. I don’t have it. So it must be wrong.

Others:

mine:

Solution:

As can be seen from the screenshot above, I right-click to add an ID attribute a to it
then enter the following code in the console,

			var video= document.getElementById('a');
			video.playbackRate=1.75

Done.

How to Solve Namedparameterjdbctemplate.queryforobject() Return Error

Project scenario:

tip: briefly describe the project background here:
for example, project scenario: example: communicate with mobile app through Bluetooth chip (hc-05), and transmit a batch of sensor data every 5S (not very large)


Problem Description:

The following code will report an error if it can’t be found in the database, and it doesn’t work whether you judge it to be empty or judge the length.

@Override
public String queryUserNameByUserId(String userId) {
	String sql = "SELECT username FROM info WHERE userId= :userId";
	MapSqlParameterSource source = new MapSqlParameterSource();
	source.addValue("userId", userId);
	return namedParameterJdbcTemplate.queryForObject(sql, source, String.class);
}

Cause analysis:

Queryforobject(), try to operate when querying data that must exist in the database.

Solution:

1. Try catch is not recommended
2. Change to list and judge to be empty, as follows.

@Override
public List<String> queryUserNameByUserId(String userId) {	//Modify
	String sql = "SELECT username FROM info WHERE userId= :userId";
	MapSqlParameterSource source = new MapSqlParameterSource();
	source.addValue("userId", userId);
    return namedParameterJdbcTemplate.queryForList(sql, source, String.class);	//修改
}

Error response from daemon for private harbor login

[root@k8s-master1 k8s-01]# docker login 172.18.8.214
Username: admin
Password:
Error response from daemon: Get https://172.18.8.214/v2/: dial tcp 172.18.8.214:443: connect: connection refused
[root@k8s-master1 k8s-01]#

Load the image locally and use HTTP or HTTPS. By default, the HTTPS protocol must be used. If you confirm that you do not use secure, you can use HTTP

[root@k8s-master1 k8s-01]# cat /etc/docker/daemon.json
{
	"registry-mirrors":["https://0cde955d3600f3000fe5c004160e0320.mirror.swr.myhuaweicloud.com"],
	"insecure-registries": ["172.18.8.214", "172.18.8.215"]  
}
[root@k8s-master1 k8s-01]#

Start docker validation

[root@k8s-master1 k8s-01]# systemctl restart docker
[root@k8s-master1 k8s-01]# docker login 172.18.8.214
Username: admin
Password:
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store

Login Succeeded
[root@k8s-master1 k8s-01]#

[Solved] Classnotfoundexception: org.springframework.core.nativedetector error

To build a microservice architecture using springcloud, the spring boot starter web dependency is referenced in the parent, but the subproject cannot be started. The error is as follows:

Build springcloud project encountered problems
Exception in thread "main" java.lang.IllegalArgumentException: Cannot instantiate interface org.springframework.context.ApplicationListener : org.springframework.boot.autoconfigure.BackgroundPreinitializer
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:450)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:429)
	at org.springframework.boot.SpringApplication.getSpringFactoriesInstances(SpringApplication.java:420)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:270)
	at org.springframework.boot.SpringApplication.<init>(SpringApplication.java:249)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248)
	at com.hm.SchoolApplication.main(SchoolApplication.java:17)
Caused by: java.lang.NoClassDefFoundError: org/springframework/core/NativeDetector
	at org.springframework.boot.autoconfigure.BackgroundPreinitializer.<clinit>(BackgroundPreinitializer.java:71)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:172)
	at org.springframework.boot.SpringApplication.createSpringFactoriesInstances(SpringApplication.java:446)
	... 7 more
Caused by: java.lang.ClassNotFoundException: org.springframework.core.NativeDetector
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
	... 14 more

Solution: it is not enough to rely only on spring boot starter web in the parent project. You should add

	<parent>
        <artifactId>spring-boot-starter-parent</artifactId>
        <groupId>org.springframework.boot</groupId>
        <version>2.1.0.RELEASE</version>
    </parent>

Just start again.

[Solved] TensorFlow Error: you must feed a value for placeholder tensor

Copy the placeholder this way:


input_placeholder = tf.placeholder(tf.int32, 
  [batch_size, sequence_len], 
  name="input")

copy_input = tf.Variable(initial_value=input_placeholder, 
  trainable=False)

Then this sentence reports an error:

sess.run(tf.global_variables_initializer())

Solution:
copy the placeholder in this way:

copy_input = tf.get_variable(
                initializer=tf.constant(0, shape=[batch_size, sequence_len]),    
                name="copy_placeholder",
                dtype=tf.int32, trainable=False)
copy_input.assign(input_placeholder)

[Solved] React import the Path of Image error: cannot find mouse ‘.‘

Problem Description: the error cannot find mouse ‘is reported when the picture path is introduced

const listArr = [
    {
        "title": "title 1",
        "icon" : "./../../img/icon1.png"
    },
    {
        "title": "title 2",
        "icon" : "./../../img/icon2.png"
    },
    {
        "title": "title 3",
        "icon" : "./../../img/icon3.png"
    },
];



listArr.map((item,index) => {
    return (
        <li key={index}>
            <img src={require(item.icon)} alt="" />    //error Cannot find moudle '.'
            {item.title}
        </li>
    )
})

Cause analysis: path variables cannot be written directly in require, but need to be written in path format

Path variables cannot be written directly in require. They need to be written in path format, which has been tested (<img src={require(`./../../img/${item.icon}`)} alt=”” />) That’s OK


Solution: < img src={require(`./../../img/${item.icon}`)} alt=”” />

const listArr = [
    {
        "title": "title 1",
        "icon" : "icon1.png"
    },
    {
        "title": "title 2",
        "icon" : "icon2.png"
    },
    {
        "title": "title 3",
        "icon" : "icon3.png"
    },
];



listArr.map((item,index) => {
    return (
        <li key={index}>
            <img src={require(`./../../img/${item.icon}`)} alt="" />
            {item.title}
        </li>
    )
})

NPM install -g create-react-app [How to Solve]

When the Mac computer is changed and the react scaffold is downloaded, an error is reported. The error is as follows

the solution is divided into the following steps

    1. sudo NPM uninstall – G create react app// configure the image NPM config set registry before deleting it https://registry.npm.taobao.org //Switch to Taobao image and install sudo cnpm install – G create react app.// download

Then I found it successful ~