[ACWing]1125. Cattle travel

Title address: https://www.acwing.com/problem/content/description/1127/ Farmer John's farm has many pastoral areas, and some paths connect some specific pastoral areas. A pastoral area with all the connections is called a pasture. But for now, you can see that at least two pastoral areas are not connected. Now, John wants to add a path to the ...

Added by jayshadow on Sat, 19 Feb 2022 15:06:22 +0200

Mutex and lock of C + + standard library_ guard,recursive_mutex,timed_mutex,recursive_timed_mutex,unique_lock

1, mutex The full name of mutex is mutual exclusion, which is an object used to help control "concurrent access to resources" in an exclusive and exclusive mannerFor example, let's lock a resource void f(int val); int val; //shared resource std::mutex valMutex; //mutex void func() { //Lock and then operate the sh ...

Added by kr4mer on Sat, 19 Feb 2022 13:26:52 +0200

Original SLAM exercise - rigid body rotation in three-dimensional space

Handwritten SLAM notes from zero Rotation mode conversion Title 1: the known rotation matrix is defined as rotating 45 ° along the Z axis. Please initialize the rotation vector, rotation matrix, quaternion and Euler angle according to this definition. Please program: 1. The mutual conversion relations of the above four expressions ...

Added by jonasr on Sat, 19 Feb 2022 13:20:47 +0200

The callback function used to be so easy to understand

  1 what is a callback function? First, what is "callback"? My understanding is: pass an executable code to other code like parameter passing, and this code will be called and executed at some time, which is called callback. If the code is executed immediately, it is called synchronous callback. If it is executed later, it is ...

Added by Genux on Fri, 18 Feb 2022 22:24:55 +0200

C + + improve programming

C + + improve programming Mainly for C + + generic programming and STL technology Template 1 1. Concept Template is to establish a general mold, which greatly improves the reusability of code Template features The template cannot be used directly. It is just a frameworkThe universality of templates is not everything 2. Function templ ...

Added by onyx on Fri, 18 Feb 2022 16:40:29 +0200

Object ObjectPtr ObjectRef relation of TVM C + + code

The Object class of TVM is the base class of many classes. For detailed analysis materials, please refer to In depth understanding of TVM: Object family - Zhihu In depth understanding of TVM: Object family (II) - Zhihu TVM source code reading: the cornerstone of all things - Object class (1) - Zhihu TVM source code reading: the cornerstone ...

Added by arhunter on Fri, 18 Feb 2022 13:25:04 +0200

Polymorphism of three characteristics of C + + object-oriented program

Concept of polymorphism Different types of objects respond differently to the same message, which is called polymorphism. Generally speaking, it is to complete a certain behavior. When different objects complete it, they will produce different results For example, if you go to an Internet cafe to get online, if you are a vip, the pri ...

Added by joePHP on Fri, 18 Feb 2022 13:15:57 +0200

"Come, refuse, go, stay" is a small car based on Openmv ranging to identify objects and maintain a constant distance

Recently, a classmate came to me because his graduation project was about to be concluded. His project was to make a car that could recognize the QR code and realize ranging. At the same time, he also hoped that the car would keep a constant distance from the QR code. That is, when the QR code approaches the car, the car will retreat, and when ...

Added by SnakeO on Fri, 18 Feb 2022 12:04:56 +0200

LeetCode data structure and algorithm learning Day02

Title quoted from https://leetcode-cn.com/ Graphic data structure and algorithm Daily learning Day02 learning notes 20 numeric values represent strings Title Description: Please implement a function to judge whether the string represents a numeric value (including integer and decimal). The values (in order) can be divided into th ...

Added by WebMonkey on Fri, 18 Feb 2022 10:11:50 +0200

Explain Linux threads in detail

concept A process is the smallest resource allocation unit of the operating system, while a thread is the smallest scheduling unit of the operating system. In other words, a program will create a process when it is running. The process has at least one thread, and the operating system schedules this thread to operate when scheduling. There ...

Added by Norsk.Firefox on Fri, 18 Feb 2022 08:07:38 +0200