QT configuration data reading and writing (QJSON/YAML/QSettings)

JSON file reading and writing Classes involved in reading and writing JSON files: QJsonArray QJsonDocument QJsonObject QJsonParseError Data reading process: Qfile-QByteArray-QJsonDocument-QJsonObject-QJsonValue Data writing is the reverse process of data reading. QJsonObject internally stores json structure files: The value(“key”) method returns the QJsonValue class, or directly overloads the [] method and uses obj[“key”] to get the […]

In-depth understanding of recursive & divide-and-conquer algorithms

First, let’s briefly explain the differences and connections between recursion, divide-and-conquer algorithm, dynamic programming, and greedy algorithm, so that you can have an impression in your mind. Recursion is a programming technique and a way of thinking to solve problems; the divide-and-conquer algorithm and dynamic programming are largely based on recursive thinking (although most dynamic […]

8 Ways to Optimize Duplicate and Redundant Code!

In daily development, we often encounter some repetitive and redundant code. Everyone knows that duplicate code is bad. It mainly has the following shortcomings: poor maintainability, poor readability, increased risk of errors and so on. Recently, I optimized some duplicate codes in the system and used several methods, which I found quite useful. Therefore, this […]

51 microcontroller: 220v household timer switch control system simulation (based on the inherent hardware of the development board)

This experiment is a small task of microcontroller development, because the system involves independent buttons (on/off keys, up, down, left and right keys, self-defined), LED digital tubes, buzzers, interrupts, timers and other related facilities. The use of 51 microcontroller is relatively comprehensive, so I will use it as an example to review. The system uses […]

When compiling with cmake, I encountered an opencv error runtime library

Error description CMake Warning at CMakeLists.txt:123 (add_executable): Cannot generate a safe runtime search path for target mono_euroc because files in some directories may conflict with libraries in implicit directories: runtime library [libopencv_stitching.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /usr/local/lib runtime library [libopencv_aruco.so.4.2] in /usr/lib/x86_64-linux-gnu may be hidden by files in: /usr/local/lib runtime library […]

Python explores the fractal world | Mandelbrot | np.frompyfunc()

Article directory Important characteristics of fractals mandelbrot collection The Mandelbrot set has a proven conclusion: Image display np.ogrid[] np.frompyfunc() Collection to image julia collection Boundless miracles come from the infinite repetition of simple rules —- Benoit B. Mandelbrot, the father of fractals Important characteristics of fractals self-similarity scale-free nonlinear Mandelbrot Collection z 0 = 0 […]

If the front-end and back-end are deployed separately under windows

This article mainly describes how to deploy the framework that separates the front and back in Windows. 1. Successfully run the Ruoyi front-end and back-end separation framework 1. Download ruoyi-vue from Ruoyi’s official website and open it with idea 2. Configure the environment according to the documents in the doc directory and run it successfully. […]

FPGA project: HCSR04

Mistakes made: 1. Since cnt_base is used to measure the high-level time of the echo echo signal, its data should be large and the bit width should be large. You can also use the cnt_us counter to calculate this high level time. In order to accurately calculate the distance, I still use the cnt_base counter. […]

FPGA project: DHT11

Mistakes I made: 1. When the START state jumps to the REPLAY state, sda will jump from high level to low level. This falling edge is caused by the sensor producing a low level response. Rather than being generated when the sensor is ready to end at a high level. REPLAYtoWAIT_2S = ( state_c == […]