实验五 继承和多态

news/2024/12/2 18:47:47/文章来源:https://www.cnblogs.com/sqmylc/p/18582314

实验一:

代码:

publisher.hpp:

 1 #pragma once
 2 
 3 #include<iostream>
 4 #include<string>
 5 
 6 using std::cout;
 7 using std::endl;
 8 using std::string;
 9 
10 class Publisher {
11 public:
12     Publisher(const string& s = "");
13 
14 public:
15     virtual void publish()const = 0;
16     virtual void use()const = 0;
17 
18 protected:
19     string name;
20 };
21 
22 Publisher::Publisher(const string&s):name{s}{}
23 
24 class Book :public Publisher {
25 public:
26     Book(const string& s = "", const string& a = "");
27 
28 public:
29     void publish()const override;
30     void use()const override;
31 
32 private:
33     string author;
34 };
35 
36 Book::Book(const string&s,const string&a):Publisher{s},author{a}{}
37 
38 void Book::publish()const {
39     cout << "Publishing book: 《" << name << "》by" << author << endl;
40 }
41 
42 void Book::use()const {
43     cout << "Reading book:" << name << "by" << author << endl;
44 }
45 
46 class Film :public Publisher {
47 public:
48     Film(const string& s = "", const string& d = "");
49 
50 public:
51     void publish()const override;
52     void use()const override;
53 
54 private:
55     string director;
56 };
57 
58 Film::Film(const string &s,const string&d):Publisher{s},director{d}{}
59 
60 void Film::publish()const {
61     cout << "Publishing film:<" << name << ">directed by" << director << endl;
62 }
63 
64 void Film::use()const {
65     cout << "watching film:" << name << "directed by" << director << endl;
66 }
67 
68 class Music :public Publisher {
69 public:
70     Music(const string& s = "", const string& a = "");
71 
72 public:
73     void publish()const override;
74     void use()const override;
75 
76 private:
77     string artist;
78 };
79 
80 Music::Music(const string& s, const string& a) :Publisher{ s }, artist{ a } {
81 }
82 
83 void Music::publish()const {
84     cout << "Publishing music<" << name << ">by" << artist << endl;
85 }
86 
87 void Music::use()const {
88     cout << "Listening to music:" << name << "by" << artist << endl;
89 }

task1.cpp:

 1 #include"publisher.hpp"
 2 #include<vector>
 3 #include<typeinfo>
 4 
 5 using std::vector;
 6 
 7 void test() {
 8     vector<Publisher*>v;
 9 
10     v.push_back(new Book("Harry Ptter", "J.K.Rowling"));
11     v.push_back(new Film("The Godfather", "Francis Ford Coppola"));
12     v.push_back(new Music("Blowing in the wind", "Bob Dylan"));
13 
14     for (auto& ptr : v) {
15         cout << "pointer type:" << typeid(ptr).name() << endl;
16 
17         cout << "RTTI type:" << typeid(*ptr).name() << endl;
18 
19         ptr->publish();
20         ptr->use();
21         cout << endl;
22     }
23 }
24 
25 int main() {
26     test();
27 }

运行结果:

实验二:

代码:

book.hpp:

 1 #pragma once
 2 
 3 #include<iostream>
 4 #include<string>
 5 #include<iomanip>
 6 
 7 
 8 using std::ostream;
 9 using std::endl;
10 using std::string;
11 using std::setw;
12 using std::left;
13 
14 
15 class Book {
16 public:
17     Book(const string&name,const string&author,const string&translator,const string &isbn,float ptice);
18 
19     friend ostream& operator<<(ostream& out, const Book& book);
20 
21 private:
22     string name;
23     string author;
24     string translator;
25     string isbn;
26     float price;
27 };
28 
29 Book::Book(const string& name, const string& author, const string& translator, const string& isbn, float price) {
30     this->name = name;
31     this->author = author;
32     this->translator = translator;
33     this->isbn = isbn;
34     this->price = price;
35 }
36 
37 ostream& operator<<(ostream& out, const Book& book) {
38     out << left;
39     out << setw(15) << "书名:" << book.name << endl
40         << setw(15) << "作者:" << book.author << endl
41         << setw(15) << "译者:" << book.translator << endl
42         << setw(15) << "定价:" << book.price;
43 
44     return out;
45 }

booksale.hpp:

 1 #pragma once
 2 
 3 #include"book.hpp"
 4 #include<iostream>
 5 #include<string>
 6 #include<iomanip>
 7 
 8 using std::string;
 9 using std::cout;
10 using std::endl;
11 using std::setw;
12 
13 class BookSale {
14 public:
15     BookSale(const Book& b, float price, int amount);
16     int get_amount()const;
17 
18     friend ostream& operator<<(ostream& out, const BookSale& item);
19 
20 private:
21     Book rb;
22     float sales_price;
23     int sales_amount;
24     float revenue;
25 };
26 
27 BookSale::BookSale(const Book& b, float price, int amount) :rb{ b }, sales_price(price), sales_amount{ amount } {
28     revenue = sales_amount * sales_price;
29 }
30 
31 int BookSale::get_amount()const {
32     return sales_amount;
33 }
34 
35 ostream& operator<<(ostream& out, const BookSale& item) {
36     out << left;
37     out << item.rb << endl
38         << setw(15) << "售价:" << item.sales_price << endl
39         << setw(15) << "销售数量:" << item.sales_amount << endl
40         << setw(15) << "营收:" << item.revenue;
41 
42     return out;
43 }

task2.cpp:

 1 #include"booksale.hpp"
 2 #include<iostream>
 3 #include<string>
 4 #include<vector>
 5 #include<algorithm>
 6 
 7 bool compare_by_amount(const BookSale& x1, const BookSale& x2) {
 8     return x1.get_amount() > x2.get_amount();
 9 }
10 
11 void test() {
12     using namespace std;
13 
14     vector<BookSale>sales_lst;
15 
16     int books_number;
17     cout << "录入图书数量:";
18     cin >> books_number;
19 
20     cout << "录入图书销售记录" << endl;
21     for (int i = 0; i < books_number; ++i) {
22         string name, author, translator, isbn;
23         float price;
24         cout << string(20, '-') << "" << i + 1 << "本图书信息录入" << string(20, '-') << endl;
25         cout << "录入书名:"; cin >> name;
26         cout << "录入作者:"; cin >> author;
27         cout << "录入译者:"; cin >> translator;
28         cout << "录入isbn:"; cin >> isbn;
29         cout << "录入定价:"; cin >> price;
30 
31         Book book(name, author, translator, isbn, price);
32         float sales_price;
33         int sales_amount;
34         
35         cout << "录入售价:"; cin >> sales_price;
36         cout << "录入销售数量"; cin >> sales_amount;
37 
38         BookSale record(book, sales_price, sales_amount);
39         sales_lst.push_back(record);
40     }
41 
42     sort(sales_lst.begin(), sales_lst.end(), compare_by_amount);
43 
44     cout << string(20, '=') << "图书销售统计" << string(20, '=') << endl;
45     for (auto& t : sales_lst) {
46         cout << t << endl;
47         cout << string(40, '-') << endl;
48     }
49 
50 }
51 
52 int main() {
53     test();
54 }

运行结果:

实验三:

代码:

pets.hpp:

 1 #pragma once
 2 #include<iostream>
 3 #include<string>
 4 
 5 using namespace std;
 6 
 7 class MachinePets {
 8 public:
 9     MachinePets(const string& name):nickname{name}{}
10     string get_nickname()const { return nickname; }
11     virtual string  talk() = 0;
12 
13 private:
14     string nickname;
15 };
16 
17 class PetCats :public MachinePets {
18 public:
19     PetCats(const string& name):MachinePets(name) {
20     }
21     
22     string  talk() {
23         return "miao wu~";
24     }
25 };
26 
27 class PetDogs :public MachinePets{
28 public:
29     PetDogs(const string& name) :MachinePets(name) {
30     }
31 
32     string  talk() {
33         return "wang wang~";
34     }
35 };

task3.cpp:

 1 #include"pets.hpp"
 2 #include<iostream>
 3 #include<vector>
 4 
 5 void test() {
 6     using namespace std;
 7 
 8     vector<MachinePets*>pets;
 9 
10     pets.push_back(new PetCats("miku"));
11     pets.push_back(new PetDogs("da huang"));
12 
13     for (auto& ptr : pets)
14         cout << ptr->get_nickname() << " says " << ptr->talk() << endl;
15 }
16 
17 int main() {
18     test();
19 }

运行结果:

实验四:

film.hpp:

 1 #pragma once
 2 #include<iostream>
 3 #include<string>
 4 #include<iomanip>
 5 
 6 using namespace std;
 7 
 8 class Film {
 9 public:
10     Film() = default;
11     int  getYear()const { return year; }
12 
13     friend  istream& operator>>(istream& in, Film& f);
14     friend  ostream& operator<<(ostream& out, Film& f);
15 private:
16     string name;
17     string director;
18     string area;
19     int  year;
20 };
21 
22 istream& operator>>(istream& in, Film &f) {
23     cout << "录入片名:"; in >> f.name;
24     cout << "录入导演:"; in >> f.director;
25     cout << "录入制片国家/地区:"; in >> f.area;
26     cout << "录入上映年份:"; in >> f.year;
27 
28     return in;
29 }
30 
31 ostream& operator<<(ostream& out, Film &f) {
32     out << left    
33         << setw(20) << f.name       
34         << setw(20) << f.director   
35         << setw(20) << f.area        
36         << setw(6) << f.year;
37 
38     return out;
39 }

task4.cpp:

 1 #include"film.hpp"
 2 #include<iostream>
 3 #include<string>
 4 #include<vector>
 5 #include<algorithm>
 6 
 7 bool compare_by_year(const Film &f1,const Film &f2) {
 8     return f1.getYear() < f2.getYear();
 9 }
10 
11 void test() {
12     using namespace std;
13 
14     int n;
15     cout << "输入电影数目:";
16     cin >> n;
17 
18     cout << "录入" << n << "部影片信息" << endl;
19     vector<Film>film_lst;
20     for (int i = 0; i < n; ++i) {
21         Film f;
22         cout << string(20, '-') << "" << i + 1 << "部影片录入" << string(20, '-') << endl;
23         cin >> f;
24         film_lst.push_back(f);
25     }
26     sort(film_lst.begin(), film_lst.end(), compare_by_year);
27 
28     cout << string(20, '=') + "电影信息(按发行年份)" + string(20, '=') << endl;
29     for (auto& f : film_lst)
30         cout << f << endl;
31 
32 }
33 
34 int main() {
35     test();
36 }

运行结果:

实验五:

代码:
complex.hpp:

 1 #pragma once
 2 #include <iostream>
 3 
 4 using namespace std;
 5 
 6 template<typename T>
 7 class Complex {
 8 public:
 9     Complex(const T&r=0,const T&i=0) :real{ r }, imag{ i } {};
10     Complex(const Complex<T>& c) {
11         this->real = c.real;
12         this->imag = c.imag;
13     }
14 
15     Complex operator+=(const Complex<T>& c) {
16         this->real += c.real;
17         this->imag += c.imag;
18         return *this;
19     }
20 
21     T get_real() const { return real; }
22     T get_imag() const { return imag; }
23 
24     friend Complex operator+(const Complex& c1, const Complex& c2){ return Complex<T>(c1.real + c2.real, c1.imag + c2.imag); }
25     friend bool operator==(const Complex& c1, const Complex& c2){ return c1.real == c2.real && c1.imag == c2.imag; }
26     friend istream& operator>>(istream& in, Complex<T>& c){
27         in >> c.real >> c.imag;
28         return in;
29     }
30     friend ostream& operator<<(ostream& out, const Complex& c){
31         out << c.real << (c.imag >= 0 ? "+" : "") << c.imag << "i";
32         return out;
33     }
34 
35 private:
36     T real;
37     T imag;
38 };

task5.cpp:

 1 #include "complex.hpp"
 2 #include <iostream>
 3 
 4 using std::cin;
 5 using std::cout;
 6 using std::endl;
 7 using std::boolalpha;
 8 
 9 void test1() {
10     Complex<int> c1(2, -5), c2(c1);
11     cout << "c1=" << c1 << endl;
12     cout << "c2=" << c2 << endl;
13     cout << "c1 + c2 = " << c1 + c2 << endl;
14 
15     c1 += c2;
16     cout << "c1=" << c1 << endl;
17     cout << boolalpha << (c1 == c2) << endl;
18 }
19 
20 void test2() {
21     Complex<double> c1, c2;
22     cout << "Enter c1 and c2:";
23     cin >> c1 >> c2;
24     cout << "c1=" << c1 << endl;
25     cout << "c2=" << c2 << endl;
26 
27     cout << "c1.real=" << c1.get_real() << endl;
28     cout << "c1.imag=" << c1.get_imag() << endl;
29 }
30 
31 int main() {
32     cout << "自定义类模板Complex测试1:" << endl;
33     test1();
34 
35     cout << endl;
36 
37     cout << "自定义类模板Complex测试2:" << endl;
38     test2();
39 }

运行结果:

实验六:

 

代码:

date.h:

 1 #pragma once
 2 
 3 class Date {
 4 private:
 5     int year;
 6     int month;
 7     int day;
 8     int totalDays;
 9 
10 public:
11     Date(int year, int month, int day);
12     int getYear() const { return year; }
13     int getMonth() const { return month; }
14     int getDay() const { return day; }
15     int getMaxDay() const;
16     bool isLeapYear() const {
17         return year % 4 == 0 && year % 100 != 0 || year % 400 == 0;
18     }
19     void show() const;
20     int operator-(const Date& date) const {
21         return totalDays - date.totalDays;
22     }
23 };

date.cpp:

 1 #include "date.h"
 2 #include <iostream>
 3 #include <cstdlib>
 4 using namespace std;
 5 
 6 namespace {
 7     const int DAYS_BEFORE_MONTH[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 };
 8 }
 9 
10 Date::Date(int year, int month, int day) : year(year), month(month), day(day) {
11     if (day <= 0 || day > getMaxDay()) {
12         cout << "Invalid date: ";
13         show();
14         cout << endl;
15         exit(1);
16     }
17     int years = year - 1;
18     totalDays = years * 365 + years / 4 - years / 100 + years / 400 + DAYS_BEFORE_MONTH[month - 1] + day;
19     if (isLeapYear() && month > 2) totalDays++;
20 }
21 
22 int Date::getMaxDay() const {
23     if (isLeapYear() && month == 2)
24         return 29;
25     else return DAYS_BEFORE_MONTH[month] - DAYS_BEFORE_MONTH[month - 1];
26 }
27 
28 void Date::show() const {
29     cout << getYear() << "-" << getMonth() << "-" << getDay();
30 }

accumulator.h:

 1 #pragma once
 2 #include "date.h"
 3 
 4 class Accumulator {
 5 private:
 6     Date lastDate;
 7     double value;
 8     double sum;
 9 
10 public:
11     Accumulator(const Date& date, double value) : lastDate(date), value(value), sum{ 0 } {}
12 
13     double getSum(const Date& date) const {
14         return sum + value * (date - lastDate);
15     }
16 
17     void change(const Date& date, double value) {
18         sum = getSum(date);
19         lastDate = date;
20         this->value = value;
21     }
22 
23     void reset(const Date& date, double value) {
24         lastDate = date;
25         this->value = value;
26         sum = 0;
27     }
28 };

account.h:

 1 #pragma once
 2 #include "date.h"
 3 #include "accumulator.h"
 4 #include <string>
 5 using namespace std;
 6 
 7 class Account {
 8 private:
 9     string id;
10     double balance;
11     static double total;
12 protected:
13     Account(const Date& date, const string& id);
14     void record(const Date& date, double amount, const string& desc);
15     void error(const string& msg) const;
16 public:
17     const string& getId() { return id; }
18     double getBalance() const { return balance; }
19     static double getTotal() { return total; }
20     virtual void deposit(const Date& date, double amount, const string& desc) = 0;
21     virtual void withdraw(const Date& date, double amount, const string& desc) = 0;
22     virtual void settle(const Date& date) = 0;
23     virtual void show() const;
24 };
25 
26 class SavingsAccount : public Account {
27 private:
28     Accumulator acc;
29     double rate;
30 public:
31     SavingsAccount(const Date& date, const string& id, double rate);
32     double getRate() const { return rate; }
33     void deposit(const Date& date, double amount, const string& desc);
34     void withdraw(const Date& date, double amount, const string& desc);
35     void settle(const Date& date);
36 };
37 
38 class CreditAccount : public Account {
39 private:
40     Accumulator acc;
41     double credit;
42     double rate;
43     double fee;
44     double getDebt() const {
45         double balance = getBalance();
46         return (balance < 0 ? balance : 0);
47     }
48 public:
49     CreditAccount(const Date& date, const string& id, double credit, double rate, double fee);
50     double getCredit() const { return credit; }
51     double getRate() const { return rate; }
52     double getFee() const { return fee; }
53     double getAvailableCredit() const {
54         if (getBalance() < 0) return credit + getBalance();
55         else return credit;
56     }
57     void deposit(const Date& date, double amount, const string& desc);
58     void withdraw(const Date& date, double amount, const string& desc);
59     void settle(const Date& date);
60     void show() const;
61 };

account.cpp:

 1 #include "account.h"
 2 #include <cmath>
 3 #include<iostream>
 4 using namespace std;
 5 
 6 double Account::total = 0;
 7 
 8 Account::Account(const Date& date, const string& id) : id(id), balance(0) {
 9     date.show();
10     cout << "\t#" << id << " created" << endl;
11 }
12 
13 void Account::record(const Date& date, double amount, const string& desc) {
14     amount = floor(amount * 100 + 0.5) / 100;
15     balance += amount;
16     total += amount;
17     date.show();
18     cout << "\t#" << id << "\t" << amount << "\t" << balance << "\t" << desc << endl;
19 }
20 
21 void Account::show() const {
22     cout << id << "\tBalance: " << balance;
23 }
24 
25 void Account::error(const string& msg) const {
26     cout << "Error (#" << id << "): " << msg << endl;
27 }
28 
29 SavingsAccount::SavingsAccount(const Date& date, const string& id, double rate)
30     : Account(date, id), rate(rate), acc(date, 0) {}
31 
32 void SavingsAccount::deposit(const Date& date, double amount, const string& desc) {
33     record(date, amount, desc);
34     acc.change(date, getBalance());
35 }
36 
37 void SavingsAccount::withdraw(const Date& date, double amount, const string& desc) {
38     if (amount > getBalance()) {
39         error("not enough money");
40     }
41     else {
42         record(date, -amount, desc);
43         acc.change(date, getBalance());
44     }
45 }
46 
47 void SavingsAccount::settle(const Date& date) {
48     double interest = acc.getSum(date) * rate / (date - Date(date.getYear() - 1, 1, 1));
49     if (interest != 0) record(date, interest, "interest");
50     acc.reset(date, getBalance());
51 }
52 
53 CreditAccount::CreditAccount(const Date& date, const string& id, double credit, double rate, double fee)
54     : Account(date, id), credit(credit), rate(rate), fee(fee), acc(date, 0) {}
55 
56 void CreditAccount::deposit(const Date& date, double amount, const string& desc) {
57     record(date, amount, desc);
58     acc.change(date, getDebt());
59 }
60 
61 void CreditAccount::withdraw(const Date& date, double amount, const string& desc) {
62     if (amount - getBalance() > credit) {
63         error("not enough credit");
64     }
65     else {
66         record(date, -amount, desc);
67         acc.change(date, getDebt());
68     }
69 }
70 
71 void CreditAccount::settle(const Date& date) {
72     double interest = acc.getSum(date) * rate;
73     if (interest != 0) record(date, interest, "interest");
74     if (date.getMonth() == 1) record(date, -fee, "annual fee");
75     acc.reset(date, getDebt());
76 }
77 
78 void CreditAccount::show() const {
79     Account::show();
80     cout << "\tAvailable credit: " << getAvailableCredit();
81 }

task6.cpp:

 1 #include "account.h"
 2 #include<iostream>
 3 using namespace std;
 4 
 5 int main() {
 6     Date date(2008, 11, 1);
 7     SavingsAccount sa1(date, "S3755217", 0.015);
 8     SavingsAccount sa2(date, "02342342", 0.015);
 9     CreditAccount ca(date, "C5392394", 10000, 0.0005, 50);
10     Account* accounts[] = { &sa1, &sa2, &ca };
11     const int n = sizeof(accounts) / sizeof(Account*);
12     cout << "(d)deposit (w)withdraw (s)show (c)change day (n)next month (e)exit" << endl;
13     char cmd;
14     do {
15         date.show();
16         cout << "\tTotal:" << Account::getTotal() << "\tcommand>";
17         int index, day;
18         double amount;
19         string desc;
20         cin >> cmd;
21         switch (cmd) {
22         case 'd':
23             cin >> index >> amount;
24             getline(cin, desc);
25             accounts[index]->deposit(date, amount, desc);
26             break;
27         case 'w':
28             cin >> index >> amount;
29             getline(cin, desc);
30             accounts[index]->withdraw(date, amount, desc);
31             break;
32         case 's':
33             for (int i = 0; i < n; i++) {
34                 cout << "[" << i << "]";
35                 accounts[i]->show();
36                 cout << endl;
37             }
38             break;
39         case 'c':
40             cin >> day;
41             if (day < date.getDay()) {
42                 cout << "You cannot specify a previous day";
43             }
44             else if (day > date.getMaxDay())
45                 cout << "Invalid day";
46             else date = Date(date.getYear(), date.getMonth(), day);
47             break;
48         case 'n':
49             if (date.getMonth() == 12)
50                 date = Date(date.getYear() + 1, 1, 1);
51             else date = Date(date.getYear(), date.getMonth() + 1, 1);
52             for (int i = 0; i < n; i++) {
53                 accounts[i]->settle(date);
54             }
55             break;
56         }
57     } while (cmd != 'e');
58     return 0;
59 }

运行结果:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/845562.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

博客园-添加统计图

💖简介 通过WPS在线列表构建博客园每日相关数据统计图。 👉效果📖实现前往WPShttps://www.kdocs.cn/latest新建多维表格 创建表格视图新建仪表盘 新建卡片、折线图卡片配置示例折线图配置示例点击分享获取链接⭐链接配置在config中配置link{icon: <svg t="173313…

华为技术专家出品,《华为开发者空间案例指南》带你玩转云上20+场景应用开发

免费领取云主机,开启你的云上开发之旅,分享体验将有机会赢取精美礼品。 关键词:开发者空间、AI、鲲鹏、Serverless随时随地都能开启开发之旅,这是一种怎样奇妙的体验?想象一下,无需安装繁琐的 IDE,也不用搭建复杂的开发环境,只需开机,就能迅速投入项目开发。在华为开发…

jQuery和CSS3折叠卡片式下拉列表框特效

这是一款使用JQUERY和CSS3制作的效果非常炫酷的折叠卡片式下拉列表框特效。该下拉列表框特效将每一个列表项都制作为卡片的样式,打开和关闭它有打开和关闭百叶窗的感觉,效果非常不错。预览 下载使用方法HTML结构 该下拉列表框特效的列表项使用一个无序列表来制作,用于切换…

幂等设计:确保操作的安全与可靠

目录一、概述1.1、什么是幂等1.2、为什么需要幂等?二、幂等如何设计实现幂等的8 种方案select+insert+主键/唯一索引冲突状态机幂等抽取防重表token令牌悲观锁(如select for update)乐观锁分布式锁三、HTTP的幂等 一、概述 在分布式系统和微服务架构中,确保操作的安全性和可靠…

从仪表盘探索 MongoDB 关键指标

这是 MongoDB 监控系列文章的第七篇,前面几篇文章的链接如下:MongoDB 监控(一) MongoDB 监控(二) MongoDB 监控(三) MongoDB 监控(四) MongoDB 监控(五) MongoDB 监控(六)按照前面系列文章,我们已经采集到 MongoDB 的监控数据了,并且通过 Grafana 和 Nightinga…

微服务引擎 MSE 及云原生 API 网关 2024 年 10 月产品动态

微服务引擎 MSE 及云原生 API 网关 2024 年 10 月产品动态

20222425 2024-2025-1 《网络与系统攻防技术》实验七实验报告

1.实验内容 本周学习内容:本周我们学了web安全的章节,首先我们了解了前端和后端技术,其次我们学习了一些web安全攻防的内容,例如SQL注入和XSS跨站脚本攻击、CSRF以及安全防范的内容。在实验的过程中我们学到了网络欺诈与防范技术。 2.实验过程 主机IP:192.168.35.1 kali(…

基于Bootstrap3的简单柱状图表插件

jchart是一款简单小巧的基于Bootstrap3.x的jquery柱状图表插件。该柱状图片表插件通过简单的设置,就可以生成非常漂亮的水平柱状图,并带有水平和垂直标签以及图表的头部和尾部。 在线演示 下载 使用方法 该jQuery柱状图插件可以通过javascript来调用,也可以直接使用HTML标…

编译OpenCV——jetson嵌入式平台

jetson嵌入式平台的系统为:ubuntu20.04 aarch64 不再研究Ubuntu x64上交叉编译ubuntu aarch64的OpenCV库,因为无法识别到arm的GTK导致编译不进去,最终imshow时会报如下错误:modules/highgui/src/window.cpp:611:error: (-2) The function is not implemented. Rebuild the …

Breakout pg walkthrough Intermediate

nmap ┌──(root㉿kali)-[~/lab] └─# nmap -p- -A 192.168.192.182 Starting Nmap 7.94SVN ( https://nmap.org ) at 2024-12-02 04:50 UTC Nmap scan report for 192.168.192.182 Host is up (0.071s latency). Not shown: 65533 closed tcp ports (reset) PORT STATE SE…

从开发者工具转型 AI 呼叫中心,这家 Voice Agent 公司已服务 100+客户

Retell.ai 的 5 位联创。(图:maginative.com)Retell AI 提供一个平台,用于构建和部署可进行自然、类人对话的 AI voice agent,赋能呼叫中心,替代或辅助人工座席。Retell AI 起初为构建 voice agent 产品的开发者提供 API,现已将重点转向为中型企业提供完整的 AI 呼叫中心…