First, create two files under src to provide the resource files required by the program
(careless programmers should pay attention to the File name, which is in the form of key and value.) the specific code is as follows:
Next, write the code in index.jsp
<%@ page language="java" import="java.ut ...
Posted by riceje7 on Tue, 10 Dec 2019 21:41:20 -0800
The difference between sleep and wait
1.sleep is a Thread method, while wait is an Object method
2. The sleep method object will not release the object lock, but will suspend execution for a specified time, but the monitoring status will remain, and it will run again when the specified time is up
When the wait method is call ...
This Django project is a test case project for learning tests.
Three ways to upload Django files (form, jQuery+jQuery.ajax, native JS + native ajax) are used as the upload function examples
Interpretation of documents
form upload file static page
jQuery+jQuery.ajax upload file ...
Posted by matt_wood87 on Tue, 10 Dec 2019 17:10:56 -0800
This problem seems to know that it is a topological sort. In addition, it should be a legal solution to find the smallest dictionary order, so greedy to find the point with the smallest number with the current entry degree of 0.
Congratulations, you fell into a hole.
In fact, I did this at the beginning. Later, when I ...
Posted by jboku on Tue, 10 Dec 2019 17:08:06 -0800
We know that in the process of Java programming, if external resources (file, database connection, network connection, redis, etc.) are opened, we must manually close these external resources after they are used.
Because the external resources are not managed by the JVM, we can't enjoy the garbage collection mechanism of the JVM. If we don't ma ...
Posted by bladecatcher on Tue, 10 Dec 2019 16:08:38 -0800
Knapsack problem greedy algorithm
[problem description] n items and a backpack are given. The weight of item i is Wi, its value is Vi, and the capacity of backpack is c. How to choose the items in the backpack to maximize the total value of the items in the backpack
·General knapsack problem!
Posted by tomwerner on Tue, 10 Dec 2019 12:30:37 -0800
Paging can be said to be a very common function. Most mainstream databases provide physical paging methods, such as Mysql's limit keyword, Oracle's ROWNUM keyword, etc.; as an ORM framework, Mybatis also provides paging functions. Next, the paging functions of Mybatis are introduced in detail.
1. Introduction to rowb ...
Posted by pankirk on Tue, 10 Dec 2019 11:49:56 -0800
I started to learn Java web programming by writing a servlet, rewriting the service method, configuring the web.xml file, and finally deploying it to tomcat or jetty container and starting it. Later, I used some frameworks, struts 2 spring MVC. Today, I rummaged through the source code of JDK and found that the web service can be created very q ...
Posted by rgermain on Tue, 10 Dec 2019 11:22:09 -0800
Main references https://www.cnblogs.com/00986014w/p/9561901.html This blog post, but he's not using the official image of zookeeper
I use the Zookeeper cluster with three nodes, which can be modified by reference.
##Build Zookeeper cluster
zookeeper-svc.yaml of cluster Service
app: zookeeper ...
Posted by tunage on Tue, 10 Dec 2019 07:43:35 -0800
Memory leak (infamous Bug)
Dynamic request heap space, do not return after use
There is no garbage collection mechanism in C + + language
Pointer cannot control the life cycle of the indicated heap space
Programming experiments: memory leaks
using namespace std;
Posted by kevinc on Tue, 10 Dec 2019 05:29:02 -0800