10 2020 档案

摘要:https://blog.csdn.net/qq_39539470/article/details/81329102,这个讲的很不错了。 const可以修饰类的成员函数,那么这个函数就不能更改数据成员了,因为对应的隐参数this会被改为一个指向变量的指针, 不能修改数据成员的值。 阅读全文
posted @ 2020-10-30 01:03 lypbendlf 阅读(343) 评论(0) 推荐(0)
摘要:1.奇怪的现像: int get(int ); int get(const int); //上面这样是可以的,不报错 int get(int ); double get(const int); //error: ambiguating new declaration of 'double get(i 阅读全文
posted @ 2020-10-29 21:07 lypbendlf 阅读(305) 评论(0) 推荐(0)
摘要:1.指向常量的指针和指针常量 int a=0; const int *const p=&a; // *p=2;//error: assignment of read-only location '*(const int*)p' int *const p1=&a; *p1 =3;//正确 在p的生命中 阅读全文
posted @ 2020-10-29 20:11 lypbendlf 阅读(203) 评论(0) 推荐(0)
摘要:https://www.zhihu.com/question/26872913 这个解释非常好,重复包含就是重复定义,那么就会报错了。 阅读全文
posted @ 2020-10-29 17:52 lypbendlf 阅读(238) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/mrlsx/p/5510496.html 1.NULL为0值,nullptr是指针对象 NULL是一个宏定义,c中NULL为(void*)0,而c++中NULL为整数0: //C语言中NULL定义 #define NULL (void*)0 // 阅读全文
posted @ 2020-10-29 17:03 lypbendlf 阅读(349) 评论(0) 推荐(0)
摘要:转自:https://www.zhihu.com/question/281940376 https://www.cnblogs.com/Yekko/p/13508941.html 这两个链接里说的有不一样的地方,到底以哪个为准,之后看cpprimer再确认。 1.基本概念 堆,英文是 heap,在内 阅读全文
posted @ 2020-10-28 20:28 lypbendlf 阅读(260) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/ii0789789789/article/details/94899531,这个讲的很好 1.ref和&的例子 链接中讲的例子很好。 2.函数式编程 是对参数直接进行拷贝,而不是引用。 void f(int &a,int &b,int &c){ cout< 阅读全文
posted @ 2020-10-28 19:20 lypbendlf 阅读(528) 评论(0) 推荐(0)
摘要:https://segmentfault.com/a/1190000007304644,这个举的例子非常好,容易理解。 1.线程冲突 线程间共享进程的资源,在访问时可能会出现 线程冲突、内存一致性错误,解决的方法是线程同步。 当两个运行在不同线程的操作,作用在同一个数据上,会发生线程冲突 (Thre 阅读全文
posted @ 2020-10-28 00:46 lypbendlf 阅读(183) 评论(0) 推荐(0)
摘要:转自:https://leetcode-cn.com/problems/binary-tree-preorder-traversal/solution/leetcodesuan-fa-xiu-lian-dong-hua-yan-shi-xbian-2/ 1.递归解法 前中后遍历都很简单,就不写了。 阅读全文
posted @ 2020-10-28 00:24 lypbendlf 阅读(208) 评论(0) 推荐(0)
摘要:j 阅读全文
posted @ 2020-10-27 22:24 lypbendlf 阅读(617) 评论(0) 推荐(0)
摘要:https://www.zhihu.com/question/19801131,这个下面的回答都很高质量。 1、介绍 https://www.cnblogs.com/smartlife/articles/12519130.html 先传入后被调用的函数。也是普通函数,因为程序通过参数把该函数的函数指 阅读全文
posted @ 2020-10-27 19:08 lypbendlf 阅读(110) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/wangguchangqing/p/6141743.html 1.区别 拷贝构造函数和赋值运算符的行为比较相似,都是将一个对象的值复制给另一个对象; 但是其结果却有些不同,拷贝构造函数使用传入对象的值生成一个新的对象的实例,而赋值运算符是将对象的 阅读全文
posted @ 2020-10-27 19:02 lypbendlf 阅读(658) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/huolong-blog/p/7587711.html 1.定义与用法 sizeof是一个操作符(operator)。 其作用是返回一个对象或类型所占的内存字节数。 sizeof有三种语法形式: 1) sizeof (object); //sizeof 阅读全文
posted @ 2020-10-27 17:36 lypbendlf 阅读(120) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/p942005405/article/details/84764104 1.例子 上面链接中给出的例子: #include <vector> #include <string> #include <iostream> struct President { 阅读全文
posted @ 2020-10-27 17:13 lypbendlf 阅读(584) 评论(0) 推荐(0)
摘要:1.递归调用过程中值传递 void dfs(vector<int> vt){ if(vt.size()==10){ for(auto v:vt) cout<<v<<" "; return; } vt.push_back(5); dfs(vt); } int main(){ vector<int> v 阅读全文
posted @ 2020-10-27 17:09 lypbendlf 阅读(294) 评论(0) 推荐(0)
摘要:https://baike.baidu.com/item/boost/69144?fr=aladdin 1.C++程序库的总称 Boost是为C++语言标准库提供扩展的一些C++程序库的总称。Boost库是一个可移植、提供源代码的C++库,作为标准库的后备,是C++标准化进程的开发引擎之一,是为C+ 阅读全文
posted @ 2020-10-27 12:57 lypbendlf 阅读(275) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/qq_41648048/article/details/90204510 第一步切换到root用户下 第二执行如下命令 #usermod -s /bin/bash wts wts为用户名 阅读全文
posted @ 2020-10-27 11:10 lypbendlf 阅读(168) 评论(0) 推荐(0)
摘要:http://c.biancheng.net/view/2226.html 阅读全文
posted @ 2020-10-26 22:42 lypbendlf 阅读(76) 评论(0) 推荐(0)
摘要:1.基本原理 两个数的最大公约数是指能同时整除它们的最大正整数。 基本原理是:两个数的最大公约数等于它们中较小的数和两数之差的最大公约数。 举例:252和105。 https://www.zhihu.com/question/62603177,这个问题下的回答可以看出更相减损术与辗转相除法的原理是相 阅读全文
posted @ 2020-10-26 22:27 lypbendlf 阅读(167) 评论(0) 推荐(0)
摘要:转自:http://c.biancheng.net/view/231.html 1.定义 memset() 函数可以说是初始化内存的“万能函数”,通常为新申请的内存进行初始化工作。它是直接操作内存空间,mem即“内存”(memory)的意思。 该函数的原型为: # include <string.h 阅读全文
posted @ 2020-10-26 10:32 lypbendlf 阅读(109) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/weixin_36888577/article/details/79937886 2.函数原型 priority_queue<Type, Container, Functional> Type 就是数据类型,Container 就是容器类型(默认使用 阅读全文
posted @ 2020-10-24 18:49 lypbendlf 阅读(212) 评论(0) 推荐(0)
摘要:1.pandas 可视化 原来dataframe对象可以直接画图啊!!https://www.yiibai.com/pandas/python_pandas_visualization.html import numpy as np import pandas as pd df = pd.DataF 阅读全文
posted @ 2020-10-23 21:56 lypbendlf 阅读(633) 评论(0) 推荐(0)
摘要:https://scikit-learn.org/stable/modules/generated/sklearn.metrics.silhouette_score.html 1.参数 主要是上面这两个参数,比如说X可以是经过tsne降维的n_feature=2的二维矩阵,第一维表示样本数量,lab 阅读全文
posted @ 2020-10-23 12:02 lypbendlf 阅读(982) 评论(0) 推荐(0)
摘要:1.http://www.datakit.cn/blog/2017/02/05/t_sne_full.html,其实这个讲的一般。 http://bindog.github.io/blog/2016/06/04/from-sne-to-tsne-to-largevis/ 1.SNE原理 https: 阅读全文
posted @ 2020-10-23 11:14 lypbendlf 阅读(596) 评论(0) 推荐(0)
摘要:https://www.zhihu.com/question/316128884 https://keras.io/guides/functional_api/ https://keras.io/guides/training_with_built_in_methods/ 从上面的讲解中,对多输入多 阅读全文
posted @ 2020-10-22 22:02 lypbendlf 阅读(2455) 评论(0) 推荐(0)
摘要:https://www.runoob.com/linux/linux-comm-scp.html 1.介绍 Linux scp 命令用于 Linux 之间复制文件和目录。 scp 是 secure copy 的缩写, scp 是 linux 系统下基于 ssh 登陆进行安全的远程文件拷贝命令。 sc 阅读全文
posted @ 2020-10-22 11:09 lypbendlf 阅读(202) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/qq_20200047/article/details/105671374 1.简单测import sys import sys import torch import random import argparse import numpy as np i 阅读全文
posted @ 2020-10-21 17:47 lypbendlf 阅读(2359) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/haoel/article/details/2886 https://seisman.github.io/how-to-write-makefile/overview.html 1.介绍 makefile定义了一系列的规则来指定,哪些文件需要先编译, 阅读全文
posted @ 2020-10-20 17:28 lypbendlf 阅读(108) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/mmk27_word/article/details/84378346 short:-2^15~2^15-1 int:-2^31~2^31-1 long:-2^31~2^31-1 long long:-2^63~2^63-1 //原来long和int表示的 阅读全文
posted @ 2020-10-19 15:32 lypbendlf 阅读(137) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/linpeach/article/details/109048408 蓝 色:文件夹 红色:压缩文件 绿色:可执行文件 白色:文本文件红色闪烁:错误的符号链接淡蓝色:符号链接黄色:设备文件灰色:其它文件 阅读全文
posted @ 2020-10-17 19:25 lypbendlf 阅读(242) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/heihu_malice7/article/details/90042912 1.例如二分查找 总共有n个元素,每次查找的区间大小就是n,n/2,n/4,…,n/2^k(接下来操作元素的剩余个数),其中k就是循环的次数。 //k在递归的时候也可以说是递归的 阅读全文
posted @ 2020-10-16 15:37 lypbendlf 阅读(1463) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/qq_40160605/article/details/80150252,这个讲的非常全面! 1.从小到大排序的数组 lower_bound( begin,end,num):从数组的begin位置到end-1位置二分查找第一个大于或等于num的数字, 阅读全文
posted @ 2020-10-16 14:59 lypbendlf 阅读(159) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/xd502djj/archive/2011/02/28/1967350.html 1.命令 1. 查看物理CPU的个数 #cat /proc/cpuinfo |grep "physical id"|sort |uniq|wc -l 2. 查看逻辑 阅读全文
posted @ 2020-10-14 14:32 lypbendlf 阅读(1408) 评论(0) 推荐(0)
摘要:1.安装pytorch https://pytorch.org/get-started/locally/ 在这个网站上根据cuda版本选择命令: conda install pytorch torchvision cudatoolkit=10.0 -c pytorch 安装过程中出现了: Conda 阅读全文
posted @ 2020-10-14 13:54 lypbendlf 阅读(416) 评论(0) 推荐(0)
摘要:1.进程kill不掉还是重新开始占用GPU?? https://www.cnblogs.com/shuai7boy/p/12540104.html 命令: top #查看id或nvidia-smi查看占用gpu的pidcd /proc/pid cat status #查看PPID为父进程ID kil 阅读全文
posted @ 2020-10-14 11:01 lypbendlf 阅读(582) 评论(0) 推荐(0)
摘要:https://www.linuxidc.com/Linux/2015-03/114695.htm 1、利用chown改变所有者: 对Document/ 目录下的所有文件与子目录执行相同的所有者变更,修改所有者为users用户组的username用户 chown -R username:users 阅读全文
posted @ 2020-10-14 11:00 lypbendlf 阅读(487) 评论(0) 推荐(0)
摘要:1.查看cuda版本: 1.cat /usr/local/cuda/version.txt 2.或者 nvcc -v 其中遇到了问题,通过第一个cat命令查看版本的时候,显示的是不存在这个目录,去对应目录下也没有发现cuda相关目录,但是通过第2哥nvcc就可以查到是9.1版本的cuda, 那么到底 阅读全文
posted @ 2020-10-13 22:47 lypbendlf 阅读(6691) 评论(0) 推荐(0)
摘要:1.挂载与解挂载 转自:https://www.cnblogs.com/zhangguilin/p/6930760.html mkdir /new ###跳板目录 mount /dev/sdb1 /new ###首先挂载跳板目录 cp -R /home/* /new ###复制/home目录所有数据 阅读全文
posted @ 2020-10-13 19:09 lypbendlf 阅读(137) 评论(0) 推荐(0)
摘要:转自:https://blog.csdn.net/gu_study/article/details/81942939 https://blog.csdn.net/Poo_Chai/article/details/80913671 1.CPU利用率 Utilization= work_time/tot 阅读全文
posted @ 2020-10-12 20:55 lypbendlf 阅读(491) 评论(0) 推荐(0)
摘要:1.要用strcpy https://zhidao.baidu.com/question/104592558.html char c[20]; string s="1234"; strcpy(c,s.c_str()); //这样才不会出错,c_str()返回的是一个临时指针,不能对其进行操作。 下面 阅读全文
posted @ 2020-10-10 14:00 lypbendlf 阅读(159) 评论(0) 推荐(0)
摘要:https://www.zhihu.com/question/62185153,这个回答下面有很多优秀的回答,但是目前我还有点看不懂。 1. python和C++执行的过程分别是怎样? 阅读全文
posted @ 2020-10-09 22:11 lypbendlf 阅读(637) 评论(0) 推荐(0)
摘要:转自:https://www.cnblogs.com/pzhfei/archive/2013/01/14/lambda_expression.html 1.匿名/Lambda函数 [capture](parameters)->return-type{body} 如果没有参数,空的圆括号()可以省略. 阅读全文
posted @ 2020-10-09 22:04 lypbendlf 阅读(187) 评论(0) 推荐(0)
摘要:https://www.cnblogs.com/stones-dream/p/10183210.html 1.sort(first_pointer,first_pointer+n,cmp) 实现原理:sort并不是简单的快速排序,它对普通的快速排序进行了优化,此外,它还结合了插入排序和推排序。系统会 阅读全文
posted @ 2020-10-09 21:55 lypbendlf 阅读(207) 评论(0) 推荐(0)