- 博客(14)
- 收藏
- 关注
原创 c++11 写者优先
#include<iostream>#include<mutex>#include<condition_variable>#include<thread>#include<string>using namespace std;class semaphere{ public: semaphere(int n):m_count(n){} semaphere(const semaphere& s)=delete; semap
2020-07-29 18:15:26
293
原创 C++11读写公平实现
#include<iostream>#include<mutex>#include<condition_variable>#include<thread>#include<string>using namespace std;class semaphere{ public: semaphere(int n):m_count(n){} semaphere(const semaphere& s)=delete; semap
2020-07-29 17:02:53
343
原创 c++11 实现读者优先
#include<iostream>#include<mutex>#include<condition_variable>#include<thread>#include<string>using namespace std;class semaphere{ public: semaphere(int n):m_count(n){} semaphere(const semaphere& s)=delete; sema.
2020-07-29 16:56:11
156
原创 C++11实现生产者消费者模型
#include<iostream>#include<mutex>#include<condition_variable>#include<queue>#include<thread>using namespace std;mutex g_mtx; // p 互斥, s 互斥 condition_variable g_cv;queue<int> q;int maxsize=10;int data=0;void
2020-07-29 16:33:44
742
2
原创 C++11 互斥锁与条件变量实现信号量
#include<iostream>#include<mutex>#include<condition_variable>#include<thread>using namespace std;class semaphere{ public: semaphere(int n):m_count(n){} semaphere(const semaphere& s)=delete; semaphere & operator=(co
2020-07-29 16:30:13
464
原创 图的关键路径-c++11实现
#include<iostream>#include<vector>#include<queue>#include<stack>using namespace std;struct graphnode{ int dst; int w; graphnode* next; graphnode(){ } graphnode(int dts_,int w_):dst(dts_),w(w_),next(nullptr){ }};vector.
2020-07-22 23:00:44
176
1
转载 python opecv 计算图片清晰度 Laplacian方差
image = cv2.imread(imgPath);img2gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)imageVar = cv2.Laplacian(img2gray, cv2.CV_64F).var()
2020-01-14 21:59:06
940
原创 2019/12/3 win10 pip 安装pycocotools
2019/12/3 pip 安装pycocotools首先你必须要有VS14.0的版本然后你必须这是解决rc缺失的办法然后安装cython这样你才能通过pip install git+https://github.com/philferriere/cocoapi.git#subdirectory=PythonAPI这个命令安装pycocotools大多数问题都在于VS的配置问题...
2019-12-03 11:13:42
370
原创 pycharm快捷键失效问题
pycharm快捷键失效问题在日常使用中,经常遇到有的快捷键用不了的问题,尝试了一番,发现是pycharm的快捷键的优先级比其他软件低一些,经常被例如qq,微信,有道等软件占用导致失效.所以要设置好常用快捷键,避免冲突....
2019-11-19 17:17:09
2139
原创 python timeit 计算时间
python timeit 计算时间import timeitdef run(): print("hello")time=timeit.timeit(run,number=10)print(time) #2.58e-05很方便的计算函数耗时的方法
2019-11-19 10:34:24
269
转载 pip换源
pip国内的一些镜像阿里云 http://mirrors.aliyun.com/pypi/simple/中国科技大学 https://pypi.mirrors.ustc.edu.cn/simple/豆瓣(douban) http://pypi.douban.com/simple/清华大学 https://pypi.tuna.tsinghua.edu.cn/simple/中国科学技术大学 ...
2019-11-19 10:24:01
148
原创 python的引用与copy
python的引用与copy引用针对变量时例如:a=1b=ac=ab的改变不会引起c的改变引用针对列表时可以看到直接复制的列表没有被改变当使用索引改变b[0]时 c也改变了这说明时地址的值变化了 这是引用,如果不希望c改变,应当使用c=a.copy()这样c的值就不会变化了...
2019-11-15 17:18:29
215
原创 c++中数据类型所占字节数
c++中数据类型所占字节64位windows系统下,1个字节等于8位2进制64位windows系统下,1个字节等于8位2进制数据类型所占字节数char1short2int4long8float4double8指针8unsigned 代表无符号位...
2019-11-14 17:54:46
277
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人