Welcome to my blogs' site. If you like, please give a Star in ZhongUncle/zhonguncle.github.io - GitHub
This site is mainly backup my CSDN blogs in Chinese, but also has some notes.
2024-03-02 | Research | #Words: 2726
How to clone system disk to a smaller hard drive or SD card on Raspberry Pi, including partition, set up and repair boot files.
2023-11-05 | Research | #Words: 1680
This blog shares some reviews and tests of Raspberry Pi 4B. ZhongUncle compares it with Mac mini 2018 i5 in many aspects.
2023-08-28 | MCU | #Words: 8378
Recently, I want to use Raspberry Pi Pico, DHT11 THS and SSD1306 OLED screen to make a thermo-hygrometer. Although the official sample has these two devices, but I encountered a big pit, so I wrote this article to record the whole process. I want this project as a beginning of learning microcontroller.
2023-08-27 | MCU | #Words: 1374
This blog begins with a description of the solution, and record my discovery process and the structure of the Pico I2C code ZhongUncle explored.
2023-08-26 | MCU | #Words: 254
Pico has two I2C, namely two sets of SDA and SCL. You can see this from the names in the pin diagram. By default, only the first I2C (`I2C0`) is enabled. It means, even if you modify the pin, but not in `I2C0`, it still doesn't work. There are two ways to modify the SDA and SCL default pins of I2C correctly, and also there is a not recommended method (but still a useful method).
2023-08-19 | MCU | #Words: 2172
Recently I received a Tang nano 9K FPGA development board as gift, so I wanted to take this opportunity to study FPGA. The official document recommand to use GOWIN IDE to develop GOWIN FPGA, but you need to apply for a license and submit a lot of information. Since it was a gift, So it is not convenient. In addition, IDE is actually not very suitable for learning and putting into production, because IDE hides many details. So I want to find other workflows, just like using any text editor and Clang/LLVM to compile C/C++ programs.
2023-08-15 | MCU | #Words: 429
Sometimes you need to reset the Raspberry Pi Pico. One way is to press and hold the BOOTSEL button on the Pico and re-plug USB; another way is connecting the RUN and GND pins with a button, and then press this button and BOOTSEL at the same time button. This puts you into USB mode.
2023-08-14 | Research | #Words: 2112
This article aims to provide a low-level explanation of APFS, the file system used by Apple devices. Because I noticed that there was a lack of documentation on how APFS works in details, so I do some research and share my findings.
2023-08-13 | Go | #Words: 476
Using Go to get URL parses is easy, but Go has strict package manage. So recommend you use `goimports` tools or shortcut key Command + S to auto complete the package. Because now use `net/url` or `net/http`, but in future maybe change.
2023-08-10 | MCU | #Words: 646
This blog lists errors that may be encountered when prepare cross-compilation environment and tool chain (arm-none-eabi-gcc) for Raspberry Pi Pico.
2023-08-09 | MCU | #Words: 2524
The reason for writing this blog is that the official tutorial is outdated. If you follow the official tutorial to configure on Mac now, you will encounter a lot of problems. I dropped into almost pits. Therefore, I record the complete process, as well as the causes and handling methods of various errors. And if I change to new Mac and encounter the same problem in the future, I read this blog to remind how to deal with it.
2023-07-19 | Research | #Words: 2150
In hard disk performance, IOPS is a very important parameter. In terms of speed, this is the most important parameter to pay attention to, rather than the sequential read and write performance or random read and write performance that many people measure.
2023-07-12 | Go | #Words: 1020
Surprisingly, Go provides an offline version (available in various languages). After downloading and installing, you can compile and run locally to view the results. You do not need to connect to the Internet to use a remote server, which improves efficiency and performance (details on this will be discussed separately later). There is a section on comparison.
2023-07-05 | UNIX | #Words: 546
Before start to introduce, something be emphasized: This method does not guarantee to view all hard disks. Some hard disks will display Resource busy due to some reasons, such as Time Machine and built-in hard disks.
2023-07-05 | UNIX | #Words: 1284
Recently, when I used macOS to mount an external hard drive, I couldn’t mount it using mount. Many articles didn’t explain the various situations in detail, so I wrote a blog to record it.
2023-06-23 | Research | #Words: 1431
BDMV is the format used by Blu-ray discs. This format cannot be played using playback software, and a hard disk player, which is a specialized device, must be used. But the most classic ffmpeg can convert it to other formats and maintain the same bit rate and definition, so that it can be viewed easily.
2023-06-12 | Swift | #Words: 323
Finally I found the `String` type has a particularly magical method, like: String(a, radix: 16, uppercase: true)
2023-06-10 | Research | #Words: 2404
Recently, I found I was not very clear about the difference between GNU GCC and Clang. It affected implementation and learning somethings, so I spent free time in some days to research it carefully.
2023-06-08 | C | #Words: 3210
Recently, I suddenly discovered something when I was learning about clang/llvm: `gcc` is a collection of tools that includes or calls all tools that convert source code into executable program, not just a simple compiler. This helped me gain a deeper understanding of compilers, so I wrote this article as a record.
2023-05-31 | Research | #Words: 677
Recently, I saw some live broadcasts on Douyin that were really interesting, and I wanted to record them. So I studied how to record these live broadcasts. There are two methods: recording the screen and downloading from the push source.
2023-05-16 | C | #Words: 2545
I just want to try to see whether is the case. I think the central limit theorem (CLT) and normal distribution are a very magical part of probability theory. I will use dice points as discrete events to calculate the probability of the sum of points. First, Implementing the program to simulate a uniformly distribute. Second, adjusting the probability of non-uniform distribution.
2023-05-12 | C | #Words: 967
In C language, there is a variable called union, which is used to store objects of different types and sizes in different situations. This is very similar to a struct: a struct is a collection of one or more variables. The declaration method of union is very simple and exactly the same as struct, as follows
2023-05-03 | C | #Words: 492
When using nvcc in the command line today, an error helper_cuda.h: No such file or directory appeared. This error message means: During compilation, the helper_cuda.h header file cannot be found (if other xxx.h cannot be found, the following explanations and solutions are also common).
2023-04-26 | C | #Words: 1293
typedef is a special feature in the C language, which is used to create new type names. You also can know from the name type def(ine). typedef is similar to alias program in Unix, which adds another name to an object. typedef also makes multiple names actually correspond to same objext, but the object of typedef operation is a data type. It is to give a nickname to the data type. This nickname usually has the first letter capitalized and is used to indicate that it is not an underlying data type.
2023-04-22 | Swift | #Words: 570
Sometimes you need to convert array subscripts and elements into a dictionary. For example, if you use array elements to search for subscripts, if you use a function to search, you have to perform a loop search and acquisition every time, which requires a lot of computing performance and memory. At this time, convert the original array into a dictionary, keyword For array elements, it would be more convenient if the value is a subscript serial number, so that the serial number can be easily found through the value of the element, and there is no need to perform a loop search every time.
2023-04-21 | Research | #Words: 2545
I encountered many problems when using VM Fusion to install Plan 9 on Mac. The official documents and some foreign blogs from the past two years were not clear, and even misleading (some situations have changed). So I am writing this article to help others who also encounter the same problem.
2023-04-19 | C | #Words: 1005
enum is abbreviation of enumerate. It is a type of constant in C language, called enumeration constant. enum provides a convenient way to associate values and names, and it is an alternative to #define. enum can be regarded as a special array, which is a list of constants, but this constant just be integer. So if there are only a few irrelevant and discontinuous constants, just define some constants directly is fine.
2023-04-05 | Non-Tech | #Words: 77
Today I accidentally discovered that the Siri calculator on iPad has accuracy issues in calculations, such as integer operations. I don’t know what is ignored.
2023-04-02 | Swift | #Words: 973
Sometimes, Xcode Test cannot meet our need, so we need to write the testing function mannully. The main of testing function is measure time of code. Whether it is testing a CPU/GPU-intensive program or a read-write-intensive program, it is necessary to obtain the running time of the program or function to calculate performance.
2023-03-16 | Research | #Words: 1123
ZhongUncle records what I find when using New Bing (GPT-4). Today New Bing called Bing Chat and can do more thing, but its mistakes are more often.
2023-02-17 | Research | #Words: 570
ZhongUncle records some performance of NN and know why bandwidth of gpu is important for Machine Learning.
2023-02-09 | Research | #Words: 755
I recently borrowed an A7R. This is my first time using a professional camera (not a card camera), and it is full frame tensor. So I spent some time to learn how to use it and how it works under various settings.
2023-02-03 | Research | #Words: 4222
When I was organizing my disk, I have a question: What is GIFs classified as? Static image files or video files?Because if you put it in a video, GIF is classified as a static image usually and is composed of images; if you put it in an image, it shows animations. Then I have new problem: Why GIFs shows animations, but be classified as static images?
2023-01-10 | Web | #Words: 400
Java supports running a single Java code file like a script on Unix like systems. But at the bottom, it unlikes the real scripts, it still needs to be compiled. You can run it as script under Linux, macOS, WSL and cannot be used under Windows PowerShell or CommandLine.
2023-01-10 | Research | #Words: 512
Recently, I need to learn Java. Due to personal habits, I just want to use the terminal for development instead of using an IDE. But I never expected that I would be tricked by the official website once, and the downloaded Java could not be developed normally. So I wrote this article to explain how to configure it. It's very simple, just find the right official website.
2022-12-06 | Research | #Words: 797
Maybe you like me have a question: Why heap sorting using a binary tree, but it is called heap sorting, rather than tree sorting? Because the predecessor of heap sort is called Tree Selection Sorting, it also uses a tree structure, but is slightly simpler. Finally we will talk about why invent heap sorting to replace tree sorting.
2022-11-24 | Swift | #Words: 608
From iOS 16, Apple start to deprecate the original `NavigationView` and will gradually phase it out completely in the future. Apple start to use `NavigationStack` and `NavigationSplitView`.
2022-10-25 | Swift | #Words: 823
ZhongUncle will introduce how to grant different permissions of Safari Extension, like types, domains, kinds.The permissions of Safari Extension extensions are roughly divided into the following aspects:
2022-10-10 | Research | #Words: 1857
If you are studying or engaged in data analysis-related, you must have used or been told to use R language. But with so many languages for data analysis, why use R? Because R can output very nice charts for publication. It may not be necessary for blogs, but it is necessary for publications such as papers and books. After all, the charts in most publications are not in color or flashy.
2022-10-04 | Research | #Words: 2899
When I was learning quicksort algorithm, I found there are many style of code. I was very curious why. So I went to read Introduction to Algorithms to search for answer. Finally I found the reason be related to the development history of quicksort.
2022-09-23 | Swift | #Words: 3101
At WWDC2022, Apple provided the chart-related package `Charts` for SwiftUI, so you don’t have to work hard to implement the chart function yourself. The amount of code suddenly changed from four to five hundred lines to a dozen or even a few lines (I still remember that I almost vomited blood trying to write the chart function). So I want to study the built-in chart function carefully, so as to facilitate future development and use
2022-09-16 | UNIX | #Words: 452
Due to my C drive is almost full, and not empty much after try to clean it, so I plan to move WSL to a new drive.
2022-09-03 | Research | #Words: 456
There are two kinds storage structures in data structures that are easily confused, namely index storage structure* and hash storage structure (hash storage structure) You can find corresponding keyword according to address. It can be understood as a yellow pages. You can find someone's phone number based on name. So index storage is also called direct addressing
2022-08-14 | Web | #Words: 1228
Recently I need to study PHP, but I found PHP unlikes scripting languages like Python and JavaScript can be viewed directly in local, PHP needs run on the server. This requires setting up an environment to learn. Although many websites that also provide already built websites, but I think I should learn how to prepare when I learn how to use PHP. Otherwise, when I still don't know how to start by myself. It would be extremely embarrassing.
2022-08-13 | Swift | #Words: 1375
Starting from iOS 15.0, Apple has abandoned the previous.animation(Animation?) and recommends developers to use .animation(Animation?, value: Equatable) or withAnimation instead.Personally, I feel that although I may not be used to it after the revision, the possibilities and freedom of development are greater.But before talking about the difference between the two, we need to understand UI animation. You can skip this part if you understand it.What is animation.Animation is a process of attribute changes such as various displacements, color changes, size changes, etc.Specific to SwiftUI's View, it is their .offset, .foregroundC
2022-08-13 | Assembly | #Words: 160
Sometimes for learning or debuging, I need to view the assembly code of the program. This is very convenient in many GUI IDEs. For example, in Xcode, just click Product-Perform Action-Assemble File Name, as follows
2022-08-13 | Assembly | #Words: 2165
Assembly is the “magic” of computers. You can be a fine “warrior” who only uses high-level languages, but if you “enchant” your “weapon” with assembly, your combat effectiveness will increase greatly (of course, there are also risks of “playing with fire and burning yourself”).
2022-07-27 | UNIX | #Words: 576
In Linux and macOS, we often need to use `man xxx` to view the introduction and usage of a program, system call, etc. This interface is called `manual page`, but sometimes it is simply called `manpage`.
2022-07-17 | Swift | #Words: 1392
ZhongUncle introduces how to jump to other pages and views in SwiftUI. I shows two methods and new method after iOS 16.Since it jumps page by page, so it is not suitable for jumping between some pages
2022-07-10 | Assembly | #Words: 210
During the assembly, you may need to specify some data size, such as the size of stack. In this case, you need to use the size command (Size Directives).
2022-07-10 | Web | #Words: 232
PHP, like Python, provides the function `parse_url(string $url, int $component = -1)`, which is very convenient.
2022-07-10 | Web | #Words: 460
This article is to introduce the common parameter parts in URLs and how to use common Python, JavaScript, and PHP to parse and obtain parameters. (You can click on the table of contents on the left to jump directly to the part you want to see)
2022-07-08 | Swift | #Words: 133
ZhongUncle introduces how to use Swift to parses URLs.
2022-06-16 | Research | #Words: 2578
Do you wonder why Type-C in difference protocols is in difference speed? I will tell you why the Type-C have different bandwidths under different protocols from pin definitions, protocols, etc.
2022-06-12 | Web | #Words: 735
It is a little troublesome to get URL parameters with JS, because JS can only get a certain part of the URL, but it cannot be subdivided. If you want to get a certain parameter, you also need to use string interception. So it’s divided into two steps:
2022-06-09 | Web | #Words: 461
ZhongUncle will introduce how to parse and obtains the URL parameters in Python, and how to use them
2022-06-03 | Web | #Words: 1565
There are two types of output data formats: formatted output and direct output. For example, the `f` of `printf` function in C language means formatted. Different data types can be printed through conversions such as `%d`. Python also has two types.
2022-05-12 | UNIX | #Words: 69
First enter WSL, then enter the root directory `/`, and use `ls` to see a directory named `mnt` (mnt is the abbreviation of mount).
2022-03-23 | Swift | #Words: 2953
How to modify TabView in SwiftUI (including properties of tabItem), such as color, position, size, etc.
2022-03-14 | Swift | #Words: 1005
In the process of developing software, we not only need to perform operations when the user clicks, but sometimes we also need to automatically perform some operations at regular intervals. For example, the most common opening screen advertisement countdown is closed, as well as some animation effects. There are generally two ways to implement these: one is to use a timer, and the other is to use asynchronous operations.
2022-02-22 | Swift | #Words: 959
Apple provides 14 major categories, a total of 174 image processing methods and some common filters in the Core Image API. The first is how to read this web page, that is to say what information this web page provides, which is very helpful for us when using it. Take the screenshot below as an example to explain how to see it.
2022-02-21 | Swift | #Words: 1081
There are many situations need developers to push notifications, but not many people talk about push notifications in SwiftUI. Here is some relevant content, So I write this blog. On the one hand, I can refer to it in future, on the other hand, I also want to help people in need.
2022-02-13 | Research | #Words: 1425
Recently, I plan to use the open source and free SQLite as a database to save money. And due to personal habits, I prefer the command line, so I record how to use SQLite in command line.
2022-02-11 | Swift | #Words: 1390
Obtaining JSON from the website API and displaying the text is a very common usage scenario in development.
2022-01-20 | Swift | #Words: 324
ZhongUncle introduce how to obatin the size of a View in SwiftUI. You can get height or width of a View component.
2022-01-11 | Swift | #Words: 234
Apple provides many symbols to developers, which improves developer efficiency and unifies the usage of many symbols to avoid misunderstandings. These synbols are called as SF symbols. Apple provides an App for developers to find these symbols, also called SF Symbol, which can be found on the Apple Developer website
2021-12-10 | Swift | #Words: 695
SwiftUI cannot directly call the camera and photo album, it needs to be used together with UIKit.
2021-12-10 | Swift | #Words: 608
I will tell you how to get images or photos from the system album in SwiftUI. SwiftUI cannot obtain the system album content by itself, so it has to rely on UIKit.
2021-04-03 | Swift | #Words: 420
ZhongUncle introduces how to obtain information of device, system and battery in Swift.