C++图书管理系统(基于结构体数组)

2023-10-27

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录


前言

问题描述
要求以图书馆管理业务为背景,设计并实现一个“图书馆管理信息系统”软件,使用该系统可以方便查询图书的信息、借阅者的个人等信息,实现借书与还书等功能。


一、需求分析

1.介绍

本系统的用户分为学生和管理员两类,其中学生为普通用户。普通用户只能对自己的信息进行查询以及借书、还书的权限,管理员用户则拥有系统的所有功能权限。

2.模块划分

(1)登录模块       登录模块用于用户登录,完成基本的验证。根据所填信息进行判断,提示“登录成功”  、     “账号或密码错误”等信息。 (2)学生模块     学生登录之后,可以浏览图书,借书,还书,以及查看个人借书清单等功能。 (3)管理员模块   管理员登录之后,可以对系统进行管理,原则上拥有所有用户的全部权限。主要功能有对学生的增删查, 对图书的增删查,以及查看全部借书清单等功能。

3.系统设计

 

二、代码实现

1.完整代码

代码如下(示例):


#include <iostream>
#include <string>
#include<fstream>
using namespace std;
//学生结构体数组最大容量
#define student_max 100
//图书结构体数组最大容量
#define book_max 200
//借书记录结构体数组最大容量
#define record_max 200

//学生结构体
struct Student {
    string id;       //学号
    string name;     //姓名
    string password; //密码
};

//学生结构体数组
struct StudentArray {
    StudentArray() : count(0) {

    }

    Student data[student_max];      //学生结构体数组
    int count;                      //学生数量
};
int find_StudentArray(StudentArray& sa, const string id);        //查找学生
bool add_StudentArray(StudentArray& sa, const Student& student);  //添加学生
bool del_StudentArray(StudentArray& sa, const string id);         //删除学生
//查找学生
int find_StudentArray(StudentArray& sa, const string id) {
    for (int index = 0; index < sa.count; index++) {
        if (sa.data[index].id == id) {
            return index;
        }
    }
    return -1;
}

//添加学生
bool add_StudentArray(StudentArray& sa, const Student& student) {
    int position = find_StudentArray(sa, student.id);
    if (position == -1) {
        sa.data[sa.count] = student;
        sa.count++;
        return true;
    }

    cout << "该学生已存在,无法添加!" << endl;
    return false;

}

//删除学生
bool del_StudentArray(StudentArray& sa, const string id) {
    int position = find_StudentArray(sa, id);
    if (position != -1) {
        for (int index = position; index < sa.count - 1; index++) {
            sa.data[index] = sa.data[index + 1];
        }
        sa.count--;
        return true;
    }
    cout << "未找到该学生,删除失败!" << endl;
    return false;
}

//图书结构体
struct Book {
    Book() :borrow(false) {

    }
    string id;   //编号
    string name; //书名
    bool borrow;        //借出 | 可借
};

//图书结构体数组
struct BookArray {
    BookArray() : count(0) {

    }

    Book data[book_max];        //图书结构体数组
    int count;                  //图书数量
};
int find_BookArray(BookArray& ba, const string id);    //查找图书
bool add_BookArray(BookArray& ba, const Book& book);   //添加图书
bool del_BookArray(BookArray& ba, const string id);    //删除图书
//查找图书
int find_BookArray(BookArray& ba, const string id) {
    for (int index = 0; index < ba.count; index++) {
        if (ba.data[index].id == id) {
            return index;
        }
    }
    return -1;
}

//添加图书
bool add_BookArray(BookArray& ba, const Book& book) {
    int position = find_BookArray(ba, book.id);
    if (position == -1) {
        ba.data[ba.count] = book;
        ba.count++;
        return true;
    }
    cout << "该图书已存在,添加失败!" << endl;
    return false;
}

//删除图书
bool del_BookArray(BookArray& ba, const string id) {
    int position = find_BookArray(ba, id);
    if (position != -1) {
        for (int index = position; index < ba.count - 1; index++) {
            ba.data[index] = ba.data[index + 1];
        }
        ba.count--;
        return true;
    }
    cout << "未找到该图书,删除失败!" << endl;
    return false;
}

//借书记录结构体
struct Record {
    string student_id;   //学生学号
    string student_name; //学生姓名
    string book_id;      //图书编号
    string book_name;    //图书书名
};

//借书记录结构体数组
struct RecordArray {
    RecordArray() : count(0) {

    }

    Record data[record_max];    //借书记录结构体数组
    int count;                  //借书记录数量
};
int find_RecordArray(RecordArray& ra, const string book_id);    //通过图书编号查找借书记录
bool add_RecordArray(RecordArray& ra, const Record& record);    //添加借书记录
bool del_RecordArray(RecordArray& ra, const string book_id);    //删除借书记录
//通过图书编号查找借书记录
int find_RecordArray(RecordArray& ra, const string book_id) {
    for (int index = 0; index < ra.count; ++index) {
        if (ra.data[index].book_id == book_id) {
            return index;
        }
    }
    return -1;
}

//添加借书记录
bool add_RecordArray(RecordArray& ra, const Record& record) {
    int position = find_RecordArray(ra, record.book_id);
    if (position == -1) {
        ra.data[ra.count++] = record;
        return true;
    }
    cout << "该借书记录已存在,添加失败!" << endl;
    return false;
}

//删除借书记录
bool del_RecordArray(RecordArray& ra, const string book_id) {
    int position = find_RecordArray(ra, book_id);
    if (position != -1) {
        for (int index = position; index < ra.count - 1; index++) {
            ra.data[index] = ra.data[index + 1];
        }
        ra.count--;
        cout << "删除成功!" << endl;
        return true;
    }
    cout << "未找到该借书记录,删除失败!" << endl;
    return false;
}

//管理员登录
void loginAdmin() {
    do {
        cout << "# 管理员登录 #" << endl;
        string id;
        string password;
        cout << "账号:";
        cin >> id;
        cout << "密码:";
        cin >> password;
        if (id == "admin" && password == "123456") {
            break;
        }
        cout << "账号或者密码错误,请重新输入!" << endl;
    } while (true);
}

//学生登录
Student& loginStudent(StudentArray& sa) {
    do {
        cout << "# 学生登录 #" << endl;
        string id;
        string password;
        cout << "账号:";
        cin >> id;
        cout << "密码:";
        cin >> password;
        int position = find_StudentArray(sa, id);
        if (position != -1) {
            if (sa.data[position].password == password) {
                return sa.data[position];
            }
        }
        cout << "账号或者密码错误,请重新输入!" << endl;
    } while (true);
}

void printBook(BookArray& ba);                                //浏览图书
void borrowBook(Student& my, BookArray& ba, RecordArray& ra);  //借书
void returnBook(Student& my, BookArray& ba, RecordArray& ra); //还书
void printRecord(Student& my, RecordArray& ra);               //学生借书清单
//学生操作菜单
void menuStudent(StudentArray& sa, BookArray& ba, RecordArray& ra) {
    Student& my = loginStudent(sa);
    int option = 0;
    do {
        cout << "# 图书管理系统 - 学生 #" << endl;
        cout << "1 > 浏览图书" << endl;
        cout << "2 > 借书 #" << endl;
        cout << "3 > 还书 #" << endl;
        cout << "4 > 借书清单 #" << endl;
        cout << "0 > 注销 #" << endl;
        cin >> option;
        switch (option) {
        case 1:
            printBook(ba);
            break;
        case 2:
            borrowBook(my, ba, ra);
            break;
        case 3:
            returnBook(my, ba, ra);
            break;
        case 4:
            printRecord(my, ra);
            break;
        }
    } while (option != 0);
}


//浏览图书
void printBook(BookArray& ba) {
    cout << "# 浏览图书 #" << endl;
    for (int index = 0; index < ba.count; index++) {
        Book& book = ba.data[index];
        cout << book.id << " " << book.name << " ";
        if (book.borrow) {
            cout << "借出";
        }
        else {
            cout << "可借";
        }
        cout << endl;
    }
}

//借书
void borrowBook(Student& my, BookArray& ba, RecordArray& ra) {
    cout << "# 借书 #" << endl;
    cout << "输入图书编号:";
    string book_id;
    cin >> book_id;
    int position = find_BookArray(ba, book_id);
    if (position != -1) {
        Book& book = ba.data[position];
        if (!book.borrow) {
            book.borrow = true;
            Record record;
            record.student_id = my.id;
            record.student_name = my.name;
            record.book_id = book.id;
            record.book_name = book.name;
            add_RecordArray(ra, record);
            cout << "恭喜,借书成功!" << endl;
        }
        else {
            cout << "抱歉,该书已经出借!" << endl;
        }
    }
    else {
        cout << "抱歉,未找到图书信息!" << endl;
    }
}

//还书
void returnBook(Student& my, BookArray& ba, RecordArray& ra) {
    cout << "# 还书 #" << endl;
    cout << "输入图书编号:";
    string book_id;
    cin >> book_id;
    int position = find_BookArray(ba, book_id);
    if (position != -1) {
        Book& book = ba.data[position];
        if (book.borrow) {
            book.borrow = false;
            del_RecordArray(ra, book_id);
            cout << "恭喜,还书成功!" << endl;
        }
        else {
            cout << "抱歉,该书尚未出借!" << endl;
        }
    }
    else {
        cout << "抱歉,未找到图书信息!" << endl;
    }
}

//学生借书清单
void printRecord(Student& my, RecordArray& ra) {
    cout << "# 借书清单 #" << endl;
    for (int index = 0; index < ra.count; ++index) {
        Record& record = ra.data[index];
        if (record.student_id == my.id) {
            cout << record.book_id << " " << record.book_name << endl;
        }
    }
}


void printStudent(StudentArray& sa);   //浏览学生
void addBook(BookArray& ba);           //添加图书
void delBook(BookArray& ba);           //删除图书
void addStudent(StudentArray& sa);     //添加学生
void delStudent(StudentArray& sa);     //删除学生
void printRecord(RecordArray& ra);     //借书清单(全部)
//管理员操作菜单
void menuAdmin(StudentArray& sa, BookArray& ba, RecordArray& ra) {
    loginAdmin();
    int option = 0;
    do {
        cout << "# 图书管理系统 - 管理员 #" << endl;
        cout << "1 > 浏览图书 #" << endl;
        cout << "2 > 添加图书 #" << endl;
        cout << "3 > 删除图书 #" << endl;
        cout << "4 > 浏览学生 #" << endl;
        cout << "5 > 添加学生 #" << endl;
        cout << "6 > 删除学生 #" << endl;
        cout << "7 > 借书清单(全部) #" << endl;
        cout << "0 > 注销 #" << endl;
        cin >> option;
        switch (option) {
        case 1:
            printBook(ba);
            break;
        case 2:
            addBook(ba);
            break;
        case 3:
            delBook(ba);
            break;
        case 4:
            printStudent(sa);
            break;
        case 5:
            addStudent(sa);
            break;
        case 6:
            delStudent(sa);
            break;
        case 7:
            printRecord(ra);
            break;
        }
    } while (option != 0);
}

//浏览学生
void printStudent(StudentArray& sa) {
    cout << "# 浏览学生 #" << endl;
    for (int index = 0; index < sa.count; ++index) {
        Student& student = sa.data[index];
        cout << student.id << " " << student.name << " ";
        cout << student.password << endl;
    }
}

//添加图书
void addBook(BookArray& ba) {
    cout << "# 添加图书 #" << endl;
    Book book;
    book.borrow = false;
    cout << "输入图书编号:";
    cin >> book.id;
    cout << "输入图书名称:";
    cin >> book.name;
    if (add_BookArray(ba, book)) {
        cout << "恭喜,添加成功!" << endl;
    }
    else {
        cout << "抱歉,添加失败!" << endl;
    }
}

//删除图书
void delBook(BookArray& ba) {
    cout << "# 删除图书 #" << endl;
    string book_id;
    cout << "输入图书编号:";
    cin >> book_id;
    if (del_BookArray(ba, book_id)) {
        cout << "恭喜,删除成功!" << endl;
    }
    else {
        cout << "抱歉,删除失败!" << endl;
    }
}

//添加学生
void addStudent(StudentArray& sa) {
    cout << "# 添加学生 #" << endl;
    Student student;
    cout << "输入学生编号:";
    cin >> student.id;
    cout << "输入学生姓名:";
    cin >> student.name;
    cout << "输入学生密码:";
    cin >> student.password;
    if (add_StudentArray(sa, student)) {
        cout << "恭喜,添加成功!" << endl;
    }
    else {
        cout << "抱歉,添加失败!" << endl;
    }
}

//删除学生
void delStudent(StudentArray& sa) {
    cout << "# 删除学生 #" << endl;
    string student_id;
    cout << "输入学生编号:";
    cin >> student_id;
    if (del_StudentArray(sa, student_id)) {
        cout << "恭喜,删除成功!" << endl;
    }
    else {
        cout << "抱歉,删除失败!" << endl;
    }
}
//借书清单(全部)
void printRecord(RecordArray& ra) {
    cout << "# 借书清单(全部) #" << endl;
    for (int index = 0; index < ra.count; ++index) {
        Record& record = ra.data[index];
        cout << record.book_id << " " << record.book_name << " ";
        cout << record.student_id << " " << record.student_name << endl;
    }
}
//数据读入
//学生数据读入
void read_student(StudentArray& sa) {
    Student s;
    ifstream stfile;
    stfile.open("student.txt");
    if (!stfile.is_open()) {
        cout << "文件打开失败!" << endl;
    }

    while (stfile >> s.id >> s.name >> s.password) {
        add_StudentArray(sa, s);
    }
    stfile.close();
}
//图书数据读入
void read_book(BookArray& ba) {
    Book b;
    ifstream bkfile;
    bkfile.open("book.txt");
    if (!bkfile.is_open()) {
        cout << "文件打开失败!" << endl;
    }
    while (bkfile >> b.id >> b.name) {
        add_BookArray(ba, b);
    }

    bkfile.close();
}
//数据读出
//学生数据读出
void write_student(StudentArray& sa) {
    Student s;
    ofstream stfile;
    stfile.open("student.txt");
    if (!stfile.is_open()) {
        cout << "文件打开失败!" << endl;
    }

    for (int i = 0; i < sa.count; i++) {
        stfile << sa.data[i].id << " " << sa.data[i].name << " " << sa.data[i].password << endl;
    }
    stfile.close();
}
//图书数据读出
void write_book(BookArray& ba) {
    Book b;
    ofstream bkfile;
    bkfile.open("book.txt");
    if (!bkfile.is_open()) {
        cout << "文件打开失败!" << endl;
    }
    for (int i = 0; i < ba.count; i++) {
        bkfile << ba.data[i].id << " " << ba.data[i].name << endl;
    }
    bkfile.close();
}
//主菜单
void menuMain() {

    StudentArray sa;
    BookArray ba;
    RecordArray ra;
    read_student(sa);
    read_book(ba);
    int option = 0;
    do {
        cout << "# 图书管理系统 #" << endl;
        cout << "1 > 学生登录" << endl;
        cout << "2 > 管理员登录 #" << endl;
        cout << "0 > 退出 #" << endl;
        cin >> option;
        switch (option) {
        case 1:
            menuStudent(sa, ba, ra);
            break;
        case 2:
            menuAdmin(sa, ba, ra);
            break;
        }
    } while (option != 0);
    write_student(sa);
    write_book(ba);
}

int main() {


    menuMain();

    return 0;
}


总结


以上就是今天要讲的内容,本文仅仅简单介绍了图书管理系统的实现,希望能给大家带来帮助。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

C++图书管理系统(基于结构体数组) 的相关文章

  • 当我在组合框中选择一个项目时,如何防止 TextChanged 事件?

    我有一个TextChanged http msdn microsoft com en us library system windows forms control textchanged aspx我的事件ComboBox http msd
  • CLR 2.0 与 4.0 性能比较?

    如果在 CLR 4 0 下运行 为 CLR 2 0 编译的 NET 程序会运行得更快吗 应用程序配置
  • 使用 lambda 表达式注册类型

    我想知道如何在 UnityContainer 中实现这样的功能 container RegisterType
  • 适合初学者的良好调试器教程[关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 有谁知道一个好的初学者教程 在 C 中使用调试器 我感觉自己好像错过了很多 我知道怎么做 单步执行代码并查看局部变量 虽然这常常给我带来问
  • 如何捕获未发送到 stdout 的命令行文本?

    我在项目中使用 LAME 命令行 mp3 编码器 我希望能够看到某人正在使用什么版本 如果我只执行 LAME exe 而不带参数 我会得到 例如 C LAME gt LAME exe LAME 32 bits version 3 98 2
  • 代码 GetAsyncKeyState(VK_SHIFT) & 0x8000 中的这些数字是什么?它们是必不可少的吗?

    我试图在按下按键的简单动作中找到这些数字及其含义的任何逻辑解释 GetAsyncKeyState VK SHIFT 0x8000 可以使用哪些其他值来代替0x8000它们与按键有什么关系 GetAsyncKeyState 根据文档返回 如果
  • 将 Long 转换为 DateTime 从 C# 日期到 Java 日期

    我一直尝试用Java读取二进制文件 而二进制文件是用C 编写的 其中一些数据包含日期时间数据 当 DateTime 数据写入文件 以二进制形式 时 它使用DateTime ToBinary on C 为了读取 DateTime 数据 它将首
  • C# 存档中的文件列表

    我正在创建一个 FileFinder 类 您可以在其中进行如下搜索 var fileFinder new FileFinder new string C MyFolder1 C MyFolder2 new string
  • 在 NaN 情况下 to_string() 可以返回什么

    我使用 VS 2012 遇到了非常令人恼火的行为 有时我的浮点数是 NaN auto dbgHelp std to string myFloat dbgHelp最终包含5008角色 你不能发明这个东西 其中大部分为0 最终结果是 0 INF
  • 如何在 C 中安全地声明 16 位字符串文字?

    我知道已经有一个标准方法 前缀为L wchar t test literal L Test 问题是wchar t不保证是16位 但是对于我的项目 我需要16位wchar t 我还想避免通过的要求 fshort wchar 那么 C 不是 C
  • 为什么我的单选按钮不起作用?

    我正在 Visual C 2005 中开发 MFC 对话框应用程序 我的单选按钮是 m Small m Medium 和 m Large 它们都没有在我的 m Summary 编辑框中显示应有的内容 可能出什么问题了 这是我的代码 Pizz
  • C++ int 前面加 0 会改变整个值

    我有一个非常奇怪的问题 如果我像这样声明一个 int int time 0110 然后将其显示到控制台返回的值为72 但是当我删除前面的 0 时int time 110 然后控制台显示110正如预期的那样 我想知道两件事 首先 为什么它在
  • C++ 中的双精度型数字

    尽管内部表示有 17 位 但 IEE754 64 位 浮点应该正确表示 15 位有效数字 有没有办法强制第 16 位和第 17 位为零 Ref http msdn microsoft com en us library system dou
  • 高效列出目录中的所有子目录

    请参阅迄今为止所采取的建议的编辑 我正在尝试使用 WinAPI 和 C 列出给定目录中的所有目录 文件夹 现在我的算法又慢又低效 使用 FindFirstFileEx 打开我正在搜索的文件夹 然后我查看目录中的每个文件 使用 FindNex
  • WPF DataGridTemplateColumn 组合框更新所有行

    我有这个 XAML 它从 ItemSource 是枚举的组合框中选择一个值 我使用的教程是 http www c sharpcorner com uploadfile dpatra combobox in datagrid in wpf h
  • 使 Guid 属性成为线程安全的

    我的一个类有一个 Guid 类型的属性 该属性可以由多个线程同时读写 我的印象是对 Guid 的读取和写入不是原子的 因此我应该锁定它们 我选择这样做 public Guid TestKey get lock testKeyLock ret
  • 堆栈是向上增长还是向下增长?

    我在 C 中有这段代码 int q 10 int s 5 int a 3 printf Address of a d n int a printf Address of a 1 d n int a 1 printf Address of a
  • 为boost python编译的.so找不到模块

    我正在尝试将 C 代码包装到 python 中 只需一个类即可导出两个函数 我编译为map so 当我尝试时import map得到像噪音一样的错误 Traceback most recent call last File
  • 是否可以在不连接数据库的情况下检索 MetadataWorkspace?

    我正在编写一个需要遍历实体框架的测试库MetadataWorkspace对于给定的DbContext类型 但是 由于这是一个测试库 我宁愿不连接到数据库 它引入了测试环境中可能无法使用的依赖项 当我尝试获取参考时MetadataWorksp
  • 不区分大小写的字符串比较 C++ [重复]

    这个问题在这里已经有答案了 我知道有一些方法可以进行忽略大小写的比较 其中涉及遍历字符串或一个good one https stackoverflow com questions 11635 case insensitive string

随机推荐

  • NodeMcu arduino编程环境搭建(Esp8266开发环境搭建)

    物联网模块 先入手了有一个ESP8266 用到那个学习那个 后面开始Node mcu一边学习一边内容更新了 1 先下载arduino编译器 资料链接 链接 https pan baidu com s 18xPtm47pjUvObBd6Veh
  • 第十四届蓝桥杯大赛软件赛省赛(C/C++ 大学B组)

    目录 试题 A 日期统计 1 题目描述 2 解题思路 3 模板代码 试题 B 01 串的熵 1 题目描述 2 解题思路 3 模板代码 试题 C 冶炼金属 1 题目描述 2 解题思路 3 模板代码 试题 D 飞机降落 1 题目描述 2 解题思
  • No implementation found for void com.wust.testjni10.CallJava.callPrintString()

    问题描述 当你看到这篇文章的时候 说明你会jni了 并且还在调用 so 库 可问题就出在调用的时候报了这么个错 No implementation found for void com wust testjni10 CallJava cal
  • uniapp-提现功能(demo)

    页面布局 提现页面 有一个输入框 一个提现按钮 一段提现全部的文字 首先用v model 和data内的数据双向绑定 输入框逻辑分析 输入框的逻辑 为了符合日常输出 所以要对输入框加一些条件限制 因为是提现 所以对输入的字符做筛选 只允许出
  • 由于某种原因,PowerPoint 无法加载MathType..... (亲测有效)

    网上找了较多的参考解决办法 最后发现如下博主提供的方法快捷有效 https blog csdn net dss875914213 article details 85873938 问题 PPT打开时弹出由于某种原因powerpoint无法加
  • 关于python

    1 关于python Python由荷兰数学和计算机科学研究学会的Guido van Rossum 于1990 年代初设计 作为一门叫做ABC语言的替代品 Python提供了高效的高级数据结构 还能简单有效地面向对象编程 Python语法和
  • Viva Workplace Analytics & Employee Feedback SU Viva Glint部署方案

    目录 一 Viva Workplace Analytics Employee Feedback SU Viva Glint介绍 二 Viva Glint和Viva Pulse特点和优势 1 简单易用
  • SLAM精度评定工具——EVO使用方法详解

    系统版本 Ubuntu20 04 ROS版本 Noetic EVO是用于处理 评估和比较里程计和SLAM算法的轨迹输出的工具 注意 本文的评测是在kitti数据集下进行评测 其他的数据集也支持评测 安装EVO 可以执行下面这条命令 pip
  • Pytorch 中如何对训练数据进行增强处理?

    假设我们的数据集是一个手写数字的图像数据集 其中每一张图像包含一个手写数字和对应的标签 我们可以通过随机旋转 平移 缩放和翻转等操作 对原始的图像进行变换增广 Data Augmentation 以增强模型的训练效果 举个例子 我们可以通过
  • JavaScript 实现数组中的字符串按长度排序,长度一样按字母顺序排序

    以下的newar数组里的val键值排序要求 字串按长度排序 长度一样按字母顺序排序 js实现数组中的字符串按长度排序 长度一样按字母顺序排序 function sortByLenByazAZVal array array sort a b
  • MYSQL之ON DUPLICATE KEY UPDATE使用

    创建表 DROP TABLE IF EXISTS user CREATE TABLE user id int 32 NOT NULL AUTO INCREMENT COMMENT 主键id userName varchar 32 NOT N
  • 【单片机毕业设计】【mcuclub-dz-055】基于单片机的智能手环控制系统设计

    最近设计了一个项目基于单片机的智能智能手环控制系统设计 与大家分享一下 一 基本介绍 项目名 智能手环 项目编号 mcuclub dz 055 单片机类型 STM32F103C8T6 具体功能 1 通过MAX30102测量心率 血氧 2 通
  • PFQ,适用于多核处理器系统中的网络监控框架

    PFQ 是一个支持多语言的网络框架 主要用于 Linux 操作系统下进行高效的包捕获和传输 适用于多核处理器系统中的网络监控框架 PFQ 专门为多核处理器而优化 包括对多个硬件队列的网络设备优化 支持任意网络设备驱动 并提供一个脚本用来加速
  • 动态内存与静态内存的区别

    1 静态内存 静态内存是指在程序开始运行时由编译器分配的内存 它的分配是在程序开始编译时完成的 不占用CPU资源 程序中的各种变量 在编译时系统已经为其分配了所需的内存空间 当该变量在作用域内使用完毕时 系统会 自动释放所占用的内存空间 变
  • Dropout层的个人理解和具体使用

    一 Dropout层的作用 dropout 能够避免过拟合 我们往往会在全连接层这类参数比较多的层中使用dropout 在训练包含dropout层的神经网络中 每个批次的训练数据都是随机选择 实质是训练了多个子神经网络 因为在不同的子网络中
  • 解决Google CoLab使用外部文件的问题

    有时 用Google CoLab时需要用到外部的数据集 这时 可以通过代码把文件上传到CoLab上 代码如下 from google colab import files uploaded files upload for fn in up
  • 2年python从业者整理的学习经验,手把手教你如何系统有效学习python

    我是从19年开始学python的 学了近半年 从业2年时间 看网课自己练 摸爬滚打后终于找到了一套不错的学习方法 以我个人经验给零基础入门的朋友讲下应该怎么系统有效学习python 首先 python不是洪湖猛兽 普通人只要认真学肯定是能学
  • python 尝试有道翻译

    一只小白的爬虫 写了一个简单 有道翻译 记录一下 如果大家有更好的方式 方法记得分享一下哦 coding utf 8 import urllib urllib2 json url http fanyi youdao com translat
  • iview引用自定义的图标

    iview引用自定义的图标 护花使者 博客园
  • C++图书管理系统(基于结构体数组)

    提示 文章写完后 目录可以自动生成 如何生成可参考右边的帮助文档 文章目录 前言 一 需求分析 二 代码实现 总结 前言 问题描述 要求以图书馆管理业务为背景 设计并实现一个 图书馆管理信息系统 软件 使用该系统可以方便查询图书的信息 借阅