Tag Archives: note

error Expected an assignment or function call and instead saw an expression

error Expected an assignment or function call and instead saw an expression

Why does recursion always report errors and cannot run?

 

Now there are two ways to deal with it

1. Add a return before the expression

res.data.forEach(item =>
          item.attr_vals.length === 0 ?[] : item.attr_vals.split(' ')
        )

2. Remove curly braces  

 res.data.forEach(item => {
          returnitem.attr_vals.length === 0 ?[] : item.attr_vals.split(' ')
            }
        )

 

[Solved] Consul Error: github.com/boltdb/bolt github.com/boltdb/bolt github.com/hashicorp/raft-boltdb

Consumer startup error:

BootstrapExpect is set to 1; this is the same as Bootstrap mode.
bootstrap = true: do not enable unless necessary
==> Starting Consul agent...
           Version: 'v1.5.3'
           Node ID: '63816065-24d9-8715-0986-cb25587fb459'
         Node name: 'node0'
        Datacenter: 'dc1' (Segment: '<all>')
            Server: true (Bootstrap: true)
       Client Addr: [192.168.8.136] (HTTP: 8500, HTTPS: -1, gRPC: -1, DNS: 8600)
      Cluster Addr: 192.168.8.136 (LAN: 8301, WAN: 8302)
           Encrypt: Gossip: false, TLS-Outgoing: false, TLS-Incoming: false, Auto-Encrypt-TLS: false

==> Log data will now stream in as it occurs:

panic: cannot free page 0 or 1: 0

goroutine 1 [running]:
github.com/boltdb/bolt.(*freelist).free(0xc00080f950, 0xbbdd, 0x7f9cd5354000)
	/go/pkg/mod/github.com/boltdb/[email protected]/freelist.go:113 +0x336
github.com/boltdb/bolt.(*Tx).Commit(0xc0001ea7e0, 0x4f2d0f4, 0x4)
	/go/pkg/mod/github.com/boltdb/[email protected]/tx.go:176 +0x1b7
github.com/hashicorp/raft-boltdb.(*BoltStore).initialize(0xc000248660, 0x0, 0x0)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:105 +0x137
github.com/hashicorp/raft-boltdb.New(0xc00017fc80, 0x17, 0x0, 0xc00017fc00, 0x17, 0x0, 0x10e7fb3900)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:81 +0xfe
github.com/hashicorp/raft-boltdb.NewBoltStore(...)
	/go/pkg/mod/github.com/hashicorp/[email protected]/bolt_store.go:60
github.com/hashicorp/consul/agent/consul.(*Server).setupRaft(0xc0006a2380, 0x0, 0x0)
	/home/circleci/project/consul/agent/consul/server.go:627 +0xa36
github.com/hashicorp/consul/agent/consul.NewServerLogger(0xc0006a2000, 0xc0000a0a50, 0xc0006b0680, 0xc0000a0c30, 0x0, 0x0, 0x0)
	/home/circleci/project/consul/agent/consul/server.go:428 +0xafe
github.com/hashicorp/consul/agent.(*Agent).Start(0xc0000b5680, 0x0, 0x0)
	/home/circleci/project/consul/agent/agent.go:411 +0x56e
github.com/hashicorp/consul/command/agent.(*cmd).run(0xc0004e9500, 0xc00004c0e0, 0xa, 0xa, 0x0)
	/home/circleci/project/consul/command/agent/agent.go:280 +0xf5b
github.com/hashicorp/consul/command/agent.(*cmd).Run(0xc0004e9500, 0xc00004c0e0, 0xa, 0xa, 0xc0004e4ca0)
	/home/circleci/project/consul/command/agent/agent.go:75 +0x4d
github.com/mitchellh/cli.(*CLI).Run(0xc0003b3cc0, 0xc0003b3cc0, 0x80, 0xc0004e51e0)
	/go/pkg/mod/github.com/mitchellh/[email protected]/cli.go:255 +0x1f1
main.realMain(0xc000094058)
	/home/circleci/project/consul/main.go:53 +0x393
main.main()
	/home/circleci/project/consul/main.go:20 +0x22

Solution reference: https://github.com/hashicorp/consul/issues/2933

Solution:
find raft. DB on the server where consumer is deployed; Use RM - f to delete all raft. DB ; Restart consumer

The echots in Vue reports an error. After obtaining the DOM element, the chart can be displayed. The console still reports an error

 <div v-if="grade<3" ref="gradeChart" style="height: 220px;width: 300px;margin:0 auto;">




  mounted() {
      this.$nextTick(() => {
				setTimeout(()=>{
					let map1=this.initEchartMap(this.gjfsx);
					console.log(this.$refs.gradeChart,"ddkiiok")
					},50)
      })

 

  The solution is to change V-IF to v-show, and the console will not report an error

 <div v-show="grade<3" ref="gradeChart" style="height: 220px;width: 300px;margin:0 auto;">

Resolve Vue error empty block XXXX

1. Reason for error reporting
under the strict syntax mode of Vue, empty code blocks are not allowed. For example, if (true) {
} how can Vue report this error when the if condition is true
2. The solution is to modify the code logic by itself. The specific modification should be determined according to the specific code, as long as it is ensured that there are no empty code blocks

RuntimeError: Couldn‘t open shared file mapping: <torch_16716_3565374679>, error code: <1455>

Training times error

RuntimeError: Couldn't open shared file mapping: <torch_16716_3565374679>, error code: <1455>

This may be because your graphics card is too old or the computing pressure is too heavy for your graphics card.

Just like multithreading on CUDA tensor, it cannot succeed. There are two methods to choose from:

1. Do not use multithreading. The num of the dataloader_ Set worker to zero.

2. Change to CPU sharing tensor. Ensure that your custom dataset dataset returns the CPU tensor.

  Method 1 is effective

Ubuntu 20.04 GPG: KeyServer receive failed: connection timed out when installing ROS configuration key

GPG: KeyServer receive failed: connection timed out

Solution 1. Change your mobile hotspot

Solution 2 (switching network configuration):

Most of this is a network problem. If the virtual machine uses the bridge mode, it can access the Internet, but it may not be connected to these public networks. At this time, we can configure the network of the virtual machine to NAT mode( Try not to make the bridge mode automatic)

Solution 3 (modify network configuration):

sudo vi /etc/resolv.conf

Options edns0 trust-ad

Solve the asynchronous execution of callback function in Axios request processing interceptor

The Axios request handles the asynchronous execution of the callback function in the interceptor, resulting in the failure to get the token refresh

https.interceptors.request.use(config => {
    if (Determine if the token is expired) {
        let promisefresh = new Promise(function (resolve, reject) {
            WebViewJavascriptBridge.callHandler(
                "getUserInfo",
                {
                    key: "111"
                },
                function (responseData) {
                    removeItem("FToken");
                    setItem("FToken", responseData);
                    config.headers["FToken"] = getItem("FToken"); 
                    config.headers["FAppType"] = "M"; 
                    resolve(config);
                }
            );
        });
        return promisefresh;
    } else {
        config.headers["FToken"] = getItem("FToken"); 
        config.headers["FAppType"] = "M"; 
        return config;
    }
}, function (error) {
    return Promise.reject(error);
});

axios.interceptors.response.use();

[Solved] Ktolin Android Project Compile Error: w: Runtime JAR files in the classpath should have the same version. These file

I haven’t opened the Android project for a while; Open compilation and report an error
w: Runtime JAR files in the classpath should have the same version. These files were found in the classpath:
e: D:/software/Gradle_ workplace/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.5.10/6b84d926e28493be69daf673e40076f89492ef7/kotlin-stdlib-common-1.5.10.jar!/ META-INF/kotlin-stdlib-common.kotlin_ Module: module was compiled with an incompatible version of kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.
insert a picture description here

the final solution is:

add this dependency; Implementation “androidx. Core: core KTX: +”
remove it and you can compile it;

Feeling is conflict; Moreover, this feeling at the beginning of Android x is prone to conflict sometimes. After all, the dependence on the new package name feels unstable. If there is a problem in the future, just lean in this direction;

The boss who knows the problem can also give advice;

Environment:
kotlin version is 1.3.11
JDK is 1.8
gradle is 4.6
Android studio is 4.1.3

[Solved] MinIO Start Error: “WARNING: Console endpoint is listening on a dynamic port…”

Error overview:

WARNING: Console endpoint is listening on a dynamic port (35734), please use --console-address ":PORT" to choose a static port.

The error message is obvious. You need to choose a static port .

I wrote a shell myself to start Minio, and used -- console address' to deploy the Minio IP in the shell: what port do I want to open the Minio console page '

The specific shell is as follows:

nohup ./minio server --address '172.20.10.10:9002' --console-address '172.20.10.10:9001' /home/minio/data &

Note: -- Address' 172.20.10.10:9002 ' is used to specify the Minio interface.

Make complaints about it.

The -- Address , -- console address parameters cannot be seen using mini - H
:

[root@localhost local]# ./minio -h
NAME:
 minio - High Performance Object Storage

DESCRIPTION:
 Build high performance data infrastructure for machine learning, analytics and application data workloads with MinIO

USAGE:
 minio [FLAGS] COMMAND [ARGS...]

COMMANDS:
 server   start object storage server
 gateway  start object storage gateway

FLAGS:
 --certs-dir value, -S value  path to certs directory (default: "/root/.minio/certs")
 --quiet                      disable startup information
 --anonymous                  hide sensitive information from logging
 --json                       output server logs and startup information in json format
 --help, -h                   show help
 --version, -v                print the version

VERSION:
 RELEASE.2021-07-12T02-44-53Z