原创 使用GDB進行多線程調試的基本常用命令

1. 線程的查看 首先創建兩個線程: #include <stdio.h> #include <unistd.h> #include <pthread.h> #include <stdlib.h> #include <string

原创 weakptr-void sharedptr-void知多少及智能指針的類型轉換

void*裸指針的使用及轉換 我們知道,在使用裸指針時,對於那些不確定的類型指針,我們可以用void*來進行指向. 真正知道了類型之後,需要進行轉換.具體的轉換方式有: static_cast<T*> const_cast<T*>

原创 POLLHUP vs POLLNVAL vs EPOLLHUP

POLLNVAL POLLNVALis equivalent to EBADF: it means the file descriptor does not actually refer to any open file, i.e

原创 pthread_join(),pthread_exit(),pthread_detach()

簡介 pthread有兩種狀態joinable狀態(屬性)和unjoinable狀態,如果線程是joinable狀態,當線程函數自己返回退出時或pthread_exit時都不會釋放線程所佔用堆棧和線程描述符。只有當你調用了pth

原创 c++primer 6.3.3節練習(返回數組指針的4個方法)

#include <iostream> #include <string> #include <vector> using namespace std; /*返回數組指針或者引用的4種方法*/ /*返回數組指針,方法1,類型別名*/

原创 C++ primer6.21練習題(產生隨機數的相關知識)

#include <iostream> #include <string> #include<ctime> #include<cstdlib> using namespace std; int MaxNum(const int xV

原创 C++primeer 6.7節練習(函數指針,函數指針形參)

6.54 #include <iostream> #include <string> #include <vector> using namespace std; /*函數指針*/ int test(int a, int b); /

原创 main函數的兩個參數

int main(int argc , char *argv[]) int main(int argc, char **argv) 當我們確實要給main函數傳參,執行不同的代碼時,我們可以選擇這種寫法。 argc is An integ

原创 Keras的自定義lambda層去reshape tensor張量時model保存出錯的解決辦法

背景           分割網絡在進行上採樣的時候我用的是雙線性插值上採樣的,而Keras裏面並沒有實現雙線性插值的函數,所以要自己調用tensorflow裏面的tf.image.resize_bilinear()函數來進行re

原创 C++ primer第五版 7.1.3節練習

定義Sales_data的頭文件 #ifndef CH6_H_INCLUDED #define CH6_H_INCLUDED #include <iostream> #include <string> using namespace st

原创 VS2017+QT打包程序發佈

https://www.cnblogs.com/doudou-1102/p/10266010.html

原创 海量數據處理算法—Bit-Map---面試題集錦

Bitmap算法簡介: https://blog.csdn.net/hguisu/article/details/7880288 面試題集錦: https://blog.csdn.net/v_july_v/article/deta

原创 java中的接口與C++的多繼承

JAVA接口含義 https://www.runoob.com/java/java-interfaces.html Java中接口的作用 問題: 例如我定義了一個接口,但是我在繼承這個接口的類中還要寫接口的實現方法,那我不如直接就

原创 宏定義函數-普通函數-內聯函數區別

宏定義函數VS普通函數VS內聯函數 宏定義函數VS普通函數 宏定義函數 要點:變量都用括號括起來,防止出錯,結尾不需要;。在實際編程中,不推薦把複雜的函數使用宏,不容易調試。多行用\ 例子: 單行: #define M

原创 CString,string,char*轉換

CString,string,char*轉換 首先假設這裏CString是CStringA,之後再討論CStringW的轉換. string=> CString string str; CString cstr; cstr.f