Category Archives: How to Fix

How to Split numbers and strings in a strings

article directory

    • BB </ li>
    • implementation </ li> </ ul>

    BB

    has a string sent from the front, in the form of letter + English, to get the letter to change color for it, so split. It USES the built-in method of String. When I look back, I see there are 60 or 70 methods in 1.8, so I have to write the String carefully when I have time.

    implementation </ h2>
    </ p>

    code

    //比如字符串为:Fn9527
    String asid = "Fn9527";
    String str = asid.replaceAll("[0-9]","");
    String num = asid.replaceAll("[a-zA-Z","");
    
    //syso
    //syso
    

    </ p>

    result

    Fn
    9527
    

    </ div>

Solve the problem of using in tensoft 2. X tf.contrib.slim No module named appears in the package: tensorflow.contrib problem

introduction

tensorflow2.x has been greatly changed over 1.x to make TensorFlow users more efficient. Where Tf.contrib was abandoned altogether is a major change of 2.x version, but import tensorflow.contrib.slim as Slim as a superior package, has been widely used in many previous versions. Most of the source code is still written based on the TensorFlow1.x version, which makes some modules that have been removed from the 2.x version unusable.

main problem

when running a import tensorflow. Contrib. Slim as slim

: ModuleNotFoundError: No module named 'tensorflow. Contrib false

solution

query existing solutions, most of the use of the reduced version of the method, if you want to use this method can go to the query.
because I don't want to use the method of reducing the version to solve, after searching on github to find out the information
link: tf.contrib.slim is not worked in tensorflow 2.0 what is the alternative for that?.

Tf - slim has a independent of tensorflow mirror to tf.com pat. V1 compatible mode is used, install the package can be

tf-slim is a lightweight library for defining, training, and evaluating complex models in TensorFlow. Tf-slim's components can be freely blended with the native TensorFlow and other frameworks.
here you can find information about Slim: link.

operation

use PIP to download tf-slim

in CMD

pip install --upgrade tf_slim

download:

note when using Slim library:

#import tensorflow.contrib.slim as slim
import tf_slim as slim

where the commented out part is the source code, modified no longer report an error.
(ps: the ability is limited, if there is an error, please point out.

After editing a file with the VIM command in xshell, the ESC key cannot be output,,,

  1. follow online tutorial for ordinary users to add root, entered a vim/etc/sudoers command, the file is edited, but couldn't find how to save and exit the interface
  2. online has said press ESC, and then wq can save, I haven't response, press the ESC only Windows ding-dong prompt
  3. for a long time to see a solution, the last line in the file, directly on the keyboard input (or shift +; These two keys)


4. At this point, you will find that you are ready to enter the command, and the next time you open the file, you will save


reference: https://blog.csdn.net/wy_1997/article/details/83822884

Sync with Gradle for project ‘XXXX‘ failed: Connection timed out: connect

using android studio synchronization project, I could not download gradle-3.5.1. Pom, after analyzing the image of aliyun every time, I failed and went to dl.google.com

of Google
The

result therefore causes the connection to time out

each time

causes this problem because HTTPS causes it, and commenting out HTTPS will solve the problem

file path to be modified: C:\Users\Administrator\.gradle\gradle.properties

systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=1080
#systemProp.https.proxyHost=mirrors.opencas.ac.cn
#systemProp.https.proxyPort=80


Flume profile case (Port listening)

Flume profile case

defines the agent name as a1

source name is r1, if there are more than one, use space spacing

sink name is k1, channel name is c1

a1.sources = r1
a1.sinks = k1
a1.channels = c1
#组名名.属性名=属性值
a1.sources.r1.type=netcat
a1.sources.r1.bind=hadoop102
a1.sources.r1.port=99999

#定义sink
a1.sinks.k1.type=logger

#定义chanel
a1.channels.c1.type=memory
a1.channels.c1.capacity=1000

#连接组件 同一个source可以对接多个channel,一个sink只能从一个channel拿数据!
a1.sources.r1.channels=c1
a1.sinks.k1.channel=c1
		


Solution of “serve with message ‘spawn Vue cli service enoent”

Error running vue:
Error while running task E:\ vue \cistudy-frontend:serve with message ‘spawn’ vue-cli-service ENOENT ‘

The solution is as follows:
re-import the project in the vue visual interface will prompt the lack of “node_modules dependency”. The previous choice was still to import, this time choose to install the node_modules dependency and then import, the installation steps are as follows:

  1. in CMD into the project directory (this is very important!!
  2. execute NPM install
  3. re-import in the visualization panel.

Log search of SQL execution on distributed green plus database master

enter/gpmaster// pg_log gpseg – 1, you can see the listed log list: using the command for a keyword in the log file: 5409626 is the SESSION ID
more gpdb-2020-09-26_000000. CSV |grep 5409526

finally renders the SQL execution LOG containing the session id. The easiest way to find the LOG above is to find the LOG. If there is a better way to find the LOG later, then update it.

Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request p

in the course of using springboot today, Met the Servlet service () for the Servlet [dispatcherServlet] in context with the path [] threw the exception [Request processing failed; nested exception is Java. Lang. NullPointerException] with root cause error, really sad, Write it down.
error reason:
I cited in the service implementation class two resource bundle files, but only write a @ Autowared, so only the first package is automatically injected, and the second package is not injection, So, should be to write a @ Autowared
so my problem is solved!

How to Fix Invalid bound statement (not found) Error

there have been many articles on the Internet explaining the possible reasons for this error, nothing more than the following:
1. Java method does not exist in mapper.xml, and then the method of executing Mapper will report the
. The return value of xxxmapper.java method is List, while the select element does not correctly configure ResultMap, or only configure ResultType
4. If you confirm that there is no problem above, please modify the corresponding XML file, such as deleting a blank line, save. 5. See if the XML configuration path of mapper is correct

error 2 treatment.

maven default would make all configuration files under the SRC/main/resources and SRC/main/Java under all the Java files packaged or published to the target \ classes here, but the reality we may under the SRC/main/Java also placed some configuration files such as hibernate configuration file or mybatis mapper configuration files, etc., if you don’t do some additional configuration, after that our packaging projects may find these must be a resource file, So add a configuration like the following to the POM.xml so that the XML file under SRC /main/ Java is copied to the corresponding class directory along with the Java compiled class file.

<build>    
<resources>       
<resource>            
<directory>src/main/java</directory>            
<includes>               
<include>**/*.properties</include>
<include>**/*.xml</include>                           
</includes>            
<filtering>false</filtering>        
</resource>   
</resources>
</build>