Skip to content

Instantly share code, notes, and snippets.

View wangzhankun's full-sized avatar
🏠
Working from home

wangzhankun wangzhankun

🏠
Working from home
View GitHub Profile
@wangzhankun
wangzhankun / copy-with-so.sh
Created November 4, 2023 08:07
copy-with-so.sh
#!/bin/bash
# 用法:./copy-with-so.sh 源文件 目标目录 sysroot
# 例如:./copy-with-so.sh /bin/ls /tmp
my_help(){
echo "用法:./copy-with-so.sh 源文件 目标目录 sysroot"
}
@wangzhankun
wangzhankun / launch.json
Last active June 21, 2021 16:09
vscode gcc debug
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "debug",
"type": "cppdbg",
"request": "launch",
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
@wangzhankun
wangzhankun / C++ string_replace.cpp
Created April 17, 2021 08:11
C++字符串中字符替换
string replace(const string& old_value, const string& new_value, const string& str)
{
string ret = str;
replaceSrc(old_value, new_value, ret);
return ret;
}
inline void replaceSrc(const string& old_value, const string& new_value, string& str)
{
while(true) {
@wangzhankun
wangzhankun / C++事件机制.cpp
Created March 22, 2021 01:40
C++事件机制
#pragma once
#include <map>
#include <functional>
namespace Utility
{
namespace Private
{
struct NullType
@wangzhankun
wangzhankun / thread_poll.cpp
Last active April 20, 2021 15:39
线程池 thread_poll
#include <mutex>
#include <condition_variable>
#include <functional>
#include <queue>
#include <thread>
class fixed_thread_pool
{
private:
struct data
@wangzhankun
wangzhankun / unique_ptr.cpp
Created February 25, 2021 12:59
智能指针
#include <iostream>
#include <vector>
#include <memory>
#include <cstdio>
#include <fstream>
#include <cassert>
#include <functional>
struct B {
virtual void bar() { std::cout << "B::bar\n"; }
#include <opencv2/core.hpp>
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/videoio.hpp>
-- 上层文件
add_syslinks("pthread","gxiapi", "yaml-cpp")
add_requires("opencv 3.4", {system = true})
set_languages("cxx17")
add_cxxflags("-Wall -pedantic")
includes("Main")
includes("Share")
includes("Armor")
includes("Buff")