【CPP】类和对象

news2024/11/21 0:16:38

1- Classes and Objects

Structures

  • A struct in C is a type consisting of a sequence of data members
  • Some functions/Statements are needed to operate the data members of an object of a struct type

在这里插入图片描述

不不小心操作错误,不小心越界

Classes

  • You should be very careful to manipulated the data members in a struct object
  • Can we improve struct to a better one ?
  • Yes, it is class ! We can put some member functions in it
class Student
{
  private:
    static size_t student_total; // declaration only
    //inline static size_t student_total = 0; //C++17, definition outside isn't needed
    char * name;
    int born;
    bool male; 
    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
};
Student yu;
yu.setName("Yu");

firstclass.cpp

#include <iostream>
#include <cstring>

class Student
{
  public:
    char name[4];
    int born;
    bool male; 
    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
    void setBorn(int b)
    {
        born = b;
    }
    void setGender(bool isMale)
    {
        male = isMale;
    }
    void printInfo()
    {
        std::cout << "Name: " << name << std::endl;
        std::cout << "Born in " << born << std::endl;
        std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
    }
};

int main()
{
    Student yu;
    yu.setName("Yu");
    yu.setBorn(2000);
    yu.setGender(true);
    yu.born = 2001; // it can also be manipulated directly
    yu.printInfo();
    std::cout << "It's name is " << yu.name << std::endl; 
    return 0;
}
Name: Yu
Born in 2001
Gender: Male
It's name is Yu

Access Specifiers

  • You can protect data members by access specifier private
  • Then data member can only be accessed by well designed member functions

access_attribute.cpp

#include <iostream>
#include <cstring>

class Student
{
  private:
    char name[4];
    int born;
    bool male; 
  public:
    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
    void setBorn(int b)
    {
        born = b;
    }
    void setGender(bool isMale)
    {
        male = isMale;
    }
    void printInfo()
    {
        std::cout << "Name: " << name << std::endl;
        std::cout << "Born in " << born << std::endl;
        std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
    }
};

int main()
{
    Student yu;
    yu.setName("Yu");
    yu.setBorn(2000);
    yu.setGender(true);
    yu.born = 2001; // you cannot access a private member
    yu.printInfo();
    return 0;
}
access-attribute.cpp:37:8: error: 'born' is a private member of 'Student'
    yu.born = 2001; // you cannot access a private member
       ^
access-attribute.cpp:8:9: note: declared private here
    int born;
        ^

Member Functions

  • A member function can be defined inside or outside class
  • 如果在类内部实现函数则就是inline 函数

function.cpp

#include <iostream>
#include <cstring>

class Student
{
  private:
    char name[4];
    int born;
    bool male; 
  public:
    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
    void setBorn(int b)
    {
        born = b;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    Student yu;
    yu.setName("Yu");
    yu.setBorn(2000);
    yu.setGender(true);
    yu.printInfo();
    return 0;
}
Name: Yu
Born in 2000
Gender: Male

File Structures

  • The source code can be placed into multiple files

student.hpp

#pragma once

#include <cstring>
class Student
{
  private:
    char name[4];
    int born;
    bool male; 
  public:
    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
    void setBorn(int b)
    {
        born = b;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

student.cpp

#include <iostream>
#include "student.hpp"

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

如果include <> 从编译器路径查找,如果是include "" 从编译器和当前目录找

main.cpp

#include "student.hpp"

int main()
{
    Student yu;
    yu.setName("Yu");
    yu.setBorn(2000);
    yu.setGender(true);
    yu.printInfo();
    return 0;
}

CMakeList.txt

cmake_minimum_required(VERSION 3.12)

project(persondemo)

ADD_EXECUTABLE(persondemo main.cpp student.cpp)


cd multi-files
mkdir build
cd build
cmake ..
make
./persondemo
Name: Yu
Born in 2000
Gender: Male

2-Constructors and Destructors

Constructors

  • Different from struct in C, a constructor will be invoked when creating an object of a class

(1) struct in C: allocate memory
(2) class in C++: allocate memory & invoke a constructor

  • But, No constructor is defined explicitly in previous examples

(1) the compiler wil generate one with empty body

如果没有人为定义构造函数,则自动会有一个空的构造函数

  • The same name with the class
  • Have no return value

class Student
{
  private:
    char name[4];
    int born;
    bool male; 
  public:
    Student()
    {
        name[0] = 0;
        born = 0;
        male = false;
        cout << "Constructor: Person()" << endl;
    }
    }
    Student(const char * initName, int initBorn, bool isMale)
    {
        setName(initName);
        born = initBorn;
        male = isMale;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }
}
  • The members can also be initialized as follows
    Student(const char * initName): born(0), male(true)
    {
        setName(initName);
        cout << "Constructor: Person(const char*)" << endl;
    }

把成员变量born 初始化为0 , 把male 初始化为true

constructor.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    char name[4];
    int born;
    bool male; 
  public:
    Student()
    {
        name[0] = 0;
        born = 0;
        male = false;
        cout << "Constructor: Person()" << endl;
    }
    Student(const char * initName): born(0), male(true)
    {
        setName(initName);
        cout << "Constructor: Person(const char*)" << endl;
    }
    Student(const char * initName, int initBorn, bool isMale)
    {
        setName(initName);
        born = initBorn;
        male = isMale;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }

    void setName(const char * s)
    {
        strncpy(name, s, sizeof(name));
    }
    void setBorn(int b)
    {
        born = b;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    Student yu;
    yu.printInfo();

    yu.setName("Yu");
    yu.setBorn(2000);
    yu.setGender(true);
    yu.printInfo();

    Student li("li");
    li.printInfo();

    Student xue = Student("XueQikun", 1962, true);
    //a question: what will happen since "XueQikun" has 4+ characters?
    xue.printInfo();

    Student * zhou =  new Student("Zhou", 1991, false);
    zhou->printInfo();
    delete zhou;

    return 0;
}
Constructor: Person()
Name: 
Born in 0
Gender: Female
Name: Yu
Born in 2000
Gender: Male
Constructor: Person(const char*)
Name: li
Born in 0
Gender: Male
Constructor: Person(const char, int , bool)
Name: XueQ�
Born in 1962
Gender: Male
Constructor: Person(const char, int , bool)
Name: Zhou�
Born in 1991
Gender: Female

Destructors

  • The destructor will be invoked when the object is destroyed
  • Be formed from the class name preceded by a tilde(~)
  • Have no return value, no parameters
    ~Student()
    {
        cout << "To destroy object: " << name << endl;
        delete [] name;
    }

析构函数只能有一个
析构函数常做的事情:释放内存,关闭文件,断掉网络etc

destructor.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    char * name;
    int born;
    bool male; 
  public:
    Student()
    {
        name = new char[1024]{0};
        born = 0;
        male = false;
        cout << "Constructor: Person()" << endl;
    }
    Student(const char * initName, int initBorn, bool isMale)
    {
        name =  new char[1024];
        setName(initName);
        born = initBorn;
        male = isMale;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }
    ~Student()
    {
        cout << "To destroy object: " << name << endl;
        delete [] name;
    }

    void setName(const char * s)
    {
        strncpy(name, s, 1024);
    }
    void setBorn(int b)
    {
        born = b;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    {
        Student yu;
        yu.printInfo();

        yu.setName("Yu");
        yu.setBorn(2000);
        yu.setGender(true);
        yu.printInfo();
    }
    Student xue = Student("XueQikun", 1962, true);
    xue.printInfo();

    Student * zhou =  new Student("Zhou", 1991, false);
    zhou->printInfo();
    delete zhou;

    return 0;
}
g++ destructor.cpp --std=c++11
Constructor: Person()
Name: 
Born in 0
Gender: Female
Name: Yu
Born in 2000
Gender: Male
To destroy object: Yu
Constructor: Person(const char, int , bool)
Name: XueQikun
Born in 1962
Gender: Male
Constructor: Person(const char, int , bool)
Name: Zhou
Born in 1991
Gender: Female
To destroy object: Zhou
To destroy object: XueQikun

人工手动调用析构函数 delete zhou,作用域结束跳出也会自动调用析构函数
如果对于new 的对象不进行手动删除delete 则作用域结束也不会动态调用析构函数,造成内存泄漏

    Student * class1 = new Student[3]{
        {"Tom", 2000, true},
        {"Bob", 2001, true},
        {"Amy", 2002, false},
    };
  • What is the different between the following two lines?
delete class1;
delete [] class1;

array.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    char * name;
    int born;
    bool male; 
  public:
    Student()
    {
        name = new char[1024]{0};
        born = 0;
        male = false;
        cout << "Constructor: Person()" << endl;
    }
    Student(const char * initName, int initBorn, bool isMale)
    {
        name =  new char[1024];
        setName(initName);
        born = initBorn;
        male = isMale;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }
    ~Student()
    {
        cout << "To destroy object: " << name << endl;
        delete [] name;
    }

    void setName(const char * s)
    {
        strncpy(name, s, 1024);
    }
    void setBorn(int b)
    {
        born = b;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    Student * class1 = new Student[3]{
        {"Tom", 2000, true},
        {"Bob", 2001, true},
        {"Amy", 2002, false},
    };

    class1[1].printInfo();
    delete class1;
    delete []class1;


    return 0;
}
Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Name: Bob
Born in 2001
Gender: Male
To destroy object: Tom

数组调用析构函数delete class1 , 只会调用第一个对象的析构函数,后面的对象不会被调用

数组调用析构函数 delete [] class1,则会调用全部对象的析构函数

Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Name: Bob
Born in 2001
Gender: Male
To destroy object: Amy
To destroy object: Bob
To destroy object: Tom

3-this pointer

Why is this needed

  • How does a member function know which name?

在这里插入图片描述

this Pointer

  • All methods in a function have a this pointer
  • It is set to the address of the object that invokes the method

在这里插入图片描述

this.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    char * name;
    int born;
    bool male; 
  public:
    Student()
    {
        name = new char[1024]{0};
        born = 0;
        male = false;
        cout << "Constructor: Person()" << endl;
    }
    Student(const char * name, int born, bool male)
    {
        this->name =  new char[1024];
        this->setName(name);
        this->born = born;
        this->male = male;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }
    ~Student()
    {
        cout << "To destroy object: " << name << endl;
        delete [] name;
    }

    void setName(const char * name)
    {
        strncpy(this->name, name, 1024);
    }
    void setBorn(int born)
    {
        this->born = born;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    Student * class1 = new Student[3]{
        {"Tom", 2000, true},
        {"Bob", 2001, true},
        {"Amy", 2002, false},
    };

    class1[1].printInfo();
    delete []class1;


    return 0;
}
Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Constructor: Person(const char, int , bool)
Name: Bob
Born in 2001
Gender: Male
To destroy object: Amy
To destroy object: Bob
To destroy object: Tom

4- const and static Members

const Variables

  • statements for constants

在这里插入图片描述

C++不推荐用 宏

const Members

  • const member variables behavior similar with normal const variables
  • const member functions promise not to modify member variables
class Student
{
  private:
    const int BMI = 24;
  public:
    Student()
    {
        BMI = 25;//can it be modified?
    int getBorn() const
    {
        born++; //Can it be modified?
        return born;
    }
};

常量函数,const 放在后面,不然跟前面的const int相冲突。不可以修改成员变量,born 是不可以被修改的,保证不修改函数里的变量

const.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    const int BMI = 24;
    char * name;
    int born;
    bool male; 
  public:
    Student()
    {
        name = new char[1024]{0};
        born = 0;
        male = false;
        // BMI = 25;//can it be modified?
        cout << "Constructor: Person()" << endl;
    }
    Student(const char * name, int born, bool male)
    {
        this->name =  new char[1024];
        setName(name);
        this->born = born;
        this->male = male;
        cout << "Constructor: Person(const char, int , bool)" << endl;
    }
    ~Student()
    {
        cout << "To destroy object: " << name << endl;
        delete [] name;
    }

    void setName(const char * name)
    {
        strncpy(this->name, name, 1024);
    }
    void setBorn(int born)
    {
        this->born = born;
    }
    int getBorn() const
    {
        //born++; //Can it be modified?
        return born;
    }
    // the declarations, the definitions are out of the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

int main()
{
    Student yu("Yu", 2000, true);
    cout << "yu.getBorn() = " << yu.getBorn() << endl;
    return 0;
}
Constructor: Person(const char, int , bool)
yu.getBorn() = 2000
To destroy object: Yu

static members

  • static members are not bound to class instances
class Student
{
  private:
    static size_t student_total; // declaration only
  public:
    Student()
    {
        student_total++;
    }

    ~Student()
    {
        student_total--;
    }
    static size_t getTotal() {return student_total;}
};

// definition it here
size_t Student::student_total = 0; 



静态成员不绑定在类对象上,只有一个

static.cpp

#include <iostream>
#include <cstring>

using namespace std;

class Student
{
  private:
    static size_t student_total; // declaration only
    //inline static size_t student_total = 0; //C++17, definition outside isn't needed
    char * name;
    int born;
    bool male; 
  public:
    Student()
    {
        student_total++;
        name = new char[1024]{0};
        born = 0;
        male = false;
        cout << "Constructor: Person(): student_total = " << student_total << endl;
    }
    Student(const char * initName, int initBorn, bool isMale)
    {
        student_total++;
        name =  new char[1024];
        setName(initName);
        born = initBorn;
        male = isMale;
        cout << "Constructor: Person(const char, int , bool): student_total = " << student_total << endl;
    }
    ~Student()
    {
        student_total--;
        cout << "To destroy object: " << name ;
        cout << ". Then " << student_total << " students are left" << endl;
        delete [] name;
    }

    void setName(const char * s)
    {
        strncpy(name, s, 1024);
    }
    void setBorn(int b)
    {
        born = b;
    }
    static size_t getTotal() {return student_total;}
    // the declarations, the definitions are out sof the class
    void setGender(bool isMale);
    void printInfo();
};

void Student::setGender(bool isMale)
{
    male = isMale;
}
void Student::printInfo()
{
    std::cout << "Name: " << name << std::endl;
    std::cout << "Born in " << born << std::endl;
    std::cout << "Gender: " << (male ? "Male" : "Female") << std::endl;
}

size_t Student::student_total = 0; // definition it here

int main()
{
    cout << "---We have " << Student::getTotal() << " students---" << endl;

    Student * class1 = new Student[3]{
        {"Tom", 2000, true},
        {"Bob", 2001, true},
        {"Amy", 2002, false},
    };

    cout << "---We have " << Student::getTotal() << " students---" << endl;

    Student yu("Yu", 2000, true);

    cout << "---We have " << Student::getTotal() << " students---" << endl;

    class1[1].printInfo();
    delete []class1;

    cout << "---We have " << Student::getTotal() << " students---" << endl;

    return 0;
}
---We have 0 students---
Constructor: Person(const char, int , bool): student_total = 1
Constructor: Person(const char, int , bool): student_total = 2
Constructor: Person(const char, int , bool): student_total = 3
---We have 3 students---
Constructor: Person(const char, int , bool): student_total = 4
---We have 4 students---
Name: Bob
Born in 2001
Gender: Male
To destroy object: Amy. Then 3 students are left
To destroy object: Bob. Then 2 students are left
To destroy object: Tom. Then 1 students are left
---We have 1 students---
To destroy object: Yu. Then 0 students are left

静态函数里面不可以修改非静态数据

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

五分钟理解Java跨平台原理(适合小白)

JVM通俗的理解 Java语言的一个非常重要的特点就是与平台的无关性。而使用Java虚拟机&#xff0c;即JVM&#xff08;Java Virtual Machine&#xff09;是实现这一特点的关键。JVM是一种用于计算设备的规范&#xff0c;它是一个虚构出来的计算机&#xff0c;是通过在实际的计算机…

SMART PLC梯形速度曲线轨迹规划(追剪从轴控制)

在介绍本专栏之前,大家可以参考另一篇博图PLC的梯形加减速点动功能块介绍文章 梯形加减速点动功能块(博途SCL)_RXXW_Dor的博客-CSDN博客文章浏览阅读184次。SMART PLC斜坡函数SMART PLC斜坡函数功能块(梯形图代码)_RXXW_Dor的博客-CSDN博客斜坡函数Ramp的具体应用可以参看下…

vue3+element-plus 表格全选和跨页勾选,以及全选全部功能

目录 背景描述 实现效果 详细开发 1.模拟数据和页面布局 2.跨页勾选和点击勾选功能 3.表头全选 4. 全选全部 &#xff08;1&#xff09;全选后禁用表格勾选&#xff08;简单&#xff09; &#xff08;2&#xff09;真正意义上的全选全部&#xff08;难&#xff09; 总…

「Eolink Apikit 教程」如何快速创建有效的API监控任务?

API 监控能够确保 API 的稳定性。如果一个 API 出现故障或崩溃&#xff0c;它可能会导致整个应用程序无法正常工作。这对用户和业务来说可能是灾难性的。通过监控 API&#xff0c;开发团队可以及时发现问题并采取措施来修复它们&#xff0c;从而降低应用程序中断的风险。 作为…

(免费领源码)PHP#mysql高校学生考证资源共享小程序35055-计算机毕业设计项目选题推荐

摘要 大学生“考证”已经成为大学生的一门必修课&#xff0c;越来越多的大学生加入考证的行列&#xff0c;他们认为毕业找工作的时候&#xff0c;证书是多多益善。大学生“考证热”应该引起学生&#xff0c;学校、以及社会用人单位等多方面的高度重视。大学生考证热潮的形成&am…

拉普拉斯噪声

拉普拉斯噪声是指从拉普拉斯分布中抽取的随机变量。拉普拉斯分布是一种连续型概率分布&#xff0c;其概率密度函数为&#xff1a; 拉普拉斯噪声在差分隐私&#xff08;Differential Privacy&#xff09;领域中被广泛使用&#xff0c;原因有以下几点&#xff1a; 灵活性&#xf…

学习笔记|单样本t检验|P值|两独立样本均数T检验|规范表达|《小白爱上SPSS》课程:SPSS第五讲 | 两独立样本均数T检验,你会了吗?

目录 学习目的软件版本原始文档P值是假设检验的终极者两独立样本均数T检验一、实战案例二、案例解析三、统计策略四、SPSS操作1、正态性检验2、T检验&#xff08;独立样本T检验&#xff09;结果 五、结果解读Tips&#xff1a;补充知识 六、规范报告1、规范表格2、规范文字 注意…

2.基于Jetson Nano的嵌入式小车避障项目

英伟达jetbot智能小车 一.数据采集 数据采集的时候&#xff0c;一定要不用的光线&#xff0c;不同的方向&#xff0c;不同的环境。 一般500-600张 二.AI训练 三.AI部署 import torch import torchvision3.1 加载预训练模型 第一步&#xff1a;载入模型 model torchvisi…

gitlab添加ssh秘钥

安装git 右击&#xff1a;git bash here 1.首先用如下命令&#xff08;如未特别说明&#xff0c;所有命令均默认在Git Bash工具下执行&#xff09;检查一下用户名和邮箱是否配置&#xff08;gitlab支持我们用用户名或邮箱登录&#xff09;&#xff1a; git config --global --…

『赠书第 2 期』- 『Django+Vue.js商城项目实战』

文章目录 1024 程序员节学习新技术关于作者内容介绍抽奖评论区抽三位小伙伴送书活动时间&#xff1a;截止到 2023-11-05 20:00:00 获奖名单 ps. 文末有抽奖&#xff0c;抽奖为 Swift社区 额外福利 1024 程序员节 受邀参加了 CSDN 举办的 1024 程序员节上海站的活动&#xff0…

【贝叶斯回归】【第 2 部分】--推理算法

一、说明 在第一部分中&#xff0c;我们研究了如何使用 SVI 对简单的贝叶斯线性回归模型进行推理。在本教程中&#xff0c;我们将探索更具表现力的指南以及精确的推理技术。我们将使用与之前相同的数据集。 二、模块导入 [1]:%reset -sf[2]:import logging import osimport tor…

亮氨酸脯氨酸肽——一种新型的医药中间体研究肽

亮氨酸脯氨酸医药中间体肽是一种合成&#xff08;人造&#xff09;激素&#xff0c;类似于大脑中产生的天然激素。它用于治疗许多医疗问题&#xff0c;包括&#xff1a; 子宫平滑肌瘤&#xff08;子宫肌瘤&#xff09;出血引起的贫血&#xff0c;或晚期或晚期前列腺癌症&#…

管理类联考——数学——汇总篇——知识点突破——代数——整式分式——记忆

文章目录 考点记忆/考点汇总——按大纲 整体目录大纲法记忆宫殿法绘图记忆法 局部数字编码法归类记忆法重点记忆法歌决记忆法谐音记忆法理解记忆法比较记忆法转图像记忆法可视化法 本篇思路&#xff1a;根据各方的资料&#xff0c;比如名师的资料&#xff0c;按大纲或者其他方式…

大数据之LibrA数据库系统告警处理(ALM-12002 HA资源异常)

告警解释 HA软件周期性检测Manager的WebService浮动IP地址和数据库。当HA软件检测到浮动IP地址或数据库异常时&#xff0c;产生该告警。 当HA检测到浮动IP地址或数据库正常后&#xff0c;告警恢复。 告警属性 告警参数 对系统的影响 如果Manager的WebService浮动IP地址异常…

手机平板摄像头如何给电脑用来开视频会议

环境&#xff1a; Iriun Webcam EV虚拟摄像头 钉钉会议 问题描述&#xff1a; 手机平板摄像头如何给电脑用来开视频会议 解决方案&#xff1a; 1.下载软件 手机端和电脑端都下载这个软件&#xff0c;连接同一局域网打开软件连接好 另外一款软件Iriun 也是一样操作 2.打…

Pytorch L1,L2正则化

L1正则化和L2正则化是常用的正则化技术&#xff0c;用于在机器学习模型中控制过拟合。它们的主要区别在于正则化项的形式和对模型参数的影响。 L1正则化&#xff08;Lasso正则化&#xff09;&#xff1a; 正则化项形式&#xff1a;L1正则化使用模型参数的绝对值之和作为正则化…

RUP核心工作流2021-架构师(六十四)

1、根据传统的软件生命周期方法学&#xff0c;可以把软件生命周期划分为&#xff08;&#xff09;。 A、软件定义、软件开发、软件测试、软件维护 B、软件定义、软件开发、软件运行、软件维护 C、软件分析、软件设计、软件开发、软件维护 D、需求获取、软件设计、软件开发、…

跳槽一定用得上的大厂Java题库!

2023年已经接近尾声了&#xff0c;疫情的影响也在逐渐减小&#xff0c;市场慢慢复苏。不过最近还是会有一些读者粉丝朋友反馈&#xff0c;“Java市场饱和了”、“大环境还是不好”、“投几十个简历都没有一个约面的”。其实并不是岗位需求量变少了&#xff0c;是越来越多的公司…

Calcite 优化层详解

1、关系代数与火山模型 1&#xff09;关系代数 基本的关系代数运算有选择、投影、集合并、集合差、笛卡儿积等。 在这些基本运算之外&#xff0c;还有一些集合之间的交集、连接、除和赋值等运算。 连接运算可分为连接、等值连接、自然连接、外连接、左外连接和右外连接。 …

腰背肌筋膜炎能彻底治愈吗

腰背肌筋膜炎&#xff1a;急性期腰部疼痛剧烈&#xff0c;有烧灼感&#xff0c;腰部活动时症状加重&#xff0c;局部压痛显著&#xff0c;有时体温升高、血液检查可见白细胞增高。急性发作后&#xff0c;少数患者症状完全消退&#xff0c;多数会遗留疼痛&#xff0c;或相隔数月…