Skip to main content

63 docs tagged with "computer-science"

View all tags

Add Two Linked Lists

题目 NOTE 1. 要点不要忘了最后的进位 2. 两个单链表可以长度任意 java

Advice in Spring AOP

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

ApplicationContext

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

APT Usage

How to write a annotation processor and use in Java Project

Aspect in Spring AOP

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

AspectJ Weaving Methods

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Bean Creation Process

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

BeanFactoryPostProcessor

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Binary Insertion

代码来自改视频改写 算法思维:该算法是在插入排序的基础上优化的 插入元素下标i,从0 ~ i-1找插入该元素的位置,

Bubble Sort

算法思维:第一层for循环控制趟数,第二层for循环从j=0和j=1开始比较 如果发现前面比后面大则互换位置 优化:当第一趟下来 没有元素交换,说明该数组已经有序了不需要排序 java

Design Patterns

<details> <summary>Global Exception Handling Class ExceptionHandlingController</summary> java package com.whalefall.learncases.exception;

Distributed System Issues

1. 基于XA协议的:二阶段提交和三阶段提交 2. 基于时间补偿机制:TCC 基于业务层面实现 3. 本地消息表:基于数据库+mq,通过mq调用服务,完成响应后回调,将状态盖好才能完成。需要配合定时任务扫描,重发消息调用服务,需要保证幂等性;(不推荐使用)

Final Field Memory Knowledge

A write to a final field inside a constructor and the subsequent assignment of the reference of the constructed object to a reference variable cannot be reordered. The first read of a reference to an object containing a final field and the subsequent first read of this final field cannot be reordered.

Functional Registration Engine Design Document

This design implements an annotation-driven business-template registration engine, automatically binding business implementation classes and corresponding processing templates at startup through the @UseTemplate annotation, implementing the decoupling of business logic and processing flow. - ✅ Annotation-driven automatic registration mechanism - ✅ Generic type safety check

Insertion Sort

插入排序 将i元素插入到下标为0~i-1的位置上,逐个比较,如果发现前面的元素比arr[i]大 则将该元素后移 否则将i元素放入到空位置上 java package whale.simpleAlgorithm;

IoC Injection Methods 1

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

IoC Injection Methods 2

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Java Class Description

Overloading: Same class, same method name, other parts different Overriding: Parent-child class, same method name, (same name, two small, one big) same parameter list, return value, exception type, modifier

Java File Related

Using Spring-Boot with Resttemplate requires no extra packages<br/> <details> <summary>Controller</summary> java package whalefall.filedownloadorup;

Java Interview Questions 1

Difference between Object-Oriented and Procedure-Oriented: - Procedure-oriented focuses more on each step and its order, object-oriented focuses more on which objects and what capabilities they have - Procedure-oriented is more direct, while object-oriented is easier to reuse, extend and maintain Three Main Characteristics: Encapsulation: Hide internal details, only provide external interfaces

Java Interview Questions 2

See blog 1. Reduce resource consumption 2. Improve response speed 3. Improve thread manageability corePoolSize: Core thread count, Number of threads created for normal work

Java Problems Summary

Go to Maven Repository to find the corresponding dependency and download it. Go to the download directory and execute the following command, replacing -DgroupId, -DartifactId, -Dversion, -Dfile

JAVA Virtual Machine

!20250922223849 1. Fetch binary stream: Get the binary stream defining the class by its fully qualified name.

JMM Related Content

For details please see. For reordering that changes program execution results, JMM requires compilers and processors to prohibit such reordering. For reordering that does not change program execution results, JMM makes no requirements for compilers and processors (JMM allows such reordering).

Joinpoint

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

jUnit Stuff

This article organizes two common testing methods: 1. Pure Unit Testing (Mockito + JUnit) 2. Spring Boot Testing (@SpringBootTest excluding auto-configuration) Features: - Does not depend on Spring container

Kafka

Kafka deployment, Docker Compose, and Spring Boot integration

lambda Usage

> NOTES: All content taken from Java 8 Functional Programming java public Set<String> findLongTracks(List<Album> albums) { Set<String> trackNames=new HashSet<>();

Lock

![](https://s2.loli.net/2023/07/15/T2tYREiaSpo3eyx.png) Locks are user-facing, defining the interface for users to interact with locks (e.g. allowing two threads to access in parallel), hiding implementation details;

Merge Sort

视频链接 算法思路:将两个局部有序的数组归并为一个有序的数组

MySQL Stored Procedures

创建user表 sql SET NAMES utf8mb4; SET FOREIGNKEYCHECKS = 0; -- ---------------------------- -- Table structure for user

netty

!20250922233019 !20250922233035

Oracle Related

sql CREATE [OR REPLACE] PROCEDURE [schema.] procedurename [parametername] [[IN] datatype [{:=|DEFAULT} expression]

Overview of AspectJ style AOP

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Pointcut in Spring AOP

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Power of 4

java package whale.leetcode.simple; / @Author: WhaleFall541 @Date: 2021/5/31 23:22 / public class PowerOfFour {

Processor Memory Model

Relax the order of write-read operations in the program, thus producing the Total Store Ordering memory model (abbreviated as TSO). On the basis of the above, continue to relax the order of write-write operations in the program, thus producing the Partial Store Order memory model (abbreviated as PSO).

Production Problems

- Problem definition, determine whether it is internal system problem or other system problem, or network reason - If serious, consider rollback (or restart application) first, solve problem first, then find reason for problem - Reason: Connection pool problem (used in thread pool), slow SQL problem, Full GC problem etc.

Python Usage Issues

Guide to configuring Python pip sources, virtual environments, and Jupyter notebooks in VSCode

Quick Sort

代码源自该视频 算法思想:选择一个中心点,将比中心点小的移动到左边,反之移动到右边; 这时形成两个子序列,对子序列递归直至,每个序列只有一个元素为止;

RabbitMQ

RabbitMQ reliability, consumption patterns, and queue types

Redis

Redis common issues, cache penetration, avalanche, and configuration

Schema-based AOP Configuration

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Selection Sort

算法思维:从0到n-1每次取一个为i, 和i后面的元素进行比较 令int k = i;如果发现比i位置上的还小,则将该位置的角标赋值给k。 最后交换i 和 k的位置;每一趟都能排好一个最小的值。

Shell Sort

代码参考该视频 算法思维: 说明 arr.length = n; 增量序列为 seq; 间隔 span = seq[p]

Spring Boot

A bug finds in those of tasks where you need change the date by the nature. <br/> Firstly You should inject a prototype bean to spring context, instea

Spring Core

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Transaction Processing

<font color='red'>本文摘自 周志明 凤凰架构:构建可靠的大型分布式系统</font>

Usage of AspectJ style AOP

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Volatile Memory Domain

避免使用锁:无锁并发编程,多线程竞争锁时,会引起上下问文切换,所以多线程处理时,可以用一些办法来避免使用锁,如将数据的ID按照Hash算法取模分段,不同的线程处理不同段的数据 CAS算法:java的atomic包使用CAS算法来更新数据,而不需要加锁

Weaving in Spring AOP 1

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)

Weaving in Spring AOP 2

Please refer to [spring-framework](https://github.com/Halcyon666/spring-framework-modified/tree/main/spring-test) for code related to this article (from official source spring-test module)