当前位置: 首页 > news >正文

C++复习笔记10

1. list是可以在常数范围内在任意位置进行插入和删除的序列式容器,并且该容器可以前后双向迭代
2. list的底层是双向链表结构,双向链表中每个元素存储在互不相关的独立节点中,在节点中通过指针指向其前一个元素和后一个元素。
3. list与forward_list非常相似:最主要的不同在于forward_list是单链表,只能朝前迭代,已让其更简单高效。
4. 与其他的序列式容器相比(array,vector,deque),list通常在任意位置进行插入、移除元素的执行效率更好。
5. 与其他序列式容器相比,list和forward_list最大的缺陷是不支持任意位置的随机访问,比如:要访问list的第6个元素,必须从已知的位置(比如头部或者尾部)迭代到该位置,在这段位置上迭代需要线性的时间开销;list还需要一些额外的空间,以保存每个节点的相关联信息(对于存储类型较小元素的大list来说这可能是一个重要的因素)。

STL中list容器的各种接口演示:

#include<iostream>
#include<list>
#include<functional>
using namespace std;//构造方法
void test01()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1;//空链表list<int> list2(10);//10个0list<int> list3(10, 5);//10个5list<int> list4(arr, arr + 10);//1到10list<int> list5(list4);//拷贝构造list<int> list6(list5.begin(), list5.end());//迭代器范围构造for (auto e : list6){cout << e << " ";}
}//迭代器的使用
//STL不成文的规定:1.STL的区间都是左闭右开区间
//begin()对应第一个元素
//end()对应最后一个元素的下一个元素
//2.带下划线的成员都是在底层内部调用的,不是外部对象调用的
//3.STL插入数据时,插入位置一般是在迭代器所指位置前面插入
void test02()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };//list<int> list1(&arr[0], &arr[9]);//左闭右开,不包含10list<int> list1(arr, arr + 10);for (auto e : list1){cout << e << " ";}cout << endl;auto it = list1.begin();cout << typeid(it).name() << endl;while (it != list1.end()){cout << *it << " ";++it;}cout << endl;for (list<int>::iterator it = list1.begin(); it != list1.end(); it++){cout << *it << " ";}cout << endl;list<int>::reverse_iterator rit = list1.rbegin();//反向迭代器,整套使用while (rit != list1.rend()){cout << *rit << " ";++rit;//这里还是++}cout << endl;}//常链表对应常迭代器
void test03()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };const list<int> list1(arr, arr + 10);for (list<int>::const_iterator it = list1.begin(); it != list1.end(); it++){cout << *it << " ";}cout << endl;list<int>::const_reverse_iterator rit = list1.rbegin();//反向迭代器,整套使用while (rit != list1.rend()){cout << *rit << " ";++rit;//这里还是++}cout << endl;
}void test04()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };const list<int> list1(arr, arr + 10);cout << "empty = "<<list1.empty() << endl;cout << "size = " << list1.size() << endl;cout << "front = " << list1.front() << endl;cout << "back = " << list1.back() << endl;//push_back() push_front() pop_back() pop_front()
}void test05()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1(arr, arr + 10);list<int> list2;list2.push_back(20);list2.push_back(25);list2.push_front(30);list<int>::iterator pos = list1.begin();//list1.insert(pos, 100);//插一个数//list1.insert(pos, 10, 2);//插10个数//list1.insert(pos, list2.begin(), list2.end());//插入迭代器区间list1.insert(pos, arr, arr + 10);//插入指针区间for (auto e : list1){cout << e << " ";}
}void test06()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1(arr, arr + 10);list<int> list2;list2.push_back(20);list2.push_back(25);list2.push_front(30);auto pos = find(list1.begin(),list1.end(),5);//find算法//list1.insert(pos, list2.begin(), list2.end());list1.erase(pos);//按位置删除list1.erase(list1.begin(), list1.end());//按区间删除list1.swap(list2);//交换操作//list1.clear();//清除操作for (auto e : list1){cout << e << " ";}
}void test07()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1(arr, arr + 10);//list1.resize(20);扩大,补零list1.resize(20, 13);//扩大,补指定值list1.resize(5, 15);//截断并保留原来值,指定的值不起作用for (auto e : list1){cout << e << " ";}
}void test08()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1(arr, arr + 10);for (auto e : list1){cout << e << " ";}cout << endl;list1.assign(5, 0);for (auto e : list1){cout << e << " ";}
}//拼接,这里是l2移到l1后面,l2就空了
void test09()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };int brr[] = { 10,20,30,40,50 };list<int> l1(arr,arr+10);list<int> l2(brr,brr+5);for (auto e : l1){cout << e << " ";}cout << endl;l1.splice(l1.end(), l2);for (auto e : l1){cout << e << " ";}cout << endl;for (auto e : l2){cout << e << " ";}
}//删除等于某个值的所有元素
void test10()
{int arr[] = { 1,2,3,4,5,6,7,8,9,10 };list<int> list1(arr, arr + 10);for (auto e : list1){cout << e << " ";}cout << endl;list1.remove(4);for (auto e : list1){cout << e << " ";}
}//unique连续重复值只保留一个
void test11()
{int arr[] = { 1,2,3,4,5,5,5,5,5,5,6,7,8,9,10,3,3,2,5,6 };int n = sizeof(arr) / sizeof(arr[0]);list<int> list1(arr, arr + n);for (auto e : list1){cout << e << " ";}cout << endl;list1.unique();for (auto e : list1){cout << e << " ";}cout << endl;
}class myCompare
{
public:bool operator()(int v1, int v2) const{return v1 > v2;}
};void test12()
{int arr[] = { 1,2,3,4,5,5,5,5,5,5,6,7,8,9,10,3,3,2,5,6 };int n = sizeof(arr) / sizeof(arr[0]);list<int> list1(arr, arr + n);//list1.sort(myCompare());//仿函数由升序变降序,自己写的谓词list1.sort(greater<int>());//使用内建函数对象for (auto e : list1){cout << e << " ";}cout << endl;list1.reverse();//反转for (auto e : list1){cout << e << " ";}cout << endl;
}void main()
{test12();system("pause");
}

list的迭代器失效:前面说过,此处大家可将迭代器暂时理解成类似于指针,迭代器失效即迭代器所指向的节点的无效,即该节点被删除了。因为list的底层结构为带头结点的双向循环链表,因此在list中进行插入时是不会导致list的迭代器失效的只有在删除时才会失效,并且失效的只是指向被删除节点的迭代器,其他迭代器不会受到影响。

删除it后,空间已经释放,t++无法正常指向下一个节点,出现段错误。

也就是说在删除某迭代器的对应结点后,就不能对这个迭代器进行操作了,因为它已经失效。

#include<iostream>
#include<list>
using namespace std;void test01()
{list<int> l1;int arr[] = { 1,2,3,4,5,6,7,8,9,10 };l1.assign(arr, arr + 10);auto it = l1.begin();while (it != l1.end()){l1.erase(it);++it;}
}void main()
{test01();system("pause");
}

其他节点不受影响:

void test02()
{list<int> l1;int arr[] = { 1,2,3,4,5,6,7,8,9,10 };l1.assign(arr, arr + 10);auto it = l1.begin();auto it1 = find(l1.begin(), l1.end(), 5);l1.erase(it);it1++;
}

防止迭代器失效:删除接口删除时会返回删除位置的下一个迭代器。

void test03()
{list<int> l1;int arr[] = { 1,2,3,4,5,6,7,8,9,10 };l1.assign(arr, arr + 10);auto it = l1.begin();while (it != l1.end()){it = l1.erase(it);//删除时会返回删除位置的下一个迭代器}	for (auto e : l1){cout << e << " ";}
}

list和vector的区别:

1.vector底层是动态顺序表存储在一段连续空间,shi是带头结点的双向循环链表。

2.vector支持随机访问,访问某元素效率为O(1),list不支持随机访问,访问某个元素的效率为O(n)。

3.vector任意位置插入和删除效率低,需要搬移元素,时间复杂度为O(N),插入时有可能需要增容,增容:开辟新空间,拷贝元素,释放旧空间,导致效率更低,list任意位置插入和删除效率高,不需要搬移元素,时间复杂度为O(1)。

4.vector的迭代器为原生态指针, list的迭代器是对原生态指针(结点指针)进行封装。

5.vector在插入元素时,要给所有的迭代器重新赋值,因为插入元素有可能会导致重新扩容,致使原来迭代器失效,删除时,当前迭代器需要重新赋值否则会失效。list插入元素不会导致迭代器失效,删除元素时,只会导致当前迭代器失效,其他迭代器不受影响。

6.vector需要高效存储,支持随机访问,不关心插入删除效率,list大量插入和删除操作,不关心随
机访问。

list的模拟实现

#include<iostream>
#include<algorithm>
using namespace std;namespace Test
{template<typename Y>class list;//声明了才能找到template<class T>class List_iterator;template<typename T>class Node{friend class List_iterator<T>;friend class list<T>;//访问其私有成员Node():_val(T()),_next(nullptr),_prev(nullptr){}Node(const T& val, Node* next = nullptr, Node* prev = nullptr) :_val(val),_next(next), _prev(prev){}~Node(){}private:T _val;Node* _next;Node* _prev;};template<class T>class List_iterator{public:typedef List_iterator<T> self;List_iterator(Node<T>* _P) :_Ptr(_P) {}bool operator!=(const List_iterator<T>& it)//<T>别忘了{return this->_Ptr != it._Ptr;}T& operator*(){return _Ptr->_val;}self& operator++(){_Ptr = _Ptr->_next;return *this;}self operator++(int)//一直是int?{//List_iterator tmp(this->_Ptr);self tmp(*this);//类模板明确类型后才是具体类才能实例化对象this->_Ptr = this->_Ptr->_next;return tmp;}self& operator--(){_Ptr = _Ptr->_prev;return *this;}self operator--(int)//一直是int?{//List_iterator tmp(this->_Ptr);self tmp(*this);//类模板明确类型后才是具体类才能实例化对象this->_Ptr = this->_Ptr->_prev;return tmp;}Node<T>* _Mynode(){return _Ptr;}private:Node<T>* _Ptr;};template<class T>class list{public:typedef List_iterator<const T> const_iterator;typedef List_iterator<T> iterator;typedef iterator _It;list() :_Size(0){CreatHead();}Node<T>*& getHead(){return _Head;}iterator begin(){return iterator(_Head->_next);}const_iterator begin() const{return const_iterator(_Head->_next);}const_iterator end() const{return const_iterator(_Head->_next);}iterator end(){return iterator(_Head);}void push_back(const T& x){insert(end(), x);/*Node<T>* _S = new Node<T> (x);_S->_prev = _Head->_prev;_S->_next = _Head;_S->_next->_prev = _S;_S->_prev->_next = _S;_Size++;*/}void pop_back(){erase(--end());}void push_front(const T& x){insert(begin(), x);}void pop_front(){erase(begin());}iterator insert(iterator _P, const T& x){Node<T>* _S = new Node<T>(x);Node<T>* cur = _P._Mynode();_S->_next = cur;_S->_prev = cur->_prev;_S->_next->_prev = _S;_S->_prev->_next = _S;_Size++;return iterator(_S);}iterator erase(iterator _P){Node<T>* cur = _P._Mynode();Node<T>* next_node = cur->_next;cur->_next->_prev = cur->_prev;cur->_prev->_next = cur->_next;delete cur;_Size--;return iterator(next_node);}iterator erase(iterator _first, iterator _last){while (_first != _last){_first = erase(_first);//重载内部调另一个重载,秀}return iterator(_last);}void swap(list<T>& lt){std::swap(_Head, lt.getHead());}void clear(){erase(begin(), end());}size_t size() const{return _Size;}bool empty(){return _Size == 0;}T& front() {return *begin();}T& front() const{return *begin();}T& back() const{return *end();}T& back() {return *(--end());}list(int n, const T& val = T()){CreatHead();while (n-- ){insert(begin(), val);}}list(_It _first, _It _last){CreatHead();while (_first != _last){push_back(*_first);++_first;}}list( list& lt)//{CreatHead();list<T> tmp(lt.begin(), lt.end());std::swap(_Head, tmp._Head);//注意这里的作用域切换_Size = lt.size();}list<T>& operator=( list<T>& lt){if (this != &lt){list<T> tmp(lt.begin(), lt.end());std::swap(_Head, tmp._Head);//this->swap(lt);}return *this;}~list(){clear();delete _Head;_Head = nullptr;}protected:void CreatHead(){_Head = new Node<T>;_Head->_next = _Head;_Head->_prev = _Head;}private:Node<T>* _Head;size_t _Size;};
}void test01()
{Test::list<int> l1;l1.push_back(1);l1.push_back(2);l1.push_back(3);l1.push_back(4);l1.push_back(5);Test::list<int>::iterator it = l1.begin();while (it != l1.end()){cout << *it << " ";it++;}cout << endl;l1.erase(l1.begin());it = l1.begin();while (it != l1.end()){cout << *it << " ";it++;}cout << endl;l1.clear();it = l1.begin();while (it != l1.end()){cout << *it << " ";it++;}cout << endl;
}void test02()
{Test::list<int> l1(5, 10);for (auto it = l1.begin(); it != l1.end(); it++){cout << *it << " ";}cout << endl;Test::list<int>l2(l1);for (auto it = l2.begin(); it != l2.end(); it++){cout << *it << " ";}cout << endl;
}void test03()
{Test::list<int> l1(5, 10);Test::list<int> l2;l2 = l1;for (auto it = l2.begin(); it != l2.end(); it++){cout << *it << " ";}
}void test04()
{Test::list<int>l1;for (int i = 0; i < 6; i++){l1.push_back(i);}for (auto e : l1){cout << e << " ";}cout << endl;l1.push_front(10);for (auto e : l1){cout << e << " ";}cout << endl;l1.pop_back();for (auto e : l1){cout << e << " ";}cout << endl;l1.pop_front();for (auto e : l1){cout << e << " ";}
}void test05()
{Test::list<int>l1;for (int i = 0; i < 6; i++){l1.push_back(i);}Test::list<int>l2;for (int i = 6; i < 11; i++){l2.push_back(i);}l1.swap(l2);for (auto e : l1){cout << e << " ";}cout << endl;for (auto e : l2){cout << e << " ";}cout << endl;
}void test06()
{const Test::list<int>l1(5,10);cout << l1.front() << endl;
}void main()
{test06();system("pause");
}

相关文章:

C++复习笔记10

1. list是可以在常数范围内在任意位置进行插入和删除的序列式容器&#xff0c;并且该容器可以前后双向迭代。 2. list的底层是双向链表结构&#xff0c;双向链表中每个元素存储在互不相关的独立节点中&#xff0c;在节点中通过指针指向其前一个元素和后一个元素。 3. list与for…...

leaflet 纯CSS的marker标记,不用图片来表示(072)

第072个 点击查看专栏目录 本示例的目的是介绍演示如何在vue+leaflet中使用纯CSS来打造marker的标记。这里用到的是L.divIcon来引用CSS来构造新icon,然后在marker的属性中引用。 这里必须要注意的是css需要是全局性质的,不能被scoped转义为其他随机的css。 直接复制下面的 v…...

Elasticsearch:使用 intervals query - 根据匹配项的顺序和接近度返回文档

Intervals query 根据匹配项的顺序和接近度返回文档。Intervals 查询使用匹配规则&#xff0c;由一小组定义构成。 然后将这些规则应用于指定字段中的术语。 这些定义产生跨越文本正文中的术语的最小间隔序列。 这些间隔可以通过父源进一步组合和过滤。 上述描述有点费解。我…...

无法决定博客主题的人必看!如何选择类型和推荐的 5 种选择

是否有人不能迈出第一步&#xff0c;因为博客的类型还没有决定&#xff1f;有些人在出发时应该行动&#xff0c;而不是思考&#xff0c;但让我们冷静下来&#xff0c;仔细想想。博客的难度因流派而异&#xff0c;这在很大程度上决定了随后的发展。因此&#xff0c;在选择博客流…...

数字化转型的成功模版,珠宝龙头曼卡龙做对了什么?

2月11日&#xff0c;曼卡龙&#xff08;300945.SZ&#xff09;发布2022年业绩快报&#xff0c;报告期内&#xff0c;公司实现营业收入16.11亿元&#xff0c;同比增长28.63%。来源&#xff1a;曼卡龙2022年度业绩快报曼卡龙能在2022年实现营收增长尤为不易。2022年受疫情影响&am…...

转换矩阵、平移矩阵、旋转矩阵关系以及python实现旋转矩阵、四元数、欧拉角之间转换

文章目录1. 转换矩阵、平移矩阵、旋转矩阵之间的关系2. 缩放变换、平移变换和旋转变换2. python实现旋转矩阵、四元数、欧拉角互相转化由于在平时总是或多或少的遇到平移旋转的问题&#xff0c;每次都是现查资料&#xff0c;然后查了忘&#xff0c;忘了继续查&#xff0c;这次弄…...

中国地图航线图(echarjs)

1、以上为效果图 需要jq、echarjs、china.json三个文件支持。以上 2、具体代码 DOM部分 <!-- 服务范围 GO--> <div class"m-maps"><div id"main" style"width:1400px;height: 800px; margin: 0 auto;"> </div> <!-…...

Python正则表达式中group与groups的用法详解

本文主要介绍了Python正则表达式中group与groups的用法详解&#xff0c;文中通过示例代码介绍的非常详细&#xff0c;对大家的学习或者工作具有一定的参考学习价值&#xff0c;需要的朋友们下面随着小编来一起学习学习吧目录在Python中&#xff0c;正则表达式的group和groups方…...

c++练习题7

1&#xff0e;下列运算符中优先级最高的是 A&#xff09;> B&#xff09; C&#xff09; && D&#xff09;! 2&#xff0e;以下关于运算符优先级的描述中&#xff0c;正确的是 。 A&#xff09;!&#xff08;逻辑非&#x…...

MySQL学习

目录1、数据库定义基本语句&#xff08;1&#xff09;数据库操作&#xff08;2&#xff09;数据表操作2.数据库操作SQL语句&#xff08;1&#xff09;插入数据&#xff08;2&#xff09;更新语句&#xff08;3&#xff09;删除数据3.数据库查询语句&#xff08;1&#xff09;基…...

C语言(强制类型转换)

一.类型转换原则 1.升级&#xff1a;当类型转换出现在表达式时&#xff0c;无论时unsigned还是signed的char和short都会被自动转换成int&#xff0c;如有必要会被转换成unsigned int(如果short与int的大小相同&#xff0c;unsigned short就比int大。这种情况下&#xff0c;uns…...

搭建hadoop高可用集群(二)

搭建hadoop高可用集群&#xff08;一&#xff09;配置hadoophadoop-env.shworkerscore-site.xmlhdfs-site.xmlmapred-site.xmlyarn-site.xml/etc/profile拷贝集群首次启动1、先启动zk集群&#xff08;自动化脚本&#xff09;2、在hadoop151,hadoop152,hadoop153启动JournalNode…...

CentOS升级内核-- CentOS9 Stream/CentOS8 Stream/CentOS7

官方文档在此 升级原因 当我们安装一些软件(对,我说的就是Kubernetes),可能需要新内核的支持,而CentOS又比较保守,不太升级,所以需要我们手工升级. # 看下目前是什么版本内核 uname -a# 安装公钥 rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org# 添加仓库,如果…...

【基础篇】一文掌握css的盒子模型(margin、padding)

1、CSS 盒子模型(Box Model) 所有HTML元素可以看作盒子,在CSS中,"box model"这一术语是用来设计和布局时使用。CSS盒模型本质上是一个盒子,封装周围的HTML元素,它包括:边距,边框,填充,和实际内容。盒模型允许我们在其它元素和周围元素边框之间的空间放置元素…...

重生之我是赏金猎人-漏洞挖掘(十一)-某SRC储存XSS多次BypassWAF挖掘

0x01&#xff1a;利用编辑器的超链接组件导致存储XSS 鄙人太菜了&#xff0c;没啥高质量的洞呀&#xff0c;随便水一篇文章吧。 在月黑风高的夜晚&#xff0c;某骇客喊我起床挖洞&#xff0c;偷瞄了一下发现平台正好出活动了&#xff0c;想着小牛试刀吧 首先信息收集了一下&a…...

Wails简介

https://wails.io/zh-Hans/docs/introduction 简介 Wails 是一个可让您使用 Go 和 Web 技术编写桌面应用的项目。 将它看作为 Go 的快并且轻量的 Electron 替代品。 您可以使用 Go 的灵活性和强大功能&#xff0c;结合丰富的现代前端&#xff0c;轻松的构建应用程序。 功能…...

滑动窗口 AcWing (JAVA)

给定一个大小为 n≤10^6 的数组。 有一个大小为 k 的滑动窗口&#xff0c;它从数组的最左边移动到最右边。 你只能在窗口中看到 k 个数字。 每次滑动窗口向右移动一个位置。 以下是一个例子&#xff1a; 该数组为 [1 3 -1 -3 5 3 6 7]&#xff0c;k 为 33。 窗口位置最小值最大…...

vue小案例

vue小案例 组件化编码流程 1.拆分静态组件&#xff0c;按功能点拆分 2.实现动态组件 3.实现交互 文章目录vue小案例组件化编码流程1.父组件给子组件传值2.通过APP组件给子组件传值。3.案例实现4.项目小细节1.父组件给子组件传值 父组件给子组件传值 1.在父组件中写好要传的值&a…...

阅读笔记3——空洞卷积

空洞卷积 1. 背景 空洞卷积&#xff08;Dilated Convolution&#xff09;最初是为解决图像分割的问题而提出的。常见的图像分割算法通常使用池化层来增大感受野&#xff0c;同时也缩小了特征图尺寸&#xff0c;然后再利用上采样还原图像尺寸。特征图先缩小再放大的过程造成了精…...

CSS系统学习总结

目录 CSS边框 CSS背景 CSS3渐变 线性渐变&#xff08;Linear Gradients&#xff09;- 向下/向上/向左/向右/对角方向 语法 线性渐变&#xff08;从上到下&#xff09; 线性渐变&#xff08;从左到右&#xff09; 线性渐变&#xff08;对角&#xff09; 使用角度 使用多…...

网络六边形受到攻击

大家读完觉得有帮助记得关注和点赞&#xff01;&#xff01;&#xff01; 抽象 现代智能交通系统 &#xff08;ITS&#xff09; 的一个关键要求是能够以安全、可靠和匿名的方式从互联车辆和移动设备收集地理参考数据。Nexagon 协议建立在 IETF 定位器/ID 分离协议 &#xff08;…...

基于FPGA的PID算法学习———实现PID比例控制算法

基于FPGA的PID算法学习 前言一、PID算法分析二、PID仿真分析1. PID代码2.PI代码3.P代码4.顶层5.测试文件6.仿真波形 总结 前言 学习内容&#xff1a;参考网站&#xff1a; PID算法控制 PID即&#xff1a;Proportional&#xff08;比例&#xff09;、Integral&#xff08;积分&…...

脑机新手指南(八):OpenBCI_GUI:从环境搭建到数据可视化(下)

一、数据处理与分析实战 &#xff08;一&#xff09;实时滤波与参数调整 基础滤波操作 60Hz 工频滤波&#xff1a;勾选界面右侧 “60Hz” 复选框&#xff0c;可有效抑制电网干扰&#xff08;适用于北美地区&#xff0c;欧洲用户可调整为 50Hz&#xff09;。 平滑处理&…...

K8S认证|CKS题库+答案| 11. AppArmor

目录 11. AppArmor 免费获取并激活 CKA_v1.31_模拟系统 题目 开始操作&#xff1a; 1&#xff09;、切换集群 2&#xff09;、切换节点 3&#xff09;、切换到 apparmor 的目录 4&#xff09;、执行 apparmor 策略模块 5&#xff09;、修改 pod 文件 6&#xff09;、…...

DockerHub与私有镜像仓库在容器化中的应用与管理

哈喽&#xff0c;大家好&#xff0c;我是左手python&#xff01; Docker Hub的应用与管理 Docker Hub的基本概念与使用方法 Docker Hub是Docker官方提供的一个公共镜像仓库&#xff0c;用户可以在其中找到各种操作系统、软件和应用的镜像。开发者可以通过Docker Hub轻松获取所…...

Linux简单的操作

ls ls 查看当前目录 ll 查看详细内容 ls -a 查看所有的内容 ls --help 查看方法文档 pwd pwd 查看当前路径 cd cd 转路径 cd .. 转上一级路径 cd 名 转换路径 …...

电脑插入多块移动硬盘后经常出现卡顿和蓝屏

当电脑在插入多块移动硬盘后频繁出现卡顿和蓝屏问题时&#xff0c;可能涉及硬件资源冲突、驱动兼容性、供电不足或系统设置等多方面原因。以下是逐步排查和解决方案&#xff1a; 1. 检查电源供电问题 问题原因&#xff1a;多块移动硬盘同时运行可能导致USB接口供电不足&#x…...

解决本地部署 SmolVLM2 大语言模型运行 flash-attn 报错

出现的问题 安装 flash-attn 会一直卡在 build 那一步或者运行报错 解决办法 是因为你安装的 flash-attn 版本没有对应上&#xff0c;所以报错&#xff0c;到 https://github.com/Dao-AILab/flash-attention/releases 下载对应版本&#xff0c;cu、torch、cp 的版本一定要对…...

ArcGIS Pro制作水平横向图例+多级标注

今天介绍下载ArcGIS Pro中如何设置水平横向图例。 之前我们介绍了ArcGIS的横向图例制作&#xff1a;ArcGIS横向、多列图例、顺序重排、符号居中、批量更改图例符号等等&#xff08;ArcGIS出图图例8大技巧&#xff09;&#xff0c;那这次我们看看ArcGIS Pro如何更加快捷的操作。…...

论文笔记——相干体技术在裂缝预测中的应用研究

目录 相关地震知识补充地震数据的认识地震几何属性 相干体算法定义基本原理第一代相干体技术&#xff1a;基于互相关的相干体技术&#xff08;Correlation&#xff09;第二代相干体技术&#xff1a;基于相似的相干体技术&#xff08;Semblance&#xff09;基于多道相似的相干体…...