### Kotlin Hello World Program Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w A simple 'Hello, World!' program written in Kotlin. This serves as a basic example to test the development environment setup. ```kotlin fun main() { println("Hello, World!") } ``` -------------------------------- ### Verify Kotlin Installation Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Confirms that the Kotlin compiler is installed and shows its version. This command is run in the command prompt or terminal after setting up the Kotlin environment. ```sh kotlinc -version ``` -------------------------------- ### Kotlin 变量进行算术运算 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 演示了变量可以参与算术运算,并将结果重新赋值给变量。 ```kotlin fun main() { var a = 9 //a初始值为9 a = a + 1 //a = a + 1也就是将a+1的结果赋值给a,跟数学是一样的,很好理解对吧 println(a) //最后得到的结果就是10了 } ``` -------------------------------- ### Kotlin 变量值赋给另一个变量 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 展示了如何将一个变量的值赋给另一个变量。 ```kotlin fun main() { var a = 10 var b = a //直接让b等于a,那么a的值就会给到b println(b) //这里输出的就是10了 } ``` -------------------------------- ### Verify Java Installation Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Checks if the Java Development Kit (JDK) is installed and displays its version. This command is executed in the command prompt or terminal. ```sh java -version ``` -------------------------------- ### Kotlin 修改变量值 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 演示了变量的值可以在程序执行过程中被修改。 ```kotlin fun main() { var a = 666 a = 777 println(a) //这里打印得到的就是777 } ``` -------------------------------- ### Kotlin 变量类型推断 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 展示了 Kotlin 编译器如何根据初始值自动推断变量的类型,从而可以省略显式类型声明。 ```kotlin fun main() { var a = 10 } ``` -------------------------------- ### Kotlin 打印变量值 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 展示了如何使用 `println` 函数将变量的值输出到控制台。 ```kotlin fun main() { var a = 10 println(a) } ``` -------------------------------- ### Kotlin 变量延迟赋值 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 演示了先声明变量,稍后再为其赋值的用法。 ```kotlin fun main() { var a : Int a = 10 } ``` -------------------------------- ### Basic HTML5 Page Structure Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c A minimal HTML5 document structure that includes essential meta tags, a title, and a body containing a 'Hello World' message. This serves as a starting point for creating web pages and can be rendered in any web browser. ```html Title
Hello World
``` -------------------------------- ### Configure In-Memory UserDetailsService Source: https://www.itbaima.cn/zh-CN/document/63v73g0zh1qlr6fk Sets up a basic UserDetailsService with in-memory users, defining usernames, passwords, and roles. This is a starting point for authentication. ```java @Configuration @EnableWebSecurity public class SecurityConfiguration { @Bean //UserDetailsService就是获取用户信息的服务 public UserDetailsService userDetailsService() { //每一个UserDetails就代表一个用户信息,其中包含用户的用户名和密码以及角色 UserDetails user = User.withDefaultPasswordEncoder() .username("user") .password("password") .roles("USER") //角色目前我们不需要关心,随便写就行,后面会专门讲解 .build(); UserDetails admin = User.withDefaultPasswordEncoder() .username("admin") .password("password") .roles("ADMIN", "USER") .build(); return new InMemoryUserDetailsManager(user, admin); //创建一个基于内存的用户信息管理器作为UserDetailsService } } ``` -------------------------------- ### Kotlin 变量声明与初始化 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 演示了如何声明一个整数类型(Int)的变量并为其赋初值。 ```kotlin fun main() { var a : Int = 10 } ``` -------------------------------- ### Starting Tomcat Server Source: https://www.itbaima.cn/zh-CN/document/ycpagby2v7j4p728 Executes the startup script for the Tomcat server. This command is typically run from the Tomcat installation's `bin` directory in a command prompt or terminal. ```shell startup.sh ``` -------------------------------- ### Kotlin Basic Hello World Program Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Demonstrates the simplest Kotlin program structure, printing 'Hello World!' to the console. Highlights the `main` function as the entry point and the `println` function for output. Emphasizes case sensitivity and the need for correct syntax. ```kotlin fun main() { println("Hello World!") } ``` -------------------------------- ### Kotlin 变量声明语法 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 展示了在 Kotlin 中声明一个变量的基本语法结构,包括变量名称和数据类型。 ```kotlin var [变量名称] : [数据类型] ``` -------------------------------- ### HTML Meta Tags for Keywords and Description Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Provides examples of `` tags used for SEO purposes, including setting keywords and descriptions for search engines. These tags help define how a page is represented in search results. ```html ``` -------------------------------- ### Configure and Install Make Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i Commands to configure and install the Make utility, followed by a version check to confirm the installation. ```sh bash configure sudo make install ``` ```sh nagocoler@ubuntu-server:~/make-3.81$ make -verison GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ``` -------------------------------- ### HTML Body Section Content Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows a simple example of content placed within the `` tag, which is rendered by the browser as the visible part of the web page. ```html
Hello World
``` -------------------------------- ### Kotlin Multiple Print Statements Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Shows how to execute multiple `println` statements sequentially to output different lines of text to the console. Illustrates the execution flow from top to bottom within the `main` function. ```kotlin fun main() { println("Hello World!") println("KFC vivo 50") } ``` -------------------------------- ### Compile Kotlin Program to JAR Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Compiles a Kotlin source file (`Main.kt`) into an executable JAR file (`Main.jar`), including the Kotlin runtime dependencies. This command is executed in the terminal. ```sh kotlinc Main.kt -include-runtime -d Main.jar ``` -------------------------------- ### Kotlin 常量声明与使用 Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w 展示了如何使用 `val` 关键字声明一个常量,并说明常量的值一旦赋值后不可修改。 ```kotlin fun main() { val a = 666 //使用val关键字,表示这是一个常量 // a = 777; //常量的值不允许发生修改,此行会编译报错 } ``` ```kotlin fun main() { val a: Int a = 777; // 再次赋值会报错 // a = 888; } ``` -------------------------------- ### Run Kotlin Program JAR Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Executes the compiled Kotlin program packaged as a JAR file. This command is used to run the `Main.jar` file created after compilation. ```sh java -jar Main.jar ``` -------------------------------- ### Kotlin Single-Line Comment Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Demonstrates the use of single-line comments in Kotlin, initiated with `//`. Any text following `//` on the same line is ignored by the compiler and serves as an explanation for human readers. ```kotlin // This is a single-line comment fun main() { println("Hello World!") // This comment is at the end of a line } ``` -------------------------------- ### Controller Endpoints Source: https://www.itbaima.cn/zh-CN/document/63v73g0zh1qlr6fk Example controller with a root endpoint and a POST endpoint for payment processing. Spring Security handles access control for these endpoints. ```java @Controller public class HelloController { //现在所有接口不需要任何验证了,因为Security已经帮我们做了,没登录是根本进不来的 @GetMapping("/") public String index(){ return "index"; } @ResponseBody @PostMapping("/pay") public JSONObject pay(@RequestParam String account){ JSONObject object = new JSONObject(); System.out.println("转账给"+account+"成功,交易已完成!"); object.put("success", true); return object; } } ``` -------------------------------- ### Spring Security Web Initializer Setup Source: https://www.itbaima.cn/zh-CN/document/u8ekxxucowr2b1tm Sets up Spring Security filters automatically by extending AbstractSecurityWebApplicationInitializer. No explicit methods need to be overridden for basic filter registration. ```java public class SecurityInitializer extends AbstractSecurityWebApplicationInitializer { //不用重写任何内容 //这里实际上会自动注册一个Filter,SpringSecurity底层就是依靠N个过滤器实现的,我们之后再探讨 } ``` -------------------------------- ### Gradle Build File Configuration (Kotlin) Source: https://www.itbaima.cn/zh-CN/document/3at7ybv04dmjc0wp Configures project settings, plugins, repositories, dependencies, and tasks. This example shows a typical setup for a Java project using JUnit. ```kotlin plugins { id("java") } group = "cn.itbaima" version = "1.0-SNAPSHOT" repositories { mavenCentral() } dependencies { testImplementation(platform("org.junit:junit-bom:5.9.1")) testImplementation("org.junit.jupiter:junit-jupiter") } tasks.test { useJUnitPlatform() } ``` -------------------------------- ### Basic HTML Structure with Text Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates the fundamental structure of an HTML document and how plain text is rendered within the `` tag. It shows the basic DOCTYPE, html, head, and body elements. ```html 你干嘛哎哟 啊真的是你鸭 ``` -------------------------------- ### HTML Line Break Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates the use of the `
` tag, which is a single tag that inserts a line break. It forces the subsequent content to start on the next line. ```html 我是第一行
我是第二行 ``` -------------------------------- ### Kotlin Documentation Comment Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Explains the use of documentation comments (`/** */`) in Kotlin, which are specifically designed for generating API documentation. These comments can include structured information like author, version, and detailed descriptions, often used by tools like KDoc. ```kotlin /** * This is a documentation comment for the main function. * It explains the program's purpose. * @author Your Name * @since 2023-07-29 */ fun main() { println("Hello World!") } ``` -------------------------------- ### YAML Configuration Syntax Example Source: https://www.itbaima.cn/zh-CN/document/e43gl1ilygps032v Provides an example of the YAML configuration file format, highlighting its hierarchical structure using indentation and key-value pairs. YAML is an alternative to the properties file format for Spring Boot configuration. ```yaml 一级目录: 二级目录: 三级目录1: 值 三级目录2: 值 三级目录List: - 元素1 - 元素2 - 元素3 ``` -------------------------------- ### Install Nginx Source: https://www.itbaima.cn/zh-CN/document/f6eya9taaelsl35p Command to install the Nginx web server on Debian or Ubuntu-based Linux distributions using the apt package manager. ```sh sudo apt install nginx ``` -------------------------------- ### Verify Gradle Installation Source: https://www.itbaima.cn/zh-CN/document/3at7ybv04dmjc0wp Checks if Gradle is installed correctly and displays its version information. This command is used after setting up the environment variables. ```shell gradle -v ``` -------------------------------- ### Install OpenJDK 8 Boot JDK Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i Installs OpenJDK 8, which is required as a bootstrap JDK for compiling OpenJDK 8 source code. ```sh sudo apt install openjdk-8-jdk ``` -------------------------------- ### Spring Boot Security Configuration Example Source: https://www.itbaima.cn/zh-CN/document/0k66v5r6slsfuog4 An example of configuring Spring Security using HttpSecurity. This demonstrates how to define authorization rules and customize security filters. ```java @Configuration public class SecurityConfiguration { @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http .authorizeHttpRequests(auth -> { ``` -------------------------------- ### Demonstrate Command Pattern for Smart Home Source: https://www.itbaima.cn/zh-CN/document/5434a3cyyjvwhs8s Illustrates the Command pattern by creating an Air Conditioner, an OpenCommand for it, and using a Controller to execute the command. ```java public static void main(String[] args) { AirConditioner airConditioner = new AirConditioner(); Controller.call(new OpenCommand(airConditioner)); } ``` -------------------------------- ### Loading JVM Shared Library (macOS Example) Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i 提供了macOS平台下加载JVM共享库(libjvm.so)的LoadJavaVM函数实现,包括使用dlopen打开库文件,以及使用dlsym查找并导出JNI_CreateJavaVM、JNI_GetDefaultJavaVMInitArgs和JNI_GetCreatedJavaVMs等关键函数指针。 ```c jboolean LoadJavaVM(const char *jvmpath, InvocationFunctions *ifn) { Dl_info dlinfo; void *libjvm; JLI_TraceLauncher("JVM path is %s\n", jvmpath); libjvm = dlopen(jvmpath, RTLD_NOW + RTLD_GLOBAL); if (libjvm == NULL) { JLI_ReportErrorMessage(DLL_ERROR1, __LINE__); JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror()); return JNI_FALSE; } ifn->CreateJavaVM = (CreateJavaVM_t) \ dlsym(libjvm, "JNI_CreateJavaVM"); if (ifn->CreateJavaVM == NULL) { JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror()); return JNI_FALSE; } ifn->GetDefaultJavaVMInitArgs = (GetDefaultJavaVMInitArgs_t) \ dlsym(libjvm, "JNI_GetDefaultJavaVMInitArgs"); if (ifn->GetDefaultJavaVMInitArgs == NULL) { JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror()); return JNI_FALSE; } ifn->GetCreatedJavaVMs = (GetCreatedJavaVMs_t) \ dlsym(libjvm, "JNI_GetCreatedJavaVMs"); if (ifn->GetCreatedJavaVMs == NULL) { JLI_ReportErrorMessage(DLL_ERROR2, jvmpath, dlerror()); return JNI_FALSE; } return JNI_TRUE; } ``` -------------------------------- ### HTML Strikethrough and Underline Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Illustrates the use of `` for strikethrough text (indicating text that is no longer accurate) and `` for underlined text (often used for emphasis or links). ```html 一男子因声称要炸火车站被拘留,民警询问哪个火车站,此男子回答道是北京火车站, 接着民警提醒他这里是上海,然后男子便说那为什么要把我抓进来呢? ``` -------------------------------- ### HTML Paired (Double) Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Illustrates a common HTML pattern: paired or 'double' tags. These require both an opening tag and a closing tag, indicated by a forward slash. ```html
``` -------------------------------- ### HTML Italic Tag Example (i, em, cite) Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates how to render text in italics using ``, ``, or `` tags. `` is used for emphasis, while `` is for citing creative works. ```html 武汉一位40岁男子与10岁小孩因口角,气愤之下连划7辆车进行报复,声称“总有一辆是小孩家的”。 ``` -------------------------------- ### HTML Bold Tag Example (b, strong) Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Illustrates how to make text bold using either the `` or `` tags. `` is semantically preferred for indicating strong importance. ```html 据CNMO了解,小米汽车在车展现场派发的矿泉水,竟然被人挂到了二手平台闲鱼上,最高卖到99.99元,网友看完后直呼“逆天”。 ``` -------------------------------- ### HTML Horizontal Rule Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows the usage of the `
` tag to create a horizontal line. This tag is used to visually separate content sections or themes within a document. ```html 自2024年11月20日06:00起:停止原神小米服务器的游戏充值和新用户注册功能
自2025年01月20日12:00起:正式关停原神在小米平台的运营,关闭游戏在小米平台的下载入口及关闭游戏服务器 ``` -------------------------------- ### Compile and Run Java Hello World Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i Demonstrates compiling and running a simple 'Hello World' Java program using the newly compiled JDK. ```java public class Main{ public static void main(String[] args){ System.out.println("Hello World!"); } } ``` ```sh nagocoler@ubuntu-server:~$ cd JavaHelloWorld/ nagocoler@ubuntu-server:~/JavaHelloWorld$ vim Main.java nagocoler@ubuntu-server:~/JavaHelloWorld$ javac Main.java nagocoler@ubuntu-server:~/JavaHelloWorld$ ls Main.class Main.java ``` ```sh /home/nagocoler/jdk-jdk8-b120/build/linux-x86_64-normal-server-slowdebug/jdk/bin/java Main Hello World! Process finished with exit code 0 ``` -------------------------------- ### MyBatis Configuration Example Source: https://www.itbaima.cn/zh-CN/document/ru4ogh2waocpn4jo An example MyBatis configuration file (`mybatis.xml`) that sets up database connection properties, type aliases, and mapper locations. This file is typically placed in the resources directory and loaded at runtime. ```xml ``` -------------------------------- ### HTML Paragraph Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates the use of the `

` tag to define paragraphs. Each `

` tag represents a distinct paragraph, and browsers automatically add spacing between them for better readability. ```html

自2024年11月20日06:00起:停止原神小米服务器的游戏充值和新用户注册功能

自2025年01月20日12:00起:正式关停原神在小米平台的运营,关闭游戏在小米平台的下载入口及关闭游戏服务器

``` -------------------------------- ### HTML Subscript and Superscript Tag Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows how to use `` for superscript text (e.g., exponents) and `` for subscript text (e.g., chemical formulas). These tags are useful for special notations. ```html 广州一女子,入职仅58天却21次迟到,且工作能力与简历不符,被公司辞退。 女子不满公司补偿,申请劳动仲裁。结果劳动仲裁开庭当天,她迟到了16分钟。 仲裁结果支持了公司,驳回了她的申请。 ``` -------------------------------- ### HTML Head Section Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows common tags found within the `` section, specifically `` for character encoding and `` for the browser tab title. ```html <head> <meta charset="UTF-8"> <title>Title ``` -------------------------------- ### HTML H1 Heading Example Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows how to use the `

` tag to create a main heading. Browsers automatically render `

` elements with larger font size and boldness compared to regular text, signifying importance. ```html

我是一个简单的标题

我是一个简单的内容,专门衬托标题用的,如果觉得我没用就删了我吧 ``` -------------------------------- ### JVM Launcher Initialization and Debugging Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i 展示了JVM启动器在启动初期的初始化操作以及如何配置诊断信息打印,包括调用InitLauncher、DumpState以及根据JLI_IsTraceLauncher条件打印命令行参数。 ```c InitLauncher(javaw); DumpState(); if (JLI_IsTraceLauncher()) { int i; printf("Command line args:\n"); for (i = 0; i < argc ; i++) { printf("argv[%d] = %s\n", i, argv[i]); } AddOption("-Dsun.java.launcher.diag=true", NULL); } ``` -------------------------------- ### Java IntBuffer get(int[] dst, int offset, int length) Example Source: https://www.itbaima.cn/zh-CN/document/eedesc445ygiqhil Provides an example of using the get(int[] dst, int offset, int length) method to read data from an IntBuffer into a specific section of a destination array. ```java public static void main(String[] args) { IntBuffer buffer = IntBuffer.wrap(new int[]{1, 2, 3, 4, 5}); int[] arr = new int[10]; buffer.get(arr, 2, 5); System.out.println(Arrays.toString(arr)); } ``` -------------------------------- ### JDK 8 Compilation Environment Setup Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i Lists the required environment configuration and dependencies for manually compiling the JDK 8 source code, emphasizing the need for specific versions of tools. ```Shell # Operating System: Ubuntu 20.04 Server # Hardware: i7-4790 4C8T / 16G RAM / 128G SSD # Debugging Tool: Jetbrains Gateway (for CLion Backend) # OpenJDK Source: https://codeload.github.com/openjdk/jdk/zip/refs/tags/jdk8-b120 # Required Compilation Environment: # Ensure these specific versions are installed: # sudo apt-get update # sudo apt-get install -y gcc-4.8 g++-4.8 make-3.81 # sudo apt-get install -y openjdk-8-jdk ``` -------------------------------- ### Java Producer Basic Connection Setup Source: https://www.itbaima.cn/zh-CN/document/a782u84512tyuo1m Demonstrates how to initialize the `ConnectionFactory` in Java, setting essential connection parameters like host, port, username, password, and virtual host for connecting to RabbitMQ. This is the foundational step for establishing a connection. ```java public static void main(String[] args) { //使用ConnectionFactory来创建连接 ConnectionFactory factory = new ConnectionFactory(); //设定连接信息,基操 factory.setHost("192.168.0.12"); factory.setPort(5672); //注意这里写5672,是amqp协议端口 factory.setUsername("admin"); factory.setPassword("admin"); factory.setVirtualHost("/test"); //创建连接 try(Connection connection = factory.newConnection()){ }catch (Exception e){ e.printStackTrace(); } } ``` -------------------------------- ### OpenJDK Build Configuration Summary Source: https://www.itbaima.cn/zh-CN/document/g96k66kczovvbm1i Displays a detailed summary of the build configuration, including the Boot JDK, C/C++ compilers, and build performance settings. ```APIDOC Configuration summary: * Debug level: slowdebug * JDK variant: normal * JVM variants: server * OpenJDK target: OS: linux, CPU architecture: x86, address length: 64 Tools summary: * Boot JDK: openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-8u312-b07-0ubuntu1~20.04-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode) (at /usr/lib/jvm/java-8-openjdk-amd64) * C Compiler: gcc-4.8 (Ubuntu 4.8.5-4ubuntu2) version 4.8.5 (at /usr/bin/gcc-4.8) * C++ Compiler: g++-4.8 (Ubuntu 4.8.5-4ubuntu2) version 4.8.5 (at /usr/bin/g++-4.8) Build performance summary: * Cores to use: 3 * Memory limit: 3824 MB * ccache status: not installed (consider installing) ``` -------------------------------- ### Gradle Project Initialization Prompts Source: https://www.itbaima.cn/zh-CN/document/3at7ybv04dmjc0wp Demonstrates the interactive prompts and user selections during `gradle init` for configuring a new project, including project type, language, build script DSL, and other settings. ```shell > Task :wrapper Select type of project to generate: 1: basic 2: application 3: library 4: Gradle plugin Enter selection (default: basic) [1..4] 2 Select implementation language: 1: C++ 2: Groovy 3: Java 4: Kotlin 5: Scala 6: Swift Enter selection (default: Java) [1..6] 3 Generate multiple subprojects for application? (default: no) [yes, no] no Select build script DSL: 1: Kotlin 2: Groovy Enter selection (default: Kotlin) [1..2] 1 Select test framework: 1: JUnit 4 2: TestNG 3: Spock 4: JUnit Jupiter Enter selection (default: JUnit Jupiter) [1..4] Project name (default: Test): Source package (default: test): com.test Enter target version of Java (min. 7) (default: 17): 17 Generate build using new APIs and behavior (some features may change in the next minor release)? (default: no) [yes, no] ``` -------------------------------- ### Run Docker Container Source: https://www.itbaima.cn/zh-CN/document/zj9uvg0sp3b0sok8 从指定的Docker镜像启动一个容器。 ```sh docker run hello-world ``` -------------------------------- ### Spring Boot Starter Dependencies for Web Source: https://www.itbaima.cn/zh-CN/document/0k66v5r6slsfuog4 Lists the core dependencies included when using `spring-boot-starter-web`. This includes basic starters, JSON support, Tomcat, and Spring Web/WebMvc modules. ```xml org.springframework.boot spring-boot-starter 3.1.1 compile org.springframework.boot spring-boot-starter-json 3.1.1 compile org.springframework.boot spring-boot-starter-tomcat 3.1.1 compile org.springframework spring-web 6.0.10 compile org.springframework spring-webmvc 6.0.10 compile ``` -------------------------------- ### Root Configuration with Data Source and MyBatis Source: https://www.itbaima.cn/zh-CN/document/u8ekxxucowr2b1tm Configures the application's root context, including setting up the DataSource (using HikariCP) and SqlSessionFactoryBean for MyBatis integration. ```java @ComponentScans({ @ComponentScan("book.manager.service") }) @MapperScan("book.manager.mapper") @Configuration public class RootConfiguration { @Bean public DataSource dataSource(){ HikariDataSource dataSource = new HikariDataSource(); dataSource.setJdbcUrl("jdbc:mysql://localhost:3306/study"); dataSource.setDriverClassName("com.mysql.cj.jdbc.Driver"); dataSource.setUsername("root"); dataSource.setPassword("123456"); return dataSource; } @Bean public SqlSessionFactoryBean sqlSessionFactoryBean(@Autowired DataSource dataSource){ SqlSessionFactoryBean bean = new SqlSessionFactoryBean(); bean.setDataSource(dataSource); return bean; } } ``` -------------------------------- ### Kotlin Hello World Main Function Source: https://www.itbaima.cn/zh-CN/document/t7lnl87f74f3v1ju Demonstrates the basic structure of a Kotlin program with the entry point 'main' function and printing to the console. ```Kotlin fun main() { println("Hello World") } ``` -------------------------------- ### HTML Basic Tag Structure Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates the fundamental structure of an HTML tag, enclosed within angle brackets. This is the basic syntax for all HTML elements. ```html ``` -------------------------------- ### C: Hash Table Test Case Source: https://www.itbaima.cn/zh-CN/document/0lsjm59k7cgu4tpr Demonstrates the usage of the hash table by initializing it, inserting several keys, and then performing search operations to verify functionality. It prints the results of the find operations. ```C int main(){ struct HashTable table; init(&table); insert(&table, 10); insert(&table, 19); insert(&table, 20); printf("%d\n", find(&table, 20)); printf("%d\n", find(&table, 17)); printf("%d\n", find(&table, 19)); } ``` -------------------------------- ### HTML Adjacent and Self-Closing Tags Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Demonstrates adjacent sibling tags and the use of a self-closing tag (`
`). This highlights different ways tags can appear sequentially. ```html

``` -------------------------------- ### Java Hello World 程序编译与运行 Source: https://www.itbaima.cn/zh-CN/document/ibeeuwsbbi00undq 演示了如何编写、编译和运行一个基本的Java程序。Java程序首先被编译成字节码(.class文件),然后由Java虚拟机(JVM)执行,实现了跨平台运行。 ```java public class Main{ public static void main(String[] args){ System.out.println("Hello World!"); } } ``` ```bash javac Main.java java Main ``` -------------------------------- ### HTML Nested Tag Structure Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows how HTML tags can be nested within each other to create hierarchical content. This nesting is crucial for organizing complex web page structures. ```html
``` -------------------------------- ### Maven Dependencies for Book Management System Source: https://www.itbaima.cn/zh-CN/document/u8ekxxucowr2b1tm Lists essential Maven dependencies for the Spring framework (security, webmvc), persistence (MySQL, MyBatis, HikariCP), utilities (Lombok, Slf4j), Servlet API, and JUnit testing. ```xml org.springframework.security spring-security-web 5.5.3 org.springframework.security spring-security-config 5.5.3 org.springframework spring-webmvc 5.3.14 mysql mysql-connector-java 8.0.27 org.mybatis mybatis-spring 2.0.6 org.mybatis mybatis 3.5.7 org.springframework spring-jdbc 5.3.14 com.zaxxer HikariCP 3.4.5 org.projectlombok lombok 1.18.22 org.slf4j slf4j-jdk14 1.7.32 javax.servlet javax.servlet-api 4.0.1 provided org.junit.jupiter junit-jupiter-api ${junit.version} test org.junit.jupiter junit-jupiter-engine ${junit.version} test ``` -------------------------------- ### Interface Segregation Principle (ISP) Example Source: https://www.itbaima.cn/zh-CN/document/6386mh7anqt4tzyv Demonstrates how to apply the Interface Segregation Principle by splitting a broad 'Device' interface into more specific 'SmartDevice' and 'NormalDevice' interfaces. This prevents clients from depending on methods they do not use, improving design flexibility. ```java interface Device { String getCpu(); String getType(); String getMemory(); } //电脑就是一种电子设备,那么我们就实现此接口 class Computer implements Device { @Override public String getCpu() { return "i9-12900K"; } @Override public String getType() { return "电脑"; } @Override public String getMemory() { return "32G DDR5"; } } //电风扇也算是一种电子设备 class Fan implements Device { @Override public String getCpu() { return null; //就一个破风扇,还需要CPU? } @Override public String getType() { return "风扇"; } @Override public String getMemory() { return null; //风扇也不需要内存吧 } } ``` ```java interface SmartDevice { //智能设备才有getCpu和getMemory String getCpu(); String getType(); String getMemory(); } interface NormalDevice { //普通设备只有 getType String getType(); } //电脑就是一种电子设备,那么我们就继承此接口 class Computer implements SmartDevice { @Override public String getCpu() { return "i9-12900K"; } @Override public String getType() { return "电脑"; } @Override public String getMemory() { return "32G DDR5"; } } //电风扇也算是一种电子设备 class Fan implements NormalDevice { @Override public String getType() { return "风扇"; } } ``` -------------------------------- ### Homepage HTML Source: https://www.itbaima.cn/zh-CN/document/63v73g0zh1qlr6fk The basic HTML structure for the application's homepage. This serves as a placeholder page after successful login. ```html 白马银行 - 首页 ``` -------------------------------- ### HTML Meta Tag for Character Encoding Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Illustrates the use of the `` tag to specify the character encoding of the HTML document, ensuring proper display of text across browsers. ```html ``` -------------------------------- ### Create Docker Container Source: https://www.itbaima.cn/zh-CN/document/zj9uvg0sp3b0sok8 创建一个Docker容器,但不立即运行它。 ```sh docker create hello-world ``` -------------------------------- ### Basic HTML Document Structure Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Presents the essential structure of an HTML document, including the document type declaration, root `` element, `` for metadata, and `` for content. ```html ``` -------------------------------- ### Java Hello World 程序结构 Source: https://www.itbaima.cn/zh-CN/document/dncxjecdv4wciqcp 展示了一个最基础的Java程序结构,包含一个公共类`Main`和一个`main`方法,用于将'Hello World!'输出到控制台。这是Java程序的入口点。 ```Java public class Main { public static void main(String[] args) { System.out.println("Hello World!"); } } ``` -------------------------------- ### 创建Spring Boot项目 - Spring Initializr Source: https://www.itbaima.cn/zh-CN/document/0k66v5r6slsfuog4 演示如何使用Spring Initializr(通过IDEA集成)来快速创建一个新的Spring Boot项目。此过程涉及选择项目语言、版本以及所需的 starter 依赖,以简化项目设置和依赖管理。 ```IDE_ACTION 1. 在IDEA中选择 'File' -> 'New' -> 'Project...' 2. 在新建项目窗口中,选择 'Spring Initializr' 类型。 3. 配置项目元数据(如Group, Artifact, Name, Description, Package name)。 4. 选择项目语言(如Java)和Spring Boot版本。 5. 在 'Dependencies' 部分,选择项目所需的 starter 依赖(例如,Web, JPA等)。 6. 点击 'Create' 生成项目。 ``` ```WEBSITE_ACTION 访问 1. 选择项目元数据(如Maven Project, Java, Spring Boot版本)。 2. 选择项目语言(如Java)和打包方式(Jar/War)。 3. 在 'Dependencies' 部分,添加项目所需的 starter 依赖。 4. 点击 'Generate' 下载项目压缩包,然后解压并导入到IDE。 ``` -------------------------------- ### Kotlin Multi-Line Comment Source: https://www.itbaima.cn/zh-CN/document/urw2e6gg1lprv65w Illustrates how to use multi-line comments in Kotlin, enclosed by `/*` and `*/`. This allows for comments spanning multiple lines, useful for longer explanations or temporarily disabling blocks of code. ```kotlin /* This is a multi-line comment. It can span across several lines. */ fun main() { println("Hello World!") } ``` -------------------------------- ### Use div for Block-level Division Source: https://www.itbaima.cn/zh-CN/document/bsisgazdftiz3o9c Shows the usage of the `
` tag, a generic block-level container, for structuring and grouping content. It does not have inherent semantic meaning but is useful for layout and styling purposes. ```html
我是第一组行内元素文本 我是普通行内元素文本
我是一个讨厌的块级元素
我是一个讨厌的块级元素
我是第二组行内元素文本 我是普通行内元素文本
我是一个讨厌的块级元素
我是一个讨厌的块级元素
```