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

c->c++(一):部分KeyWord

        本文主要探讨c++相关关键字的使用。

char
        char默认是unsigned/signed取决平台,wchar_t宽字符:用于Unicode编码(超过一个字节),用wcin和wcout输入输出,字符串为wstring
        char8_t(20),char16_t(11起),char32_t(11):指定占用字节数且是无符号,字符串类u8string,u16string,u32string(20)

逻辑与位运算        

       and(&&),or(||),not(!),bitand(&),bitor(|),xor(^)and_eq(&=),or_eq(|=)xor_eq(^=),compl(~),not_eq(!=)

引用(&):
          引用在定义时初始化(指向对象),后面不能指向其他对象,指针可在任何时候指向其他对象
          引用本质:int &b = a; <==> int * const b = &a;(指针变量const化)
          引用主要用在函数传参和返回值,sizeof(引用)是目标变量大小,未规定引用所占空间大小,编译器会给分配空间
  
enum       

enum class enmu_type_name:unsigned int{MON = 1, THU, WEN};
enum enmu_type_name{MON = 1, THU, WEN};


        枚举类型和值类型可以互相转换,但不能运算

inline:
        定义在类声明之中的成员函数将自动地成为内联函数
        类外定义inline函数,类定义和成员函数在同一头文件,否则编译无法进行置换

class A
{ public:void Foo(int x, int y) { ... }   //自动地成为内联函数,即使没有inline关键字 
}

nullptr
        C语言中NULL标记野指针((void *)0),C++为其他类型((int *)0 ...)
        nullptr的本质

const class nullptr_t
{public:template<class T> inline operator T*()const {return 0;}template<class C, class T> inline operator T C::*() const {return 0;}private:void operator&() const;
}   nullptr={};

static_assert
        C编译错误用#error输出,asser运行时错误退出
        C++的static_assert静态断言编译时错误退出,

内存对齐
        扩大对齐:__attribute__((aligned(n))),缩小对齐:__attribute__((packed))
        alignas(n)与__attribute__((aligned(n)))相同,alignof(struct s) <==> 返回未对齐结构体大小或扩大机构体所占字节数

类型转换
        typeid:返回变量,表达式,对象,的类型,返回静/动态态类型

static_cast<type-id>(exdivssion)

        显示类型转换:基本类型转换,指针类型转换(空针->目标类型空针),函数类型转换(任意类型函数->void),父类和子类之间指针和引用转换(上行转换安全,下行转换不安全),不能转换掉exdivssion的const、volitale、__unaligned

dynamic_cast< type-id >(exdivssion)

        Type-id必须是类指针、类引用或者void *,主用于类层次间上行转换和下行转换,类之间交叉转换

reinterpret_cast <new_type>(expression) 

        reintepret_cast <==> C的强制类型转换,不进行类型检查

const_cast(const_cast<type_id> (expression))

        常量向非常量转化,用于添加和移除const或volatile修饰

auto(11)
        自动推导出变量(对象)类型,定义时初始化,不能一次定义多个类型的不同变量
        decltype:编译器推导目标表达式类型,不要求初始化
        auto和decltype:
                auto忽略顶层const,decltype保留const
                auto作为类型占用符,decltype类似于sizeof
                auto推断出引用(解引用)原有类型,decltype推断出引用
                auto推断时会执行,decltype做分析

class
        class是对struct扩展,数据(成员变量)和方法(成员函数)的封装,包含数据和方法的访问权限(private、protected、public)
        static静态成员和方法属于class,非静态属于对象
        this本质是指向当前对象的指针,未定义对象前可在方法中调用对象成员
        virtual修饰class成员函数为虚函数(基类中),有接口声明没实体,可在派生类中重写(override)实现面向对象多态性
        final修饰class的不能被被继承,final修饰成员的方法子类不能重写
        using能让子类去声明并访问父类中private成员
        operator用于运算符重载(重定义运算符)
        friend不属于class的外部函数访问class内受保护的成员变量
        explicit(显式)、implicit(隐式)修饰构造函数防止构造函数错误类型转换

const
        const限制函数内部对类成员变量修改,mutable可突破const成员函数限制,可以修改特定成员变量
        constexpr将变量值赋值给const修饰的变量

constexpr int multiply (int x, int y)
{return x * y;
}
const int val = multiply( 10, 10 );   //const int val = 100;

        export定义模板类或模板函数,在,h文件中声明,类似extern
        requires用于模板参数约束

异常处理

throw(int,double,char,long,short)

        函数抛出5类exception,throw()不会抛出异常noexcept替代throw()表示不抛出异常,noexcept(bool)抛出任意异常
        throw异常若没有catch会向上层传递直到被catch,函数可用throw列表来标识抛出的异常
        标准库exception类:bad_typeid,typeid运算是多态指针且不为NULL,会拋出异常
        bad_cast,dynamic_cast多态基类对象(或引用)到派生类引用的强制类型转换若不安全会拋出异常

namespace

        避免命名冲突,提高可读性和可维护性,支持模块化和封装,提高代码可靠性和扩展性
        命名空间里面可以包含变量、函数、类型,不能定义在局部作用域
        相同名称命名空间编译时会合并,相同名称命名空间不能存在相同变量、函数、类型的定义
        未命名空间(全局变量)直接使用,命名空间(全局变量)使用 :: 域作用限定符或using关键字声明使用

函数

        void func(int i,int j);C中func函数编译后符号表中为func,C++编译后符号表中为_Z3funcii所以c++中函数参数列表类型、个数可变,还可带有默认参数,c不可行
        C++调用C库(使用C规则编译):extern "C"{};

demo1:

        key word测试

目录结构:

代码示例: 

        CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.20)                            #最低版本要求SET(CMAKE_CXX_COMPILER "g++")                                   #设置g++编译器PROJECT(KeyWord)                                                #设置工程名MESSAGE(STATUS "test keyword")                                  #打印消息ADD_EXECUTABLE(pro main.cpp)                                    #生成可执行文件

        run.sh 

#!/bin/bashif [ -f ./Makefile ]
thenmake clean
ficmake .makeecho "---------------------------------"./pro

        main.cpp 

#include <iostream>using namespace std;int bool_test()
{int num = 2;bool logic = !num;cout << boolalpha << logic << endl;return 0;
}int test_cite()
{struct test{int num;int &cite = num;};struct test s;s.num = 1;int tmp = 10;s.cite = 3;//&s.cite = tmp; //引用在定义时初始化(指向合法地址),后面不能指向其他地址,指针可在任何时候指向其他地址cout << "sizeof(s.num) : " << sizeof(s.num) << endl;cout << "sizeof(s.cite) : " << sizeof(s.cite) << endl;cout << "sizeof(s) : " << sizeof(s) << endl;cout << "sizeof(struct test) :" << sizeof(struct test) << endl;cout << "num : " << s.num << endl;cout << "cite : " << s.cite << endl;const int &t = tmp;//t = 20;       //引用本质:int &b = a; <==> int * const b = &a;(指针变量const化)return 0;
}int test_enum()
{enum test {ZERO,ONE,TWO};test num; //c++ ,c: enum test numnum = ZERO;cout << "num :" << num << endl;cout << "enmu list :" << ZERO << " " << ONE << " "  << TWO  << endl;//ZERO++; ZERO = 2; //不能赋值enum tmp {A = 1,B = 4,C = 5};tmp t = tmp(10);cout << "t :" << t << endl;return 0;
}void func(char *p)
{cout << "char func" << endl;
}void func(int *p)
{cout << "int func" << endl;
}int test_nullptr()
{char *pc = nullptr;int *pi = nullptr;func(pi);func(pc);cout << "c++ NULL :" << NULL <<endl;//c++ : NULL == 0, c: NULL == (void *)0return 0;
}int test_static_assert()
{static_assert(sizeof(void *) == 8,"not support 64bit system ");return 0;
}int mem_align()
{struct s1{char a;short b;int c;};struct alignas(16) s2{char a;short b;int c;};cout << "sizeof(s1) :" << sizeof(struct s1) << endl;cout << "alignof(s2) :" << alignof(struct s1) << endl;cout << "sizeof(s2) :" << sizeof(struct s2) << endl;cout << "sizeof(s2) :" << alignof(struct s2) << endl;return 0;
}int test_typeid()
{char a;unsigned char b;signed char c;int d;long e;float f;double g;short h;cout << "typeid(a).name() :" << typeid(a).name() << endl;cout << "typeid(b).name() :" << typeid(b).name() << endl;cout << "typeid(c).name() :" << typeid(c).name() << endl;cout << "typeid(d).name() :" << typeid(d).name() << endl;cout << "typeid(e).name() :" << typeid(e).name() << endl;cout << "typeid(f).name() :" << typeid(f).name() << endl;cout << "typeid(g).name() :" << typeid(g).name() << endl;cout << "typeid(h).name() :" << typeid(h).name() << endl;cout << "typeid(short).name() :" << typeid(short).name() << endl;return 0;
}int type_convert()
{char a = 1;int b;b = a;b = static_cast<int>(a);cout << "b :" << b << endl;class A {public:virtual void Foo() //虚函数{}};class B : public  A{};class C : public  A{};A *c1 = new B;B* c3 = dynamic_cast<B*>(c1); //下行转换C* c4 = dynamic_cast<C*>(c1); //横向转换int *pi;char *pc;pi = reinterpret_cast<int *>(pc);const int n = 10;int *t = const_cast<int *>(&n);*t = 20;cout << "n : " << n << endl;cout << "*t : " << *t << endl;return 0;
}int test_auto()
{int a = 5;auto b = 6;auto c = a;decltype(a) e;decltype(b) f;decltype(c) g;auto h = e;auto i = f;auto j = g;const int num = 1;auto tmp = num;decltype(num) t = 8;tmp = 2;//auto忽略const//t = 9; //decltype可推断出constchar s = 1;auto &s1 = s;cout << "a type : " << typeid(a).name() << endl;cout << "b type : " << typeid(b).name() << endl;cout << "c type : " << typeid(c).name() << endl;cout << "e type : " << typeid(e).name() << endl;cout << "f type : " << typeid(f).name() << endl;cout << "g type : " << typeid(g).name() << endl;cout << "h type : " << typeid(h).name() << endl;cout << "i type : " << typeid(i).name() << endl;cout << "j type : " << typeid(j).name() << endl;cout << "num type : " << typeid(num).name() << endl;cout << "tmp type : " << typeid(tmp).name() << endl;cout << "t type : " << typeid(t).name() << endl;cout << "s1 type : " << typeid(s1).name() << endl;cout << "decltype(s1) type : " << typeid(decltype(s1)).name() << endl;return  0;
}class A
{public:int i;static int j; void func1();static void func2();
};void A::func1()
{this->j = 30;A::j = 40;cout << "this.i :" << this->i  << endl;
}void A::func2()
{A::j = 50;cout << "func2" << endl;
}int A::j;int test_class()
{A::j = 10;A a;a.i = 1;cout << "a.i :" << a.i << endl;cout << "A::j :" << A::j << endl;a.func1();cout << "A::j :" << A::j << endl;A::func2();cout << "A::j :" << A::j << endl;return 0;
}class B
{public:void set_value();private:mutable int value;
};void B::set_value()
{value = 0;value++;cout << "value :" << value << endl;
}int test_mutable()
{B b;b.set_value();return 0;
}constexpr int add_num(int a,int b)
{return a+b;
}int test_constexpr()
{const int num = add_num(10,10);// const int num = 20;cout << "num :" << num << endl;return 0;
}template <typename T>T multiplicaty(T a,T b)
{return a*b;
}int test_template()
{cout << "1*2 :" << multiplicaty(1,2) << endl;cout << "1.1*2.2 :" << multiplicaty(1.1,2.2) << endl;return 0;
}int test_abnormal()
{int m,n;cout << "input dividend : ";cin >> m;cout << "input divisor : ";cin >> n;try{if(n == 0)throw(1);}catch(int e){cout << "divisor can't input 0,repeat input divisor : ";cin >> n;}cout << "m/n : " << m/n << endl;return 0;
}int main()
{cout << "------------------------------------" << endl;bool_test();cout << "------------------------------------" << endl;test_cite();cout << "------------------------------------" << endl;test_enum();cout << "------------------------------------" << endl;test_nullptr();cout << "------------------------------------" << endl;test_static_assert();cout << "------------------------------------" << endl;mem_align();cout << "------------------------------------" << endl;test_typeid();cout << "------------------------------------" << endl;type_convert();cout << "------------------------------------" << endl;test_auto();cout << "------------------------------------" << endl;test_class();cout << "------------------------------------" << endl;test_mutable();cout << "------------------------------------" << endl;test_constexpr();cout << "------------------------------------" << endl;test_template();cout << "------------------------------------" << endl;test_abnormal();cout << "------------------------------------" << endl;return 0;
}

 结果示例:

demo2:

        namespace测试

目录结构:

代码示例: 

        CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.20)                            #最低版本要求SET(CMAKE_CXX_COMPILER "g++")                                   #设置g++编译器PROJECT(namespace)                                              #设置工程名MESSAGE(STATUS "test namespace")                                #打印消息ADD_EXECUTABLE(pro main.cpp namespace.cpp)                      #生成可执行文件

        run.sh 

#!/bin/bashif [ -f ./Makefile ]
thenmake clean
ficmake .makeecho "---------------------------------"./pro

        namespace.hpp 

#ifndef __NAMESPACE_HPP
#define __NAMESPACE_HPPnamespace
{int num;
}namespace n1
{int num;void printf_num(const int num);
}namespace n2
{int num;namespace n3{int num;void printf_num(const int num);}
}#endif

        namespace.cpp 

#include <iostream>using namespace std;namespace n1
{int tmp;void printf_num(const int num){cout << "num :" << num << endl;}
}namespace n2
{namespace n3{void printf_num(const int num){cout << "num :" << num << endl;}}
}

        main.cpp 

#include <iostream>
#include "namespace.hpp"using namespace std;
int main()
{num = 1;n1::num = 2;cout << "num :" << num <<endl;n1::printf_num(n1::num);n2::num = 3;cout << "num :" << n2::num << endl;n2::n3::num = 4;n2::n3::printf_num(n2::n3::num);return 0;
}

结果示例:

demo3: 

        C++调用C

目录结构:

代码示例:

         CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.20)                            #最低版本要求SET(CMAKE_CXX_COMPILER "g++")                                   #设置g++编译器PROJECT(CPP_CALL_C)                                             #设置工程名MESSAGE(STATUS "cpp call c")                                    #打印消息ADD_EXECUTABLE(pro main.cpp clib.c)                             #生成可执行文件

        run.sh 

#!/bin/bashif [ -f ./Makefile ]
thenmake clean
ficmake .makeecho "---------------------------------"./pro

        clib.h 

#ifndef __CLIBC_H#define __CLIBC_Hvoid func();#endif

        clib.c 

#include <stdio.h>
#include "clib.h"void func(){printf("c func\n");return;}

        main.cpp  

#ifdef __cplusplusextern "C"{#endif#include "clib.h"#ifdef __cplusplus}  #endifint main(){func();return 0;}

 结果示例:

 

demo4: 

        c调用c++

目录结构:

代码示例:

        CMakeLists.txt

CMAKE_MINIMUM_REQUIRED(VERSION 2.20)                            #最低版本要求SET(CMAKE_CXX_COMPILER "g++")                                   #设置g++编译器PROJECT(CPP_CALL_C)                                             #设置工程名MESSAGE(STATUS "cpp call c")                                    #打印消息ADD_EXECUTABLE(pro main.c package_func.cpp cpplib.cpp)          #生成可执行文件

        run.sh 

#!/bin/bashif [ -f ./Makefile ]
thenmake clean
ficmake .makeecho "---------------------------------"./pro

        cpplib.hpp 

#ifndef __LIB_HPP#define __LIB_HPPvoid func();#endif

        cpplib.cpp  

#include <iostream>
#include "cpplib.hpp"using namespace std;void func()
{cout << "c++ func" << endl;return;
}

        package_func.hpp 

#ifndef __PACKAGE_FUNC_HPP
#define __PACKAGE_FUNC_HPP#ifdef __cplusplusextern "C"{#endifvoid package_func();#ifdef __cplusplus}#endif
#endif

        package_func.cpp 

#include "cpplib.hpp"
#include "package_func.hpp"void package_func()
{func();}
r

        main.c 

#include "package_func.hpp"int main(){package_func();return 0;}

结果示例 :

相关文章:

c->c++(一):部分KeyWord

本文主要探讨c相关关键字的使用。 char char默认是unsigned/signed取决平台,wchar_t宽字符:用于Unicode编码(超过一个字节),用wcin和wcout输入输出,字符串为wstring char8_t(20),char16_t(11起),char32_t(11):指定占用字节数且是无符号,字符串类u8string,u16s…...

【iOS】YYModel源码阅读笔记

文章目录 前言一、JSON转换库对比二、YYModel性能优化三、YYModel的使用四、架构分析YYClassInfo 剖析 五、流程剖析转换前准备工作 – 将JSON统一成NSDictionary将NSDictionary 转换为Model对象提取Model信息使用NSDictionary的数据填充Model 总结 前言 先前写了JSONModel的源…...

C++Qt做一个鼠标在按钮上悬浮3s显示一个悬浮窗口

当你想要在 Qt 中创建一个自定义按钮并添加悬浮窗口的功能时&#xff0c;你可以通过继承 QPushButton 类来实现。下面是一个示例代码&#xff0c;演示了如何创建一个自定义按钮类 HoverButton&#xff0c;并在鼠标悬浮在按钮上 3 秒后显示一个悬浮窗口&#xff0c;窗口包含图片…...

sslh一键在一个端口上运行多个服务(KALI工具系列二十三)

目录 1、KALI LINUX 简介 2、sslh工具简介 3、信息收集 3.1 目标主机IP&#xff08;win&#xff09; 3.2 KALI的IP 4、操作示例 4.1 监听特定端口 4.2 配置SSH 4.3 配置apache 4.4 配置sshl 4.5 验证配置 5、总结 1、KALI LINUX 简介 Kali Linux 是一个功能强大、…...

Vue27-内置指令04:v-once指令

一、需求 二、v-once指令 获取初始值&#xff1a; 三、小结...

Pytorch环境配置的方法

Pytorch虚拟环境配置全流程 以安装pytorch1.9.1为例 1. 创建虚拟环境 安装Anaconda3&#xff0c;打开 PowerShell 创建虚拟环境并进入&#xff1a; conda create -n torch1.9.1 python3.8 conda activate torch1.9.1 conda create -n torch1.9.1 python3.8 conda activate to…...

数字化制造案例分享以及数字化制造能力评估(34页PPT)

资料介绍&#xff1a; 通过全面的数字化企业平台和智能制造技术的应用&#xff0c;制造型企业不仅提升了自身的竞争力&#xff0c;也为整个制造业的数字化转型提供了借鉴。同时&#xff0c;数字化制造能力的评估是企业实现数字化转型的关键环节&#xff0c;需要从技术变革、组…...

搜维尔科技:特斯拉称工厂内有两台人形机器人开始自主工作

搜维尔科技消息&#xff0c;据外电报道&#xff0c;特斯拉声称&#xff0c;其目前拥有两台 Optimus 人形机器人在工厂内自主工作&#xff0c;这尚属首次。 如果目前这场薪酬方案混乱有什么好处的话&#xff0c;那就是特斯拉几乎看起来又有了一个公关部门。 当然&#xff0c;其…...

SIGMOD 2024 | 时空数据(Spatial-Temporal)和时间序列(Time Series)论文总结

SIGMOD2024于6月9号-6月14号正在智利圣地亚戈举行&#xff08;Santiago Chile&#xff09; 本文总结了SIGMOD 2024有关时间序列&#xff08;time series&#xff09;,包括时序数据库&#xff0c;查询优化等内容。以及时空数据&#xff08;spatial-temporal data&#xff09;的…...

学习分享-分布式 NoSQL 数据库管理系统Cassandra以及它和redis的区别

前言 最近在学习的过程中遇到如何应对海量幂等 Key 所消耗的内存的问题&#xff0c;在网上查找资料了解到Cassandra或许是解决方式之一&#xff0c;所以查找了Cassandra的相关资料及其Cassandra和redis的区别。 什么是Cassandra Cassandra 是一个开源的分布式 NoSQL 数据库管…...

Android 汉字转拼音(两行就够了)

在Android中&#xff0c;我们可以使用Android自带的Transliterator类来实现汉字转拼音的功能。下面是使用Transliterator类的示例代码&#xff1a; 在你的Activity或者工具类中&#xff0c;使用以下代码来实现汉字转拼音的功能&#xff1a; import android.support.v7.app.Ap…...

JVM

栈 定义 每个线程运行时所需要的内存, 称为虚拟机栈每个栈由多个栈帧(包含参数, 局部变量, 放回值)组成, 对应着每次方法调用时所占用的内存每个线程只能有一个活动栈帧, 对应着当前正在执行的那个方法 堆 定义: 通过new关键字, 创建对象都会使用堆内存 特点:它是线程共享…...

MySQL锁机制和事务管理:如何处理并发和隔离性

引言 在数据库系统中,多个用户可能同时访问和修改数据,这就是并发操作。并发操作的主要优势在于,它显著提高了资源的利用率和事务的吞吐量。然而,如果不适当的管理并发操作,就会引发一些问题。以下几种并发操作中常见的问题: 丢失修改:这是某一事务的更新被另一事务的…...

特别名词Test Paper7

特别名词Test Paper7 potteries 陶器power 权力&#xff1b;能源powerpoint 投影的文件precaution 预防precision 精密度preference 偏爱preposition 介词prescription 药方presentation 演讲&#xff1b;陈述preservation 保存president 总统&#xff1b;校长&#xff08;大学…...

2的n次方表格

做项目的时候有时候会担心数据溢出&#xff0c;常用的数据长度就有8位、16位、32位、64位。相信八位都很容易记住就是256&#xff0c;16位是65536&#xff0c;但是数字一大就记不住了&#xff0c;甚至连换算为十进制是多少位都不得而知。 下表中就有1 ~ 64位数据的范围。 0次…...

EVS9329-ES驱动器EVS9329ES可议价

EVS9329-ES驱动器EVS9329ES可议价 EVS9329-ES驱动器EVS9329ES可议价 EVS9329-ES驱动器EVS9329ES可议价 EVS9329-ES驱动器EVS9329ES可议价 EVS9329-ES驱动器EVS9329ES可议价 EVS9329-ES步进电机按结构分类&#xff1a;步进电动机也叫脉冲电机&#xff0c;包括反应式步进电动…...

JSON、yam|fIProperties

JSON、YAML和Properties都是数据序列化和存储的格式&#xff0c;它们各自有独特的特点和适用场景。 1. JSON (JavaScript Object Notation) : 特点&#xff1a;JSON是一种轻量级的数据交换格式&#xff0c;易于人阅读和编写&#xff0c;同时也易于机器解析和生成。它基于ECMA…...

关于投标中的合理均价基准差径靶心法(KIMI回答)

投标中的合理靶心法到底是什么呢&#xff1f;用了KIMI来进行回答&#xff1a;...

好久没写文章

好久没写文章...

卡塔尔.巴林:海外媒体投放-宣发.发稿效果显著提高

引言 卡塔尔和巴林两国积极采取措施&#xff0c;通过海外媒体投放和宣发&#xff0c;将本国的商业新闻和相关信息传达给更广泛的受众。在这一过程中&#xff0c;卡塔尔新闻网、巴林商业新闻和摩纳哥新闻网等媒体起到了关键作用。通过投放新闻稿&#xff0c;这些国际化的媒体平…...

XML Group端口详解

在XML数据映射过程中&#xff0c;经常需要对数据进行分组聚合操作。例如&#xff0c;当处理包含多个物料明细的XML文件时&#xff0c;可能需要将相同物料号的明细归为一组&#xff0c;或对相同物料号的数量进行求和计算。传统实现方式通常需要编写脚本代码&#xff0c;增加了开…...

反向工程与模型迁移:打造未来商品详情API的可持续创新体系

在电商行业蓬勃发展的当下&#xff0c;商品详情API作为连接电商平台与开发者、商家及用户的关键纽带&#xff0c;其重要性日益凸显。传统商品详情API主要聚焦于商品基本信息&#xff08;如名称、价格、库存等&#xff09;的获取与展示&#xff0c;已难以满足市场对个性化、智能…...

mongodb源码分析session执行handleRequest命令find过程

mongo/transport/service_state_machine.cpp已经分析startSession创建ASIOSession过程&#xff0c;并且验证connection是否超过限制ASIOSession和connection是循环接受客户端命令&#xff0c;把数据流转换成Message&#xff0c;状态转变流程是&#xff1a;State::Created 》 St…...

ssc377d修改flash分区大小

1、flash的分区默认分配16M、 / # df -h Filesystem Size Used Available Use% Mounted on /dev/root 1.9M 1.9M 0 100% / /dev/mtdblock4 3.0M...

基于Flask实现的医疗保险欺诈识别监测模型

基于Flask实现的医疗保险欺诈识别监测模型 项目截图 项目简介 社会医疗保险是国家通过立法形式强制实施&#xff0c;由雇主和个人按一定比例缴纳保险费&#xff0c;建立社会医疗保险基金&#xff0c;支付雇员医疗费用的一种医疗保险制度&#xff0c; 它是促进社会文明和进步的…...

Vue2 第一节_Vue2上手_插值表达式{{}}_访问数据和修改数据_Vue开发者工具

文章目录 1.Vue2上手-如何创建一个Vue实例,进行初始化渲染2. 插值表达式{{}}3. 访问数据和修改数据4. vue响应式5. Vue开发者工具--方便调试 1.Vue2上手-如何创建一个Vue实例,进行初始化渲染 准备容器引包创建Vue实例 new Vue()指定配置项 ->渲染数据 准备一个容器,例如: …...

rnn判断string中第一次出现a的下标

# coding:utf8 import torch import torch.nn as nn import numpy as np import random import json""" 基于pytorch的网络编写 实现一个RNN网络完成多分类任务 判断字符 a 第一次出现在字符串中的位置 """class TorchModel(nn.Module):def __in…...

LeetCode - 199. 二叉树的右视图

题目 199. 二叉树的右视图 - 力扣&#xff08;LeetCode&#xff09; 思路 右视图是指从树的右侧看&#xff0c;对于每一层&#xff0c;只能看到该层最右边的节点。实现思路是&#xff1a; 使用深度优先搜索(DFS)按照"根-右-左"的顺序遍历树记录每个节点的深度对于…...

Mysql中select查询语句的执行过程

目录 1、介绍 1.1、组件介绍 1.2、Sql执行顺序 2、执行流程 2.1. 连接与认证 2.2. 查询缓存 2.3. 语法解析&#xff08;Parser&#xff09; 2.4、执行sql 1. 预处理&#xff08;Preprocessor&#xff09; 2. 查询优化器&#xff08;Optimizer&#xff09; 3. 执行器…...

Python基于历史模拟方法实现投资组合风险管理的VaR与ES模型项目实战

说明&#xff1a;这是一个机器学习实战项目&#xff08;附带数据代码文档&#xff09;&#xff0c;如需数据代码文档可以直接到文章最后关注获取。 1.项目背景 在金融市场日益复杂和波动加剧的背景下&#xff0c;风险管理成为金融机构和个人投资者关注的核心议题之一。VaR&…...