Implementation of singleton mode (C + +)
Implement singleton mode
The purpose of singleton pattern is to make an object of a class the only instance in the system. The class created by the method of singleton mode has only one instance in the current process (if necessary, it may belong to singleton in a thread, for example, only the same instance is used in the thread context)
...
Added by dkphp2 on Fri, 17 Dec 2021 20:19:02 +0200
Design pattern: Command pattern C + + implementation
preface
Today I reviewed the command mode, which is very interesting. Here I share it with you!
1. Command mode understanding
Command mode is to separate the command issuer from the command executor so that they are not directly connected, but record these commands through a third party, and then the third party tells the command exe ...
Added by Design on Fri, 17 Dec 2021 20:16:03 +0200
Address book management system
1. Demand analysis
Using C + + to realize address book management system
The following functions need to be realized in the system:
Add contact: add a new contact to the address book. The information includes (name, gender, age, contact number, home address, and records up to 1000 people.
Show contacts: displays all contact information in t ...
Added by dudeddy on Fri, 17 Dec 2021 12:23:37 +0200
On the use and modification of spj on online judge platform
LDUOJ For example, goto - > github LDUOJ Platform Developer spj development blog The spj usage rules of different platforms may be different, but there are not too many changes to be made
first:
Parameter correspondence
args[1] corresponds to the input of data args[2] is the answer to the corresponding data, that is, an allowable cond ...
Added by Calamity-Clare on Fri, 17 Dec 2021 02:12:10 +0200
Rotate Array
1. Title
Give you an array and rotate the elements of the array K positions to the right, where k is a non-negative number.
Example 1:
Input: nums = [1,2,3,4,5,6,7], k = 3
Output: [5,6,7,1,2,3,4]
Explanation:
Rotate one step to the right: [7,1,2,3,4,5,6]
Rotate 2 steps to the right: [6,7,1,2,3,4,5]
Rotate 3 steps to the ri ...
Added by NightCoder on Thu, 16 Dec 2021 23:48:37 +0200
c + + implementation of signal slot
Although I do not use the Qt framework, I am very interested in the signal slot mechanism. Recently, I read csdn several articles on signal slots. From my own point of view, the records are as follows:
Implementation of signal slot mechanism with c + + Personal understanding of the signal slot mechanism: a signal slot is a channel that establi ...
Added by sarabjit on Thu, 16 Dec 2021 10:20:54 +0200
โค๏ธ You can understand at a glance! Nanny level example explanation STL list container [ten thousand words sorting] โค๏ธ
๐ Author: Linux ape
๐ Introduction: CSDN blog expert ๐๏ผ C/C + +, interview, question brushing and algorithm. Please consult me, pay attention to me and chat privately if you have any questions!
๐ Attention column: C/C + + interview customs collection (high quality articles are constantly updated...) ๐
catalogue
1, What is a list? ...
Added by StripedTiger on Thu, 16 Dec 2021 08:36:28 +0200
Remote video control series - mjpg stream source code analysis - init_v4l2
Entry parameter: struct vdIn * vd.
1. Turn on a usb camera
if((vd->fd = OPEN_VIDEO(vd->videodevice, O_RDWR)) == -1) {
perror("ERROR opening V4L interface");
DBG("errno: %d", errno);
return -1;
}
#define OPEN_VIDEO(fd, flags) open(fd, flags)
The main function is the open function, where VD - > videodevice ...
Added by jamiel on Thu, 16 Dec 2021 07:46:58 +0200
Blue Bridge Cup practice 008
Blue Bridge Cup practice 008
Interview question 01.06 String compression
String compression. Using the number of character repetitions, write a method to realize the basic string compression function. For example, the string aabcccccaaa becomes a2b1c5a3. If the "compressed" string is not shorter, the original string is returned. You ...
Added by plautzer on Wed, 15 Dec 2021 21:58:08 +0200
Summary of C + + string segmentation methods
In some programming exercises, the string is often processed, and the string is often segmented to extract each part of the information before processing. Although C + + does not provide a direct string segmentation function such as split like python, there are some other methods to segment it. The following describes several string segmentatio ...
Added by ailgup on Tue, 14 Dec 2021 23:53:30 +0200