自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

IQIT

好记性不如烂博客

  • 博客(192)
  • 收藏
  • 关注

转载 can简介

这篇文章主要针对can协议簇(aka socket can)这篇文章包含以下内容:1 概述–什么是Socket CAN?2 动机–为什么使用socket API接口?3 Socket CAN详解3.1 接收队列3.2 发送帧的本地回环3.3 网络安全相关3.4 网络故障监测4 如何使用Socket CAN4.1 使用can_filter的原始套接字 (RAW socket)4.1.1 原始套接字选项 CAN_RAW_FILTER4.1.2 原始套接字选项 CAN_RAW_ERR_FI

2021-08-18 00:33:11 1584 1

原创 道格拉斯 扑克算法

#ifndef DOUGLASPEUCKER_H#define DOUGLASPEUCKER_H#include <iostream>#include<fstream>#include<vector>#include<eigen3/Eigen/Core>#include<string>#include <sstream>class DouglasPeucker{public: typedef st...

2021-03-23 21:43:06 449

原创 Eigen中文文档

Eigen教程目的这是我学习Eigen时翻译的Eigen官方文档。翻译的主要原因在于:与其只在用到某一部分的时候查找API,不如先整体进行一个初步的整体学习,建立知识体系,益于程序的编写和解Bug;不知为何,英文文档不能一目十行,所以还是翻译一下,利于再次使用时的快速访问和理解;在百度,github等网站未能找到中文版的文档;官方文档中的代码不利于在本地运行,每次还得复制粘贴,编译...

2019-10-19 22:31:02 4491 2

原创 vscode

launch.json{ // 使用 IntelliSense 了解相关属性。 // 悬停以查看现有属性的描述。 // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { ...

2019-08-21 20:42:18 218

原创 STL:并发一之 async() and future class

async()提供的借口让一个可调用对象在后台运行,成为一个独立的线程;它将其获得的函数立即异步启动于一个分离的线程;future<>是一个模板类,等待线程结果并获取结果,由于是获取线程的将来的结果,所以叫future。这个结果可能是返回值,也可能是一个异常; future为async被调用的返回类型的特化,我们需要调用它,这是因为:它可以确保async的被调用对象的执行。使用ge...

2019-07-20 21:02:53 509

原创 Timer类

time类是一个辅助函数,用于程序计时。它封装了STL中的chrono。只要把chrono中的时钟、时间点和时间间隔看懂,下面的代码就是小菜一碟。#pragma once//STL#include <chrono>namespace StVO {class Timer {public: // Timer的时间单位:秒 毫秒 纳秒 static con...

2019-07-19 23:48:29 221

原创 STL:set

Set是一个集合;集合中有不同的元素;所有元素会根据value进行排序,默认是升序,即采用operator< 实现比较;不可以通过迭代器来改变value,即只读;set插入/删除,迭代器仍然有效,除被删除元素的迭代器除外;(把迭代器想象为一个指针即可);底层采用红黑树实现。set的各成员函数列表如下:begin()–返回指向第一个元素的迭代器clear()–清除所有元...

2019-07-19 23:39:11 123

原创 STL:chrono

// ratio中关于单位的变换// 位于vs中的ratio standard headertypedef ratio<1, 1000000000000000000LL> atto;typedef ratio<1, 1000000000000000LL> femto;typedef ratio<1, 1000000000000LL> pico;typ...

2019-07-19 23:38:44 403

原创 数据结构:二叉树

// c++11 // 实现了前序 中序 后序遍历以及获取树的节点个数#include <iostream>using namespace std;template <typename T>class BTreeNode{public: BTreeNode() { m_pleft = nullptr; m_pright = nullptr; }...

2019-07-17 15:31:10 104

原创 数据结构:单向链表

// 问题:// 1 不能把node写在类外,需要深入了解模板知识// 2 没有写完template <typename T >class SingleLinkList{public: SingleLinkList() { head = new Node<T>; length = 0; current = head; } template...

2019-07-17 12:16:31 112

原创 设计模式:简单工厂模式

面向对象思维:抽象、封装、继承、多态;实现代码复用,减少代码复制;实现松耦合,减少紧耦合;简单工厂模式:采用一个单独的类,来创建实例化的过程// 采用简单工厂模式,实现一个简单的计算器// 参考《大话设计模式》#include <iostream>#include <exception>using namespace std;class Operation...

2019-07-16 21:43:07 104

原创 visual studio 错误:在查找预编译头时遇到意外的文件结尾。是否忘记了向源中添加“#include "StdAfx.h"”?

解决方案如下图:

2019-07-11 17:13:05 1501

原创 pl-stvo 编译流程

本文讲解stvo的配置

2019-07-09 14:52:44 1407 4

原创 8.3 string流

书中页数:P287代码名称:sstream.cc#include <iostream>using std::cin; using std::cout; using std::cerr;using std::istream; using std::ostream; using std::endl;#include <sstream>using std::ostr...

2019-05-26 09:33:33 160

原创 8.2 文件输入输出

书中页数:P285代码名称:fileIO.cc#include <iostream>using std::cerr; using std::cout; using std::endl;#include <fstream>using std::ifstream;#include <string>using std::string;#incl...

2019-05-26 09:26:45 141

原创 8.1.2 条件状态

书中页数:P282代码名称:clearIO.cc#include <iostream>using std::cin; using std::cout; using std::endl;#include <sstream>using std::istringstream;#include <string>using std::string;v...

2019-05-26 09:12:50 188

原创 8.1.3 管理输出缓冲

书中页数:P282代码名称:buf.cc#include <iostream>using std::endl; using std::flush; using std::ends;using std::unitbuf; using std::nounitbuf; using std::cout;int main(){ // writes hi and a newline...

2019-05-26 08:56:54 179

原创 数据结构: 栈

栈是一种只允许在一端进行操作的线性表。具体地说,栈是一种特殊的线性表,只允许在栈顶进行操作,而栈底不允许操作。由于仅容许在一端操作,使其具有后进先出的结构特性。常见的栈操作包括:创建栈、销毁栈、清空栈、入栈、出栈、获取栈顶元素、获取栈的大小等。例如,在C++中,对栈的介绍如下:std::stacktemplate <class T, class Container = deque...

2019-05-17 13:13:54 194

原创 7.1.1 设计Sales_data类—使用改进的Sales_data类

书中页数:P229代码名称:avg_price.cc add_item.cc//avg_price.cc#include <iostream>using std::cerr; using std::cin; using std::cout; using std::endl;#include "Sales_data.h"int main(){ Sales_data ...

2019-05-15 14:51:47 475

原创 7.6 类静态成员

书中页数:P268代码名称:Account.h Account.cc useAccount.cc// Account.h #ifndef ACCOUNT_H#define ACCOUNT_H#include <string>class Account {public: Account() = default; Account(const std::string...

2019-05-15 14:37:08 147

原创 7.5.6 字面值常量类

书中页数:P267代码名称:debug.h debug.cc//debug.h#ifndef DEBUG_H#define DEBUG_Hclass Debug {public: constexpr Debug(bool b = true): hw(b), io(b), other(b) { } constexpr Debug(bool h, bool i, bool o): ...

2019-05-15 14:23:09 190

原创 7.3 类的其他特性

书中页数:P243代码名称:WindowMgr.h Screen.h useScreen.cc#ifndef WINDOW_MGR#define WINDOW_MGR#include <vector>#include <string>#include <iostream>#include "newscreen.h"class BitMap...

2019-05-15 14:12:01 132

原创 7.1.1 设计Sales_data类

书中页数:P228代码名称:Sales_data.h Sales_data.cc//Sales_data.h #ifndef SALES_DATA_H#define SALES_DATA_H#include <string>#include <iostream>class Sales_data {friend Sales_data add(const ...

2019-05-15 14:00:39 277

原创 6.7 函数指针—返回指向函数的指针

书中页数:P221代码名称:fcnptrRet.cc#include <iostream>using std::cout; using std::endl;#include <string>using std::string;// declarations (not strictly speaking necessary in this file)stri...

2019-05-14 17:37:30 309

原创 6.7 函数指针

书中页数:P221代码名称:usefcnptr.cc#include <iostream>using std::cout; using std::endl;#include <vector>using std::vector;// function to return minimum element in an vector of intsint min_...

2019-05-14 17:35:46 127

原创 6.4 重载函数

书中页数:P206代码名称:printFcns.h#ifndef PRINTFCNS_H#define PRINTFCNS_H#include <vector>void print(const char *cp);void print(const int *beg, const int *end); void print(std::vector<int>::c...

2019-05-14 16:33:23 96

原创 6.3.3 返回数组指针

书中页数:P205代码名称:arrRet.cc#include <cstddef>using std::size_t;#include <iostream>using std::cout; using std::endl;// code to illustrate declarations of array-related typesint arr[10]...

2019-05-14 16:21:00 139

原创 6.2.6 含有可变形参的函数

书中页数:P197代码名称:errMsg_initList.cc#include <vector>using std::vector;#include <string>using std::string; #include <iostream>using std::cout; using std::endl;#include <ini...

2019-05-14 16:01:35 143

原创 6.2.4 数组形参

书中页数:P193代码名称:stl-arr-fcns.cc#include <iostream>using std::endl; using std::cout;#include <iterator>using std::begin; using std::end;// prints a null-terminated array of characters...

2019-05-14 15:28:12 94

原创 6.1 函数基础-调用函数

书中页数:P182代码名称:mainmath.cc//mainmath.cc#include "LocalMath.h"#include <iostream>using std::cout; using std::endl;int main(){ // pass a literal to fact int f = fact(5); // f equals 1...

2019-05-14 15:19:11 250

原创 6.2.4 数组形参

书中页数:P193代码名称:good_printmain.cc#include <iterator>using std::begin; using std::end;#include <cstddef>using std::size_t;#include <iostream>using std::cout; using std::endl;...

2019-05-14 15:17:41 125

原创 6.2.2 传引用参数-使用引用参数返回额外信息

书中页数:P189代码名称:refparms.cc#include <iostream>using std::cin; using std::cout; using std::endl;#include <string>using std::string;#include <vector>using std::vector;#include...

2019-05-12 10:42:38 255

原创 6.3.2 有返回值函数—引用返回左值

书中页数:P202代码名称:ref-fcn.cc#include <iostream>using std::cout; using std::endl;#include <string>using std::string;char &get_val(string &str, string::size_type ix) { retur...

2019-05-12 10:27:58 138

原创 6.2 参数传递

书中页数:P187代码名称:reset.cc#include <iostream>using std::cout; using std::endl;#include <vector>using std::vector;// function that takes a reference to an int // and sets the given obj...

2019-05-12 10:25:50 352

原创 6.5.2 内联函数和constexpr函数

书中页数:P213代码名称:inline_shorter.cc#include <string>using std::string;#include <iostream>using std::cout; using std::endl;//inline version: find the shorter of two stringsinline const...

2019-05-12 10:16:32 133

原创 6.5.3 调试帮助

书中页数:P215代码名称:wdebug.cc#include <cstddef>using std::size_t;#include <cassert>// assert is a preprocessor macro and therefore not in std// hence we need to include cassert header, /...

2019-05-12 10:01:30 128

原创 6.3.2 有返回值的函数-值是如何被返回的

书中页数:P172代码名称:make_plural.h make_plural.cc//make_plural.h#include <cstddef>using std::size_t;#include <string>using std::string;#include <iostream>using std::cout; using st...

2019-05-12 09:48:53 303

原创 6.3.2 有返回值函数-主函数main的返回值

书中页数:P203代码名称:mainret.cc#include <cstdlib>/* EXIT_FAILURE and EXIT_SUCCESS are preprocessor variables * such variables are not in the std namespace, * hence, no using declarati...

2019-05-12 09:37:20 227

原创 6.1.3 分离式编译

书中页数:P186代码名称:LocalMath.h LocalMath.cc fact.cc//LocalMath.h#ifndef LOCALMATH_H#define LOCALMATH_H//definition in LocalMath.ccint fact(int); // iterative definition of factorialint facto...

2019-05-12 09:30:08 226

原创 6.1.1 局部对象-局部静态对象

书中页数:P185代码名称:count-calls.cc#include <cstddef>using std::size_t;#include <iostream>using std::cout; using std::endl;size_t count_calls(){ static size_t ctr = 0; // value will pe...

2019-05-12 09:19:26 216

空空如也

空空如也

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

TA关注的人

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