Transfer: http://www.cnblogs.com/waterystone/p/4920797.html
First, an overview
When it comes to concurrency, you have to talk about ReentrantLock; when it comes to ReentrantLock, you have to talk about AbstractQueued Synchronizer (AQS)!
Class is its name.Abstract queue synchronizer,AQSA set of definitions is defined.Multithreaded access to shared resourcesSynchronizer framework,Many synchronous class implementations rely on it.,Such as commonly used ReentrantLock/Semaphore/CountDownLatch…。
What is thread synchronization?:Thread synchronization refers to multi...
After we train the model with keras, we usually save the model format type as hdf5, that is. H5 file.
But if we want to migrate to the mobile end, especially the one supported by tensorflow, we need to convert it to tflite.
How to convert? In tensorflow1.9 and above versions, it is convenient to convert by command line.
tflite_convert --output_file=/home/yourname/Documents/tensorflow/images/500pics2/model/my_model.tflite --keras_model_file=/home/yourname/Documents/tensorflow/images/500pics2/model/my_model.h5
Other options are available at https://github.com/tensorflow/tensorflow/blob/master...
My computer has several versions of jdk, JDK1.6 and jdk1.8, but my environment variables are set to jdk1.6. However, opening CMD to see Java version shows 1.8, which makes me puzzled. Later, problems were discovered.
Problem: under the path variable, JDK1.8 automatically generates variables for us, covering 1.7 of the original version.
Solution: 1. remove the C:\ProgramData\Oracle\Java\javapath in the path variable.
2.Move the%JAVA_HOME%/bin in the environment variable Path to the front end.
At this time, the Java -version again in CMD will display the information o...
> environment: centos7
ningx version: nginx-1.8.0.tar.gz”
decompression source package to/usr/local > otherwisenginx can not start.
10.cd /usr/local/nginx/sbin
11../nginx Viewnginx start?
After a long time, I finally remembered that I had not finished writing here.
Let’s write a simple piece of the sklearn library today, including data set calls, clustering, contour coefficients, and so on.
Data set function Chinese translation Task type Data scale load_boston BostonHouse price regression 506*13 fetch_california_housing Housing in California regression 20640*9 load_diabetes Diabetes regression 442*10 load_digits Handwriting classification 1797*64 load_breast_cancer Mammary cancer Classification and clustering (357+212)*30 load_iris Iris Classification and clustering (50*...
PyCharm is a powerful Python IDE, and PEP 8 alerts are also useful, but the function name can’t contain capital letters and a few other specifications really feel bad, as a Virgo obsessive compulsive disorderPatients, the wave line below the code is absolutely not allowed to exist.
File -> Settings -> Editor -> Inspections -> right side Python”
PEP 8 naming convention violation alarm ID view”https://pypi.org/project/pep8-naming/
code
sample message
N801
class names should use CapWords Convention”
N802
function name should be lower...
Backup data
Archiving of output directory format
Backup in this way can avoid the restriction of the operating system to the size of a single file.
pg_dump.exe -U postgres -F d -f E:\mydbbak mydb
After the backup is completed, a backup folder will be generated.
tarFormat archiving (no parallel recovery is supported when recovering with pg_resotre)
pg_dump.exe -U postgres -F t mydb > mydb.tar
Generate SQL script
pg_dump.exe -U postgres -F p mydb > mydb.sql
Generate custom format archive
pg_dump.exe -U postgres -F c mydb > mydb.bin
Apart from S...
▄︻┻┳═One Agenda:
▄︻┻┳═1. (1/7) [code tidiness] do you really use enumerations? No!
▄︻┻┳═The method parameters of the (2/7) enumeration error usage
▄︻┻┳═One (3/7) enumeration error method parameter (two)
▄︻┻┳═Method (4/7) enumerated error usage method return value
▄︻┻┳═One (5/7) enumerate the wrong usage of the method inside the body.
▄︻┻┳═The branch judgment of the wrong usage of (6/7) enumeration
▄︻┻┳═(7/7) enumerate the definition of data type by enumeration.
Continue to talk about the use of enumeration....