Category Archives: How to Fix

How to increase the effect of onchange event after adding readonly attribute to input tag and display time of laydate plug-in

Trial and error: It is not possible to bind the onChange event to the input tag directly in HTML and JS.
Reason: ReadOnly is read-only, and onChange events respond to value changes. However, the actual onChange event is only valid for the interface input value. Modified values through DOM objects are invalid.
Use onblur instead. Onblur events are triggered when an object loses focus. The measured effect can occasionally start, occasionally fail.
Solution 2: Given that the input box renders the event with layDate, in the done function on layDate, assign the input box to the selected value that needs to be executed during the execution of the onChange event.
Solution # 2 Perfect the problem.
Note: When searching the web, be careful to combine your own scene. For example, the input box has been rendered with laydate, which is equivalent to an event. Therefore, we should consider whether we can achieve our requirements in this event.
 
 

Enum type and set type of MySQL

Enumeration type and collection type of MySQL
CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE CREATE TABLE

create table consumer(
    id int,
    name char(16),
    sex enum('male','female','other'),
    level enum('vip1','vip2','vip3'),
    hobbies set('play','music','read','run')
)

Enumeration here means that you can select only one from here, and set means that you can select more than one from set.
Input insert statement

insert into consumer values(1,'egon','male','vip2','music,read')

And you might be wondering, what happens if I put multiple entries in the corresponding enum?

insert into consumer values(2,'eg','male','vip1,vip2','music,read')


ah

Invalid chrome console

When debugging using the console, console.log(" Hello word!" ) does not print.
I’m beginning to doubt myself…
Several circumstances
Default Default Default levels

Insert into / delete / update / select of SQL Server database table

Score
Id = int, primary key, StuName Subject Result

2>r> 3
5
.> … … …
Add a score: Name StuName is Lei Wang, Subject is Java programming, Result is 92
Insert into score(StuName,Subject,Result) Values(‘ StuName ‘, ‘Java programming’,92);
2. Delete the score information of Chinese subject
Delete from score where subject = ‘Chinese’;
Change student’s StuName to 76
Update Score Set Result= 76 Where Stuname = ‘Stuname’
Select * from user where Score> 80
Select * From Score Where Result > = 80;

@Autowired injection * * required a single bean, but 2 were found**

why
The StringRedistemplate object is injected into the project as follows:

@Autowired
private StringRedisTemplate redisTemplate;

Then it says an error:

Field redisTemplate in com.xxx.api.controller.XxxController required a single bean, but 2 were found:
  - getRedisTemplate: defined by method 'getRedisTemplate' in class path resource [com/xxx/config/RedisConfig.class]
  - stringRedisTemplate: defined by method 'stringRedisTemplate' in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration$RedisConfiguration.class]

@Autowired is either injected by type or declared @Qualifier(” beanID “), which has nothing to do with the field name I defined as redisTemplate. Other
but the project is so written, nor the @ the Qualifier is not an error (and I didn’t complain before use), the only difference is the field name is different, other places are stringRedisTemplate, I changed, really good. This is clearly a metaphysical operation, if you follow the previous interpretation of @Autowired.
why

@Autowired annotation injection rule:

after some code tests, the Autowired default by Type, if the same Type to find multiple beans, then, and according to the Name way comparison, if there are more than one, then an exception is reported.

According to the error prompt: StringRedisTemplate this type of bean in container pool has two redisTemplate, StringRedisTemplate (our own projects, configured with a spring boot automatically configure also give I added a)
I defined the field name is redisTemplate: no, just the StringRedisTemplate is some, so there is no problem!
To solve
There are many solutions:

    field is modified for StringRedistemPlate to specify the injected bean using @Qualifier. In some cases, add @primary [not recommended]
the conflicting bean
END
I had memorized the infusion process deeply until I came across it. Some items in the notes didn’t impress me as being important, and I kept a summary in mind, yet I couldn’t discover its significance until I encountered the problem.

Error response from daemon: Conflict: unable to delete 8598c91556dc (must be forced)

>

docker rmi $(docker images | grep "none" | awk '{print $3}')

:
ror response from daemon: conflict: Unable to delete 8598c91556DC (must be forced) – image is being used by stopped container 8f10ef9b804f
Because mirroring is used by a container, you need to delete the container first, and then execute the delete command

docker rm 8f10ef9b804f

docker rmi $(docker images | grep "none" | awk '{print $3}')

Docker 19.03 for July 2019 has been officially released, and for me there are two highlights of this release.
1, is the docker don’t need root access to start drinking run
2, is to support the GPU enhancements, we want to read in the docker nvidia graphics card no longer need extra install nvidia – docker
Verify GPU options:
docker run –help | grep -i gpus
Docker calls the GPU command:
docker run -it –rm –gpus all ubuntu /bin/bash
The training model
parameter — GPUS ID must be present, otherwise the GPU will not be used. ID refers to which GPU is used for training, and it refers to binding the container to the specified GPU for running
 
Refer to the blog: https://blog.csdn.net/byaa34616/article/details/100951724

Several ways to center elements horizontally and vertically

Six ways:
Absolute plus margin solution fixed plus margin solution display:table solution line-height solution flex layout solution transform unknown element width and height solution


Absolute + margin scheme

    div{
        position: absolute;
        width: 100px;
        height: 100px;
        left: 50%;
        top: 50%:
        margin-top: -50px;
        margin-left: -50px;
    }

Fixed plus margin scheme

    div{
        position: fixed;
        width: 100px;
        height: 100px;
        top: 0;
        right:0;
        left: 0;
        bottom: 0;
        margin: auto;
    }

Display: table scheme

    div{
        display: table-cell;
        vertical-align: middle;
        text-align: center;
        width: 100px;
        height: 100px;
    }

The line-height scheme for the inline element

    div{
        text-align: center;
        line-height: 100px;
    }

Flex Flexible Layout Solution

    div{
        display: flex;
        align-items: center;
        justify-content:center
    }

Transform unknown element width and height solution

    div{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%)
    }

Hive view execution plan

explain select deptno `dept`,
       year(hiredate) `year`,
       sum(sal)
from tb_emp
group by deptno, year(hiredate);

1. There are several stages
So let’s say we have two of them in this case

+------------------------------------+
|Explain                             |
+------------------------------------+
|STAGE DEPENDENCIES:                 |
|  Stage-1 is a root stage           |
|  Stage-0 depends on stages: Stage-1|
+------------------------------------+

Stage 0 is dependent on stage1, which means stage1 is executed first, then stage 0
1 View the Map phase of stage1
You can see that the Map phase is mostly done
Table Scanning The table data volume is statistically retrieved by the Expressions block

+-------------------------------------------------------------------------------------------------+
|Explain                                                                                          |
+-------------------------------------------------------------------------------------------------+
|    Map Reduce                                                                                   |
|      Map Operator Tree:                                                                         |
|          TableScan                                                                              |
|            alias: tb_emp                                                                        |
|            Statistics: Num rows: 6 Data size: 718 Basic stats: COMPLETE Column stats: NONE      |
|            Select Operator                                                                      |
|              expressions: deptno (type: int), year(hiredate) (type: int), sal (type: float)     |
|              outputColumnNames: _col0, _col1, _col2                                             |
|              Statistics: Num rows: 6 Data size: 718 Basic stats: COMPLETE Column stats: NONE    |
|              Group By Operator                                                                  |
|                aggregations: sum(_col2)                                                         |
|                keys: _col0 (type: int), _col1 (type: int)                                       |
|                mode: hash                                                                       |
|                outputColumnNames: _col0, _col1, _col2                                           |
|                Statistics: Num rows: 6 Data size: 718 Basic stats: COMPLETE Column stats: NONE  |
|                Reduce Output Operator                                                           |
|                  key expressions: _col0 (type: int), _col1 (type: int)                          |
|                  sort order: ++                                                                 |
|                  Map-reduce partition columns: _col0 (type: int), _col1 (type: int)             |
|                  Statistics: Num rows: 6 Data size: 718 Basic stats: COMPLETE Column stats: NONE|
|                  value expressions: _col2 (type: double)                                        |
+-------------------------------------------------------------------------------------------------+

3. Look at the Reduce phase
Determine input and output formats

+-------------------------------------------------------------------------------------------+
|Explain                                                                                    |
+-------------------------------------------------------------------------------------------+
|      Reduce Operator Tree:                                                                |
|        Group By Operator                                                                  |
|          aggregations: sum(VALUE._col0)                                                   |
|          keys: KEY._col0 (type: int), KEY._col1 (type: int)                               |
|          mode: mergepartial                                                               |
|          outputColumnNames: _col0, _col1, _col2                                           |
|          Statistics: Num rows: 3 Data size: 359 Basic stats: COMPLETE Column stats: NONE  |
|          File Output Operator                                                             |
|            compressed: false                                                              |
|            Statistics: Num rows: 3 Data size: 359 Basic stats: COMPLETE Column stats: NONE|
|            table:                                                                         |
|                input format: org.apache.hadoop.mapred.SequenceFileInputFormat             |
|                output format: org.apache.hadoop.hive.ql.io.HiveSequenceFileOutputFormat   |
|                serde: org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe                  |
+-------------------------------------------------------------------------------------------+

reference
Hive Experiment 5: Check out the HQL execution plan and key steps in _HeroicPoem column -CSDN blog _Hive View the execution plan
LanguageManual Explain – Apache Hive – Apache Software Foundation

Solve the problem of failure in installation of golang plug-in dependency in vscode

Solved the Golang plugin dependency installation failure issue in VS Code
Vscode installed in ms - vscode. Go after plugins can open support for the language, the ms - vscode. Go plugins need to rely on some tools, prompt after the installation is complete


Installing github.com/nsf/gocode SUCCEEDED
Installing github.com/uudashr/gopkgs/cmd/gopkgs SUCCEEDED
Installing github.com/ramya-rao-a/go-outline FAILED
Installing github.com/acroca/go-symbols FAILED
Installing golang.org/x/tools/cmd/guru FAILED
Installing golang.org/x/tools/cmd/gorename FAILED
Installing github.com/fatih/gomodifytags SUCCEEDED
Installing github.com/haya14busa/goplay/cmd/goplay SUCCEEDED
Installing github.com/josharian/impl FAILED
Installing github.com/rogpeppe/godef SUCCEEDED
Installing sourcegraph.com/sqs/goreturns FAILED
Installing golang.org/x/lint/golint FAILED
Installing github.com/cweill/gotests/... FAILED
Installing github.com/derekparker/delve/cmd/dlv SUCCEEDED

8 tools failed to install.

Due to network problems, some dependent tools cannot be installed properly, so manual installation is required.
Here are the steps for manually installing the tool:
GOPATH

    in % % \ SRC \ directory and establish a path \ x golang.org into GOPATH%\src\golang.org % \ x , download tools, source code git clone https://github.com/golang/tools.git tools after the completion of the clone, A Tools folder will be generated so that the source code for the tool is ready to execute under % goPath %

        go install github.com/ramya-rao-a/go-outline
    
        go install github.com/acroca/go-symbols
    
        go install golang.org/x/tools/cmd/guru
    
        go install golang.org/x/tools/cmd/gorename
    
        go install github.com/rogpeppe/godef
    
        go install github.com/sqs/goreturns
    
        go install github.com/cweill/gotests/gotests
    
    

    Separate processing golint golint source is located in the https://github.com/golang/lint , enter GOPATH%\src\golang.org % \ x after the execution of git clone https://github.com/golang/lint download golint GOPATH need source code to the % % , the execution of go install github.com/golang/lint/golint
    This completes the installation of the tools on which VS Code's Golang plug-in depends.

Configuring common environment variables in Windows

The article directories
1, JDK 2, Maven 3, Gradle 4

A, the JDK
Two environment variables JAVA_HOME and CLASSPATH need to be configured:

va_home =D:\programs\jdk1.8 p>
%java_home % \>; %JAVA_HOME%\jre\bin; add classpath:
code> c>path =.; %JAVA_HOME%\lib\dt.jar; %JAVA_HOME% lib\tools.jar

Use java-version and javac-version determine if the creation was successful
Second, the maven
Increase MAVEN_HOME:
MAVEN_HOME = D: \ apache maven - 3.3.9
in the Path to increase again:
% MAVEN_HOME % \ bin
mvn-v
Third, gradle
Increase the GRADLE_HOME = D: \ gradle - 6.7.1
in the path to increase again:
% GRADLE_HOME % \ bin
gradle-v / code>
Four,