Assertion An assertion is a logical judgment that checks for something that shouldn’t happen The Assert keyword was introduced in JDK1.4 and can be turned on through the JVM parameter -enableassertions SpringBoot provides the Assert assertion tool class, which is usually used for data validity checking. //Requires parameter object to be non-null (Not Null), otherwise […]
Tag: writing
mybatis handles one-to-many, many-to-one, many-to-many relationships, annotations and xml file writing
Zero, Preface This article is used to study one-to-many, many-to-one, and many-to-many relationships between tables and objects. Two methods of xml file configuration and annotation configuration were studied Super complete~ The entities used for research are students, teachers, courses Note: The relationship between students and teachers should be many-to-many. This article uses many-to-one, that is, […]
[Array method reduce] Details of reduce and simulation rewriting of other array extension methods
Learn key phrases: Array.reduce Array.prototype.reduce reduce method Override reduce method 1. Write in front Many students (referring to myself) have no difficulty in learning other array expansion methods, but when it comes to the reduce method, they will appear stupid, so today I will quickly explain this method clearly. In fact, all array expansion methods […]
[SpringBoot] Handwriting simulates the core process of SpringBoot
Dependency package Create a new project containing two modules: springboot module, representing springboot source code implementation;The user module represents the business system and uses the springboot module; Dependency packages: Spring, SpringMVC, Tomcat, etc., introduce dependencies as follows: <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>5.3.18</version> </dependency> <dependency> <groupId>javax.servlet</groupId> […]
Orange Pi (orangePiZero2) 2: Driver development, writing code to control the level of the IO port
1. View the chip manual Go to the official website to download the chip manual and view the manual. 1. As can be seen from the chip manual, the base address of GPIO (0x0300B000): 2. You can see the PC offset (0x0048) from the chip manual: The address of GPIOx is the GPIO base address […]
Java tool class for reading and writing excel supports multiple Sheets
1. What is POI POI’s full name is PoorObfuscation Implementation. It is an open source project of Apache components that can read and write a series of Microsoft Office office software. The POI version corresponding to the examples in this article is 3.9. 2. Generate Excel tool class package org.zhao.component; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import […]
Use the Function interface in Java 8 to eliminate if…else (a very novel way of writing)
Article directory Function functional interface Supplier supply function Consumer consumption function Runnable no parameter no return function The Function function takes a parameter and returns a value. Supplier, Consumer and Runnable can be regarded as a special form of Function Use tips Handle if that throws an exception Handle if branch operations If a value […]
Use the Function interface in Java 8 to eliminate if…else (a very novel way of writing)
Source: juejin.cn/post /7011435192803917831 Welcome to join Xiaoha’s Planet, you will get: Exclusive project practice/Java learning route/One-on-one questions/Learning check-in/Gift book benefits Currently, I am leading my friends to work on the first project within the planet: Full StackSeparation of front-end and back-end blog, hands-on, back-end + front-end full-stack development, from 0 to 1 Explain the development […]
Writing a Simple Garbage Collector in C
Article directory Make malloc Mark and scan Scan the heap Scan a continuous area Find data segment Find the bottom of the call stack Integrate Writing a simple garbage collector in C (maplant.com) Make malloc Header describes memory block typedef struct header {<!– –> unsigned int size; struct header *next; } header_t; Dynamically allocated memory […]