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

网站个人备案做企业网站/搜索排名影响因素

网站个人备案做企业网站,搜索排名影响因素,做果盘网站,wordpress搭的************* C topic: 面试题 08.12. 八皇后 - 力扣(LeetCode) ************* Good morning, gays, Fridary angin and try the hard to celebrate. Inspect the topic: This topic I can understand it in a second. And I do rethink a movie, …

*************

C++

topic: 面试题 08.12. 八皇后 - 力扣(LeetCode)

*************

Good morning, gays, Fridary angin and try the hard to celebrate.

Inspect the topic:

This topic I can understand it in a second.  And I do rethink a movie, which talks anout chess

This title imposes the same rectructions on queens as the rules for queens in chess. In chess, queens may move either stright and diagonally. And may by this code was applied in some chees games.

 

Back to the topic, try to find the topics I've done which is similar to t his topic. It seems like no one like this. 

Use matrix, I learned matrix from a teacher, Master Tang:

Greedy algorithm, I did yesterday, may work. Every step goes to the best way, and might have the happy ending in the end.

First, put the queen in matrix[1][1], then put the second  row, maxtrix[2][1] is forbidden cuz it is in the first column. Matrix[2][2] is forbidden cuz it in the diagonal. Put it in matrix[2][3]. Actally, make sure that  matrix[i][i] put nothing. 

From the first row,  put the queen in the first column.

To the second row, put the queen in the first column, check if it conflicts with previous queens. If not, add a row. If so, change a column.

Take an example, N = 13, The position-array has 13 elements, each ranges from 0 to 12. 

For each increatment, generate a new array of positions. Check if the condition is satisfied for each array of positions. If satisfied, save it.                                                                         

When the last queen find her place, the war end.

This is a really new algorithm called Backtracking Algorithm.A backtracking algorithm is an algorithm that tries different things until it finds the right answer. It avoids doing unnecessary work. Backtracking algorithms are used to solve many kinds of problems. The usage of backtracking algorithm follows:

void backtrack(路径参数, 选择列表参数) {// 检查是否满足结束条件if (满足结束条件) {// 处理解决方案return;}// 遍历选择列表for (auto i : 选择列表) {// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

Try to write the code:

need to find a right way to describe the chess board. matrix N × N doesnot work, the reason of it is that memory is everything for the computer, N × N use tooooooooooooo much storage. Never think about it. 

Every queen has different row, so it can be used in one-line matrix, for instace:

 it can be described as 4 multiply 4 

  1. 1 0 0 0
  2. 0 0 1 0
  3. 0 1 0 0 
  4. 0 0 0 1

also, a smarter way to describe is as follow:

array X = [1, 3, 2, 4], which means

  1. the 1st  queen laies at row 1 column 1,
  2. the 2nd queen laies at row 2 column 3,
  3. the 3rd queen laies at row 3 column  2,
  4. the 4th queen laies at row 4 column  4,

but how to tell the computer that the queens cannot stay in the diagonal? 

the same color's position is illegal. It can EZ tell that two queens on the same diagonal if and only if their row and column differences are equal. 
|row1 - row4| == |column4 - column1|

There's no need to double-check each row and column; only the diagonals. To check more efficiently, record which columns and diagonals have been used when placing the queens.

record this in three sets:

  1. Columns where queens have already been placed.
  2. Primary diagonal: row-column values on the same primary diagonal.
  3. Sub-diagonal: row + column values where identical values are on the same sub-diagonal.

 so make up the code to describe the 3 sets in backtrack structure:

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (满足结束条件) {// 处理解决方案return;}// 遍历选择列表for (auto i : 选择列表) {// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

move next, what is 满足结束条件? it is the row == n, the last queen finds her palace.

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 处理解决方案return;}// 遍历选择列表for (auto i : 选择列表) {// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

and what is 处理解决方案? That is return the result. But pay vital attention to the result like this:

make sure that the code return a string:

 

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (auto i : 选择列表) {// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

the next step is 遍历选择列表. This is the most diffcult step, including how to lay the queens. Make sure that every column has been visited.

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (int col = 0; col < n; col++) {// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

If there's already a queen in the column, main diagonal, or sub-diagonal where you're placing the queen, skip that spot.

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (int col = 0; col < n; col++) {if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}// 添加当前选项到路径路径.push_back(i);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

in this special code :

if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}

1ULL meas 1 unsigned long long,  << means move 1 step to the left.

diag_mask is an integer, for example:

if col == 2, in binary system is 10;  1ULL << 2 is 4, in binary system is 100

see, in binary system, int 1 moves one step left.

then put the queen

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (int col = 0; col < n; col++) {if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}// 在当前位置放置皇后queens.push_back(col);// 进行递归backtrack(路径, 更新的选择列表);// 回溯,移除当前选项路径.pop_back();}
}

and move to the next row:

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (int col = 0; col < n; col++) {if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}// 在当前位置放置皇后queens.push_back(col);// 递归到下一行backtrack_bit(n, row + 1, cols_mask | (1ULL << col),diag1_mask | (1ULL << d1), diag2_mask | (1ULL << d2),queens, result);// 回溯,移除当前选项路径.pop_back();}
}

and next

void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) 
{// 检查是否满足结束条件if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 遍历选择列表for (int col = 0; col < n; col++) {if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}// 在当前位置放置皇后queens.push_back(col);// 递归到下一行backtrack_bit(n, row + 1, cols_mask | (1ULL << col),diag1_mask | (1ULL << d1), diag2_mask | (1ULL << d2),queens, result);// 回溯,移除当前皇后queens.pop_back();}
}

dont forget to initialize at the very beginning:

class Solution {
public:// 主函数,接收一个整数n,表示棋盘的大小vector<vector<string>> solveNQueens(int n) {vector<vector<string>> result; // 用于存储所有可能的解vector<int> queens; // 用于存储当前放置皇后的列位置// 从第0行开始回溯backtrack_bit(n, 0, 0, 0, 0, queens, result);return result; // 返回所有可能的解}private:// 回溯函数,参数包括棋盘大小n,当前行row,以及三个掩码void backtrack_bit(int n, int row, unsigned long long cols_mask,unsigned long long diag1_mask, unsigned long long diag2_mask,vector<int>& queens, vector<vector<string>>& result) {// 如果到达最后一行,说明找到了一个解if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 尝试在当前行的每一列放置皇后for (int col = 0; col < n; col++) {int d1 = row - col + (n - 1); // 对角线1的索引int d2 = row + col; // 对角线2的索引// 检查当前位置是否安全if ((cols_mask & (1ULL << col)) ||(diag1_mask & (1ULL << d1)) ||(diag2_mask & (1ULL << d2))) {continue; // 如果不安全,跳过这一列}// 在当前位置放置皇后queens.push_back(col);// 递归到下一行backtrack_bit(n, row + 1, cols_mask | (1ULL << col),diag1_mask | (1ULL << d1), diag2_mask | (1ULL << d2),queens, result);// 回溯,移除当前皇后queens.pop_back();}}
};

and of course it works:

unsigned longlong can be replaced as unsigned long, to save the storge.

class Solution {
public:// 主函数,接收一个整数n,表示棋盘的大小vector<vector<string>> solveNQueens(int n) {vector<vector<string>> result; // 用于存储所有可能的解vector<int> queens; // 用于存储当前放置皇后的列位置// 从第0行开始回溯backtrack_bit(n, 0, 0, 0, 0, queens, result);return result; // 返回所有可能的解}private:// 回溯函数,参数包括棋盘大小n,当前行row,以及三个掩码void backtrack_bit(int n, int row, unsigned long cols_mask,unsigned long diag1_mask, unsigned long diag2_mask,vector<int>& queens, vector<vector<string>>& result) {// 如果到达最后一行,说明找到了一个解if (row == n) {// 生成棋盘的字符串表示vector<string> board;for (int i = 0; i < n; i++) {string row_str(n, '.'); // 初始化一行,全部为'.'row_str[queens[i]] = 'Q'; // 在皇后的位置放置'Q'board.push_back(row_str); // 将这一行添加到棋盘表示中}result.push_back(board); // 将整个棋盘添加到结果中return;}// 尝试在当前行的每一列放置皇后for (int col = 0; col < n; col++) {int d1 = row - col + (n - 1); // 对角线1的索引int d2 = row + col; // 对角线2的索引// 检查当前位置是否安全if ((cols_mask & (1UL << col)) ||(diag1_mask & (1UL << d1)) ||(diag2_mask & (1UL << d2))) {continue; // 如果不安全,跳过这一列}// 在当前位置放置皇后queens.push_back(col);// 递归到下一行backtrack_bit(n, row + 1, cols_mask | (1UL << col),diag1_mask | (1UL << d1), diag2_mask | (1UL << d2),queens, result);// 回溯,移除当前皇后queens.pop_back();}}
};

 and here is the magic:

 consume memory ranges from 11.96 to 12.15. 

reverse upgrading, sad.

anyway 

wish me have a good weekend.

相关文章:

数组 - 八皇后 - 困难

************* C topic: 面试题 08.12. 八皇后 - 力扣&#xff08;LeetCode&#xff09; ************* Good morning, gays, Fridary angin and try the hard to celebrate. Inspect the topic: This topic I can understand it in a second. And I do rethink a movie, …...

【分布式】Redis分布式缓存

一、什么是Redis分布式缓存 Redis分布式缓存是指使用Redis作为缓存系统来存储和管理数据的分布式方案。在分布式系统中&#xff0c;多台服务器共同对外提供服务&#xff0c;为了提高系统的性能和可扩展性&#xff0c;通常会引入缓存来减轻数据库的压力。Redis作为一种高性能的…...

Ubuntu——extrepo添加部分外部软件源

extrepo 是一个用于 Ubuntu 和其他基于 Debian 的系统的工具&#xff0c;它的主要作用是简化和管理外部软件源&#xff08;repositories&#xff09;的添加和更新。通过使用 extrepo&#xff0c;用户可以方便地添加、删除和管理第三方软件源&#xff0c;而不需要手动编辑源列表…...

评估大语言模型(LLM)在分子预测任务能够理解分子几何形状性能

摘要 论文地址&#xff1a;https://arxiv.org/pdf/2403.05075 近年来&#xff0c;机器学习模型在各个领域越来越受欢迎。学术界和工业界都投入了大量精力来提高机器学习的效率&#xff0c;以期实现人工通用智能&#xff08;AGI&#xff09;。其中&#xff0c;大规模语言模型&a…...

如何查看电脑刷新率

Windows 系统 通过显示设置查看&#xff1a; 右键点击桌面空白处&#xff0c;选择 “显示设置”。在打开的窗口中&#xff0c;找到 “高级显示设置”。点击 “显示适配器属性”。在弹出的窗口中&#xff0c;选择 “监视器” 选项卡&#xff0c;即可看到当前的屏幕刷新率。使用 …...

mysql集群MHA方式部署

1. 基本信息 部署机器角色部署路径192.168.242.71MySQL-Mater MHA-NodeMySQL: /alidata1/mysql-8.0.28192.168.242.72MySQL-Slave MHA-NodeMHA-Node: /alidata1/admin/tools/mha4mysql-node-0.58192.168.242.73MySQL-Slave MHA-Node192.168.242.74MHA-ManagerMHA-Manager: …...

第十七章 使用 MariaDB 数据库管理系统

1. 数据库管理系统 数据库是指按照某些特定结构来存储数据资料的数据仓库。在当今这个大数据技术迅速崛起的年代&#xff0c;互联网上每天都会生成海量的数据信息&#xff0c;数据库技术也从最初只能存储简单的表格数据的单一集中存储模式&#xff0c;发展到了现如今存储海量…...

rabbitmq 安装延时队列插件rabbitmq_delayer_message_exchange(linux centOS 7)

1.插件版本 插件地址&#xff1a;Community Plugins | RabbitMQ rabbitmq插件需要对应的版本&#xff0c;根据插件地址找到插件 rabbitmq_delayer_message_exchange 点击Releases 因为我rabbitmq客户端显示的版本是&#xff1a; 所以我选择插件版本是&#xff1a; 下载 .ez文…...

Unity性能优化---动态网格组合(一)

网格组合是将 Unity 中的多个对象组合为一个对象的技术。因此&#xff0c;在多物体的场景中&#xff0c;使用网格组合&#xff0c;会有效的减少小网格的数量&#xff0c;最终将得到一个包含许多小网格的大网格游戏对象&#xff0c;这将提高游戏或模拟器的性能。在Unity 的 “St…...

Appium:安装uiautomator2失败

目录 1、通过nmp安装uiautomator2&#xff1a;失败 2、通过 Appium 的平台直接安装驱动程序 3、通过pip 来安装 uiautomator2 1、通过nmp安装uiautomator2&#xff1a;失败 我先是通过npm安装的uiautomator2&#xff0c;也显示已经安装成功了&#xff1a; npm install -g …...

电子信息工程自动化 单片机彩灯控制

摘要 随着社会经济和科学技术的不断进步&#xff0c;人们在保持发展的同时&#xff0c;环境带给人类的影响已经不足以让我们忽视&#xff0c;所以城市的美化问题慢慢的进入了人们的眼帘&#xff0c;PLC的产生给带电子产品带来了巨大变革&#xff0c;彩灯的使用在城市的美化中变…...

word poi-tl 表格功能增强,实现表格功能垂直合并

目录 问题解决问题poi-tl介绍 功能实现引入依赖模版代码效果图 附加&#xff08;插件实现&#xff09;MergeColumnData 对象MergeGroupData 类ServerMergeTableData 数据信息ServerMergeTablePolicy 合并插件 问题 由于在开发功能需求中&#xff0c;word文档需要垂直合并表格&…...

LSTM-CNN-BP-RF-SVM五模型咖喱融合策略混合预测模型

目录 效果一览基本介绍程序设计参考资料 效果一览 基本介绍 LSTM-CNN-BP-RF-SVM五模型咖喱融合策略混合预测模型 Matlab代码注释清晰。 程序设计 完整程序和数据获取方式&#xff1a;私信博主回复LSTM-CNN-BP-RF-SVM五模型咖喱融合策略混合预测模型&#xff08;Matlab&#…...

《鸿蒙开发-答案之书》 怎么设置Json字段的别名

《鸿蒙开发-答案之书》 怎么设置Json字段的别名 Android设置别名用的是SerializedName(“msg”)&#xff0c;那鸿蒙用的是啥&#xff0c;有点懵不知道。 鸿蒙得引入第三方库&#xff1a;ohpm install class-transformer 然后用Expose({ name: ‘first-name’ }) 示例代码&…...

ftp服务器搭建-安装、配置及验证

ftp服务器搭建-安装、配置及验证 #安装 sudo apt-get install vsftpd #配置文件 cat > /etc/vsftpd.conf << "EOF" listenNO listen_ipv6YES anonymous_enableNO local_enableYES write_enableYES dirmessage_enableYES use_localtimeYES xferlog_enable…...

鸿蒙应用获取wifi连接的ip地址(官方文档获取的格式转换成192.168.1.xxx格式)

目录 一.背景 二.官网流程 wifiManager.getLinkedInfo9+ 三.转换成192.168.xxx.xxx格式 一.背景 本次来学习如何获取到鸿蒙设备连接wifi后的ip地址,由于官网文档中获取的ip地址和我们平时看到的192:168:xxx:xxx有所不同,需要进行下转换,所以记录下,如下的流程是在OpenH…...

c++数据结构算法复习基础--11--高级排序算法-快速排序-归并排序-堆排序

高阶排序 1、快速排序 冒泡排序的升级算法 每次选择一个基准数&#xff0c;把小于基准数的放到基准数的左边&#xff0c;把大于基准数的放到基准数的右边&#xff0c;采用 “ 分治算法 ”处理剩余元素&#xff0c;直到整个序列变为有序序列。 最好和平均的复杂度&#xff1a…...

人工智能学习路线详细规划

一、引言 在当今科技飞速发展的时代&#xff0c;人工智能已成为引领未来的关键技术之一。无论是为了追求职业发展的新机遇&#xff0c;还是出于对这一前沿领域的浓厚兴趣&#xff0c;深入学习人工智能都是一个极具价值的选择。本文将为大家精心规划一条人工智能学习路线&#…...

深度学习之视觉处理

CNN 视觉处理三大任务&#xff1a;分类、目标检测、图像分割上游&#xff1a;提取特征&#xff0c;CNN下游&#xff1a;分类、目标、分割等&#xff0c;具体的任务 概述 卷积神经网络是深度学习在计算机视觉领域的突破性成果。在计算机视觉领域, 往往我们输入的图像都很大&am…...

遇到问题:hive中的数据库和sparksql 操作的数据库不是同一个。

遇到的问题&#xff1a; 1、hive中的数据库和sparksql 操作的数据库不同步。 观察上面的数据库看是否同步 &#xff01;&#xff01;&#xff01; 2、查询服务器中MySQL中hive的数据库&#xff0c;发现创建的位置没有在hdfs上&#xff0c;而是在本地。 这个错误产生的原因是&…...

Spring Boot与Spring Security集成:前后分离认证流程的优化实践

在当前的Web开发领域&#xff0c;前后分离架构已经成为一种流行趋势。这种架构将前端和后端进行解耦&#xff0c;前端负责用户界面和交互逻辑&#xff0c;后端则负责数据处理和业务逻辑。在前后分离的项目中&#xff0c;如何安全、高效地实现用户认证是一个关键问题。本文将深入…...

设计模式——Chain(责任链)设计模式

摘要 责任链设计模式是一种行为设计模式&#xff0c;通过链式调用将请求逐一传递给一系列处理器&#xff0c;直到某个处理器处理了请求或所有处理器都未能处理。它解耦了请求的发送者和接收者&#xff0c;允许动态地将请求处理职责分配给多个对象&#xff0c;支持请求的灵活传…...

HarmonyOS(63) ArkUI 自定义占位组件NodeContainer

NodeContainer 1、前言2、NodeContainer和NodeController3、示例代码3.1、创建@Builder3.2、 创建NodeController3.3、 使用NodeCtroller4、NodeContainer的作用5、FrameNode简介6、BuilderNode简介7、参考资料1、前言 在HarmonyOS(62) ArkUI @Reusable组件复用原理讲了组件复…...

Python深度强化学习对冲策略:衍生品投资组合套期保值Black-Scholes、Heston模型分析...

全文链接&#xff1a;https://tecdat.cn/?p38463 本文提出了一个在存在交易成本、市场冲击、流动性约束或风险限制等市场摩擦的情况下&#xff0c;使用现代深度强化学习方法对衍生品投资组合进行套期保值的框架。我们讨论了标准强化学习方法如何应用于非线性奖励结构&#xff…...

【opencv入门教程】2. Point()类用法

文章选自&#xff1a; void Samples::PointFunc() {//输入二维点Point2f point2f(6, 2);cout << "【2维点】p " << point2f << ";\n" << endl;// 输入三维点Point3f point3f(8, 2, 0);cout << "【3维点】p3f "…...

前端导出excel实战(xlsx库和exceljs库)

一. 概览 前端导出excel是比较常见的需求&#xff0c;比如下载excel模板和批量导出excel。目前比较常用的库有xlsx和excel&#xff0c;接下来就着两种方式进行梳理。 二. 下载模板 xlsx库实现&#xff1a; 示例核心代码如下&#xff1a; const excelColumn {details: {ma…...

【附源码】基于环信鸿蒙IM SDK实现一个聊天Demo

项目背景 本项目基于环信IM 鸿蒙SDK 打造的鸿蒙IM Demo&#xff0c;完全适配HarmonyOS NEXT系统&#xff0c;实现了发送消息&#xff0c;添加好友等基础功能。代码开源&#xff0c;功能简洁&#xff0c;如果您有类似开发需求可以参考。 源码地址&#xff1a;https://github.c…...

Python库常用函数-数据分析

Python库常用函数 1.pandas库 &#xff08;1&#xff09;数据读取与写入 读取 CSV 文件&#xff1a; data pd.read_csv(file.csv)读取 Excel 文件&#xff1a; data pd.read_excel(file.xlsx, sheet_nameSheet1)写入 CSV 文件&#xff1a; data.to_csv(new_file.csv, ind…...

汽车EEA架构:架构的简介

1.架构的定义 汽车领域谈论的架构一词&#xff0c;来源于英文单词Architecture。在《系统架构:复杂系统的产品设计与开发》一书中对架构的定义如下:系统架构是一种概念的具象化&#xff0c;是物理或信息功能到形式元素的分配&#xff0c;是系统之内的元素之间的关系与周边环境…...

渗透测试--数据库攻击

这篇文章瘾小生其实想了很久&#xff0c;到底是放在何处&#xff0c;最终还是想着单拎出来总结&#xff0c;因为数据库攻击对我们而言非常重要&#xff0c;而且内容众多。本篇文章将讲述在各位获取数据库权限的情况下&#xff0c;各个数据库会被如何滥用&#xff0c;以及能够滥…...