Blog

Quarantine Diary

#Lifestyle

Recently, Omicron has swept through Hefei, causing this city of ten million people to enter a state of near semi-shutdown. You can see the so-called “big whites” outside all day long, along with countless ambulances. You can also come across information on various social media platforms like “a certain neighborhood has been locked down” or “residents of a certain building are being taken away in entire vehicles for quarantine.” In the past, I didn’t think it was a big deal. After all, it’s been three years since the Covid-19 outbreak, and I haven’t been infected yet (of course, even if I did get infected, it wouldn’t be a big deal; I’m quite confident in my body’s immunity). But unfortunately, on October 24, which happened to be “1024 Programmer’s Day,” I was required by the community to go into centralized quarantine. At first, I was quite resistant. I had seen those awful quarantine facilities online, and the thought of staying in one for a week—no one to talk to, no going outside for activities… losing the freedom of a normal person—I felt like I’d go crazy (though, in fact, I didn’t go crazy). But in the end, I found out that I was being taken to a “four-star” hotel for quarantine. This instantly lifted my spirits. After all, staying in this hotel normally costs 300-400 yuan per night. What a steal!

Read more →

October 28, 2022

How NAT Traversal Works (Tailscale)

#Technology

Translator’s Foreword This article is a reprint of a 2020 English blog post: How NAT Traversal Works. Imagine this scenario: you have one machine in Beijing and another in Shanghai, both on local area networks (e.g., a desktop at home and a laptop connected to Starbucks Wi-Fi). Both have private IP addresses but can access the public internet. How can these two machines communicate directly?

Read more →

July 7, 2022

NVIDIA DALI Tutorials

#Technology

First Encounter The origin of this matter dates back to when I read a paper a long time ago. The core of the paper was to discuss the role of pre-training strategies in low-level vision tasks. Since it’s about pre-training strategies, inevitably, a larger dataset is required. The reason pre-training has been rarely applied in low-level vision tasks in recent years is mainly due to the lack of large-scale datasets. This paper focuses on three tasks in low-level vision tasks: SR (Super-Resolution), DeRain (Rain Removal), and DeNoise (Noise Reduction). The authors used images from ImageNet as the base images and obtained low-resolution images for the SR task using bicubic interpolation, while rain streaks and Gaussian noise were directly added to the clean base images for the DeRain and DeNoise tasks.

Read more →

June 8, 2022

Cython Basics

#Technology

Getting Started Concept of Cython Cython is essentially Python with C data types. With few exceptions, nearly all Python code is valid Cython code. The Cython compiler translates the code into equivalent C code that calls the Python/C API. Since Cython’s parameters and variables can be declared with C data types, codes that operate on both Python values and C values can be freely mixed, with Cython automatically converting where necessary. Additionally, reference counting and error checking in Python are automatic, and Python’s exception handling mechanism, including try-except and try-finally, works just as well, even when operating on C data.

Read more →

May 11, 2022

We Stand With Ukraine!

#Statement

We stand in solidarity with Ukraine against Russia’s aggression, condemn President Putin’s actions, and donate to charities to help those affected. Main TextWe firmly stand with the people of Ukraine and with all those around the world who oppose the Russian government’s war and acts of aggression against this peaceful nation. We walk alongside everyone who bravely stands up to resist aggression, expose disinformation, and refuse to remain silent. We praise the unity and indomitable spirit of the Ukrainian people and fight alongside them.

Read more →

April 23, 2022

Farewell, Mriya!

#Lifestyle

The conflict between Russia and Ukraine has escalated recently and shows no sign of stopping. On domestic social media, I see that most Chinese people verbally support Russia, and given the current strong relationship between China and Russia, this attitude is understandable. But I think, war is a complex thing, you can’t say which side is right and which is wrong, because every side in a war is considering from the perspective of protecting their country’s interests, so there’s no right or wrong. Zelensky’s desire to join the EU may be to improve Ukraine’s declining economy; the desire to join NATO may also be due to the huge sense of crisis brought to the Ukrainian people by the Crimea crisis in 2014. Putin’s annexation of Crimea was also to protect Russia’s national interests, after all, the Black Sea Fleet can’t be without an outlet to the sea; the invasion of Ukraine was also caused by the United States’ step by step provocation… The United States’ betrayal was first, and NATO’s five expansions made Russia feel increasingly insecure…

Read more →

March 2, 2022

Python Basics

#Technology

Summary of Function Concepts Calling Functions Python has many useful built-in functions that can be called directly. To call a function, you need to know its name and parameters. You can check the official Python documentation or use the help function, such as help(abs). If you pass the wrong number of arguments when calling a function, a TypeError will be raised, and Python will clearly tell you how many arguments the function requires. If the number of arguments is correct but the argument type is not accepted by the function, a TypeError will also be raised.

Read more →

December 29, 2021

Swift Learning (11) - Classes and Structures (Improved Code Version)

#Technology

Structures and classes, as general and flexible constructs, have become the foundation for building code. You can use the syntax for defining constants, variables, and functions to define properties and add methods for structures and classes. Unlike other programming languages, Swift does not require you to create separate files for the interface and implementation code of custom structures and classes. You only need to define a structure or class in a single file, and the system will automatically generate an external interface for other code.

Read more →

August 30, 2021

Swift Learning (10) - Enums (Improved Code Version)

#Technology

Enums define a common type for a group of related values, allowing you to use these values in a type-safe way within your code. If you are familiar with C, you know that enums in C assign related names to a group of integer values. Enums in Swift are more flexible and do not require a value for every enum case. If you provide a value for an enum case (called a raw value), its type can be a string, character, integer, or floating-point number.

Read more →

August 25, 2021

Swift Learning (9) - Closures (Improved Code Version)

#Technology

A closure is a self-contained block of function code that can be passed around and used in your code. Closures in Swift are similar to code blocks in C and Objective-C (blocks), as well as anonymous functions (lambdas) in Python. Closures can capture and store references to any constants and variables from the context in which they are defined. This is known as capturing constants and variables. Swift manages all memory operations involved in the capturing process.

Read more →

August 23, 2021