【上海大学《面向对象程序设计A》课程小项目报告】抽象向量类模板及其派生类
1 项目内容及要求
本项目通过设计一个抽象向量类模板,以及一个通用的向量类模板和一个字符串类作为其派生类,以满足各种应用场景中的数据存储和处理需求。
项目内容:
- 抽象向量类模板。
- 派生向量类。
- 派生字符串类。
- 测试及异常处理。
- 联合测试
2.1 抽象向量类模板
2.1.1 数据成员设计
int num;//向量的维度
T* p;//存储元素的数组
2.1.2 成员函数设计
VECTOR(int size = 0, const T* x = NULL)//构造函数
VECTOR(const VECTOR& v)//拷贝构造函数
virtual ~VECTOR()//虚析构函数
VECTOR& operator=(const VECTOR& v)//赋值运算符重载
T& operator[](int index)//用于访问特定位置的元素
void resize(int size)//重设容器大小
virtual void Output(ostream& out) const = 0;//纯虚函数
virtual void Input(istream& in) = 0;//纯虚函数
2.2 派生向量类模板
2.2.1 定义纯虚函数
void Output(ostream& out) const
{if (__super::num == 0) out << "( )";else{out << "(" << __super::p[0];for (int i = 1; i < __super::num; i++){out << "," << __super::p[i];}out << ")" << endl;}
}void Input(istream& in)
{char c;T x;__super::resize(0);in >> c;if (c != '(') return;while (in >> x){__super::resize(__super::num + 1);__super::p[__super::num - 1] = x;in >> c;if (c == ')') break;}
}
2.2.2 成员函数设计
Vector(int size = 0, const T* x = NULL)//构造函数
Vector operator+(const Vector& v)//+运算符重载
2.2.3 测试及异常处理
int TestVector()
{int a[10] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };double x[8];for (int i = 0; i < 8; i++)x[i] = sqrt(double(i));Vector<int> vi1(10, a), vi2(5, a + 5);Vector<double> vd1(8, x), vd2(3, x);cout << "原始数据:" << endl;cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "调整维数到5:" << endl;vi1.resize(5);vi2.resize(5);vd1.resize(5);vd2.resize(5);cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\n将数据写入文件 vector.txt 中..." << endl;ofstream outfile("vector.txt");outfile << vi1 << '\n'<< vi2 << vd1 << '\n' << vd2 << endl;outfile.close();cout << "\n清除对象的数据(即调整维数到0)..." << endl;vi1.resize(0);vi2.resize(0);vd1.resize(0);vd2.resize(0);cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\n从文件 vector.txt 中读取的数据:" << endl;ifstream infile("vector.txt");infile >> vi1 >> vi2 >> vd1 >> vd2;infile.close();cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\nvi1 + vi2 = " << vi1 + vi2<< "\nvd1 + vd2 = " << vd1 + vd2 << endl;cout << "\n异常处理测试" << endl;Vector<int> v;cout << "请输入一个整数向量。如 (1, 3, 5, 7)" << endl;try{cin >> v;//如果格式错误,则抛出异常}catch (const char* str){cout << str << endl;return 0;}return 0;
}
运行结果:

2.3 派生字符串类
2.3.1 定义纯虚函数
void Output(ostream& out) const
{for (int i = 0; i < __super::num; i++){out << p[i];}
}void Input(istream& in)
{string temp;in >> temp;*this = temp.c_str();
}
2.3.2 成员函数设计
String(const char* x = "")//构造函数
String operator+(const String& s)//+运算符重载
2.3.3 测试及异常处理
int TestString()
{String str1 = "Hello", str2 = str1, str3;// 转换构造 拷贝构造 默认构造cout << "原始数据(双引号是另外添加的):" << endl;cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;str3 = str2; // 赋值运算str1 = "C++ program.";str2 = str3 + ", world!"; // 拼接运算cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n将数据写入文件 string.txt 中..." << endl;ofstream outfile("string.txt");outfile << str1 << '\n'<< str2 << '\n'<< str3 << endl;outfile.close();cout << "\n清除对象的数据(即调整长度到0)..." << endl;str1.resize(0);str2.resize(0);str3.resize(0);cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n从文件 string.txt 中读取的数据:" << endl;ifstream infile("string.txt");infile >> str1>> str2>> str3;infile.close();cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n异常处理测试" << endl;String str4 = "Hello";try{cout << str4 << endl;cout << str4[10] << endl;//越界访问,抛出异常}catch (const char* str){cout << str << endl;return 0;}return 0;
}
运行结果:

3 联合测试
#include "Vec.h"int TestVector(), TestString(), Test();void menu()
{cout << "\n1 --- testing Vector [v]"<< "\n2 --- testing String [s]"<< "\n3 --- testing Vector & String [m]"<< "\n0 --- exit [q]"<< endl;
}int main()
{char choice = '0';do{menu();cin >> choice;switch (choice){case '1':case 'v':case 'V': TestVector(); break;case '2':case 's':case 'S': TestString(); break;case '3':case 'm':case 'M': Test(); break;case '0':case 'q':case 'Q':case 27: choice = 0; break;default: cout << "选择错误,重新选择" << endl; break;}} while (choice);return 0;
}int Test()
{Vector<int> v;String str;cout << "请输入一个整数向量。如 (1, 3, 5, 7)" << endl;try{cin >> v;}catch (const char* str) { cout << str << endl;return 0;}cout << v << endl;cin.sync(); // 刷新输入流缓冲区(目的是读取并丢弃向量后的换行符)cout << "请输入一个字符串。如 abc 12345 xyz" << endl;cin >> str;cout << str << endl;cout << "\n将数据写入文件 output.txt 中..." << endl;ofstream outfile("output.txt");outfile << v << endl<< str << endl;outfile.close();cout << "\n清除对象的数据..." << endl;v.resize(0);str.resize(0);cout << "向量:" << v << endl<< "字符串:\"" << str << "\"" << endl;cout << "\n从文件 output.txt 中读取的数据:" << endl;ifstream infile("output.txt");infile >> v;infile >> str;infile.close();cout << "向量:" << v << endl<< "字符串:\"" << str << "\"" << endl;return 0;
}
运行结果:

4 完整代码
4.1 Vec.h
#pragma once
#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <fstream>
#include <string>
using namespace std;template <typename T> class VECTOR
{
public:VECTOR(int size = 0, const T* x = NULL){num = (size > 0) ? size : 0;p = NULL;if (num > 0){p = new T[num];for (int i = 0; i < num; i++)p[i] = (x == NULL) ? 0 : x[i];}}VECTOR(const VECTOR& v){num = v.num;p = NULL;if (num > 0){p = new T[num];for (int i = 0; i < num; i++)p[i] = v.p[i];}}virtual ~VECTOR(){if (p != NULL) delete[] p;}VECTOR& operator=(const VECTOR& v){if (num != v.num){if (p != NULL) delete[] p;p = new T[num = v.num];}for (int i = 0; i < num; i++)p[i] = v.p[i];return *this;}T& operator[](int index){if (index >= num) throw "越界访问";else return p[index];}void resize(int size){if (size < 0 || size == num) return;else if (size == 0){if (p != NULL) delete[] p;num = 0;p = NULL;}else{T* temp = p;p = new T[size];for (int i = 0; i < size; i++)p[i] = (i < num) ? temp[i] : 0;num = size;delete[] temp;}}virtual void Output(ostream& out) const = 0;virtual void Input(istream& in) = 0;int num;//向量的维度T* p;//存储元素的数组
};template <typename T> ostream& operator<<(ostream& out, const VECTOR<T>& v)
{v.Output(out);return out;
}template <typename T> istream& operator>>(istream& in, VECTOR<T>& v)
{v.Input(in);return in;
}template <typename T> class Vector :public VECTOR<T>
{
public:Vector(int size = 0, const T* x = NULL) :VECTOR<T>(size, x) {}void Output(ostream& out) const{if (__super::num == 0) out << "( )";else{out << "(" << __super::p[0];for (int i = 1; i < __super::num; i++){out << "," << __super::p[i];}out << ")" << endl;}}void Input(istream& in){char c;T x;__super::resize(0);in >> c;if (c != '(') throw "格式错误";while (in >> x){__super::resize(__super::num + 1);__super::p[__super::num - 1] = x;in >> c;if (c == ')') break;}}Vector operator+(const Vector& v){Vector Add;if (__super::num == v.__super::num){Add.resize(__super::num);for (int i = 0; i < __super::num; i++){Add[i] = __super::p[i] + v.__super::p[i];}}return Add;}};class String : public VECTOR<char>
{
public:String(const char* x = "") : VECTOR<char>(strlen(x), x) { }void Output(ostream& out) const{for (int i = 0; i < __super::num; i++){out << p[i];}}void Input(istream& in){string temp;in >> temp;*this = temp.c_str();}String operator+(const String& s){int i, j;String add;add.__super::num = __super::num + s.__super::num;add.p = new char[add.__super::num];for (i = 0; i < __super::num; i++){add.p[i] = p[i];}for (j = 0; j < s.__super::num; j++){add.p[i + j] = s.p[j];}return add;}};
4.2 Test.cpp
#include "Vec.h"int TestVector(), TestString(), Test();void menu()
{cout << "\n1 --- testing Vector [v]"<< "\n2 --- testing String [s]"<< "\n3 --- testing Vector & String [m]"<< "\n0 --- exit [q]"<< endl;
}int main()
{char choice = '0';do{menu();cin >> choice;switch (choice){case '1':case 'v':case 'V': TestVector(); break;case '2':case 's':case 'S': TestString(); break;case '3':case 'm':case 'M': Test(); break;case '0':case 'q':case 'Q':case 27: choice = 0; break;default: cout << "选择错误,重新选择" << endl; break;}} while (choice);return 0;
}int Test()
{Vector<int> v;String str;cout << "请输入一个整数向量。如 (1, 3, 5, 7)" << endl;try{cin >> v;}catch (const char* str) { cout << str << endl;return 0;}cout << v << endl;cin.sync(); // 刷新输入流缓冲区(目的是读取并丢弃向量后的换行符)cout << "请输入一个字符串。如 abc 12345 xyz" << endl;cin >> str;cout << str << endl;cout << "\n将数据写入文件 output.txt 中..." << endl;ofstream outfile("output.txt");outfile << v << endl<< str << endl;outfile.close();cout << "\n清除对象的数据..." << endl;v.resize(0);str.resize(0);cout << "向量:" << v << endl<< "字符串:\"" << str << "\"" << endl;cout << "\n从文件 output.txt 中读取的数据:" << endl;ifstream infile("output.txt");infile >> v;infile >> str;infile.close();cout << "向量:" << v << endl<< "字符串:\"" << str << "\"" << endl;return 0;
}
4.3 TestString.cpp
#include "Vec.h"int TestString()
{String str1 = "Hello", str2 = str1, str3;// 转换构造 拷贝构造 默认构造cout << "原始数据(双引号是另外添加的):" << endl;cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;str3 = str2; // 赋值运算str1 = "C++ program.";str2 = str3 + ", world!"; // 拼接运算cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n将数据写入文件 string.txt 中..." << endl;ofstream outfile("string.txt");outfile << str1 << '\n'<< str2 << '\n'<< str3 << endl;outfile.close();cout << "\n清除对象的数据(即调整长度到0)..." << endl;str1.resize(0);str2.resize(0);str3.resize(0);cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n从文件 string.txt 中读取的数据:" << endl;ifstream infile("string.txt");infile >> str1>> str2>> str3;infile.close();cout << "str1 = \"" << str1<< "\"\nstr2 = \"" << str2<< "\"\nstr3 = \"" << str3 << "\"" << endl;cout << "\n异常处理测试" << endl;String str4 = "Hello";try{cout << str4 << endl;cout << str4[10] << endl;//越界访问,抛出异常}catch (const char* str){cout << str << endl;return 0;}return 0;
}
4.4 TestVector.cpp
#include "Vec.h"int TestVector()
{int a[10] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };double x[8];for (int i = 0; i < 8; i++)x[i] = sqrt(double(i));Vector<int> vi1(10, a), vi2(5, a + 5);Vector<double> vd1(8, x), vd2(3, x);cout << "原始数据:" << endl;cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "调整维数到5:" << endl;vi1.resize(5);vi2.resize(5);vd1.resize(5);vd2.resize(5);cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\n将数据写入文件 vector.txt 中..." << endl;ofstream outfile("vector.txt");outfile << vi1 << '\n'<< vi2 << vd1 << '\n' << vd2 << endl;outfile.close();cout << "\n清除对象的数据(即调整维数到0)..." << endl;vi1.resize(0);vi2.resize(0);vd1.resize(0);vd2.resize(0);cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\n从文件 vector.txt 中读取的数据:" << endl;ifstream infile("vector.txt");infile >> vi1 >> vi2 >> vd1 >> vd2;infile.close();cout << "vi1 = " << vi1 << "\nvi2 = " << vi2<< "\nvd1 = " << vd1 << "\nvd2 = " << vd2 << endl;cout << "\nvi1 + vi2 = " << vi1 + vi2<< "\nvd1 + vd2 = " << vd1 + vd2 << endl;cout << "\n异常处理测试" << endl;Vector<int> v;cout << "请输入一个整数向量。如 (1, 3, 5, 7)" << endl;try{cin >> v;//如果格式错误,则抛出异常}catch (const char* str){cout << str << endl;return 0;}return 0;
}
注意:
包含项目的文件夹中以下三个文本文档需要自行创建:

相关文章:
【上海大学《面向对象程序设计A》课程小项目报告】抽象向量类模板及其派生类
1 项目内容及要求 本项目通过设计一个抽象向量类模板,以及一个通用的向量类模板和一个字符串类作为其派生类,以满足各种应用场景中的数据存储和处理需求。 项目内容: 抽象向量类模板。派生向量类。派生字符串类。测试及异常处理。联合测试…...
Leetcode每日一题学习训练——Python3版(到达首都的最少油耗)
版本说明 当前版本号[20231205]。 版本修改说明20231205初版 目录 文章目录 版本说明目录到达首都的最少油耗理解题目代码思路参考代码 原题可以点击此 2477. 到达首都的最少油耗 前去练习。 到达首都的最少油耗 给你一棵 n 个节点的树(一个无向、连通、无环…...
Java面试题(每天10题)-------连载(42)
目录 Spring篇 1、Spring Bean的作用域之间有什么区别? 2、什么是Spring inner beans? 3、Spring框架中的单例Beans是线程安全的吗? 4、请举例说明如何在Spring中诸如一个Java Collection? 5、如何向Spring Bean中诸如一个J…...
netty websocket学习
【硬核】肝了一月的Netty知识点 超详细Netty入门,看这篇就够了! bzm_netty_sb netty-chat vuewebsokect实现实时聊天,可单聊、可群聊(一) vue实现聊天栏定位到最底部(超简单、可直接复制使用)…...
【数据结构】环形队列
环形队列 1. 定义 环形队列就是将队列在逻辑上看作环形结构、物理上仍是数组形式存储的一种数据结构。 其实现主要分为两种情况: 浪费空间法记录空间法 2. 实现 实现要考虑的是成员变量 2.1 记录空间法 使用used标识当前存储了多少元素,如果为空&a…...
嵌入式C编码规范
嵌入式C编码规范 编码规范,没有最好,只有最合适,有但不执行不如没有。 嵌入式C编码规范 https://mp.weixin.qq.com/s/z4u3YnF6vdQ1olsLeF-y_A 更多嵌入式信息请关注微信公众号【嵌入式系统】...
Golang 并发 — 流水线
并发模式 我们可以将流水线理解为一组由通道连接并由 goroutine 处理的阶段。每个阶段都被定义为执行特定的任务,并按顺序执行,下一个阶段在前一个阶段完成后开始执行。 流水线的另一个重要特性是,除了连接在一起,每个阶段都使用…...
Elasticsearch:什么是非结构化数据?
非结构化数据定义 非结构化数据是指未按照设计的模型或结构组织的数据。 非结构化数据通常被归类为定性数据,可以是人类或机器生成的。 非结构化数据是最丰富的可用数据类型,经过分析后,可用于指导业务决策并在许多其他用例中实现业务目标。…...
15:00的面试,15:06就出来了,问的问题过于变态了。。。
从小厂出来,没想到在另一家公司又寄了。 到这家公司开始上班,加班是每天必不可少的,看在钱给的比较多的份上,就不太计较了。没想到5月一纸通知,所有人不准加班,加班费不仅没有了,薪资还要降40%…...
Web自动化测试怎么做?Web网页测试全流程解析
1、功能测试 web网页测试中的功能测试,主要测试网页中的所有链接、数据库连接、用于在网页中提交或获取用户信息的表单、Cookie 测试等。 (1)查看所有链接: 测试从所有页面到被测特定域的传出链接。 测试所有内部链接。 测…...
MySQL数据库SQLSTATE[22007]: Invalid datetime format 日期类型不能为空值的解决办法
如果你的数据库是mysql, 如果你创建表或插入数据时遇到的BUG–它长这样: Invalid datetime format: 1292 Incorrect datetime value: ‘’ for column ‘xxx’ at row 1 或 1067 - Invalid default value for ‘xx’ 那么我将赐予你 两套剑法: &#…...
搬运工让你分分钟了解Web接口测试
01、什么是接口 百度说:接口泛指实体把自己提供给外界的一种抽象化物(可以为另一实体),用以由内部操作分离出外部沟通方法,使其能被内部修改而不影响外界其他实体与其交互的方式 上面这句有点抽象,网上的…...
作业12.5
1.定义一个基类 Animal,其中有一个虛函数perform(),用于在子类中实现不同的表演行为。 #include <iostream>using namespace std; class Animal { private:int weight; public:Animal(){}Animal(int weight):weight(weight){}virtual …...
leetCode 47. 全排列 II + 回溯算法 + 图解 + 笔记
给定一个可包含重复数字的序列 nums ,按任意顺序 返回所有不重复的全排列 示例 1: 输入:nums [1,1,2] 输出: [[1,1,2],[1,2,1],[2,1,1]] 示例 2: 输入:nums [1,2,3] 输出:[[1,2,3],[1,3,2…...
Maya 2024(3D建模、动画和渲染软件)
Maya 2024是一款非常强大的3D建模、动画和渲染软件,它提供了许多新功能和改进,以帮助建模师、动画师和渲染师更加高效地进行创作。 在建模方面,Maya 2024引入了Symmetry(对称)功能,可以在网格两侧生成均匀…...
C++作业5
完成沙发床的多继承(有指针成员) 代码: #include <iostream>using namespace std;class Bed { private:double *money; public:Bed(){cout << "Bed::无参构造函数" << endl;}Bed(double money):money(new doub…...
Go语言很难吗?为什么 Go 岗位这么少?
其实这个话题已经躺在我的 TODO 里很久了,近来很多社区的小伙伴都私下来交流,也有在朋友圈看吐槽 Go 上海的大会没什么人。还不如 Rust 大会,比较尴尬。 今天主要是从个人角度看看为什么 Go 岗位看起来近来很难的样子? 盘一下数…...
为什么要替换 Object.defineProperty?
目录 前言:为什么要替换 Object.defineProperty? 详解:为什么要替换 Object.defineProperty? 总结: 前言:为什么要替换 Object.defineProperty? JavaScript中的Object.defineProperty是一种…...
百马百担c语言编程
以下是一个百马百担问题的C语言编程实现: #include <stdio.h>int main() { int n, m, k; scanf("%d%d%d", &n, &m, &k); int a[n], b[m], c[k]; for (int i 0; i < n; i) { scanf("%d", &a[i]);…...
C++检测字符串中有效的括号个数
匹配一个字符串buf中,连续包换运算符reg的次数: #include <iostream>//return 返回匹配的字符个数 //buf, 要检测的字符串 //reg, 包含的连续运算符 int GetMatchCount(std::string& buf, std::string& reg) {int nMatchCount 0;if (reg.…...
论文解读:交大港大上海AI Lab开源论文 | 宇树机器人多姿态起立控制强化学习框架(二)
HoST框架核心实现方法详解 - 论文深度解读(第二部分) 《Learning Humanoid Standing-up Control across Diverse Postures》 系列文章: 论文深度解读 + 算法与代码分析(二) 作者机构: 上海AI Lab, 上海交通大学, 香港大学, 浙江大学, 香港中文大学 论文主题: 人形机器人…...
CTF show Web 红包题第六弹
提示 1.不是SQL注入 2.需要找关键源码 思路 进入页面发现是一个登录框,很难让人不联想到SQL注入,但提示都说了不是SQL注入,所以就不往这方面想了 先查看一下网页源码,发现一段JavaScript代码,有一个关键类ctfs…...
数据库分批入库
今天在工作中,遇到一个问题,就是分批查询的时候,由于批次过大导致出现了一些问题,一下是问题描述和解决方案: 示例: // 假设已有数据列表 dataList 和 PreparedStatement pstmt int batchSize 1000; // …...
华硕a豆14 Air香氛版,美学与科技的馨香融合
在快节奏的现代生活中,我们渴望一个能激发创想、愉悦感官的工作与生活伙伴,它不仅是冰冷的科技工具,更能触动我们内心深处的细腻情感。正是在这样的期许下,华硕a豆14 Air香氛版翩然而至,它以一种前所未有的方式&#x…...
使用Matplotlib创建炫酷的3D散点图:数据可视化的新维度
文章目录 基础实现代码代码解析进阶技巧1. 自定义点的大小和颜色2. 添加图例和样式美化3. 真实数据应用示例实用技巧与注意事项完整示例(带样式)应用场景在数据科学和可视化领域,三维图形能为我们提供更丰富的数据洞察。本文将手把手教你如何使用Python的Matplotlib库创建引…...
JavaScript基础-API 和 Web API
在学习JavaScript的过程中,理解API(应用程序接口)和Web API的概念及其应用是非常重要的。这些工具极大地扩展了JavaScript的功能,使得开发者能够创建出功能丰富、交互性强的Web应用程序。本文将深入探讨JavaScript中的API与Web AP…...
无人机侦测与反制技术的进展与应用
国家电网无人机侦测与反制技术的进展与应用 引言 随着无人机(无人驾驶飞行器,UAV)技术的快速发展,其在商业、娱乐和军事领域的广泛应用带来了新的安全挑战。特别是对于关键基础设施如电力系统,无人机的“黑飞”&…...
给网站添加live2d看板娘
给网站添加live2d看板娘 参考文献: stevenjoezhang/live2d-widget: 把萌萌哒的看板娘抱回家 (ノ≧∇≦)ノ | Live2D widget for web platformEikanya/Live2d-model: Live2d model collectionzenghongtu/live2d-model-assets 前言 网站环境如下,文章也主…...
Linux部署私有文件管理系统MinIO
最近需要用到一个文件管理服务,但是又不想花钱,所以就想着自己搭建一个,刚好我们用的一个开源框架已经集成了MinIO,所以就选了这个 我这边对文件服务性能要求不是太高,单机版就可以 安装非常简单,几个命令就…...
Python 高效图像帧提取与视频编码:实战指南
Python 高效图像帧提取与视频编码:实战指南 在音视频处理领域,图像帧提取与视频编码是基础但极具挑战性的任务。Python 结合强大的第三方库(如 OpenCV、FFmpeg、PyAV),可以高效处理视频流,实现快速帧提取、压缩编码等关键功能。本文将深入介绍如何优化这些流程,提高处理…...
