Two languages implement design patterns (C + + and Java) (12: combination pattern)

Composition mode, which combines objects into attribute structure to represent the "part whole" hierarchy. The combination mode makes the use of single object and combination object consistent. Its UML diagram is as follows: The main solution: in our tree structure problem, it blurs the concept of simple elements and complex eleme ...

Added by Tyco on Fri, 25 Oct 2019 19:25:31 +0300

After summarizing 11 items, my understanding of Python decorators

As you know, @ symbol is the syntax sugar of decorator, and the function behind @ symbol is the protagonist of our article: decorator. The decorator is placed at the beginning of a function definition, and it's like a hat on the function's head. Bind to this function. When we call this function, the first thing is not to execute this function, ...

Added by noppie on Fri, 25 Oct 2019 16:51:17 +0300

Spring Boot 2.X: Custom registration Servlet, Filter, Listener

Preface The web.xml file has been removed from Spring Boot. If you need to register and add Servlet, Filter and Listener as Spring Bean, there are two ways in Spring Boot: Annotation @ WebServlet, @ WebFilter, @Listener Used to configure. Spring Boot JavaConfig annotation is used to configure the Bean. Before registration When using Servlet, ...

Added by andrewtayloruk on Fri, 25 Oct 2019 03:58:18 +0300

In depth study of Redis, analysis of basic types [Hash]

More wonderful articles, pay attention to the public account [tobetopjava Er], more tens of thousands of excellent vip resources for free waiting for you to take!!! Next, we will analyze the basic type of Hash. I'm sure you are familiar with Hash. Next, we will go deep into the source code to analyze the implementation of Hash in Redis. First ...

Added by sullyman on Tue, 22 Oct 2019 14:02:43 +0300

Learn ES6 again and mix with the unfinished version that will be returned sooner or later

This blog series is a summary of the usage of ES6 basic grammar. If there are any mistakes, please correct them.The third part mainly includes the for of cycle. for of cycle Several ways of circulation Normal for loop for(let i=0;i<arr.length;i++){ //content } forEach cycle 1. Use of foreach format arr.forEach(function (element,index,a ...

Added by Andy17 on Mon, 21 Oct 2019 15:10:20 +0300

What's new in C × 8.0

01. Readonly member The readonly modifier can be applied to any member of a structure, indicating that the member does not modify the state. This is finer than applying the readonly modifier to a struct declaration. public struct Point { public double X { get; set; } public double Y { get; set; } public double Distance = ...

Added by Stryks on Mon, 21 Oct 2019 08:44:19 +0300

Class decorator

In python, everything is an object, function and class are an object, so decorators can be applied to functions, and they should also be applied to classes. #Function decorator example def deco(func): print("====,Decorator operation") return func @deco # Foo = deco(test) def test(): print ...

Added by techwiz on Sun, 20 Oct 2019 23:18:05 +0300

Spring Boot 2 + Thymeleaf: form field binding, form submission processing

Some usage of Thymeleaf in Spring Boot for form processing:(1) use th:field attribute: to bind form fields(2) using ids object: generally used for the use of lable with radio or checkbox(3) form submission Development environment: IntelliJ idea February 2, 2019Spring Boot version: 2.1.8 Create a new Spring Boot project named demo.pom.xml depe ...

Added by teongkia on Sun, 20 Oct 2019 21:57:16 +0300

Day13 httpServlet and java inheritance

I. httpServlet 1. guide pack //Find the package by searching Maven servlet (class name) to pom.xml import package <dependencies> <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java --> <dependency> <groupId>mysql</groupId> <artifactId>mysq ...

Added by hstraf on Sat, 19 Oct 2019 22:48:31 +0300

Cookie overview and application of Java Web

What is Cookie Cookie technology is a solution to keep session tracking on the client side. II. Creation of Cookie object Cookies can be created through the constructor of the javax.servlet.http.Cookie class. Cookie cookie = new Cookie("username","Hum's blog"); The first parameter specifies the proper ...

Added by orlandinho on Sat, 19 Oct 2019 21:21:47 +0300