TypeScript (1) Type declaration, type inference, union type, interface, function, type assertion, type alias, enumeration

Table of Contents (1) Introduction 1.The difference between JavaScript and TypeScript 2. Advantages of TypeScript (2) Used in vue3 project (3) Type declaration 1.Basic data types (1)string (2) number (3)boolean (4)null and undefined 2. Reference data type (1)Array array (2) Tuple tuple (3)Object object 3.any and void types (1)any (2)void 4. Use typeof to determine […]

C language custom types: unions and enumerations

?Record 1. Union type declaration 2. Characteristics of the consortium 3. Calculation of union 4. Declaration of enumeration type 5. Advantages of enumeration types 6. What are the uses of enumeration types? 1. consortium 1.1 Union type declaration Like a structure, a union is also composed of two or more members, and these members can […]

23-24C++ (48)–Character array, structure, strong enumeration, macro definition + strcpy_s(a, “ABC”) + strlen (a) + typedef

1. Character array Although the string type is more convenient in many aspects of processing strings, it is always at a disadvantage compared to char arrays in terms of calculation speed, and there is no string type in the C language. For subsequent data structure and algorithm courses, as well as hardware development courses, you […]

The use of Java reflection and enumeration

The use of Java reflection and enumeration 1. Java reflection mechanism 1.1 Definition of reflection The concept of reflection: The reflection mechanism means that for any class, all the internal information of the class can be obtained during the running process. And for any object, being able to access and modify all its attributes and […]

Custom types: structure, enumeration, union

Directory: Table of contents: Structure Declaration of structure type self-referencing of structures Definition and initialization of structure variables Structure memory alignment Structure parameter passing Structure implements bit fields (filling of bit fields & portability) enumerate Definition of enumeration type Advantages of enumerations Use of enumerations joint union type definition Features of the union Union size […]

Weekly competition 368 (simulation, suffix decomposition, enumeration + mathematics, preprocessing + partitioned DP)

Article directory Weekly competition 368 [100106. Elements and Minimum Mountain Triplets I](https://leetcode.cn/problems/minimum-sum-of-mountain-triplets-i/) simulation [100114. Elements and Minimum Mountain Triplets II](https://leetcode.cn/problems/minimum-sum-of-mountain-triplets-ii/) prefix and suffix decomposition [100097. Minimum number of groups to create a valid assignment](https://leetcode.cn/problems/minimum-number-of-groups-to-create-a-valid-assignment/) Enumeration + brain twister [6920. Get the minimum number of modifications to K semi-palindromes](https://leetcode.cn/problems/minimum-changes-to-make-k-semi-palindromes/) Preprocessing + Partitioned DP Weekly Competition 368 […]

Input parameter verification custom enumeration

Range input check, the entered value can only be the recommended input value @RangeInputCheck(message = “Field status must be within (1=Java, 2=Python, 3=Go)”, ranges = {“1”, “2”, “3”}) package com.abi.common.constant; import javax.validation.Constraint; import javax.validation.ConstraintValidator; import javax.validation.ConstraintValidatorContext; import javax.validation.Payload; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Objects; import […]

[Python Experimental Design] BMI calculation / Integer division / Monte Carlo approximation of pi / Enumeration method to verify 6174 conjecture / Joseph ring / Rotary lottery / Ability value / Caesar encryption

Table of Contents 1. [Calculate BMI Index] 2. [Input integers to divide] 3. [Monte Carlo method to calculate the approximate value of pi] 4. [Use enumeration method to verify 6174 conjecture] 5. [Simulated counting game (Joseph Ring Problem)] 6. [Simulated Roulette Lottery Game] 7. [Ability Value Accumulation] 8. [Principle and Implementation of Caesar Encryption Algorithm] […]

String constant pool, reflection, enumeration, Lambda

Table of Contents 1. String constant pool 1. Concept 2.Examples 3.intern method 2. Reflection 1. Concept 2. Reflection related classes 3.Related methods in the Class class 4.Reflection example 3. Enumeration 1. Define an enumeration type 2. Common methods of enumeration types 3. Enumeration methods come from inheritance 4.Construction method of enumeration 5. Reflection enumeration type […]

Explanation of structures, enumerations, and unions in C language

Table of Contents 1. Structure 1.1 Structure writing format 1.2 Definition of structure variables 1.3 Structure initialization and access to members 1.4 Structure parameter passing 1.5 Structure memory size calculation 1.6 Structural body position break 1.6.1 How bit breaks allocate space 2. Enumeration 2.1 Value acquisition and assignment of enumerations 2.2 Advantages of enumeration 3. […]