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

03/29 使用 海康SDK 对接时使用的 MysqlUtils

前言

最近朋友的需求, 是需要使用 海康sdk 连接海康设备, 进行数据的获取, 比如 进出车辆, 进出人员 

这一部分是 资源比较贫瘠时的一个 Mysql 工具类 

 

 

测试用例

public class MysqlUtils {public static String MYSQL_HOST = "192.168.31.9";public static int MYSQL_PORT = 3306;public static String MYSQL_DB = "20240811_vehicle_stats";public static String MYSQL_USERNAME = "root";public static String MYSQL_PASSWORD = "postgres";public static String COLUMN_CATM = "catm";public static String COLUMN_UPTM = "uptm";public static String SQL_DUMMY_SQL = "select 1;";public static boolean DEFAULT_ADD_CATM_UPTM = false;public static SingleStringColumnExtractor SINGLE_STRING_COLUMN_EXTRACTOR = new SingleStringColumnExtractor();public static GenericMapExtractor GENERIC_MAP_EXTRACTOR = new GenericMapExtractor();public static MyStatsVehicleFlowLogExtractor MY_STATISTICS_VEHICLE_FLOW_LOG_EXTRACTOR = new MyStatsVehicleFlowLogExtractor();public static MyStatsPeopleFlowLogExtractor MY_STATISTICS_PEOPLE_FLOW_LOG_EXTRACTOR = new MyStatsPeopleFlowLogExtractor();// disable constructorprivate MysqlUtils() {System.err.println("can't instantiate !");}// mysql jdbcDriverstatic {try {Class.forName("com.mysql.jdbc.Driver");} catch (ClassNotFoundException e) {System.err.println("can't found jdbcDriver !");}}public static void init() {MYSQL_HOST = ConfigUtils.getString("MYSQL_HOST", MYSQL_HOST);MYSQL_PORT = ConfigUtils.getInt("MYSQL_PORT", MYSQL_PORT);MYSQL_DB = ConfigUtils.getString("MYSQL_DB", MYSQL_DB);MYSQL_USERNAME = ConfigUtils.getString("MYSQL_USERNAME", MYSQL_USERNAME);MYSQL_PASSWORD = ConfigUtils.getString("MYSQL_PASSWORD", MYSQL_PASSWORD);DEFAULT_ADD_CATM_UPTM = ConfigUtils.getString("DEFAULT_ADD_CATM_UPTM", String.valueOf(DEFAULT_ADD_CATM_UPTM)).equalsIgnoreCase("true");}// 获取 jdbc 链接public static Connection getConnection(String ip, int port, String dbName, String userName, String password) {Connection con = null;try {con = DriverManager.getConnection(String.format("jdbc:mysql://%s:%d/%s?useUnicode=true&characterEncoding=UTF8", ip, port, dbName), userName, password);} catch (SQLException se) {se.printStackTrace();System.err.println("error while try to get an connection !");}return con;}public static Connection getConnection() {return MysqlUtils.getConnection(MYSQL_HOST, MYSQL_PORT, MYSQL_DB, MYSQL_USERNAME, MYSQL_PASSWORD);}// 执行 jdbc 查询public static <T> List<T> executeQuery(String sql, Function<ResultSet, T> recordExtractor) {Connection con = MysqlUtils.getConnection(MYSQL_HOST, MYSQL_PORT, MYSQL_DB, MYSQL_USERNAME, MYSQL_PASSWORD);PreparedStatement stat = null;ResultSet rs = null;List<T> result = new ArrayList<>();try {stat = con.prepareStatement(sql);rs = stat.executeQuery();while (rs.next()) {result.add(recordExtractor.apply(rs));}} catch (SQLException e) {e.printStackTrace();} finally {try {if(stat != null) {stat.close();}if(rs != null) {rs.close();}if (con != null) {con.close();}} catch (SQLException e) {e.printStackTrace();}}return result;}public static List<Map<String, Object>> executeQuery(String sql) {return executeQuery(sql, GENERIC_MAP_EXTRACTOR);}// 执行 jdbc 更新public static int executeUpdate(String sql) {Connection con = MysqlUtils.getConnection(MYSQL_HOST, MYSQL_PORT, MYSQL_DB, MYSQL_USERNAME, MYSQL_PASSWORD);PreparedStatement stat = null;int updated = -1;try {stat = con.prepareStatement(sql);updated = stat.executeUpdate();} catch (SQLException e) {e.printStackTrace();} finally {try {if(stat != null) {stat.close();}if (con != null) {con.close();}} catch (SQLException e) {e.printStackTrace();}}return updated;}public static String assembleInsertSql(String tableName, Map<String, Object> entity, boolean addCommonFields) {String insertSqlTemplate = " insert into %s (%s) values (%s); ";List<String> fieldNames = new ArrayList<>(), fieldValues = new ArrayList<>();for (String fieldName : entity.keySet()) {Object originalFieldValue = entity.get(fieldName);String fieldValue = resolveFieldValue(entity, fieldName, originalFieldValue);fieldNames.add(String.format("`%s`", fieldName));fieldValues.add(transferFieldValueIfNecessary(fieldValue));}if (addCommonFields) {Long currentTs = System.currentTimeMillis();addFixedFieldNames(fieldNames, currentTs, true);addFixedFieldValues(fieldValues, currentTs, true);}String sql = String.format(insertSqlTemplate, tableName,join(fieldNames, ", "),join(fieldValues, ", "));return sql;}public static String assembleInsertSql(String tableName, Map<String, Object> entity) {return assembleInsertSql(tableName, entity, DEFAULT_ADD_CATM_UPTM);}public static String assembleBatchInsertSql(String tableName, List<Map<String, Object>> entityList, boolean addCommonFields) {String insertSqlTemplate = " insert into %s (%s) values %s; ";List<String> insertFieldNames = new ArrayList<>(), outerFieldValues = new ArrayList<>();Set<String> fieldNames = new LinkedHashSet<>();Long currentTs = System.currentTimeMillis();for (Map<String, Object> entity : entityList) {fieldNames.addAll(entity.keySet());}for (String fieldName : fieldNames) {insertFieldNames.add(String.format("`%s`", fieldName));}if (addCommonFields) {addFixedFieldNames(insertFieldNames, currentTs, true);}for (Map<String, Object> entity : entityList) {List<String> fieldValues = new ArrayList<>();for (String fieldName : fieldNames) {Object originalFieldValue = entity.get(fieldName);String fieldValue = resolveFieldValue(entity, fieldName, originalFieldValue);fieldValues.add(transferFieldValueIfNecessary(fieldValue));}if (addCommonFields) {addFixedFieldValues(fieldValues, currentTs, true);}outerFieldValues.add(String.format("(%s)", join(fieldValues, ", ")));}String sql = String.format(insertSqlTemplate, tableName,join(insertFieldNames, ", "),join(outerFieldValues, ", "));return sql;}public static String assembleBatchInsertSql(String tableName, List<Map<String, Object>> entityList) {return assembleBatchInsertSql(tableName, entityList, DEFAULT_ADD_CATM_UPTM);}public static String assembleUpdateSql(String tableName, String idFieldName, Map<String, Object> entity, boolean addCommonFields) {String updateSqlTemplate = " update %s set %s %s; ";List<String> fieldNames = new ArrayList<>(), fieldValues = new ArrayList<>();for (String fieldName : entity.keySet()) {Object originalFieldValue = entity.get(fieldName);String fieldValue = resolveFieldValue(entity, fieldName, originalFieldValue);fieldNames.add(String.format("`%s`", fieldName));fieldValues.add(transferFieldValueIfNecessary(fieldValue));}if (addCommonFields) {Long currentTs = System.currentTimeMillis();addFixedFieldNames(fieldNames, currentTs, false);addFixedFieldValues(fieldValues, currentTs, false);}List<String> setClauseList = new ArrayList<>();for (int i = 0; i < fieldNames.size(); i++) {setClauseList.add(String.format(" %s = %s ", fieldNames.get(i), fieldValues.get(i)));}String setClause = join(setClauseList, ", ");String idValue = String.valueOf(entity.get(idFieldName));String whereCond = String.format(" where %s = %s ", idFieldName, transferFieldValueIfNecessary(idValue));String sql = String.format(updateSqlTemplate, tableName, setClause, whereCond);return sql;}public static String assembleUpdateSql(String tableName, String idFieldName, Map<String, Object> entity) {return assembleUpdateSql(tableName, idFieldName, entity, DEFAULT_ADD_CATM_UPTM);}public static List<String> assembleBatchSaveSql(String tableName, String idFieldName,List<Map<String, Object>> entityList, Function<ResultSet, String> idExtractor,boolean addCommonFields) {List<String> idList = entityList.stream().map(ele -> String.valueOf(ele.get(idFieldName))).collect(Collectors.toList());List<String> existsIdList = selectExistsById(tableName, idFieldName, idList, idExtractor);Map<String, Map<String, Object>> toInsertById = new LinkedHashMap<>(), toUpdateById = new LinkedHashMap<>();for (Map<String, Object> entity : entityList) {String idValue = String.valueOf(entity.get(idFieldName));Map<String, Map<String, Object>> entityByIdTmp = toInsertById;if (existsIdList.contains(idValue)) {entityByIdTmp = toUpdateById;}entityByIdTmp.put(idValue, entity);}List<String> result = new ArrayList<>();String insertSql = SQL_DUMMY_SQL;List<Map<String, Object>> toInsertList = new ArrayList<>(toInsertById.values());if (!isEmpty(toInsertList)) {insertSql = assembleBatchInsertSql(tableName, toInsertList, addCommonFields);}result.add(insertSql);List<Map<String, Object>> toUpdateList = new ArrayList<>(toUpdateById.values());for (Map<String, Object> toUpdate : toUpdateList) {String updateSql = assembleUpdateSql(tableName, idFieldName, toUpdate, addCommonFields);result.add(updateSql);}return result;}public static <T> List<String> assembleBatchSaveSql(String tableName, String idFieldName,List<Map<String, Object>> entityList, Function<ResultSet, String> recordExtractor) {return assembleBatchSaveSql(tableName, idFieldName, entityList, recordExtractor, true);}public static List<String> selectExistsById(String tableName, String idFieldName, List<String> idList, Function<ResultSet, String> recordExtractor) {if (isEmpty(idList)) {return Collections.emptyList();}String querySqlTemplate = " select %s as id from %s %s; ";String idInSnippet = join(idList.stream().map(MysqlUtils::transferFieldValueIfNecessary).collect(Collectors.toList()), ", ");String whereCond = String.format(" where %s in (%s) ", idFieldName, idInSnippet);String querySql = String.format(querySqlTemplate, idFieldName, tableName, whereCond);return executeQuery(querySql, recordExtractor);}public static String generateQuerySql(String tableName, String whereCond) {String querySql = String.format(" select * from %s ", tableName);if (isNotBlank(whereCond)) {querySql = String.format(" %s where %s ", querySql, whereCond);}return querySql;}public static String generateDeleteSql(String tableName, String whereCond) {String querySql = String.format(" delete from %s ", tableName);if (isNotBlank(whereCond)) {querySql = String.format(" %s where %s ", querySql, whereCond);}return querySql;}public static String resolveFieldValue(Map<String, Object> entity, String fieldName, Object fieldValue) {if (fieldValue == null) {return null;}if (fieldValue instanceof Date) {return DateFormatUtils.format((Date) fieldValue);}if (fieldValue instanceof LocalDateTime) {LocalDateTime dateTime = ((LocalDateTime) fieldValue);return String.format("%s-%s-%s %s:%s:%s",String.format("%04d", dateTime.getYear()),String.format("%02d", dateTime.getMonthValue()),String.format("%02d", dateTime.getDayOfMonth()),String.format("%02d", dateTime.getHour()),String.format("%02d", dateTime.getMinute()),String.format("%02d", dateTime.getSecond()));}return String.valueOf(fieldValue);}public static void addFixedFieldNames(List<String> fieldNames, Long currentTs, boolean addCatm) {if (addCatm) {fieldNames.add(COLUMN_CATM);}fieldNames.add(COLUMN_UPTM);}public static void addFixedFieldValues(List<String> fieldValues, Long currentTs, boolean addCatm) {if (addCatm) {fieldValues.add(transferFieldValueIfNecessary(String.valueOf(currentTs)));}fieldValues.add(transferFieldValueIfNecessary(String.valueOf(currentTs)));}public static String transferFieldValueIfNecessary(String fieldValue) {if (fieldValue == null) {return "NULL";}if (fieldValue.contains("\"")) {fieldValue = fieldValue.replace("\"", "\\\"");}return String.format("\"%s\"", fieldValue);}public static String transferSingleQuoteFieldValueIfNecessary(String fieldValue) {if (fieldValue == null) {return "NULL";}if (fieldValue.contains("'")) {fieldValue = fieldValue.replace("'", "\\'");}return String.format("'%s'", fieldValue);}public static void fillOrTrimToFieldNames(Map<String, Object> entity, List<String> fieldNames, String defaultValue) {List<String> field2Remove = new ArrayList<>();for (Map.Entry<String, Object> entry : entity.entrySet()) {String fieldName = entry.getKey();if (!fieldNames.contains(fieldName)) {field2Remove.add(fieldName);}}for (String fieldName : field2Remove) {entity.remove(fieldName);}for (String fieldName : fieldNames) {if (!entity.containsKey(fieldName)) {entity.put(fieldName, defaultValue);}}}public static void fillOrTrimToFieldNames(Map<String, Object> entity, List<String> fieldNames) {fillOrTrimToFieldNames(entity, fieldNames, "");}public static String wrapSqlIn(List<String> list) {if (isEmpty(list)) {return "";}return String.format("\"%s\"", join(list, "\", \""));}public static boolean isBlank(String str) {return str == null || str.trim().length() == 0;}public static boolean isNotBlank(String str) {return !isBlank(str);}public static <T> boolean isEmpty(Collection<T> list) {return list == null || (list.size() == 0);}public static <T> String join(Collection<T> list, String seprator) {StringBuffer result = new StringBuffer();for (Iterator ite = list.iterator(); ite.hasNext(); result.append((String) ite.next())) {if (result.length() != 0) {result.append(seprator);}}return result.toString();}}

 

 

GenericMapExtractor
public class GenericMapExtractor implements Function<ResultSet, Map<String, Object>> {@Overridepublic Map<String, Object> apply(ResultSet resultSet) {try {Map<String, Object> result = new LinkedHashMap<>();int columnCount = resultSet.getMetaData().getColumnCount();for (int i = 1; i <= columnCount; i++) {String columnName = resultSet.getMetaData().getColumnName(i);result.put(columnName, resultSet.getObject(columnName));}return result;} catch (Exception e) {e.printStackTrace();return null;}}}

 

 

MyStatsPeopleFlowLogExtractor
public class MyStatsPeopleFlowLogExtractor implements Function<ResultSet, StatsPeopleFlowLog> {@Overridepublic StatsPeopleFlowLog apply(ResultSet resultSet) {try {Map<String, Object> entityMap = MysqlUtils.GENERIC_MAP_EXTRACTOR.apply(resultSet);JSONObject entityJson = (JSONObject) JSON.toJSON(entityMap);return StatsPeopleFlowLog.fromJSON(entityJson);} catch (Exception e) {e.printStackTrace();return null;}}
}

 

 

部分截图

 

 

完 

 

 

 

 

 

相关文章:

03/29 使用 海康SDK 对接时使用的 MysqlUtils

前言 最近朋友的需求, 是需要使用 海康sdk 连接海康设备, 进行数据的获取, 比如 进出车辆, 进出人员 这一部分是 资源比较贫瘠时的一个 Mysql 工具类 测试用例 public class MysqlUtils {public static String MYSQL_HOST "192.168.31.9";public static int MY…...

2025.2.7 Python开发岗面试复盘

2025.2.7 Python开发岗面试复盘 问题: 是否了解过其他语言? 了解过Java、JavaScript、C等语言,但主要技术栈是Python。 Python跟Java的区别? Python是解释型语言,Java是编译型语言 Python动态类型,Java静态类型 Python简洁易读,Java相对严谨复杂 Python GIL限制并发,Java并…...

一个sql只能有一个order by

ORDER BY 子句在 SQL 中只能出现一次&#xff0c;静态部分和动态部分只能写一个 ORDER BY...

Windows Docker笔记-在容器中运行项目

在文章《Windows Docker笔记-Docker容器操作》中&#xff0c;已经成功创建了容器&#xff0c;也就是建好了工厂&#xff0c;接下来就应该要安装流水线设备&#xff0c;即运行项目达到生产的目的。 在Ubuntu容器中新建项目 这里要新建一个简单的C项目&#xff0c;步骤如下&…...

postgreSQL16.6源码安装

1.获取源码 从PostgreSQL: File Browser获取tar.bz2或者tar.gz源码 2.解压 tar xf postgresql-version.tar.bz2 roothwz-VMware-Virtual-Platform:/usr/local# tar xf postgresql-16.6.tar.bz2 roothwz-VMware-Virtual-Platform:/usr/local# ll 总计 24324 drwxr-xr-x 12 ro…...

寒假2.5

题解 web:[网鼎杯 2020 朱雀组]phpweb 打开网址&#xff0c;一直在刷新&#xff0c;并有一段警告 翻译一下 查看源码 每隔五秒钟将会提交一次form1&#xff0c;index.php用post方式提交了两个参数func和p&#xff0c;func的值为date&#xff0c;p的值为Y-m-d h:i:s a 执行fu…...

定期删除一周前的数据,日志表的表空间会增长吗?

即使定期删除一周前的数据&#xff0c;日志表的表空间仍可能持续增长。原因如下&#xff1a; 删除操作不释放空间&#xff1a;DELETE 操作只会标记数据为删除状态&#xff0c;并不会立即释放空间。这些空间可以被后续的 INSERT 操作重用&#xff0c;但不会自动缩减表的总大小。…...

yum 安装mysql

sudo yum install mysql-server sudo systemctl start mysqld sudo systemctl enable mysqld 获取临时 root 密码并登录 MySQL 安装完成后&#xff0c;MySQL 会生成一个临时的 root 密码。你可以通过查看日志文件来找到这个密码&#xff1a; sudo grep ‘temporary password’…...

Servlet笔记(下)

HttpServletRequest对象相关API 获取请求行信息相关(方式,请求的url,协议及版本) | API | 功能解释 | | ----------------------------- | ------------------------------ | | StringBuffer getRequestURL(); | 获取客户端…...

Windows 中学习Docker环境准备3、在Ubuntu中安装Docker

Windows 中学习Docker环境准备1、Win11安装Docker Desktop Windows 中学习Docker环境准备2、Docker Desktop中安装ubuntu Windows 中学习Docker环境准备3、在Ubuntu中安装Docker 需要更多Docker学习视频和资料&#xff0c;请文末联系 步骤 1&#xff1a;更新系统并安装依赖…...

【centOS】搭建公司内网git环境-GitLab 社区版(GitLab CE)

1. 安装必要的依赖 以 CentOS 7 系统为例&#xff0c;安装必要的依赖包&#xff1a; sudo yum install -y curl policycoreutils openssh-server openssh-clients postfix sudo systemctl start postfix sudo systemctl enable postfix2. 添加 GitLab 仓库 curl -sS https:/…...

Unity DoTween使用文档

DoTween 使用文档 DoTween 是 Unity 中非常流行的动画补间插件。它通过链式调用方式&#xff0c;让开发者可以快速创建平滑、自然的动画效果。本文将介绍 DoTween 的基础用法、缓动曲线原理&#xff08;包含常见缓动曲线的数学公式与参数说明&#xff09;、案例演示以及一些常…...

【办公类-99-01】20250201学具PDF打印会缩小一圈——解决办法:换一个PDF阅读器

背景需求&#xff1a; 2024年1月13日&#xff0c;快要放寒假了&#xff0c;组长拿着我们班的打印好的一叠教案来调整。 “前面周计划下面的家园共育有调整&#xff0c;你自己看批注。” “还有你这个教案部分的模版有问题&#xff0c;太小&#xff08;窄&#xff09;了。考虑…...

组合总和II(力扣40)

这道题的难点就在于题目所给的集合中有重复的数字&#xff0c;我们需要进行去重操作。首先明确去重指的是去重哪一部分。注意并不是对递归的集合去重&#xff0c;而是对当前集合的遍历进行去重。这么说可能有点抽象&#xff0c;举个例子&#xff1a;假设集合为1,1,2,3,4&#x…...

基于HTML生成网页有什么优势

在互联网时代&#xff0c;网页是人们获取信息、交流互动的重要窗口&#xff0c;而基于HTML生成网页&#xff0c;是搭建网络大厦的关键。HTML语法简洁直观&#xff0c;标签和属性语义明确&#xff0c;新手也能迅速上手&#xff0c;创建包含基础元素的网页&#xff0c;极大降低了…...

php 接入扣子的 token获取

本身逻辑只是个api&#xff0c;但是官方不提供php的sdk 扎心了老铁&#xff0c;这下php 狗都不用了&#xff0c;主要麻烦的是如何获取access_token&#xff0c;代码如下 protected function get_jwt(): string{$header [alg > RS256,typ > JWT,kid > $this->kid];…...

Redis02 - 持久化

Redis持久化 文章目录 Redis持久化一&#xff1a;持久化简介1&#xff1a;Redis为什么要进行持久化2&#xff1a;Redis持久化的方式 二&#xff1a;RDB持久化介绍1&#xff1a;手动触发RDB2&#xff1a;自动触发RDB3&#xff1a;redis.conf中进行RDB的配置4&#xff1a;RDB优缺…...

【力扣】240.搜索二维矩阵 II

题目 我的代码 class Solution { public:bool searchMatrix(vector<vector<int>>& matrix, int target) {for(int i0;i<matrix.size();i){for(int j0;j<matrix[0].size();j){if(targetmatrix[i][j]){return true;}else if(target<matrix[i][j]){brea…...

RabbitMQ 从入门到精通:从工作模式到集群部署实战(二)

接上篇&#xff1a;《RabbitMQ 从入门到精通&#xff1a;从工作模式到集群部署实战&#xff08;一&#xff09;》 链接 文章目录 4.安装RabbitMQ Messaging Topology Operator 裸金属环境部署RabbitMQ部署单实例部署集群 4.安装RabbitMQ Messaging Topology Operator 使用 cer…...

编程AI深度实战:大模型哪个好? Mistral vs Qwen vs Deepseek vs Llama

随着开源 LLM 的发展&#xff0c;越来越多的模型变得专业化&#xff0c;“代码”LLM 变得非常流行。这些 LLM 旨在比其 “常识” 对应物更小&#xff0c;但旨在超越更大的通用模型的编码性能。 这些模型以极低的成本提供大型模型的功能&#xff0c;进一步使本地 LLM 空间民主化…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

QMC5883L的驱动

简介 本篇文章的代码已经上传到了github上面&#xff0c;开源代码 作为一个电子罗盘模块&#xff0c;我们可以通过I2C从中获取偏航角yaw&#xff0c;相对于六轴陀螺仪的yaw&#xff0c;qmc5883l几乎不会零飘并且成本较低。 参考资料 QMC5883L磁场传感器驱动 QMC5883L磁力计…...

Leetcode 3577. Count the Number of Computer Unlocking Permutations

Leetcode 3577. Count the Number of Computer Unlocking Permutations 1. 解题思路2. 代码实现 题目链接&#xff1a;3577. Count the Number of Computer Unlocking Permutations 1. 解题思路 这一题其实就是一个脑筋急转弯&#xff0c;要想要能够将所有的电脑解锁&#x…...

基础测试工具使用经验

背景 vtune&#xff0c;perf, nsight system等基础测试工具&#xff0c;都是用过的&#xff0c;但是没有记录&#xff0c;都逐渐忘了。所以写这篇博客总结记录一下&#xff0c;只要以后发现新的用法&#xff0c;就记得来编辑补充一下 perf 比较基础的用法&#xff1a; 先改这…...

Java 加密常用的各种算法及其选择

在数字化时代&#xff0c;数据安全至关重要&#xff0c;Java 作为广泛应用的编程语言&#xff0c;提供了丰富的加密算法来保障数据的保密性、完整性和真实性。了解这些常用加密算法及其适用场景&#xff0c;有助于开发者在不同的业务需求中做出正确的选择。​ 一、对称加密算法…...

什么?连接服务器也能可视化显示界面?:基于X11 Forwarding + CentOS + MobaXterm实战指南

文章目录 什么是X11?环境准备实战步骤1️⃣ 服务器端配置(CentOS)2️⃣ 客户端配置(MobaXterm)3️⃣ 验证X11 Forwarding4️⃣ 运行自定义GUI程序(Python示例)5️⃣ 成功效果![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/55aefaea8a9f477e86d065227851fe3d.pn…...

莫兰迪高级灰总结计划简约商务通用PPT模版

莫兰迪高级灰总结计划简约商务通用PPT模版&#xff0c;莫兰迪调色板清新简约工作汇报PPT模版&#xff0c;莫兰迪时尚风极简设计PPT模版&#xff0c;大学生毕业论文答辩PPT模版&#xff0c;莫兰迪配色总结计划简约商务通用PPT模版&#xff0c;莫兰迪商务汇报PPT模版&#xff0c;…...

【C++进阶篇】智能指针

C内存管理终极指南&#xff1a;智能指针从入门到源码剖析 一. 智能指针1.1 auto_ptr1.2 unique_ptr1.3 shared_ptr1.4 make_shared 二. 原理三. shared_ptr循环引用问题三. 线程安全问题四. 内存泄漏4.1 什么是内存泄漏4.2 危害4.3 避免内存泄漏 五. 最后 一. 智能指针 智能指…...

宇树科技,改名了!

提到国内具身智能和机器人领域的代表企业&#xff0c;那宇树科技&#xff08;Unitree&#xff09;必须名列其榜。 最近&#xff0c;宇树科技的一项新变动消息在业界引发了不少关注和讨论&#xff0c;即&#xff1a; 宇树向其合作伙伴发布了一封公司名称变更函称&#xff0c;因…...

C++ 设计模式 《小明的奶茶加料风波》

&#x1f468;‍&#x1f393; 模式名称&#xff1a;装饰器模式&#xff08;Decorator Pattern&#xff09; &#x1f466; 小明最近上线了校园奶茶配送功能&#xff0c;业务火爆&#xff0c;大家都在加料&#xff1a; 有的同学要加波霸 &#x1f7e4;&#xff0c;有的要加椰果…...