自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(101)
  • 资源 (6)
  • 收藏
  • 关注

原创 Windows下获得系统cpu空闲比及指定进程CPU占比

【代码】Windows下获得系统cpu空闲比及指定进程CPU占比。

2024-02-29 13:34:28 132

原创 3d Slicer软件一种新的体绘制方式

vtk Multi-Volumne试验性体绘制方式,细节更丰富,影像更清晰,值得学习使用。

2024-02-24 21:15:39 197

原创 简易好用的C++结构体与JSON文本相互转换开源库

struct_mapping开源库使用示例,可以在C++结构体与JSON文本间相互转换

2023-09-22 15:55:24 619

原创 MFC QT混合编程‘完美’方案

建立MFC-RIBBON/QT程序的模板

2023-08-28 20:09:24 406

原创 MS VC 2022开发Linux应用记录之02篇-开发调试Linux QT应用

首先 vim ~/.bashrc 然后在里面添加 export QT_QPA_PLATFORM='offscreen' 即时生效 source ~/.bashrc 这样就可以额 每次修改.bashrc后,使用source ~/.bashrc(或者 . ~/.bashrc) 就可以立刻加载修改后的设置,使之生效。vim /etc/profile , 添加 export DISPLAY=:0.0 ,wq,保存退出 ,再 source /etc/profile 生效。

2023-07-23 01:06:44 235

原创 MS VC 2022开发Linux应用记录之01篇

13. 在代码中设置断点,按F5进行调试。单步运行,可以从Linux终端中看到一步步的输出。14.也可以在虚拟机的~/.vs目录下找到上述C++项目,并可运行生产的目标程序。12. 生成程序,可以在linux终端中运行该程序。

2023-07-22 23:03:29 186

原创 VTK套索裁剪演示

【VTK套索裁剪演示-哔哩哔哩】 https://b23.tv/EbVWuJp。

2023-03-19 22:13:12 282 1

原创 手写Linux环境下C++内存泄漏检测

简单有效的Linux程序内存泄漏检测代码

2022-10-30 22:54:34 176

原创 手写Visual C++软件内存泄漏检测代码

简单快捷的VC++程序泄漏检测代码

2022-10-29 21:31:49 130

原创 VTK几个坐标的测试

获得VTK三维视图的几个主要位置的世界坐标

2022-09-11 23:39:03 333 1

原创 armadillo + openblas 编译

armadillo + openblas 编译

2022-08-25 12:32:36 451

原创 Windows 为什么需要资源句柄

Windows 为什么需要资源句柄

2022-07-29 14:32:46 287

原创 VC开发非MFC程序内存泄漏跟踪代码

WINDOWS 环境下使用VC开发非MFC程序内存泄漏跟踪代码

2022-07-03 18:26:59 226

转载 转载:VTK笔记-裁剪分割-不规则闭合圈选裁剪-vtkSelectPolyData类(黑山老妖)

 vtkClipClosedSurface类使用平面集合剪裁闭合曲面。

2022-06-26 18:27:03 1055

转载 转载:VTK笔记-裁剪分割-三维曲线或几何切割体数据(黑山老妖)

https://blog.csdn.net/liushao1031177/article/details/118419221

2022-06-26 13:58:04 1175 1

原创 Slicer的传输函数参数值

<?xml version="1.0" encoding="UTF-8"?><MRML> <VolumeProperty selected="false" hideFromEditors="false" name="CT-AAA" gradientOpacity="4 0 1 255 1" userTags="" specularPower="10" scalarOpacity="12 -3024 0 143.556 0 166.222 0.686275 214.389.

2022-05-29 18:37:35 142

原创 linux下抓取C++ throw调用栈

使用API钩子技术,抓取throw调用的调用堆栈。1. hook_cxa_throw-lys.hpp#pragma once#include <dlfcn.h>#include <cstddef>#include <exception>#include <signal.h>#include <execinfo.h>#include <ucontext.h>#include <thread>#i

2022-05-25 22:16:26 500

原创 发布本人的第一个CSDN视频,VTK的

Vtk 3D Pro 2022-05-21 23-02-40-CSDN直播

2022-05-22 00:09:28 93

原创 googletest 自动化测试例子合集

下面是本人的一些测试结果,仅作展示

2022-05-10 16:44:10 1146

原创 VTK 3D体绘制颜色传输效果展示

下面是本人的一些测试结果,仅作展示

2022-05-07 16:52:43 317 2

原创 C++ 并发编程练习15 “最简单的线程池”

下面的代码展示了一个简单的线程池。#include <atomic>#include <functional>#include <iostream>#include <mutex>#include <queue>#include <thread>#include <vector>template<typename T>class thread_safe_queue{private:

2022-05-02 16:32:59 981

原创 C++并发编程练习14 “异步任务测试”

使用feature特性,可以获得异步执行的效果。如下面的例子#include <iostream> #include <future> #include <chrono> #include <thread> int loopType (int from, int to) { for (int i = from; i != to; ++i) { std::cout <

2022-05-02 15:13:10 931

原创 在Linux Deepin OS 下编译ParaView的步骤

首先编译OPEN-MPIgit clone https://github.com/open-mpi/ompi.gitcd ./ompigit submodule update --init --recursivesudo apt-get install autoconfsudo apt-get install libtoolsudo apt-get install flex./autogen.pl./confiugremake再下载ParaView源代码git clone h..

2022-04-30 14:54:53 481 3

原创 在Windows/QT环境编程中同时catch C++异常和SEH异常

代码如下://.hclass CONTROLLER_API CExceptionGuard{public: CExceptionGuard(); ~CExceptionGuard();private: class Impl; Impl* prd;};// .cppclass SE_Exception : public std::exception{private: const unsigned int nSE;public: SE_Exception() noe

2022-04-28 12:10:40 1782

原创 在Windows中编译libevent库步骤

1. 从下面的网页中下载和安装 Win64OpenSSL-1_1_1n.msi , 全部照缺省设置安装即可Win32/Win64 OpenSSL Installer for Windows - Shining Light Productions (slproweb.com)2. 到git下载libevent库https://github.com/libevent/libevent.git33. CMake配置libevent项目勾选 EVENT__DISABLE_MBEDTLSOPE

2022-04-27 00:12:38 1734

原创 DLL远程注入一则

1. 线程注入一注入的可行性 kernel32.dll 和 user32.dll 是两个在大部分程序上都会调用的 DLL 同一个 DLL,在不同的进程中,不一定被映射(加载)在同一个内存地址下。但是 kernel32.dll和 user32.dll 例外。他们总是被映射到进程的内存首选地址因此,在所有使用这两个 DLL 的 进程中,这两个 DLL 的内存地址是相同的。我们在本进程获取的 kernel32.dli 中函数的地址, 在目标进程中也是一样的。2. 涉及的 API OpenProce

2022-04-24 00:14:24 279

原创 C++并发编程练习13 “线程安全栈设计”

使用mutex锁,设计一个线程安全的stack,示例如下#include <exception>#include <memory>#include <mutex>#include <stack>struct empty_stack : std::exception{ const char* what() const throw();};template<typename T>class threadsafe_sta

2022-04-23 17:57:56 710

原创 C++并发编程练习12 “在跨线程中使用函数对象(指针)”

需要谨慎防止被保护的对象意外泄露到外界函数被更改状态。代码示例如下:#include <functional>#include <iostream>#include <mutex>#include <string>#include <thread>struct TData{public: int n; std::string str;public: TData() { n = 0; str = "Mout

2022-04-23 16:28:19 891

原创 C++并发编程练习11 “互斥量”

在多线程开发中,常遇到共享数据需要保护的问题,我们可以使用互斥量std::mutext类来解决这个问题,示例如下#include <chrono>#include <iostream>#include <mutex>#include <thread>#include <vector>struct scoped_mutex{ scoped_mutex(std::mutex& mtx) : mt(mt

2022-04-23 15:14:13 548

原创 C++并发编程练习10 “线程管理之线程ID”

std::thread有一个get_id()函数可以唯一标识系统中线程。示例如下#include <chrono>#include <iostream>#include <string>#include <thread>#include <vector>std::thread::id master;void func(int i){ std::string msg = std::to_string(i);

2022-04-23 00:10:48 940

原创 C++并发编程练习09 “线程管理之线程数目动态确定”

我们可以动态计算并创建合理的线程数目, 代码示例如下#include <algorithm>#include <functional>#include <iostream>#include <numeric>#include <thread>#include <vector>template<typename Iterator, typename T>struct accumulate_block{

2022-04-22 23:50:12 144

原创 C++并发编程练习08 “线程管理之线程容器”

我们可以使用容器保存一组线程,如下面的vector装入一组线程:#include <chrono>#include <iostream>#include <string>#include <thread>#include <vector>void func(int n){ std::string str = std::to_string(n); str += '\n'; std::cout <&lt

2022-04-22 22:40:44 329

原创 C++并发编程练习07 “线程管理之线程scoped”

线程scoped在某些场合还是很有用的,可以简化编程,不易出错。示例如下:#include <exception>#include <iostream>#include <thread>struct scoped_thread{ std::thread th; scoped_thread(std::thread&& t) { if (!t.joinable()) throw std::runtime_error("threa

2022-04-22 22:19:32 228

原创 C++并发编程练习06 “线程管理之线程对象转移“

线程对象可以和一般对象一样,其所有权可以被转移,示例如下:#include <iostream>#include <thread>void get(std::thread&& t){ t.detach(); int a; std::cin >> a; std::cout << a << std::endl;}void task(const char* sz){ std::cout << s

2022-04-22 22:03:47 227

原创 C++并发编程练习05 “线程管理之传递引用参数给任务函数与std::ref绑定”

传递引用时需注意,如下面代码注释中所述:#include <iostream>#include <thread>void task(int& n){ n *= 2;}int main(){ int a = 100; //注意必须用std::ref绑定,否则由于thread构造函数无法识别,它将传入a的副本的引用给task函数 std::thread t(task, std::ref(a)); t.join()

2022-04-22 20:31:57 263

原创 C++并发编程练习04 “线程管理之传递参数给任务函数”

我们可以对不同的多线程任务函数传递对应参数。其参考代码如下:#include <iostream>#include <thread>void task(int n, const char* message){ std::cout << n << "," << message << std::endl;}int main(){ std::thread t(task, 1, "something hap

2022-04-22 20:17:08 277

原创 C++并发编程练习03 “线程管理之线程守卫”

包装类对象析构时执行线程#include <iostream>#include <thread>struct thread_guard{public: std::thread& t; explicit thread_guard(std::thread& _t) : t(_t) {}; ~thread_guard() { if(t.joinable()) t.join(); } thread_guard(thread_guard&

2022-04-22 10:26:31 195

原创 C++并发编程练习02 “线程管理之启动线程”

启动线程有detach()和join()两个函数,前者是异步启动,后者是同步启动并等待结束。#include <iostream>#include <thread>struct task{ int& i; task(int& i_) :i(i_) {}; void operator()() { for (int j = 0; j < 200; j++) std::cout

2022-04-22 10:12:38 123

原创 C++并发编程练习01 “Hello World“

#include <iostream>#include <thread>void sayHello(){ std::cout << "Hello World!\n";}int main(){ std::thread t(sayHello); t.join(); return 0;}

2022-04-22 10:05:50 123

原创 使用批处理文件递归删除C++项目中的.git文件夹和VC生成文件

使用.bat文件可以方便的进行如标题所示的文件。.bat文件的内容可以象下面这样@echo Offdel /F /s /a *.suo *.dll *.exe *.sha512 *.db *.ncb *.user *.pdb *.netmodule *.aps *.ilk *.plg *.opt *.idb *.obj *.sbr *.exp *.tlh *.tli *.clw *.pch *.res *.sdf *.ipch *.log *.tlogsetlocal enabledela

2022-04-20 17:57:00 348

LCC编译器VC源码包

LCC编译器源码,是一款C语言编译器,可以使用VC编译, 配合nasm可以开发Windows控制台应用程序

2015-10-02

VS2008 运行库源码学习手册

做成chm文档的C 运行时刻库源码 单个文档,导航容易,可在电脑和平板上阅读,后者建议使用QQ阅读

2013-08-22

TxtScript- C/CPP语法着色编辑器

C C++ 语言文件浏览与编辑工具,支持语法着色,附完整源代码和编译好的可执行文件 需要 VC2008 SP1 包支持。 Ribbon界面。 有好的建议或者改进欢迎提供给本人

2013-01-23

OllyDbg使用图文教程

OllyDbg使用图文教程,较详细,是我苦心从国外网站找到的,感兴趣的可以下载看看

2008-10-26

Exceptional C++

Exceptional C++

2007-04-11

The C++ Standard Library

The C++ Standard Library

2007-03-29

空空如也

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

TA关注的人

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