C++ —— Tinyxml2在Vs2017下相关使用2(较文1更复杂,附源码)
相关链接
C++ —— Tinyxml2在Vs2017下相关使用1(附源码)
tinyxml2简介
TinyXML2是一个简单,小巧,高效,C++XML解析器,可以很容易地集成到其他程序中。TinyXML-2解析一个XML文档,并从中构建一个 可以读取、修改和保存的文档对象模型 (DOM)。XML代表“可扩展标记语言”。这是一个通用目的 用于描述任意数据的人类和机器可读标记语言。 为存储应用程序数据而创建的所有随机文件格式都可以 全部替换为 XML。一个解析器可以解决所有问题。
源码下载
Github - Tinyxml2源码下载地址
一般来说,下载源码后无需编译仅将其中的tinyxml2.cpp、tinyxml2.h包含在自己的项目中就可以使用了。
(若需构建库使用CMake构建源码,然后利用Vs仅编译tinyxml2项目。)
使用tinyxml2注意事项
TinyXML与实体
TinyXML认得预定义的特殊“字符实体”,即:& &< <> >" "' ‘
这些在XML文档读取时都会被辨认出来,并会被转化成等价的UTF-8字符。
代码写入xml
<?xml version="1.0" encoding="UTF-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"><ItemGroup Label="ProjectConfigurations"><ProjectConfigurations Include="Debug|X64"><Configuration>Debug</Configuration><Platform>x64</Platform></ProjectConfigurations><ProjectConfiguration Include="Release|X64"><Configuration>Release</Configuration><Platform>x64</Platform></ProjectConfiguration></ItemGroup><Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props"/><Import Project="$(VCTargetsPath)\Microsoft.Cpp.props"/><ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')"><Import Project="$(QtMsBuild)\qt_defaults.props"/></ImportGroup><PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings"><QtInstall>5.12.4(64)</QtInstall><QtModules>core;gui;widgets;network;</QtModules><QtBuildConfig>debug</QtBuildConfig></PropertyGroup><Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')"><Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly."/></Target><ImportGroup Label="ExtensionSettings"/><ImportGroup Label="Shared"/><ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"><Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform"/><Import Project="$(QtMsBuild)\Qt.props"/></ImportGroup><ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration"><ClCompile><TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType><MultiProcessorCompilation>true</MultiProcessorCompilation><DebugInformationFormat>None</DebugInformationFormat><Optimization>MaxSpeed</Optimization></ClCompile><Link><SubSystem>Console</SubSystem><GenerateDebugInformation>false</GenerateDebugInformation></Link></ItemDefinitionGroup>
</Project>
#include <iostream>
#include "tinyxml/tinyxml2.h"int main()
{
#if 0 // 写入tinyxml2::XMLDocument xml;xml.Parse("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");tinyxml2::XMLElement* rootNode = xml.NewElement("Project");rootNode->SetAttribute("DefaultTargets", "Build");rootNode->SetAttribute("ToolsVersion", "15.0");rootNode->SetAttribute("xmlns", "http://schemas.microsoft.com/developer/msbuild/2003");xml.InsertEndChild(rootNode);{tinyxml2::XMLElement *element_ItemGroup = xml.NewElement("ItemGroup");element_ItemGroup->SetAttribute("Label", "ProjectConfigurations");rootNode->InsertEndChild(element_ItemGroup);{tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfigurations");element_ProjectConfiguration->SetAttribute("Include", "Debug|X64");element_ItemGroup->InsertEndChild(element_ProjectConfiguration);{tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");element_ProjectConfiguration_Configuration->InsertNewText("Debug");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);}{tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");element_ProjectConfiguration_Platform->InsertNewText("x64");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);}}{tinyxml2::XMLElement *element_ProjectConfiguration = xml.NewElement("ProjectConfiguration");element_ProjectConfiguration->SetAttribute("Include", "Release|X64");element_ItemGroup->InsertEndChild(element_ProjectConfiguration);{ tinyxml2::XMLElement *element_ProjectConfiguration_Configuration = xml.NewElement("Configuration");element_ProjectConfiguration_Configuration->InsertNewText("Release");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Configuration);}{tinyxml2::XMLElement *element_ProjectConfiguration_Platform = xml.NewElement("Platform");element_ProjectConfiguration_Platform->InsertNewText("x64");element_ProjectConfiguration->InsertEndChild(element_ProjectConfiguration_Platform);}}}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.Default.props");rootNode->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(VCTargetsPath)\\Microsoft.Cpp.props");rootNode->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Condition", "Exists('$(QtMsBuild)\\qt_defaults.props')");{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(QtMsBuild)\\qt_defaults.props");element_ImportGroup->InsertEndChild(element_Import);}rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_PropertyGroup = xml.NewElement("PropertyGroup");element_PropertyGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");element_PropertyGroup->SetAttribute("Label", "QtSettings");{{tinyxml2::XMLElement *element_QtInstall = xml.NewElement("QtInstall");element_QtInstall->InsertNewText("5.12.4(64)");element_PropertyGroup->InsertEndChild(element_QtInstall);}{tinyxml2::XMLElement *element_QtModules = xml.NewElement("QtModules");element_QtModules->InsertNewText("core;gui;widgets;network;");element_PropertyGroup->InsertEndChild(element_QtModules);}{tinyxml2::XMLElement *element_QtBuildConfig = xml.NewElement("QtBuildConfig");element_QtBuildConfig->InsertNewText("debug");element_PropertyGroup->InsertEndChild(element_QtBuildConfig);}}rootNode->InsertEndChild(element_PropertyGroup);}{tinyxml2::XMLElement *element_Target = xml.NewElement("Target");element_Target->SetAttribute("Name", "QtMsBuildNotFound");element_Target->SetAttribute("BeforeTargets", "CustomBuild;ClCompile");element_Target->SetAttribute("Condition", "!Exists('$(QtMsBuild)\\qt.targets') or !Exists('$(QtMsBuild)\\qt.props')");{tinyxml2::XMLElement *element_Message = xml.NewElement("Message");element_Message->SetAttribute("Importance", "High");element_Message->SetAttribute("Text", "QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly.");element_Target->InsertEndChild(element_Message);}rootNode->InsertEndChild(element_Target);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "ExtensionSettings");rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "Shared");rootNode->InsertEndChild(element_ImportGroup);}{tinyxml2::XMLElement *element_ImportGroup = xml.NewElement("ImportGroup");element_ImportGroup->SetAttribute("Label", "PropertySheets");element_ImportGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Debug|x64'");rootNode->InsertEndChild(element_ImportGroup);{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props");element_Import->SetAttribute("Condition", "exists('$(UserRootDir)\\Microsoft.Cpp.$(Platform).user.props')");element_Import->SetAttribute("Label", "LocalAppDataPlatform");element_ImportGroup->InsertEndChild(element_Import);}{tinyxml2::XMLElement *element_Import = xml.NewElement("Import");element_Import->SetAttribute("Project", "$(QtMsBuild)\\Qt.props");element_ImportGroup->InsertEndChild(element_Import);}}{tinyxml2::XMLElement *element_ItemDefinitionGroup = xml.NewElement("ItemDefinitionGroup");element_ItemDefinitionGroup->SetAttribute("Condition", "'$(Configuration)|$(Platform)' == 'Release|x64'");element_ItemDefinitionGroup->SetAttribute("Label", "Configuration");{{tinyxml2::XMLElement *element_ClCompile = xml.NewElement("ClCompile");element_ItemDefinitionGroup->InsertEndChild(element_ClCompile);{tinyxml2::XMLElement *element_TreatWChar_tAsBuiltInType = xml.NewElement("TreatWChar_tAsBuiltInType");element_TreatWChar_tAsBuiltInType->InsertNewText("true");element_ClCompile->InsertEndChild(element_TreatWChar_tAsBuiltInType);}{tinyxml2::XMLElement *element_TreatWChar_MultiProcessorCompilation = xml.NewElement("MultiProcessorCompilation");element_TreatWChar_MultiProcessorCompilation->InsertNewText("true");element_ClCompile->InsertEndChild(element_TreatWChar_MultiProcessorCompilation);}{tinyxml2::XMLElement *element_DebugInformationFormat = xml.NewElement("DebugInformationFormat");element_DebugInformationFormat->InsertNewText("None");element_ClCompile->InsertEndChild(element_DebugInformationFormat);}{tinyxml2::XMLElement *element_Optimization = xml.NewElement("Optimization");element_Optimization->InsertNewText("MaxSpeed");element_ClCompile->InsertEndChild(element_Optimization);}}{tinyxml2::XMLElement *element_Link = xml.NewElement("Link");element_ItemDefinitionGroup->InsertEndChild(element_Link);{tinyxml2::XMLElement *element_SubSystem = xml.NewElement("SubSystem");element_SubSystem->InsertNewText("Console");element_Link->InsertEndChild(element_SubSystem);}{tinyxml2::XMLElement *element_GenerateDebugInformation = xml.NewElement("GenerateDebugInformation");element_GenerateDebugInformation->InsertNewText("false");element_Link->InsertEndChild(element_GenerateDebugInformation);}}}rootNode->InsertEndChild(element_ItemDefinitionGroup);}xml.SaveFile("./temp_behaviac.xml");xml.Clear();system("pause");return 0;
}
代码读取xml

int main()
{tinyxml2::XMLDocument xml;tinyxml2::XMLError errXml = xml.LoadFile("./temp_behaviac.xml");if (tinyxml2::XML_SUCCESS == errXml){tinyxml2::XMLElement* root = xml.RootElement();if (root){std::cout << root->Value()<< " DefaultTargets=" << root->Attribute("DefaultTargets")<< " ToolsVersion=" << root->Attribute("ToolsVersion")<< " xmlns=" << root->Attribute("xmlns") << std::endl;tinyxml2::XMLElement *XMLElement_ItemGroup = root->FirstChildElement();if (XMLElement_ItemGroup){std::cout << "\t" << XMLElement_ItemGroup->Value() << " Label=" << XMLElement_ItemGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_ProjectConfigurations = XMLElement_ItemGroup->FirstChildElement();if (!XMLElement_ProjectConfigurations) { return -1; }std::cout << "\t\t" << XMLElement_ProjectConfigurations->Value() << " Include=" << XMLElement_ProjectConfigurations->Attribute("Include") << std::endl;{tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfigurations->FirstChildElement();if (!XMLElement_Configuration) { return -1; }std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();if (!XMLElement_Platform) { return -1; }std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_ProjectConfiguration = XMLElement_ProjectConfigurations->NextSiblingElement();if (!XMLElement_ProjectConfiguration) { return -1; }std::cout << "\t\t" << XMLElement_ProjectConfiguration->Value() << " Include=" << XMLElement_ProjectConfiguration->Attribute("Include") << std::endl;{tinyxml2::XMLElement *XMLElement_Configuration = XMLElement_ProjectConfiguration->FirstChildElement();if (!XMLElement_Configuration) { return -1; }std::cout << "\t\t\t" << XMLElement_Configuration->Value() << " " << XMLElement_Configuration->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Platform = XMLElement_Configuration->NextSiblingElement();if (!XMLElement_Platform) { return -1; }std::cout << "\t\t\t" << XMLElement_Platform->Value() << " " << XMLElement_Platform->GetText() << std::endl;}}tinyxml2::XMLElement *XMLElement_Import = XMLElement_ItemGroup->NextSiblingElement();if (!XMLElement_Import) { return -1; }std::cout << "\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();if (!XMLElement_Import2) { return -1; }std::cout << "\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup = XMLElement_Import2->NextSiblingElement();if (!XMLElement_ImportGroup) { return -1; }std::cout << "\t" << XMLElement_ImportGroup->Value() << " Condition=" << XMLElement_ImportGroup->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup->FirstChildElement();if (!XMLElement_Import) { return -1; }std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << std::endl;}tinyxml2::XMLElement *XMLElement_PropertyGroup = XMLElement_ImportGroup->NextSiblingElement();if (!XMLElement_PropertyGroup) { return -1; }std::cout << "\t" << XMLElement_PropertyGroup->Value() << " Condition=" << XMLElement_PropertyGroup->Attribute("Condition") << " Label=" << XMLElement_PropertyGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_QtInstall = XMLElement_PropertyGroup->FirstChildElement();if (!XMLElement_QtInstall) { return -1; }std::cout << "\t\t" << XMLElement_QtInstall->Value() << " " << XMLElement_QtInstall->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_QtModules = XMLElement_QtInstall->NextSiblingElement();if (!XMLElement_QtModules) { return -1; }std::cout << "\t\t" << XMLElement_QtModules->Value() << " " << XMLElement_QtModules->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_QtBuildConfig = XMLElement_QtModules->NextSiblingElement();if (!XMLElement_QtBuildConfig) { return -1; }std::cout << "\t\t" << XMLElement_QtBuildConfig->Value() << " " << XMLElement_QtBuildConfig->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_Target = XMLElement_PropertyGroup->NextSiblingElement();if (!XMLElement_Target) { return -1; }std::cout << "\t" << XMLElement_Target->Value() << " Name=" << XMLElement_Target->Attribute("Name") << " BeforeTargets=" << XMLElement_Target->Attribute("BeforeTargets") << " Condition=" << XMLElement_Target->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Message = XMLElement_Target->FirstChildElement();if (!XMLElement_Message) { return -1; }std::cout << "\t\t" << XMLElement_Message->Value() << " Importance=" << XMLElement_Message->Attribute("Importance") << " Text=" << XMLElement_Message->Attribute("Text") << std::endl;}tinyxml2::XMLElement *XMLElement_ImportGroup1 = XMLElement_Target->NextSiblingElement();if (!XMLElement_ImportGroup1) { return -1; }std::cout << "\t" << XMLElement_ImportGroup1->Value() << " Label=" << XMLElement_ImportGroup1->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup2 = XMLElement_ImportGroup1->NextSiblingElement();if (!XMLElement_ImportGroup2) { return -1; }std::cout << "\t" << XMLElement_ImportGroup2->Value() << " Label=" << XMLElement_ImportGroup2->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_ImportGroup3 = XMLElement_ImportGroup2->NextSiblingElement();if (!XMLElement_ImportGroup3) { return -1; }std::cout << "\t" << XMLElement_ImportGroup3->Value() << " Label=" << XMLElement_ImportGroup3->Attribute("Label") << " Condition=" << XMLElement_ImportGroup3->Attribute("Condition") << std::endl;{tinyxml2::XMLElement *XMLElement_Import = XMLElement_ImportGroup3->FirstChildElement();if (!XMLElement_Import) { return -1; }std::cout << "\t\t" << XMLElement_Import->Value() << " Project=" << XMLElement_Import->Attribute("Project") << " Condition=" << XMLElement_Import->Attribute("Condition") << " Label=" << XMLElement_Import->Attribute("Label") << std::endl;tinyxml2::XMLElement *XMLElement_Import2 = XMLElement_Import->NextSiblingElement();if (!XMLElement_Import2) { return -1; }std::cout << "\t\t" << XMLElement_Import2->Value() << " Project=" << XMLElement_Import2->Attribute("Project") << std::endl;}tinyxml2::XMLElement *XMLElement_ItemDefinitionGroup = XMLElement_ImportGroup3->NextSiblingElement();if (!XMLElement_ItemDefinitionGroup) { return -1; }std::cout << "\t" << XMLElement_ItemDefinitionGroup->Value() << " Condition=" << XMLElement_ItemDefinitionGroup->Attribute("Condition") << " Label=" << XMLElement_ItemDefinitionGroup->Attribute("Label") << std::endl;{tinyxml2::XMLElement *XMLElement_ClCompile = XMLElement_ItemDefinitionGroup->FirstChildElement();if (!XMLElement_ClCompile) { return -1; }std::cout << "\t" << XMLElement_ClCompile->Value() << std::endl;{tinyxml2::XMLElement *XMLElement_TreatWChar_tAsBuiltInType = XMLElement_ClCompile->FirstChildElement();if (!XMLElement_TreatWChar_tAsBuiltInType) { return -1; }std::cout << "\t\t" << XMLElement_TreatWChar_tAsBuiltInType->Value() << " " << XMLElement_TreatWChar_tAsBuiltInType->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_MultiProcessorCompilation = XMLElement_TreatWChar_tAsBuiltInType->NextSiblingElement();if (!XMLElement_MultiProcessorCompilation) { return -1; }std::cout << "\t\t" << XMLElement_MultiProcessorCompilation->Value() << " " << XMLElement_MultiProcessorCompilation->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_DebugInformationFormat = XMLElement_MultiProcessorCompilation->NextSiblingElement();if (!XMLElement_DebugInformationFormat) { return -1; }std::cout << "\t\t" << XMLElement_DebugInformationFormat->Value() << " " << XMLElement_DebugInformationFormat->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_Optimization = XMLElement_DebugInformationFormat->NextSiblingElement();if (!XMLElement_Optimization) { return -1; }std::cout << "\t\t" << XMLElement_Optimization->Value() << " " << XMLElement_Optimization->GetText() << std::endl;}tinyxml2::XMLElement *XMLElement_Link = XMLElement_ClCompile->NextSiblingElement();if (!XMLElement_Link) { return -1; }std::cout << "\t" << XMLElement_Link->Value() << std::endl;{tinyxml2::XMLElement *XMLElement_SubSystem = XMLElement_Link->FirstChildElement();if (!XMLElement_SubSystem) { return -1; }std::cout << "\t\t" << XMLElement_SubSystem->Value() << " " << XMLElement_SubSystem->GetText() << std::endl;tinyxml2::XMLElement *XMLElement_GenerateDebugInformation = XMLElement_SubSystem->NextSiblingElement();if (!XMLElement_GenerateDebugInformation) { return -1; }std::cout << "\t\t" << XMLElement_GenerateDebugInformation->Value() << " " << XMLElement_GenerateDebugInformation->GetText() << std::endl;}}}}root = nullptr;}system("pause");return 0;
}
笔者
笔者 - jxd
相关文章:
C++ —— Tinyxml2在Vs2017下相关使用2(较文1更复杂,附源码)
相关链接 C —— Tinyxml2在Vs2017下相关使用1(附源码) tinyxml2简介 TinyXML2是一个简单,小巧,高效,CXML解析器,可以很容易地集成到其他程序中。TinyXML-2解析一个XML文档,并从中构建一个 可以…...
阿里内推强推的并发编程学习笔记,原理+实战+面试题,面面俱到!
并发编程 谈到并发编程,可能很多人都有过经验,甚至比我了解的更多。 那么并发与并行的区别又是什么? 并发编程是编程中的核心问题,实践中,当人们希望利用计算机处理一些现实世界问题,以及希望同时处理多…...
域名注册查询流程
域名注册查询怎么查域名是否被注册?域名注册查询如何查域名的过期时间和注册商?域名注册查询用什么工具?下面是关于域名注册查询流程介绍。 1、域名注册查询可以用什么工具? 这里可以使用聚查工具,聚查包括:whois 查询、建站历史查询、反链查询、P…...
【Linux学习笔记】代码编辑工具vim
1. vim工具基本模式的转换2. vim命令模式下的各种编辑命令2.1. 光标行定位2.2. 光标自由定位2.3. 复制粘贴2.4. 删除2.5. 文本的大小写替换2.6. 文本的替换2.7. 文本的前删后删2.8. 撤销操作 3. vim底行模式下的命令3.1. 设置行号与取消设置行号3.2. 分屏操作3.3. 在不退出vim的…...
Android Boring SSL
前期设置 SSLContext.getInstance(“TLS”)SSLContext.init()SSLContext.getSocketFactory()SSLSocketFactory.createSocket()NativeSsl.newInstance()BioWrapper 的创建ConscryptEngineSocket.startHandshake() TLS协商 state_start_connect(TLS)state_enter_early_data(TLS)s…...
中国人民大学与加拿大女王大学金融硕士项目:开启你的金融精英之路
在全球化的今天,金融行业的发展日新月异,对金融人才的需求也日益增长。为了满足这一需求,中国人民大学与加拿大女王大学联合推出了金融硕士项目,旨在培养具有国际视野、专业素养和创新能力的金融精英。 这一开创性的项目将两大世…...
HashSet编程小案例,控制生日和姓名。重写HashCode
Java编程: 定义员工Employee类,该类包含:private成员属性name,sal,birthday(MyDate类型), 其中birthday为MyDate类型(属性包括:year,month,day), 要求&…...
虚幻阴影整理
虚拟阴影贴图(VSM)是一种全新的阴影贴图方法,可以提供稳定的高分辨率阴影。通过与虚幻引擎5的Nanite虚拟几何体、Lumen全局光照和反射以及世界分区功能结合使用,它能够实现电影级的品质效果,为大型开放场景提供光照。 …...
MySQL数据库(一)
数据库 —— 基础 1. 数据库 DataBase 数据库管理系统 2. SQL语言2.1 DDL数据定义语言2.1.1 数据库基础操作2.1.2 数据表基础操作2.1.3 字段基础操作 2.2 DML表记录管理2.2.1 插入数据INSERT2.2.2 更新数据UPDATE2.2.3 删除数据DELETE 3. SQL数据类型3.1 数值类型3.1.1 整数类型…...
C++11 新特性
C11 新特性 C11 新特性统一的列表初始化声明auto 关键字decltype 关键字nullptr 关键字 关键字 using使用 using 在子类中引用基类的成员使用 using 关键字定义类型别名 范围-based for 循环右值引用和移动语义左值引用和右值引用右值引用使用场景和意义完美转发 lambda表达式移…...
排查手机应用app微信登录问题不跳转失败原因汇总及其解决方案
经过最近我发的文章,我个人觉得解决了不少小问题,因为最近很小白的问题已经没有人私聊问我了,我总结了一下排查手机应用app微信登录问题不跳转失败的原因汇总及其解决方案在这篇文章中,分析微信登录不跳转的原因,并提供解决方案。希望通过这篇文章,能够帮助大家顺利解决这…...
软考高级系统架构设计师系列之:数学与经济管理
软考高级系统架构设计师系列之:数学与经济管理 一、数学与经济管理二、图论应用-最小生成树三、图论应用-最短路径四、图论应用-网络与最大流量五、运筹方法-线性规划六、运筹方法-动态规划七、运筹方法-转移矩阵八、运筹方法-排队论九、运筹方法-决策-不确定决策十、运筹方法…...
基于Scrapyd与Gerapy部署scrapy爬虫方案【可用于分布式爬虫部署】
scrapyd部署爬虫 Scrapyd 是一个基于 Scrapy 的开源项目,它提供了一个简单的方式来部署、运行和监控 Scrapy 爬虫。它是一个用于集成 Scrapy 爬虫到分布式架构中的工具,允许您在分布式环境中运行爬虫,并提供了一组 Web API,用于管…...
ST-SSL:基于自监督学习的交通流预测模型
文章信息 文章题为“Spatio-Temporal Self-Supervised Learning for Traffic Flow Prediction”,是一篇发表于The Thirty-Seventh AAAI Conference on Artificial Intelligence (AAAI-23)的一篇论文。该论文主要针对交通流预测任务,结合自监督学习&#…...
如何处理C++中的字符串编码和国际化?
在C中处理字符串编码和国际化的常用方式如下: 字符串编码: 使用UTF-8编码:UTF-8是一种可变字节长度的编码方式,广泛用于表示 Unicode 字符。C中的字符串类型std::string默认使用的是UTF-8编码。可以通过使用宽字符类型std::wstrin…...
DH48WK 温控器参数设置
北京东昊力伟科技有限责任公司 温控仪、温度控制器 产品特点: 可外接温度传感器Pt100、Cu50、K、E、J、N、T、R、S、B兼容输入;PID控制输出、位式控制输出、继电器报警输出;控温能满足设定温度值的0.2℃;既可用于加热控制、也可…...
【文档智能】多模态预训练模型及相关数据集汇总
前言 大模型时代,在现实场景中或者企业私域数据中,大多数数据都以文档的形式存在,如何更好的解析获取文档数据显得尤为重要。文档智能也从以前的目标检测(版面分析)阶段转向多模态预训练阶段,本文将介绍目…...
超全整理,性能测试——数据库索引问题定位+分析(详细)
目录:导读 前言一、Python编程入门到精通二、接口自动化项目实战三、Web自动化项目实战四、App自动化项目实战五、一线大厂简历六、测试开发DevOps体系七、常用自动化测试工具八、JMeter性能测试九、总结(尾部小惊喜) 前言 1、数据库服务器添…...
44springboot摄影跟拍预定管理系统
大家好✌!我是CZ淡陌。一名专注以理论为基础实战为主的技术博主,将再这里为大家分享优质的实战项目,本人在Java毕业设计领域有多年的经验,陆续会更新更多优质的Java实战项目,希望你能有所收获,少走一些弯路…...
Flink之窗口触发机制及自定义Trigger的使用
1 窗口触发机制 窗口计算的触发机制都是由Trigger类决定的,Flink中为各类内置的WindowsAssigner都设计了对应的默认Trigger. 层次结构如下: Trigger ProcessingTimeoutTriggerEventTimeTriggerCountTriggerDeltaTriggerNeverTrigger in GlobalWindowsContinuousEventTimeTrigge…...
测试微信模版消息推送
进入“开发接口管理”--“公众平台测试账号”,无需申请公众账号、可在测试账号中体验并测试微信公众平台所有高级接口。 获取access_token: 自定义模版消息: 关注测试号:扫二维码关注测试号。 发送模版消息: import requests da…...
大话软工笔记—需求分析概述
需求分析,就是要对需求调研收集到的资料信息逐个地进行拆分、研究,从大量的不确定“需求”中确定出哪些需求最终要转换为确定的“功能需求”。 需求分析的作用非常重要,后续设计的依据主要来自于需求分析的成果,包括: 项目的目的…...
模型参数、模型存储精度、参数与显存
模型参数量衡量单位 M:百万(Million) B:十亿(Billion) 1 B 1000 M 1B 1000M 1B1000M 参数存储精度 模型参数是固定的,但是一个参数所表示多少字节不一定,需要看这个参数以什么…...
《用户共鸣指数(E)驱动品牌大模型种草:如何抢占大模型搜索结果情感高地》
在注意力分散、内容高度同质化的时代,情感连接已成为品牌破圈的关键通道。我们在服务大量品牌客户的过程中发现,消费者对内容的“有感”程度,正日益成为影响品牌传播效率与转化率的核心变量。在生成式AI驱动的内容生成与推荐环境中࿰…...
分布式增量爬虫实现方案
之前我们在讨论的是分布式爬虫如何实现增量爬取。增量爬虫的目标是只爬取新产生或发生变化的页面,避免重复抓取,以节省资源和时间。 在分布式环境下,增量爬虫的实现需要考虑多个爬虫节点之间的协调和去重。 另一种思路:将增量判…...
2025季度云服务器排行榜
在全球云服务器市场,各厂商的排名和地位并非一成不变,而是由其独特的优势、战略布局和市场适应性共同决定的。以下是根据2025年市场趋势,对主要云服务器厂商在排行榜中占据重要位置的原因和优势进行深度分析: 一、全球“三巨头”…...
用机器学习破解新能源领域的“弃风”难题
音乐发烧友深有体会,玩音乐的本质就是玩电网。火电声音偏暖,水电偏冷,风电偏空旷。至于太阳能发的电,则略显朦胧和单薄。 不知你是否有感觉,近两年家里的音响声音越来越冷,听起来越来越单薄? —…...
前端调试HTTP状态码
1xx(信息类状态码) 这类状态码表示临时响应,需要客户端继续处理请求。 100 Continue 服务器已收到请求的初始部分,客户端应继续发送剩余部分。 2xx(成功类状态码) 表示请求已成功被服务器接收、理解并处…...
数据库正常,但后端收不到数据原因及解决
从代码和日志来看,后端SQL查询确实返回了数据,但最终user对象却为null。这表明查询结果没有正确映射到User对象上。 在前后端分离,并且ai辅助开发的时候,很容易出现前后端变量名不一致情况,还不报错,只是单…...
高效的后台管理系统——可进行二次开发
随着互联网技术的迅猛发展,企业的数字化管理变得愈加重要。后台管理系统作为数据存储与业务管理的核心,成为了现代企业不可或缺的一部分。今天我们要介绍的是一款名为 若依后台管理框架 的系统,它不仅支持跨平台应用,还能提供丰富…...
