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

(十一)C++自制植物大战僵尸游戏客户端更新实现

植物大战僵尸游戏开发教程专栏地址icon-default.png?t=N7T8http://t.csdnimg.cn/cFP3z


更新检查

游戏启动后会下载服务器中的版本号然后与本地版本号进行对比,如果本地版本号小于服务器版本号就会弹出更新提示。让用户选择是否更新客户端。

在弹出的更新对话框中有显示最新版本更新的内容,以及更新按钮等。用户可以选择更新方式或者进行更新。


文件位置 

代码文件实现位置在Class\Scenes\MainMenuScene文件夹中。 


UpdateClient.h 

客户端更新类继承与对话框类(Dialog),因为客户端更新也是一个对话对话框供玩家操作。UpdateClient头文件定义如下。

class UpdateClient :public Dialog
{
public:CREATE_FUNC(UpdateClient);CC_CONSTRUCTOR_ACCESS:UpdateClient();virtual bool init();private:enum class Update_Button{百度网盘下载,腾讯微云下载,直接下载,退出游戏,确定};void createDiglog();	                                                       /* 创建对话框 */void createButton(const std::string& name, Vec2& vec2, Update_Button button);  /* 创建按钮 */void showText();void addScrollView();void addMouseEvent();void downloadHistoryText();void downloadData();void downloadProgress();void downloadSuccess();void downloadError();private:Sprite* _dialog;    /* 对话框 */std::unique_ptr<network::Downloader> _downloader;Label* _remindText;Label* _progressText;Label* _explanText;Label* _historyText;Sprite* _loadBarBackground;ui::LoadingBar* _loadingBar;ui::ScrollView* _textScrollView;bool _isNewDowndload;
};

UpdateClient.cpp

构造函数

在构造函数中对变量进行初始化操作。

UpdateClient::UpdateClient() :_dialog(nullptr), _remindText(nullptr), _progressText(nullptr), _explanText(nullptr), _loadBarBackground(nullptr), _loadingBar(nullptr), _historyText(nullptr), _isNewDowndload(true)
{_downloader.reset(new network::Downloader());
}

init函数

创建游戏更新对话框,首先会调用init函数。在init函数中首先会在场景中创建一个黑色半透明的遮罩层,使用场景变黑,让玩家聚焦到此对话框中。然后调用createShieldLayer(this)函数屏蔽除本层之外的所以事件监听,该函数的实现在自定义对话框教程(教程九)中有介绍,作用是让玩家只能和该对话框进行交互。最后使用createDialog()函数创建更新菜单。

bool UpdateClient::init()
{if (!LayerColor::initWithColor(Color4B(0, 0, 0, 180)))return false;createShieldLayer(this);createDialog();return true;
}

createDialog()函数

在该函数中主要实现整个更新菜单的界面。

void UpdateClient::createDialog()
{_dialog = Sprite::createWithSpriteFrameName("LevelObjiectivesBg.png");_dialog->setPosition(_director->getWinSize() / 2);_dialog->setScale(0.9f);this->addChild(_dialog);/* 创建触摸监听 */createTouchtListener(_dialog);auto PauseAnimation = SkeletonAnimation::createWithData(_global->userInformation->getAnimationData().find("PauseAnimation")->second);PauseAnimation->setAnimation(0, "animation", true);PauseAnimation->setPosition(Vec2(530, 650));_dialog->addChild(PauseAnimation);showText();createButton(_global->userInformation->getGameText().find("百度网盘下载")->second, Vec2(165, 100), Update_Button::百度网盘下载);createButton(_global->userInformation->getGameText().find("腾讯微云下载")->second, Vec2(405, 100), Update_Button::腾讯微云下载);createButton(_global->userInformation->getGameText().find("直接下载")->second, Vec2(645, 100), Update_Button::直接下载);createButton(_global->userInformation->getGameText().find("关闭游戏")->second, Vec2(885, 100), Update_Button::退出游戏);createButton(_global->userInformation->getGameText().find("确定")->second, Vec2(520, 100), Update_Button::确定);}

创建更新菜单背景,设置位置到屏幕中心,缩放0.9倍大小。 

_dialog = Sprite::createWithSpriteFrameName("LevelObjiectivesBg.png");
_dialog->setPosition(_director->getWinSize() / 2);
_dialog->setScale(0.9f);
this->addChild(_dialog);

对创建好的背景进行触摸监听,可以实现更新菜单的拖动。 

/* 创建触摸监听 */
createTouchtListener(_dialog);

 显示文字内容以及创建多个按钮。

showText();createButton(_global->userInformation->getGameText().find("百度网盘下载")->second, Vec2(165, 100), Update_Button::百度网盘下载);
createButton(_global->userInformation->getGameText().find("腾讯微云下载")->second, Vec2(405, 100), Update_Button::腾讯微云下载);
createButton(_global->userInformation->getGameText().find("直接下载")->second, Vec2(645, 100), Update_Button::直接下载);
createButton(_global->userInformation->getGameText().find("关闭游戏")->second, Vec2(885, 100), Update_Button::退出游戏);
createButton(_global->userInformation->getGameText().find("确定")->second, Vec2(520, 100), Update_Button::确定);

downloadData()函数

客户端内文件下载更新函数。创建文件下载进度条以及文字信息。

void UpdateClient::downloadData()
{if (!_loadBarBackground){_loadBarBackground = Sprite::createWithSpriteFrameName("bgFile.png");_loadBarBackground->setPosition(Vec2(_dialog->getContentSize().width / 2.f, _dialog->getContentSize().height / 2.f - 100));_loadBarBackground->setScale(1.5f);_dialog->addChild(_loadBarBackground);}if (!_loadingBar){_loadingBar = ui::LoadingBar::create();_loadingBar->loadTexture("progressFile.png", TextureResType::PLIST);_loadingBar->setDirection(LoadingBar::Direction::LEFT); /* 设置加载方向 */_loadingBar->setPercent(0);_loadingBar->setScale(1.5f);_loadingBar->setPosition(Vec2(_dialog->getContentSize().width / 2.f, _dialog->getContentSize().height / 2.f - 100));_dialog->addChild(_loadingBar);}_explanText->setColor(Color3B::BLACK);_explanText->setString("");const static string sNameList = _global->userInformation->getGameText().find("资源名称")->second + UserInformation::getNewEditionName(true) + ".rar";const static string path = _global->userInformation->getGameText().find("存放路径")->second + sNameList;_downloader->createDownloadFileTask(_global->userInformation->getGameText().find("资源网址")->second, path, sNameList);downloadProgress();downloadSuccess();downloadError();
}

创建下载任务,传入服务器文件地址 、文件路径、文件名称。

_downloader->createDownloadFileTask(_global->userInformation->getGameText().find("资源网址")->second, path, sNameList);

调用下载进度、下载成功、下载失败函数 。下载过程会调用downloadProgress()函数,下载成功调用downloadSuccess()函数,下载失败调用downloadError()函数。

downloadProgress();
downloadSuccess();
downloadError();

downloadProgress()函数

onTaskProgress lamda函数中,会实时计算下载进度,bytesReceived参数是当前下载的文大小,totalBytesExpected是文件总大小,totalBytesReceived是总下载大小。通过这三个参数可以计算下载完成所需事件。

void UpdateClient::downloadProgress()
{_downloader->onTaskProgress = [=](const network::DownloadTask& task,int64_t bytesReceived,int64_t totalBytesReceived,int64_t totalBytesExpected){_explanText->setString(_global->userInformation->getGameText().find("解释说明_慢")->second);float percent = float(totalBytesReceived * 100) / totalBytesExpected;_loadingBar->setPercent(percent);int hour = (totalBytesExpected - totalBytesReceived) / (bytesReceived * 10) / 3600;int min = ((totalBytesExpected - totalBytesReceived) / (bytesReceived * 10) - hour * 3600) / 60;int second = (totalBytesExpected - totalBytesReceived) / (bytesReceived * 10) - hour * 3600 - min * 60;char buf[128];if (bytesReceived / 1024.f * 10 >= 1000){std::snprintf(buf, 128, "%.1fMB/s  %dKB/%dKB  %.2f%%  time:%02d:%02d:%02d",bytesReceived / 1024.f / 1024.f * 10, int(totalBytesReceived / 1024), int(totalBytesExpected / 1024), percent, hour, min, second);_progressText->setString(buf);}else{std::snprintf(buf, 128, "%.1fKB/s  %dKB/%dKB  %.2f%%  time:%02d:%02d:%02d",bytesReceived / 1024.f * 10, int(totalBytesReceived / 1024), int(totalBytesExpected / 1024), percent, hour, min, second);_progressText->setString(buf);}_remindText->setString(_global->userInformation->getGameText().find("文件正在下载中!请稍等!")->second);};
}

downloadSuccess()函数

成功下载文件后会调用onFileTaskSuccess lamda函数。在函数中显示下载成功文字信息,将按钮隐藏,然后提示用户退出重新启动游戏。

void UpdateClient::downloadSuccess()
{_downloader->onFileTaskSuccess = [this](const cocos2d::network::DownloadTask& task){_progressText->setString(_global->userInformation->getGameText().find("下载成功")->second +_global->userInformation->getGameText().find("存放路径")->second + task.identifier + " ]");_remindText->setString(_global->userInformation->getGameText().find("点击确定退出游戏!")->second);_explanText->setString(_global->userInformation->getGameText().find("下载成功说明")->second);((Button*)_dialog->getChildByName("0"))->setVisible(false);((Button*)_dialog->getChildByName("1"))->setVisible(false);((Button*)_dialog->getChildByName("2"))->setVisible(false);((Button*)_dialog->getChildByName("3"))->setVisible(false);((Button*)_dialog->getChildByName("4"))->setVisible(true);};
}

downloadError()函数

如果下载失败,会调用onTaskError lamda函数,在函数中先错误信息提示用户。errorCode的是错误代码,errorStr是错误信息,errorCodeInternal是内部错误代码。

void UpdateClient::downloadError()
{_downloader->onTaskError = [this](const cocos2d::network::DownloadTask& task,int errorCode,int errorCodeInternal,const std::string& errorStr){_remindText->setString(_global->userInformation->getGameText().find("下载失败")->second);((Button*)_dialog->getChildByName("2"))->setEnabled(true);((Button*)_dialog->getChildByName("3"))->setEnabled(true);char str[256];snprintf(str, 256, "Failed to download : 资源文件, identifier(%s) error code(%d), internal error code(%d) desc(%s) 请检查网络连接是否正常!如果网络连接正常请多试几次!或更换其他方式下载!", task.identifier.c_str(), errorCode, errorCodeInternal, errorStr.c_str());_explanText->setString(str);_explanText->setColor(Color3B::RED);
#ifdef DEBUGlog("Failed to download : %s, identifier(%s) error code(%d), internal error code(%d) desc(%s)", task.requestURL.c_str(), task.identifier.c_str(), errorCode, errorCodeInternal, errorStr.c_str());
#endif // DEBUG};
}

其他函数

showText()、createButton()、addScrollView()、addMouseEvent()等函数不再一一列举,可自行查看。

void UpdateClient::showText()
{addScrollView();_historyText = Label::createWithTTF(_global->userInformation->getGameText().find("更新信息加载中!")->second, GAME_FONT_NAME_1, 50);_historyText->setAnchorPoint(Vec2::ANCHOR_MIDDLE_TOP);_historyText->setColor(Color3B::BLACK);_historyText->setMaxLineWidth(650); _textScrollView->addChild(_historyText);_textScrollView->setInnerContainerSize(_historyText->getContentSize());_historyText->setPosition(Vec2(_dialog->getContentSize().width / 2.f - 150, _textScrollView->getInnerContainerSize().height - 150));downloadHistoryText();/* 标题 */_remindText = Label::createWithTTF(_global->userInformation->getGameText().find("检测到有新版本,请选择更新方式!")->second, GAME_FONT_NAME_1, 50);_remindText->setPosition(Vec2(_dialog->getContentSize().width / 2.f, _dialog->getContentSize().height / 2.f + 200));_remindText->setColor(Color3B::BLACK);_remindText->setMaxLineWidth(900);_remindText->setName("Update");_dialog->addChild(_remindText);/* 进度文字 */_progressText = Label::createWithTTF("", GAME_FONT_NAME_1, 25);_progressText->setMaxLineWidth(900);_progressText->setPosition(Vec2(_dialog->getContentSize().width / 2.f, _dialog->getContentSize().height / 2.f));_dialog->addChild(_progressText);/* 说明文字 */_explanText = Label::createWithTTF("", GAME_FONT_NAME_1, 30);_explanText->setPosition(Vec2(_dialog->getContentSize().width / 2.f, _dialog->getContentSize().height / 2.f + 100));_explanText->setColor(Color3B::BLACK);_explanText->setMaxLineWidth(900);_dialog->addChild(_explanText);
}void UpdateClient::addScrollView()
{_textScrollView = ui::ScrollView::create();_textScrollView->setDirection(ui::ScrollView::Direction::VERTICAL);_textScrollView->setAnchorPoint(Vec2::ANCHOR_MIDDLE);_textScrollView->setContentSize(Size(720.0f, 320.0f));_textScrollView->setPosition(_dialog->getContentSize() / 2.0f);_textScrollView->setBounceEnabled(true);_textScrollView->setScrollBarPositionFromCorner(Vec2(20, 0));_textScrollView->setScrollBarWidth(10);_textScrollView->setScrollBarColor(Color3B::BLACK);_dialog->addChild(_textScrollView);addMouseEvent();
}void UpdateClient::addMouseEvent()
{/* 鼠标滑动监听 */auto mouse = EventListenerMouse::create();mouse->onMouseScroll = [=](Event* event){auto mouseEvent = static_cast<EventMouse*>(event);float movex = mouseEvent->getScrollY() * 5;auto minOffset = 0.f;auto maxOffset = 100.f;auto offset = _textScrollView->getScrolledPercentVertical();offset += movex;if (offset < minOffset){offset = minOffset;}else if (offset > maxOffset){offset = maxOffset;}_textScrollView->scrollToPercentVertical(offset, 0.5f, true);};Director::getInstance()->getEventDispatcher()->addEventListenerWithSceneGraphPriority(mouse, _textScrollView);
}void UpdateClient::downloadHistoryText()
{const string sURLList = _global->userInformation->getGameText().find("更新信息网址")->second;_downloader->createDownloadDataTask(sURLList);_downloader->onDataTaskSuccess = [this](const cocos2d::network::DownloadTask& task,std::vector<unsigned char>& data){string historyNetWork;for (auto p : data){historyNetWork += p;}TTFConfig ttfConfig(GAME_FONT_NAME_1, 25, GlyphCollection::DYNAMIC);_historyText->setTTFConfig(ttfConfig);_historyText->setString(historyNetWork);_textScrollView->setInnerContainerSize(_historyText->getContentSize());_historyText->setPosition(Vec2(350, _textScrollView->getInnerContainerSize().height));};_downloader->onTaskError = [this](const cocos2d::network::DownloadTask& task,int errorCode,int errorCodeInternal,const std::string& errorStr){_historyText->setString(_global->userInformation->getGameText().find("更新信息加载失败!")->second);_textScrollView->setInnerContainerSize(_historyText->getContentSize());};
}

相关文章:

(十一)C++自制植物大战僵尸游戏客户端更新实现

植物大战僵尸游戏开发教程专栏地址http://t.csdnimg.cn/cFP3z 更新检查 游戏启动后会下载服务器中的版本号然后与本地版本号进行对比&#xff0c;如果本地版本号小于服务器版本号就会弹出更新提示。让用户选择是否更新客户端。 在弹出的更新对话框中有显示最新版本更新的内容…...

关于Qt主窗口的菜单部件

前言 在介绍主窗口的两大部件之前&#xff0c;我们要先知道关于主窗口的一些知识。 主窗口 一个主窗口可以没有菜单条、工具条、状态条&#xff0c;但必须设置中心部件。在 Q 生成的 C头文件 ui_mainwindow.h 代码中,我们可以看到以下代码: centralWidget new Qwidget(MainWi…...

rabbitmq每小时自动重启

引言 找了半天&#xff0c;最后通过系统日志发现是因为执行 systemctl restart rabbitmq-server 命令无法返回回调 systemctl 导致超时&#xff0c;自动关机。怀疑是 rabbitmq 与 systemctl 冲突&#xff0c;后 mq 升级版本已修复&#xff0c;可参考&#xff1a;https://github…...

【多线程】单例模式 | 饿汉模式 | 懒汉模式 | 指令重排序问题

文章目录 单例模式一、单例模式1.饿汉模式2.懒汉模式&#xff08;单线程&#xff09;3.懒汉模式&#xff08;多线程&#xff09;改进 4.指令重排序1.概念2.question:3.解决方法4总结&#xff1a; 单例模式 一、单例模式 单例&#xff0c;就是单个实例 在有些场景中&#xff0c…...

00_Qt概述以及如何创建一个QT新项目

Qt概述 1.Qt概述1.1 什么是Qt1.2 Qt的发展史1.3 支持的平台1.4 Qt版本1.5 Qt的下载与安装1.6 Qt的优点 2.QT新项目创建3.pro文件4.主函数5.代码命名规范和快捷键 1.Qt概述 1.1 什么是Qt Qt是一个跨平台的C图形用户界面应用程序框架。它为应用程序开发者提供建立艺术级图形界面…...

git报错

这里写自定义目录标题 git报错Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 有一个原因就是在github上设置对应密钥时&#xff0c;有一个key获取应该设置为…...

【R: mlr3:超参数调优】

本次分享官网教程地址 https://mlr3book.mlr-org.com/chapters/chapter4/hyperparameter_optimization.html 型调优 当你对你的模型表现不满意时&#xff0c;你可能希望调高你的模型表现&#xff0c;可通过超参数调整或者尝试一个更加适合你的模型&#xff0c;本篇将介绍这些操…...

使用Pandas实现股票交易数据可视化

一、折线图&#xff1a;展现股价走势 1.1、简单版-股价走势图 # 简洁版import pandas as pdimport matplotlib.pyplot as plt# 读取CSV文件df pd.read_csv(../数据集/格力电器.csv)data df[[high, close]].plot()plt.show() 首先通过df[[high,close]]从df中获取最高价和收盘…...

蓝桥杯刷题-乌龟棋

312. 乌龟棋 - AcWing题库 /* 状态表示&#xff1a;f[b1,b2,b3,b4]表示所有第 i种卡片使用了 bi张的走法的最大分值。状态计算&#xff1a;将 f[b1,b2,b3,b4]表示的所有走法按最后一步选择哪张卡片分成四类&#xff1a;第 i类为最后一步选择第 i种卡片。比如 i2&#xff0c;则…...

美国纽扣电池认证标准要求16 CFR 第 1700和ANSI C18.3M标准

法规背景 为了纪念瑞茜哈姆史密斯(Reese Hamsmith)美国德州一名于2020年12月因误食遥控器里的纽扣电池而不幸死亡的18个月大的女婴。 美国国会于2022年8月16日颁布了H.R.5313法案&#xff08;第117-171号公众法&#xff09;也称为瑞茜法案&#xff08;Reese’s Law&#xff09…...

华硕ROG幻16笔记本电脑模式切换管理工具完美替代华硕奥创中心管理工具

文章目录 华硕ROG幻16笔记本电脑模式切换管理工具完美替代华硕奥创中心管理工具1. 介绍2. 下载3. 静音模式、平衡模式、增强模式配置4. 配置电源方案与模式切换绑定5. 启动Ghelper控制面板6. 目前支持的设备型号 华硕ROG幻16笔记本电脑模式切换管理工具完美替代华硕奥创中心管理…...

【ROS2笔记六】ROS2中自定义接口

6.ROS2中自定义接口 文章目录 6.ROS2中自定义接口6.1接口常用的CLI6.2标准的接口形式6.3接口的数据类型6.4自定义接口Reference 在ROS2中接口interface是一种定义消息、服务或动作的规范&#xff0c;用于描述数据结构、字段和数据类型。ROS2中的接口可以分为以下的几种消息类型…...

设计模式-代理模式(Proxy)

1. 概念 代理模式&#xff08;Proxy Pattern&#xff09;是程序设计中的一种结构型设计模式。它为一个对象提供一个代理对象&#xff0c;并由代理对象控制对该对象的访问。 2. 原理结构图 抽象角色&#xff08;Subject&#xff09;&#xff1a;这是一个接口或抽象类&#xff0…...

中伟视界:智慧矿山智能化预警平台功能详解

矿山智能预警平台是一种高度集成化的安全监控系统&#xff0c;它能够提供实时的监控和报警功能&#xff0c;帮助企业和机构有效预防和响应潜在的安全威胁。以下是矿山智能预警平台的一些关键特性介绍&#xff1a; 报警短视频生成&#xff1a; 平台能够在检测到报警时自动生成短…...

如何在PPT中获得网页般的互动效果

如何在PPT中获得网页般的互动效果 效果可以看视频 PPT中插入网页有互动效果 当然了&#xff0c;获得网页般的互动效果&#xff0c;最简单的方法就是在 PPT 中插入网页呀。 那么如何插入呢&#xff1f; 接下来为你讲解如何获得&#xff08;此方法在 PowerPoint中行得通&#…...

HTML段落标签、换行标签、文本格式化标签与水平线标签

目录 HTML段落标签 HTML换行标签 HTML格式化标签 加粗标签 倾斜标签 删除线标签 下划线标签 HTML水平线标签 HTML段落标签 在网页中&#xff0c;要把文字有条理地显示出来&#xff0c;就需要将这些文字分段显示。在 HTML 标签中&#xff0c;<p>标签用于定义段落…...

NVIC简介

NVIC&#xff08;Nested Vectored Interrupt Controller&#xff09;是ARM处理器中用于中断管理的一个重要硬件模块。它负责处理来自多个中断源的中断请求&#xff0c;并根据中断的优先级来安排处理器执行相应的中断服务例程&#xff08;ISR&#xff09;。NVIC是ARM Cortex-M系…...

LeetCode-924. 尽量减少恶意软件的传播【深度优先搜索 广度优先搜索 并查集 图 哈希表】

LeetCode-924. 尽量减少恶意软件的传播【深度优先搜索 广度优先搜索 并查集 图 哈希表】 题目描述&#xff1a;解题思路一&#xff1a;解题思路二&#xff1a;0解题思路三&#xff1a;0 题目描述&#xff1a; 给出了一个由 n 个节点组成的网络&#xff0c;用 n n 个邻接矩阵图…...

【linux】yum 和 vim

yum 和 vim 1. Linux 软件包管理器 yum1.1 什么是软件包1.2 查看软件包1.3 如何安装软件1.4 如何卸载软件1.5 关于 rzsz 2. Linux编辑器-vim使用2.1 vim的基本概念2.2 vim的基本操作2.3 vim命令模式命令集2.4 vim底行模式命令集2.5 vim操作总结补充&#xff1a;vim下批量化注释…...

excel试题转word格式

序号试题选项答案 格式如上。输出后在做些适当调整就可以。 import pandas as pd from docx import Document from docx.shared import Inches# 读取Excel文件 df pd.read_excel(r"你的excel.xlsx")# 创建一个新的Word文档 doc Document()# 添加标题 doc.add_headi…...

stm32G473的flash模式是单bank还是双bank?

今天突然有人stm32G473的flash模式是单bank还是双bank&#xff1f;由于时间太久&#xff0c;我真忘记了。搜搜发现&#xff0c;还真有人和我一样。见下面的链接&#xff1a;https://shequ.stmicroelectronics.cn/forum.php?modviewthread&tid644563 根据STM32G4系列参考手…...

三维GIS开发cesium智慧地铁教程(5)Cesium相机控制

一、环境搭建 <script src"../cesium1.99/Build/Cesium/Cesium.js"></script> <link rel"stylesheet" href"../cesium1.99/Build/Cesium/Widgets/widgets.css"> 关键配置点&#xff1a; 路径验证&#xff1a;确保相对路径.…...

基于uniapp+WebSocket实现聊天对话、消息监听、消息推送、聊天室等功能,多端兼容

基于 ​UniApp + WebSocket​实现多端兼容的实时通讯系统,涵盖WebSocket连接建立、消息收发机制、多端兼容性配置、消息实时监听等功能,适配​微信小程序、H5、Android、iOS等终端 目录 技术选型分析WebSocket协议优势UniApp跨平台特性WebSocket 基础实现连接管理消息收发连接…...

以光量子为例,详解量子获取方式

光量子技术获取量子比特可在室温下进行。该方式有望通过与名为硅光子学&#xff08;silicon photonics&#xff09;的光波导&#xff08;optical waveguide&#xff09;芯片制造技术和光纤等光通信技术相结合来实现量子计算机。量子力学中&#xff0c;光既是波又是粒子。光子本…...

Linux 内存管理实战精讲:核心原理与面试常考点全解析

Linux 内存管理实战精讲&#xff1a;核心原理与面试常考点全解析 Linux 内核内存管理是系统设计中最复杂但也最核心的模块之一。它不仅支撑着虚拟内存机制、物理内存分配、进程隔离与资源复用&#xff0c;还直接决定系统运行的性能与稳定性。无论你是嵌入式开发者、内核调试工…...

面向无人机海岸带生态系统监测的语义分割基准数据集

描述&#xff1a;海岸带生态系统的监测是维护生态平衡和可持续发展的重要任务。语义分割技术在遥感影像中的应用为海岸带生态系统的精准监测提供了有效手段。然而&#xff0c;目前该领域仍面临一个挑战&#xff0c;即缺乏公开的专门面向海岸带生态系统的语义分割基准数据集。受…...

从 GreenPlum 到镜舟数据库:杭银消费金融湖仓一体转型实践

作者&#xff1a;吴岐诗&#xff0c;杭银消费金融大数据应用开发工程师 本文整理自杭银消费金融大数据应用开发工程师在StarRocks Summit Asia 2024的分享 引言&#xff1a;融合数据湖与数仓的创新之路 在数字金融时代&#xff0c;数据已成为金融机构的核心竞争力。杭银消费金…...

解决:Android studio 编译后报错\app\src\main\cpp\CMakeLists.txt‘ to exist

现象&#xff1a; android studio报错&#xff1a; [CXX1409] D:\GitLab\xxxxx\app.cxx\Debug\3f3w4y1i\arm64-v8a\android_gradle_build.json : expected buildFiles file ‘D:\GitLab\xxxxx\app\src\main\cpp\CMakeLists.txt’ to exist 解决&#xff1a; 不要动CMakeLists.…...

用鸿蒙HarmonyOS5实现中国象棋小游戏的过程

下面是一个基于鸿蒙OS (HarmonyOS) 的中国象棋小游戏的实现代码。这个实现使用Java语言和鸿蒙的Ability框架。 1. 项目结构 /src/main/java/com/example/chinesechess/├── MainAbilitySlice.java // 主界面逻辑├── ChessView.java // 游戏视图和逻辑├──…...

全面解析数据库:从基础概念到前沿应用​

在数字化时代&#xff0c;数据已成为企业和社会发展的核心资产&#xff0c;而数据库作为存储、管理和处理数据的关键工具&#xff0c;在各个领域发挥着举足轻重的作用。从电商平台的商品信息管理&#xff0c;到社交网络的用户数据存储&#xff0c;再到金融行业的交易记录处理&a…...