自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(44)
  • 资源 (1)
  • 收藏
  • 关注

原创 Windows 安装QT 5.7.0 配置VS2019 编译环境

安装的时候把能遇到的坑都遇到了一遍ref:https://forum.qt.io/topic/90839/lnk1158-cannot-run-rc-exe/2ref:https://www.jb51.net/article/183061.htmref:http://download.qt.io/ref:https://blog.csdn.net/jasonkent27/article/details/40826609/ref:https://blog.csdn.net/thequitesunsh

2020-08-13 09:53:12 1495

原创 矩阵的运算

b站DR_CAN C++代码实现

2023-03-02 18:15:29 93

原创 LeetCode 简单难度 返回两数之和的下标

题目给定一个整数数组 nums 和一个目标值 target,请你在该数组中找出和为目标值的那 两个 整数,并返回他们的数组下标。你可以假设每种输入只会对应一个答案。但是,数组中同一个元素不能使用两遍。class Solution {public: vector<int> twoSum(vector<int>& nums, int target) { vector<int>::iterator i,j; vector

2020-11-24 10:15:30 144

原创 Essential C++ 1.7文件读写

文件写入#include <iostream>#include <vector>#include <string>#include <fstream>int main(){ using namespace std; ofstream file_name("test_1.6.txt", ios_base::app); // ios_base::app append mode 会在文件内追加内容 //ofstream file_na

2020-08-04 12:16:40 117

原创 C++ Linux 判断文件是否为空

#include <iostream>#include <sys/stat.h>bool file_is_empty(std::string &file_path){ struct stat buf{}; stat(file_path.c_str(), &buf); size_t size = buf.st_size; return size == 0;}int main(){ std::string fi

2020-08-03 11:24:07 748

原创 C++ 判断文件是否存在

#include <iostream>#include <windows.h>#include <time.h>#include <string>#define CFG_FILE_PATH "dennis_check.txt"using namespace std;int test_exits(const string &path){ WIN32_FIND_DATA result; HANDLE hFile; h

2020-07-29 17:49:47 331

原创 C++ Primer Plus 9.3.4

9.11cmake_minimum_required(VERSION 3.16)project(9_11)set(CMAKE_CXX_STANDARD 14)set(Source dennis_name.cpp)set(Headers dennis_name.h)add_executable(9_11 main.cpp ${Source} ${Headers})main#include "dennis_name.h"void other();void another();i

2020-06-08 16:58:38 149

原创 C++ Primer Plus 7 8.2.3

8.5#include <iostream>using namespace std;double cube(double a);double refcube(double &a);int main() { double x = 3.0; //到了最后这里也会变成27 cout << cube(x); cout << " = cube of " << x << endl; //这里显示是 2

2020-06-01 18:00:21 106

原创 C++ Primer Plus 7_18

#include using namespace std;double besty(int);double pam(int);void estimate(int lines, double (*pf)(int));int main() {int code;cout << “Enter a num:”;cin >> code;cout << "1: ";estimate(code, besty);cout << "2: ";estima

2020-05-29 16:28:13 146

原创 C++ Primer Plus 7.8

7.15#include <iostream>#include <array>#include <string>using namespace std;const int Seasons = 4;const array<string, Seasons> snames = {"spring", "summer","fall", "winter"};void fill(array<double,Seasons> *pa);void s

2020-05-29 16:27:10 87

原创 C++ Primer Plus 7.92

7.17#include <iostream>using namespace std;const int Len = 66;const int Divs = 6;void subdivide(char ar[], int low, int high, int level);int main() { char ruler[Len]; int i; for (i = 1; i < Len -2; i++) ruler[i] = ' ';

2020-05-28 19:37:02 76

原创 C++ Primer Plus 7.10

7.11#include <iostream>using namespace std;struct travel_time{ int hours; int mins;};const int Mins_per_hour = 60;travel_time sum(travel_time t1, travel_time t2);void show_time(travel_time t);int main(){ travel_time t1 = {5, 4

2020-05-26 17:59:01 139

原创 C++ Primer Plus 7.3.4

7.7#include <iostream>#include <string>#include <cstring>using namespace std;void show_array(const double* ar, int n);int fill_array(double ar[], int limit);void revalue(double r, double ar[], int n);const int MAX = 5;int main(

2020-05-25 15:02:09 108

原创 C++ Primer 5.1.15

5.12#include <iostream>#include <string>#include <cstring>using namespace std;int main(){ string word = "?ate"; for (char i = 'a'; word != "mate"; i++) //比较两个字符串 { cout << word << endl; word[

2020-05-25 10:33:07 100

原创 C++ primer plus 4.10 ——vector array

4.24#include <iostream>#include <vector>#include <array>using namespace std;int main() { std::vector<int> vi; int n = 3;// std::cin >>n; std::vector<double> vd(n); cout << "created a " &lt

2020-05-25 09:47:40 95

原创 C++ 老九 P91函数模板

#include <iostream>using namespace std;template<typename YY> void Sort(YY yarray[], int len); //define a type of datatemplate<typename YY>void Show(YY ar[], int len);int main(){ int a[5] = {10,5,69,6,31384}; Show(a, 5);

2020-05-09 11:24:09 151

原创 C++老九 P91 函数重载

#include <iostream>using namespace std;void Sort(int [], int len);void Sort(float [], int len);void Sort(double [], int len);void Show(int [], int len);int main(){ int a[5] = {10,5,69,6,31384}; Sort(a,5); Show(a,5); retur

2020-05-09 11:04:35 87

原创 C++ 老九 P84

#include <iostream>using namespace std;int &sum(){ int num = 10; int &refnum = num; return refnum; //不要返回局部变量的引用,会出问题 该快内存会被占用}int &sum(int &num1, int &num2){ num1++; num2++;}string chatTo(con

2020-05-09 09:49:48 101

原创 C++ 老九 P83 引用

#include <iostream>using namespace std;void swap1(int, int);void swap2(int *, int *);void swap3(int &, int &);void swap1(int num1, int num2){ int temp = num2; num2 = num...

2020-05-07 15:48:38 87

原创 C++老九 P79 函数指针

函数指针#include <iostream>#include "Cal.h"using namespace std;int main(){ double (*prtCC)(double, double); double num1, num2; char op; cout << "please input 2 num: "; ...

2020-05-07 11:06:13 307

原创 C++ P76

传递指针#include <iostream>using namespace std;void Change(int *a);int main(){ int bbb = 10; int *num = &bbb;// int num = 10; Change(num); cout << *num << e...

2020-05-07 09:15:48 77

原创 C++ 老九 堆栈 P98

堆 栈的区别栈空间会益处,速度比较快在类中使用 栈空间 mian 函数结束之后, 在 稀函数 中会自动释放。堆空间需要在 稀函数中 手动 delete 释放内存程序当中推荐使用堆内存...

2020-04-22 17:16:32 73

原创 C++ 老九 带参构造 P97

Main#include <iostream>#include "LandOwnerv4.h"#include "Student.h"using namespace std;int main() { Student stu1; Student stu2(" dennis ", "Got a name "); Student stu3(6); ...

2020-04-22 15:24:10 108

原创 C++ 老九 类的构造函数 P96

Main#include <iostream>#include "LandOwnerv4.h"using namespace std;int main() { LandOwnerv4 landOwnerv4; return 0;}头文件//// Created by llb on 2020/4/22.//#ifndef CLASS_EXERC...

2020-04-22 15:13:12 74

原创 C++ 老九 类 P94

Main#include <iostream>//#include "LandOwnerv1.hpp" //本地包含用“” 外部调用用<>#include "LandOwnerv2.h"using namespace std;int main() {// std::cout << "Hello, World!" << ...

2020-04-22 10:16:49 105

原创 C++ 8.2

引用程序清单8.5#include <iostream>double cube(double a);double refcube(double &ra);int main() { using namespace std; double cal = 3.0; cout << cube(cal); cout <&...

2020-04-21 09:26:47 138

原创 C++ 7.8 -7.10

1. 函数指针7.18#include <iostream>double besty(int);double pam(int);void estimate(int lines, double (*pf)(int)); // double (*pf)(int)) // | ...

2020-04-20 15:38:19 87

原创 ROS cartographer

安装ROS, 用清华源。 Ubuntu更新为清华源安装cartographer,需要用代理。初始化工作空间, 在 bash.rc 里添加工作空间路经安装rplidar安装vs coderos_arduino_bridge 修改配置文件和 launch文件修改USB 权限修改cartographer 配置文件 (tracking_frame = “base_link” p...

2020-04-20 14:39:22 167

转载 USB bind

由于ubuntu USB设备号为从零开始依次累加,所以多个设备每次开机后设备号不固定,机器人每次开机都要蛋疼的按顺序插,在网上找到一种方法:udev的规则udev的规则说明,可以参考博客说明:http://blog.csdn.net/cokewei/article/details/8281239将端口重映射到新的固定的名字,并且设置其权限为可读。使用对应的id端口映射到固定的名字上。1l...

2020-04-14 16:58:18 224

转载 ubuntu16.04环境下软件启动,但是不显示软件界面

博主新装的ubuntu系统,然后安装pycharm,第一次安装成功,可是启动时,不显示软件界面;卸载后重装,安装界面都不显示;然后用命令行进行安装,启动软件后,依然不能切换到软件界面。后来Alt+Tab,发现软件明明已经启动…原因是系统默认了两个或者多个数据显示端口,启动软件时,软件界面出现在了当前显示屏以外的输出端口。可以用命令查看当前启动的输出端口xrandr有一个显示端口有分辨率数据,...

2020-04-14 14:06:48 525

原创 C++老九笔记 p59 - p66

1. P59char ch = 'a';char * ptr_ch = &ch;cout << ptr_ch << endl; //这里打印的并不是地址,因为默认是字符串地址,而不是字符的地址如果要打印成地址,就需要用 void指针cout <<(void *) ptr_ch << endl; 这个打印的是地址2. P60...

2020-04-13 08:44:44 187

原创 C++ 7.7

迭代器#include <iostream>#include <vector>int main() { using namespace std; vector<double> a = {12.1, 42, 94, 54}; vector<double>::iterator ttt; for (ttt = ...

2020-04-12 00:19:11 74

原创 C++ 7.6

7.11 程序#include <iostream>#include <string>#include <cstring>struct travel_time //定义结构{ int hours; int mins;};const int Min_per_hour =60;travel_time sum(travel...

2020-04-10 08:47:46 196

原创 C++ 7.3- 7.5

#include <iostream>#include <string>const int ArSize = 8;int sum_arr(const int arr[], int n);int main() { using namespace std; int cookies[ArSize] = {1, 2,4,8,16,32,64,128};...

2020-04-09 14:02:01 136

原创 C++ 7.2

定义一个函数,输入一个字符, 输入需要打印的次数 -> 在屏幕上打印出来#include <iostream>#include <string>void cheers(char x, int n);int main() { using namespace std; int times; char ch; cout &lt...

2020-04-08 23:07:49 157

原创 C++ Primer+ Plus (6.6-6.8)

输入一串字符串, 计算空格的个数#include <iostream>#include <string>#include <vector>#include <array>//enum spec{red, orange, yellow, green, blue, violet, indigo};const int ArSize = 80;...

2020-04-08 17:24:34 213

原创 TensorFlow——笔记

tensorflow 2.0的格式w = tf.Variable(tf.random.uniform(784, 100), -1, 1)1.x 的格式Weights = tf.Variable(tf.random_uniform([1], -1.0, 1.0))

2020-04-08 15:16:07 46

原创 C++ 指针

#include <iostream>#include <string>#include <string>#include <cstring>using namespace std;int main(){ double * p = new double [3]; p[0] = 0.3; p[1] = 0.4;...

2020-04-08 14:32:15 67

原创 ML 梯度下降

import numpy as npimport matplotlib.pyplot as pltfrom pylab import mplimport random as randomimport csvx_data = [338., 333., 328., 207., 226., 25., 179., 60., 208., 606.]y_data = [640., 633., 6...

2020-02-18 16:44:54 121

原创 C++ 复合类型

getline() get()这两种都是可以接受一行字符串, get() 把换行符保留在输入列中书上建议用get()cin.clear() 清楚空行#include <iostream>#include <string>using namespace std;int main(){ const int Array_size = 20; c...

2020-01-18 13:50:04 103

qt+qt vs tools+小福利

QT的安装包和qt vs tools的下载链接。顺便还有qt资源的小福利。有什么问题可以咨询我,链接失效请联系我

2020-08-13

空空如也

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

TA关注的人

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