Struts 2 internationalization - Chinese English conversion

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

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 ...

Posted by Bac on Tue, 10 Dec 2019 20:28:20 -0800

AJAX and from upload file example [django project]

Project brief 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 file Interpretation of documents form_upload.html form upload file static page jquery_ajax_upload.html jQuery+jQuery.ajax upload file ...

Posted by matt_wood87 on Tue, 10 Dec 2019 17:10:56 -0800

Luogu P3243 [HNOI2015] cuisine making

Title gate 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

Use try with resources to close resources gracefully

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 (Java implementation) - greedy algorithm

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 [problem analysis] ·General knapsack problem! Optim ...

Posted by tomwerner on Tue, 10 Dec 2019 12:30:37 -0800

Mybatis paging

Preface 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. RowBounds page 1. Introduction to rowb ...

Posted by pankirk on Tue, 10 Dec 2019 11:49:56 -0800

com.sun.net.httpserver create web Service

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

Kubernetes builds Zookeeper and Kafka clusters

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 apiVersion: v1 kind: Service metadata: labels: app: zookeeper ...

Posted by tunage on Tue, 10 Dec 2019 07:43:35 -0800

[C + +] 37 μ intelligent pointer analysis

Eternal topic 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 #include <iostream> #include <string> using namespace std; class Test { ...

Posted by kevinc on Tue, 10 Dec 2019 05:29:02 -0800