自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(8)
  • 收藏
  • 关注

原创 Linux/C/C++ 条件变量实现线程的暂停、继续、停止功能

1.threadControl.cpp#include <iostream>#include <mutex>#include <vector>#include <thread>#include <chrono>#include <condition_variable>enum THREAD_CONTROL{ THREAD_RUN, THREAD_PAUSE, THREAD_STOP,

2021-03-10 12:53:06 1999

原创 Linux/C/C++ 利用小根堆实现topN

topN.cpp#include <iostream>#include <vector>std::vector<int> topN(const std::vector<int>& arry, const unsigned int toplen);void createheap(std::vector<int>& res);void heapify(std::vector<int>& res, co

2021-02-28 21:08:50 491

原创 Linux/C/C++ TrieTree字典树实现关键词过滤

1.main.cpp#include <iostream>#include "othertrie.hpp"using namespace mytrie;int main(int argc, char *argv[]){ std::string text = "即便在世界仍深陷冷战之中的1970年,毛主席"\ "在会见美国记者斯诺时也曾表示:“中美两国总要建交的。中国和美国难道就"\ "一百年不建交啊?” 美国前总统尼克松也曾说过:“我们改善同北京的实际上的

2021-02-28 21:00:36 311

原创 Linux/C/C++ 文件监控和网络监控的简单实现(利用hook技术)

file_filter.c#include <stdio.h>#include <string.h>#include <stdlib.h>#include <sys/stat.h>#include <unistd.h>#include <dlfcn.h>#define STRMAXLEN 301const char path[] = "/home/changun/test"; // 受监控的目录const cha

2020-12-19 15:42:28 2528 2

原创 Linux/C/C++ epoll网络服务端多线程实现-EPOLLONESHOT事件

demo.c#include <stdio.h>#include <stdlib.h>#include <string.h>#include <netinet/tcp.h>#include <arpa/inet.h>#include <pthread.h>#include <unistd.h>#include <poll.h>#include <errno.h>#include

2020-12-09 23:27:51 956

原创 Linux/C/C++将虚拟机磁盘文件挂载到本地文件系统

vdfmount.h#ifndef VDFMOUNT_H#define VDFMOUNT_H#include <sys/mount.h>#include "public.h"#include "WidgetConst.h"#include "Logger.h"using namespace LogFile;class vdfMount{public: vdfMount() { m_isMount = -1; m_image

2020-11-08 16:19:23 780

原创 Linux/C/C++多线程和IO多路转接网络服务端的简单实现

webServer.c#include <stdio.h>#include <stdlib.h>#include <string.h>#include <netinet/tcp.h>#include <arpa/inet.h>#include <pthread.h>#include <unistd.h>#include <poll.h>#include <errno.h>#in

2020-10-18 18:03:05 394 1

原创 TOTP动态密钥生成器Linux/C/C++实现

TOTP动态密钥生成器Linux/C/C++TOTP.h#ifndef __TOTP_H#define __TOTP_H#include <iostream>#include <sstream>#include <string>#include <vector>#include <ctime>#include <iomanip>#include <algorithm>#define PUBLIC_K

2020-09-13 16:13:40 2092 1

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除