21. The data types of mysql database are different between numerical and double.
numberic can only express fixed-point numbers with a maximum precision of 65 digits
while double can describe that the allowed values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0 and 2.2250738585072014E-3 08 to 1.7976931348623157E+ 308
Although the number of decimal places can be longer, the range of values expressed is far less than that of double.
These are the differences.
Don’t just consider the accuracy, but also consider the value range.
The other one is fixed point and the other is floating point, and the computing time efficiency is also different.
Refer to netizens’ answers.
22. Is it necessary to use code blocks in the code.
method a(){
Readability has deteriorated.
See that Boos uses code blocks in some places, which improves the readability of the code.
What’s confusing is that I have never used code blocks. I prefer to add a line of comments at the head of different code blocks to briefly describe the core logic of a piece of code.
23. Password security issues.Password encryption for form input, security controls, https, symmetric encryption is used during the transmission process,
An interface for verifying passwords is added inside the program, so that "programmers don't know the actual password."
Based on simple considerations, there was no way to deal with it in the early stage.
24. Errors often occur when comparing funds, interest, etc. with Double.
My personal idea is that the funds are reserved to the next "grain" of the cent, which is more accurate in the case of rounding, or only rounding.
Double subtraction is not directly compared with 0, but the absolute value is subtracted and compared with the target error, such as 0.001.
25.VIM sets the line number.
Modify /etc/vimrc and add a line of configuration "set nu".
In this way, the line number will be displayed every time the file is opened.
However, I found another problem. With the line number, I chose to copy it directly with the line number. After pasting, I still need to manually delete the line number. Damn.
26. There have been too many p2p platforms recently, and government departments and third-party payment are more worried.Alipay and Tenpay have stopped providing third-party payment services to unknown p2p platforms.
A friend is helping someone develop a p2p system. The third-party payment aspect is stuck. He can only find a third-party payment company that provides services.
Otherwise, the system developed for customers will not be sold and the money will not be received. I heard that Guofubao can still be connected, which is not bad. It may be of Guofubao level. There are not many customers, and it is not yet to the point of selecting customers.
I don’t know if this is a good thing or a bad thing.
27.SpringMVC form validation.It is said online that Spring also has a set of validation components, spring-modules-validation.jar; I have never used it.
In the company’s project, Hibernate’s Validator is used. My personal impression of Hibernate is that it is relatively large and bulky.
I still prefer Jodd’s vtor verification component. http://jodd.org/doc/vtor/index.html
The jar package is very small and needs practice.
28.Mybatis configuration file.ChargeLogSummaryDao.xml
In order to be lazy, I directly copied and then modified it. As a result, only part of the content was modified, and the namespace was not modified. As a result, when the project is started, it is always prompted that ChargeLogDao.add already exists.
After searching for a long time, I found the cause of the problem by searching for "ChargeLog".
29. Whether the Nginx configuration file test is correct.nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successfulnginx -s reload, reload Syntax errors may occur during the process, check it first, it is more reliable~
30. Cache has 2 sets of implementations.Cache defines the cache interface. The bottom layer can be Redis and Memcache. This is the choice of the underlying technology.
However, it should be noted that the same Redis implementation can have different business aspects.
For example, the requirements for login and session-related businesses are different from buffering ordinary object data. User login data is even more critical.
According to Boss’s experience, when the amount of data is too large, the oldest cached data may be overwritten.
For ordinary business data, it is completely acceptable.
However, for Session data, this is not possible, which will cause the logged-in user to suddenly disconnect.
The above introduces the problems encountered at work in 2015: 21-30 (these 10 questions are very valuable), including aspects of the content, I hope it will be helpful to friends who are interested in PHP tutorials.