“Dependency Injection” of golang library

Article directory 1. Write at the front 2. Dependency injection 2.1 Usage scenarios 2.2 Framework comparison 3. Examples of fx framework usage scenarios 3.1 Example 3.2 golang native library 3.3 fx library 3.4 Comparison 3.4.1 Comparison of the above two implementation methods 3.4.2 About over-design 3.4.3 Enlightenment 4. Thoughts 5. References 1. Write at the […]

Use the tkinter library in python to make a beating purple heart

# Beating Heart # default input import random from math import sin, cos, pi, log from tkinter import * CANVAS_WIDTH = 980 # Canvas height CANVAS_HEIGHT = 720 #Canvas width CANVAS_CENTER_X = CANVAS_WIDTH / 2 # Canvas center point x-axis coordinate CANVAS_CENTER_Y = CANVAS_HEIGHT / 2 # The x-axis coordinate of the canvas center point […]

IIC protocol reads temperature and humidity data (HAL library)

Directory 1. I2C bus protocol 1.1. Introduction to I2C 1.2. Hardware I2C 1.3. Protocol layer 1.3.1 I2C communication composite format 1.3.2 Start and stop signals of communication 1.3.3 Data validity 1.3.4 Address and data direction 1.3.5 Response 2. IIC protocol reads temperature and humidity data 2.1 Experimental content and AHT20 2.2 CubeMX configuration 2.2.1 System […]

stm car HAL library speed measurement PID speed regulation Bluetooth OLED use

//Redirect serial port one int fputc(int ch,FILE *stream) { HAL_UART_Transmit( & amp;huart1,( uint8_t *) & amp;ch,1,0xFFFF); return ch; } //typedef struct __FILE FILE; When using printf, add #include<stdio.h>; 2. Serial port interrupt callback function uint8_t g_ucUsart3ReceiveData; //Save the data received by serial port 3 main.c HAL_UART_Receive_IT( & amp;huart3, & amp;g_ucUsart3ReceiveData,1); //Serial port three receives data […]

java decompress all rar compressed packages

Introduce dependencies <!– rar–> <dependency> <groupId>com.github.axet</groupId> <artifactId>java-unrar</artifactId> <version>1.7.0-8</version> </dependency> <dependency> <groupId>net.sf.sevenzipjbinding</groupId> <artifactId>sevenzipjbinding</artifactId> <version>16.02-2.01</version> </dependency> <dependency> <groupId>net.sf.sevenzipjbinding</groupId> <artifactId>sevenzipjbinding-all-platforms</artifactId> <version>16.02-2.01</version> </dependency> ExtractCallback You need to first ship the ExtractCallback tool class and then call the method /** * @Author JimmySong * @Date 2023/11/8 13:49 * @Version 1.0 */ import net.sf.sevenzipjbinding.*; import java.io.*; public class ExtractCallback implements IArchiveExtractCallback […]

STM32-HAL library 09-CAN communication (loopback mode)

1. Materials used: STM32F103C6T6 Minimum System Board STM32CUBEMX (HAL library software) MDK5 Serial debugging assistant 2. What you learned: Preliminarily learn how to use the CAN communication function of STM32. In this chapter, we mainly achieve the effect of on-board CAN communication, that is, 32 sends CAN information and then prints it out through the […]

[Git] Gui graphical management, SSH protocol private library integrated with IDEA use

1. Using Gui graphical interface 1. Open the manager according to your needs 2. Clone an existing library 3. Introduction to graphical interface 1. First update a code file in the local warehouse and use it: 2. Enter the graphical management interface to refresh code resources: 3. Click Stage changed to track the file and […]

oracle switches temporary table spaces, creates indexes, creates temporary tables, and creates large and small table spaces

1. The temporary table space of the switched database is temp1/the undo table space of the switched database is undotbs01 1. View the table space of the current database select tablespace_name from dba_tablespaces; It was found that there are no above two table spaces. 2. Create temp1 temporary table space and undotbs01 table space #Create […]

PHP uses recursion to integrate its two-dimensional array into a hierarchical tree, where the hierarchical id is in a uuid format. The weird problem has been solved.

No more verbosity, just go directly to the source code. <?php function findChildren($list, $p_id){ $r = array(); foreach ($list as $k => $item) { if ($item[‘fid’] == $p_id) { unset($list[$k]); $length = count($r); $r[$length] = $item; if ($t = findChildren($list, $item[‘id’])) { $r[$length][‘children’] = $t; } } } return $r; } function findChildren2($list,$p_id, & amp;$sike=[]) […]