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

应用密码学第一次作业(9.23)

一、Please briefly describe the objectives of information and network security,such as confidentiality, integrity, availability , authenticity , and accountability

The objectives of information and network security include:

  1. Confidentiality: Protecting sensitive information from unauthorized access.
  2. Integrity: Ensuring data accuracy and preventing unauthorized modifications.
  3. Availability: Ensuring resources are accessible to authorized users when needed.
  4. Authenticity: Verifying the identities of users and systems to confirm that communications are genuine.
  5. Accountability: Ensuring that user and system actions can be tracked and recorded for auditing and compliance.

二、Please encrypt the message “ Must see you at the fifth teaching building”, by using Playfair cipher with the keyword “GUETT”

Fill the keyword matrix with the rest of letters ,and remove duplicate letters
在这里插入图片描述
Group plain text
Mu st se ey ou at th ef if th te ac hi ng bu il di ng
KT RA QA TX PG GA AF TD MB AF AT UH BN IA CG KM BL IA
在这里插入图片描述
Code examples are given below:

1.#include<iostream>
2.#include<cstring>
3.
4.using namespace std;
5.void encrypt()
6.{
7.    const int N = 100;
8.    char letters[26] = "ABCDEFGHIKLMNOPQRSTUVWXYZ";//用于填充矩阵
9.    int flag[25] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };//字母是否已在矩阵中,与letters数组对应
10.    char ch[5][5];//5X5矩阵
11.    char ch1[N];//密钥
12.    char ch2[N];//明文
13.    char ch4;//无关字符
14.    int len = 'a' - 'A';
15.    cout << "输入密钥:";
16.    cin >> ch1;
17.    int flg = 1;
18.    while (flg == 1)
19.    {
20.        for (int i = 0; i < strlen(ch1); i++)//把所输入的密钥转化为大写字母
21.        {
22.            if (ch1[i] > 'z' || ch1[i] < 'a')
23.            {
24.                cout << "请重新选择操作:" << endl;
25.                flg = 0; break;
26.            }
27.            else
28.                ch1[i] = ch1[i] - len;
29.        }
30.        if (flg == 1)
31.        {
32.            for (int i = 0; i < strlen(ch1); i++)//把密钥中的J都变为I
33.            {
34.                if (ch1[i] == 'J')ch1[i] = 'I';
35.            }
36.            int i = 0; int j = 0;
37.            //把密钥中的字母填入到矩阵中,并把该字母标记为已用
38.            for (int k = 0; k < strlen(ch1); k++)
39.            {
40.                for (int t = 0; t < 25; t++)
41.                {
42.                    if (ch1[k] == letters[t] && flag[t] == 0)
43.                    {
44.                        ch[i][j] = letters[t];
45.                        flag[t] = 1;
46.                        if (j < 4)j++;
47.                        else { i++; j = 0; }
48.                    }
49.                }
50.            }
51.            for (int k = 0; k < 25; k++)//按字母表顺序把未用字母依次填入到矩阵中
52.            {
53.                if (flag[k] == 0)
54.                {
55.                    ch[i][j] = letters[k];
56.                    flag[k] = 1;
57.                    if (j < 4)j++;
58.                    else { i++; j = 0; }
59.                }
60.            }
61.            cout << "密钥填充后的矩阵为: " << endl;
62.            for (i = 0; i < 5; i++)
63.                for (j = 0; j < 5; j++)
64.                {
65.                    cout << ch[i][j];
66.                    cout << " ";
67.                    if (j == 4)
68.                        cout << endl;
69.                }
70.            cout << endl;
71.            cout << "请输入明文(请输入英文字符):";
72.            cin >> ch2;
73.            cout << "输入一个无关字符:";
74.            cin >> ch4;
75.            if (ch4 >= 'a')
76.                ch4 = ch4 - len;
77.            for (int k = 0; k < strlen(ch2); k++)//把所输入的明文转化为大写字母
78.            {
79.                if (ch2[k] >= 'a')
80.                    ch2[k] = ch2[k] - len;
81.            }
82.            for (int k = 0; k < strlen(ch2); k++)//把明文中的J都变为I
83.            {
84.                if (ch2[k] == 'J')
85.                    ch2[k] = 'I';
86.            }
87.            //为明文添加必要的无关字符以防止同一组的两个字符相同
88.            for (int k = 0; k < strlen(ch2); k += 2)
89.            {
90.                if (ch2[k] == ch2[k + 1])
91.                {
92.                    for (int t = strlen(ch2); t > k; t--)
93.                        ch2[t + 1] = ch2[t];
94.                    ch2[k + 1] = ch4;
95.                }
96.            }
97.            //若明文有奇数个字符,则添加一个无关字符以凑够偶数个
98.            if (strlen(ch2) % 2 != 0)
99.            {
100.                ch2[strlen(ch2) + 1] = ch2[strlen(ch2)];//字符串结尾赋'\0'
101.                ch2[strlen(ch2)] = ch4;//明文串尾插入无关字符
102.            }
103.            cout << "经过处理后的明文为:";
104.            for (int k = 0; k < strlen(ch2); k += 2)
105.                cout << ch2[k] << ch2[k + 1] << " ";
106.            cout << endl;
107.            cout << "其最终长度为:" << strlen(ch2) << endl;
108.            //明文输入并整理完毕///
109.            for (int k = 0; k < strlen(ch2); k += 2)
110.            {
111.                int m1, m2, n1, n2;
112.                for (m1 = 0; m1 <= 4; m1++)
113.                {
114.                    for (n1 = 0; n1 <= 4; n1++)
115.                    {
116.                        if (ch2[k] == ch[m1][n1])break;
117.                    }
118.                    if (ch2[k] == ch[m1][n1])break;
119.                }
120.                for (m2 = 0; m2 <= 4; m2++)
121.                {
122.                    for (n2 = 0; n2 <= 4; n2++)
123.                    {
124.                        if (ch2[k + 1] == ch[m2][n2])break;
125.                    }
126.                    if (ch2[k + 1] == ch[m2][n2])break;
127.                }
128.                m1 = m1 % 5;
129.                m2 = m2 % 5;
130.                if (n1 > 4) { n1 = n1 % 5; m1 = m1 + 1; }
131.                if (n2 > 4) { n2 = n2 % 5; m2 = m2 + 1; }
132.                if (m1 == m2)
133.                {
134.                    ch2[k] = ch[m1][(n1 + 1) % 5];
135.                    ch2[k + 1] = ch[m2][(n2 + 1) % 5];
136.                }
137.                else
138.                {
139.                    if (n1 == n2)
140.                    {
141.                        ch2[k] = ch[(m1 + 1) % 5][n1];
142.                        ch2[k + 1] = ch[(m2 + 1) % 5][n2];
143.                    }
144.                    else
145.                    {
146.                        ch2[k] = ch[m1][n2];
147.                        ch2[k + 1] = ch[m2][n1];
148.                    }
149.                }
150.            }
151.            cout << "加密后所得到的密文是:";
152.            for (int k = 0; k < strlen(ch2); k += 2)
153.                cout << ch2[k] << ch2[k + 1] << " ";
154.            cout << endl;
155.        }
156.        else break;
157.    }
158.
159.}
160.
161.//解密算法
162.void decrypt()
163.{
164.    const int N = 100;
165.    char letters[26] = "ABCDEFGHIKLMNOPQRSTUVWXYZ";//用于填充矩阵
166.    int flag[25] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
167.    //标记字母是否已在矩阵中,与letters数组对应
168.    char ch[5][5];//5X5矩阵
169.    char ch1[N];//密钥
170.    char ch2[N];//密文
171.    int len = 'a' - 'A';
172.    int flg = 1;
173.    cout << "输入密钥:";
174.    cin >> ch1;
175.    while (flg == 1)
176.    {
177.        for (int i = 0; i < strlen(ch1); i++)//把所输入的密钥转化为大写字母
178.        {
179.            if (ch1[i] > 'z' || ch1[i] < 'a')
180.            {
181.                cout << "请重新选择操作:" << endl;
182.                flg = 0; break;
183.            }
184.            else
185.                ch1[i] = ch1[i] - len;
186.        }
187.        if (flg == 1)
188.        {
189.            for (int i = 0; i < strlen(ch1); i++)//把密钥中的J都变为I        
190.            {
191.                if (ch1[i] == 'J')ch1[i] = 'I';
192.            }
193.            int i = 0; int j = 0;
194.            //把密钥中的字母填入到矩阵中,并把该字母标记为已用
195.            for (int k = 0; k < strlen(ch1); k++)
196.            {
197.                for (int t = 0; t < 25; t++)
198.                {
199.                    if (ch1[k] == letters[t] && flag[t] == 0)
200.                    {
201.                        ch[i][j] = letters[t];
202.                        flag[t] = 1;
203.                        if (j < 4)j++;
204.                        else { i++; j = 0; }
205.                    }
206.                }
207.            }
208.            for (int k = 0; k < 25; k++)//按字母表顺序把未用字母依次填入到矩阵中
209.            {
210.                if (flag[k] == 0)
211.                {
212.                    ch[i][j] = letters[k];
213.                    flag[k] = 1;
214.                    if (j < 4)j++;
215.                    else { i++; j = 0; }
216.                }
217.            }
218.            cout << "密钥填充后的矩阵为: " << endl;
219.            for (i = 0; i < 5; i++)
220.
221.                for (j = 0; j < 5; j++)
222.                {
223.                    cout << ch[i][j];
224.                    cout << " ";
225.                    if (j == 4)
226.                        cout << endl;
227.                }
228.            cout << endl;
229.            // 矩阵生成完毕
230.            int f = 0;
231.            do {
232.                cout << "请输入密文(英文字符):";
233.                cin >> ch2;
234.                for (int k = 0; k < strlen(ch2); k++)//把所输入的密文转化为大写字母
235.                {
236.                    if (ch2[k] >= 'a')
237.                        ch2[k] = ch2[k] - len;
238.                }
239.                for (int k = 0; k < strlen(ch2); k++)//把密文中的J都变为I
240.                {
241.                    if (ch2[k] == 'J')ch2[k] = 'I';
242.                }
243.                for (int k = 0; k < strlen(ch2); k += 2)
244.                {
245.                    if (ch2[k] == ch2[k + 1])
246.                    {
247.                        cout << "同一分组中不能出现相同字符!请重新输入。" << endl;
248.                        f = 1;
249.                        break;
250.                    }
251.                    else f = 2;
252.                }
253.                if (f == 1)continue;
254.                if (strlen(ch2) % 2 != 0)
255.                {
256.                    cout << "字符串不能为奇数个!请重新输入。" << endl;
257.                    f = 1;
258.                }
259.                else f = 2;
260.            } while (f == 1);
261.            //解密开始
262.            for (int k = 0; k < strlen(ch2); k += 2)
263.            {
264.                int m1, m2, n1, n2;
265.                for (m1 = 0; m1 <= 4; m1++)
266.                {
267.                    for (n1 = 0; n1 <= 4; n1++)
268.                    {
269.                        if (ch2[k] == ch[m1][n1])break;
270.                    }
271.                    if (ch2[k] == ch[m1][n1])break;
272.                }
273.                for (m2 = 0; m2 <= 4; m2++)
274.                {
275.                    for (n2 = 0; n2 <= 4; n2++)
276.                    {
277.                        if (ch2[k + 1] == ch[m2][n2])break;
278.                    }
279.                    if (ch2[k + 1] == ch[m2][n2])break;
280.                }
281.                m1 = m1 % 5;
282.                m2 = m2 % 5;
283.                if (n1 > 4) { n1 = n1 % 5; m1 = m1 + 1; }
284.                if (n2 > 4) { n2 = n2 % 5; m2 = m2 + 1; }
285.                if (m1 == m2)
286.                {
287.                    ch2[k] = ch[m1][(n1 + 4) % 5];
288.                    ch2[k + 1] = ch[m2][(n2 + 4) % 5];
289.                }
290.                else
291.                {
292.                    if (n1 == n2)
293.                    {
294.                        ch2[k] = ch[(m1 + 4) % 5][n1];
295.                        ch2[k + 1] = ch[(m2 + 4) % 5][n2];
296.                    }
297.                    else
298.                    {
299.                        ch2[k] = ch[m1][n2];
300.                        ch2[k + 1] = ch[m2][n1];
301.                    }
302.                }
303.            }
304.            cout << "解密后所得到的明文是:";
305.            for (int k = 0; k < strlen(ch2); k += 2)
306.                cout << ch2[k] << ch2[k + 1] << " ";
307.            cout << endl;
308.        }
309.        else break;
310.    }
311.
312.}
313.
314.int main()
315.{
316.
317.    int n;
318.    cout << "请选择1加密2解密:" << endl;
319.    while (true)
320.    {
321.        cin >> n;
322.        switch (n)
323.        {
324.        case 1:
325.            encrypt();
326.            break;
327.        case 2:
328.            decrypt();
329.            break;
330.        default:
331.            break;
332.        }
333.    }
334.    return 0;
335.}
336.

三、Given the plain text{000102030405060708090A0B0C0D0E0F} and the key {010101010101010101010101010101011}:

a. Show the original contents of State, displayed as a 4 x 4 matrix.
00 01 02 03
04 05 06 07
08 09 0A 0B
0C 0D 0E 0F
b. Show the value of State after initial AddRoundKey.
01 00 03 02
05 04 07 06
09 08 0B 0A
0D 0C 0F 0E
c. Show the value of State after SubBytes.
7C 63 7B 77
6B F2 C5 6F
01 30 2B 67
D7 FE 76 AB

d. Show the value of State after ShiftRows.
7C 63 7B 77
F2 C5 6F 6B
2B 67 01 30
AB D7 FE 76
e. Show the value of State after MixColumns.
95 A2 B8 15
B5 0C 58 87
7E AA EF E6
50 12 E4 2E

#include<iostream>
1.using namespace std;
2.int StateMatrix[4][4];  // 状态矩阵
3.#define SIZE_M  4
4.#define SIZE_N 4
5.
6.int muti(int hex1, int hex2) {
7.
8. switch (hex1) {
9. case 0x01:
10.  return hex2;
11. case 0x02:
12.  if (hex2 >= 0x80) {
13.   hex2 = hex2 << 1;
14.   hex2 = hex2 % 32;
15.   hex2 ^= 0x1b;
16.  }
17.
18.  else {
19.   hex2 = hex2 << 1;
20.   //hex2 = hex2 %16;
21.  }
22.
23.  return hex2;
24. case 0x03:
25.  return muti(0x01, hex2) ^ muti(0x02, hex2);
26.
27. }
28. printf("出错啦!");
29. return -1;
30.
31.}
32.
33.int main() {
34.
35. //int matrix_a[SIZE_M][SIZE_N] = { {0x02,0x03,0x01,0x01},{0x01,0x02,0x03,0x01},{0x01,0x01,0x02,0x03},{0x03,0x01,0x01,0x02} };//a
36. //int matrix_b[SIZE_N][SIZE_S] = { {0x7C,0x63,0x7B,0x77},{0xF2,0xC5,0x6F,0x6B},{0x2B,0x67,0x01,0x30},{0xAB,0xD7,0xFE,0x76 } };//b
37.
38.
39. int input[SIZE_M][SIZE_N]= { {0x7C,0x63,0x7B,0x77},{0xF2,0xC5,0x6F,0x6B},{0x2B,0x67,0x01,0x30},{0xAB,0xD7,0xFE,0x76 } };
40.
41.
42.
43. for (int i = 0; i < 4; i++)
44.
45.
46.  for (int j = 0; j < 4; j++) {
47.
48.   StateMatrix[i][j] = input[i][j];
49.
50.  }
51.
52.
53. int d0, d1, d2, d3;
54.
55. for (int i = 0; i < 4; i++) {
56.
57.  d0 = muti(0x02, StateMatrix[0][i]) ^ muti(0x03, StateMatrix[1][i]);
58.
59.  d0 ^= muti(0x01, StateMatrix[2][i]) ^ muti(0x01, StateMatrix[3][i]);
60.
61.  d1 = muti(0x01, StateMatrix[0][i]) ^ muti(0x02, StateMatrix[1][i]);
62.
63.
64.  d1 ^= muti(0x03, StateMatrix[2][i]) ^ muti(0x01, StateMatrix[3][i]);
65.
66.
67.  d2 = muti(0x01, StateMatrix[0][i]) ^ muti(0x01, StateMatrix[1][i]);
68.
69.  d2 ^= muti(0x02, StateMatrix[2][i]) ^ muti(0x03, StateMatrix[3][i]);
70.
71.
72.  d3 = muti(0x03, StateMatrix[0][i]) ^ muti(0x01, StateMatrix[1][i]);
73.
74.
75.  d3 ^= muti(0x01, StateMatrix[2][i]) ^ muti(0x02, StateMatrix[3][i]);
76.
77.
78.  printf("第%d列的结果是:\n%x %x %x %x\n", i, d0, d1, d2, d3);
79.
80.  StateMatrix[0][i] = d0;
81.
82.  StateMatrix[1][i] = d1;
83.
84.  StateMatrix[2][i] = d2;
85.
86.  StateMatrix[3][i] = d3;
87.
88. }
89.
90. return 0;
91.
92.}
93.

在这里插入图片描述
四、Compute the output of the MixColumns transformation for the following sequence of input bytes “67 89 AB CD.” Apply the InvMixColumns transformation to the obtained result to verify your calculations. Change the first byte of the input from “67” to “77" perform the MixColumns transformation again for the new input, and determine how many bits have changed in the output.
Note: You can perform all calculations by hand or write a program supporting these computations. If you choose to write a program, it should be written entirely by you;no use of libraries or public domain source code is allowed in this assignment.
28 05 2F 8A
在这里插入图片描述
08 15 3F BA
在这里插入图片描述

相关文章:

应用密码学第一次作业(9.23)

一、Please briefly describe the objectives of information and network security,such as confidentiality, integrity, availability , authenticity , and accountability The objectives of information and network security include: Confidentiality: Protecting se…...

JSON合并工具

JSON合并工具 1. 项目概述 本项目旨在开发一个强大而灵活的JSON合并工具&#xff0c;能够合并多个JSON文件&#xff0c;处理复杂的嵌套结构&#xff0c;提供详细的合并报告&#xff0c;并实现全面的验证和错误处理机制。 2. 功能需求 2.1 基本合并功能 支持合并两个或多个…...

【网络编程】网页的显示过程

文章目录 1.URL 解析2.DNS 解析3.TCP三次握手4.服务器接收请求5.客户端接收响应 首先我们知道网页经过网络总共有应用层&#xff0c;传输层&#xff0c;网络层&#xff0c;数据链路层&#xff0c;物理层 1.URL 解析 将获得的网址解析出协议&#xff0c;主机名&#xff0c;域名…...

用nginx-rtmp-win32-master及ffmpeg模拟rtmp视频流

效果 使用nginx-rtmp-win32-master搭建RTMP服务 双击exe就可以了。切记整个目录不能有中文 README.md ,启用后本地的RTM路径: rtmp://192.168.1.186/live/xxx ffmpeg将地本地视频推RMTP F:\rtsp\ffmpeg-7.0.2-essentials_build\bin>ffmpeg -re -i F:\rtsp\123.mp4 -c c…...

使用python-pptx将PPT转换为图片:将每张幻灯片保存为单独的图片文件

哈喽,大家好,我是木头左! 本文将详细介绍如何使用python-pptx将PPT的每一张幻灯片保存为单独的图片文件。 安装python-pptx库 需要确保已经安装了python-pptx库。可以通过以下命令使用pip进行安装: pip install python-pptx导入所需库 接下来,需要导入一些必要的库,包…...

聊聊企业的低代码实践背景与成效

数字化转型的道路充满挑战是大家的普遍共识&#xff0c;许多企业仍未完全步入数字化的行列&#xff0c;它们面临的是系统的碎片化和操作的复杂性。在数字优先的今天&#xff0c;企业要想维持竞争力&#xff0c;比任何时期都更需要实施某种程度的数字化升级。如果一个组织难以提…...

zookeeper面试题

1. 什么是zookeeper zookeeper是一个开源的 分布式协调服务。他是一个为分布式应用提供一致性服务的软件&#xff0c;分布式应用程序可以基于Zookeeper实现诸如数据发布/订阅、负载均衡、命名服务、分布式协调/通知、集群管理、Master选举、分布式锁和分布式队列等功能。 Zooke…...

Linux学习笔记13---GPIO 中断实验

中断系统是一个处理器重要的组成部分&#xff0c;中断系统极大的提高了 CPU 的执行效率&#xff0c;本章会将 I.MX6U 的一个 IO 作为输入中断&#xff0c;借此来讲解如何对 I.MX6U 的中断系统进行编程。 GIC 控制器简介 1、GIC 控制器总览 I.MX6U(Cortex-A)的中断控制器…...

[Redis][Hash]详细讲解

目录 0.前言1.常见命令1.HSET2.HGET3.HEXISTS4.HDEL5.HKEYS6.HVALS7.HGETALL8.HMGET9.HLEN10.HSETNX11.HINCRBY12.HINCRBYFLOAT 2.内部编码1.ziplist(压缩链表)2.hashtable(哈希表) 3.使用场景4.缓存方式对比1.原⽣字符串类型2.序列化字符串类型3.哈希类型 0.前言 在Redis中&am…...

上半年亏损扩大/百亿资产重组终止,路畅科技如何“脱困”?

在智能网联汽车市场形势一片大好的前提下&#xff0c;路畅科技上半年的营收却出现了下滑&#xff0c;并且亏损也进一步扩大。 2024年半年度报告显示&#xff0c;路畅科技营业收入1.35亿元&#xff0c;同比下滑7.83%&#xff1b;实现归属上市公司股东的净利润为亏损2491.99万元…...

协议IP规定,576字节和1500字节的区别

576字节和1500字节的区别主要在于它们是IP数据报在数据链路层中的最大传输单元&#xff08;MTU&#xff09;的不同限制。‌ ‌576字节‌&#xff1a;这个数值通常与IP层&#xff08;网络层&#xff09;的数据报有关&#xff0c;它指的是在不进行分片的情况下&#xff0c;IP数据…...

对抗攻击的详细解析:原理、方法与挑战

对抗攻击的详细解析&#xff1a;原理、方法与挑战 对抗攻击&#xff08;Adversarial Attack&#xff09;是现代机器学习模型&#xff0c;尤其是深度学习模型中的一个关键安全问题。其本质在于&#xff0c;通过对输入数据添加精微的扰动&#xff0c;人类难以察觉这些扰动&#…...

Python办公自动化教程(003):PDF的加密

【1】代码 from PyPDF2 import PdfReader, PdfWriter# 读取PDF文件 pdf_reader PdfReader(./file/Python教程_1.pdf) pdf_writer PdfWriter()# 对第1页进行加密 page pdf_reader.pages[0]pdf_writer.add_page(page) # 设置密码 pdf_writer.encrypt(3535)with open(./file/P…...

python全栈学习记录(十七)logging、json与pickle、time与datatime、random

logging、json与pickle、time与datatime、random 文章目录 logging、json与pickle、time与datatime、random一、logging二.json与pickle三.time与datatime四.random 一、logging logging模块用来记录日志信息。 import logging # 进行基本的日志配置 logging.basicConfig( fi…...

【艾思科蓝】JavaScript在数据可视化领域的探索与实践

【ACM出版 | EI快检索 | 高录用】2024年智能医疗与可穿戴智能设备国际学术会议&#xff08;SHWID 2024&#xff09;_艾思科蓝_学术一站式服务平台 更多学术会议请看 学术会议-学术交流征稿-学术会议在线-艾思科蓝 目录 引言 JavaScript可视化库概览 D3.js基础入门 1. 引入…...

【标准库的典型内容】std::declval

一、 d e c l v a l declval declval的基本概念和常规范例 s t d : : d e c l v a l std::declval std::declval 是 C 11 C11 C11标准中出现的一个函数模板。这个函数模板设计的比较奇怪&#xff08;没有实现&#xff0c;只有声明&#xff09;&#xff0c;因此无法被调用&…...

深入了解package.json文件

在前端项目开发中&#xff0c;我们经常会遇到package.json文件。这个文件不仅是一个简单的配置文件&#xff0c;它还承担了项目管理的重任。下面&#xff0c;我们将深入探讨package.json文件的各个字段和作用&#xff0c;并通过实例来帮助你更好地理解和使用它。 package.json…...

【基础知识】网络套接字编程

套接字 IP地址 port&#xff08;端口号&#xff09; socket&#xff08;套接字&#xff09; socket常见API //创建套接字 int socket(int domain, int type, int protocol); //绑定端口 int bind(int sockfd, const struct sockaddr *addr, socklen_t addrlen); //监听套接字…...

小程序地图展示poi帖子点击可跳转

小程序地图展示poi帖子点击可跳转 是类似于小红书地图功能的需求 缺点 一个帖子只能有一个点击事件&#xff0c;不适合太复杂的功能&#xff0c;因为一个markers只有一个回调回调中只有markerId可以使用。 需求介绍 页面有地图入口&#xff0c;点开可打开地图界面地图上展…...

传统到AI 大数据分析的演变,颠覆智慧水电的未来?

传统到AI 大数据分析的演变&#xff0c;颠覆智慧水电的未来&#xff1f; 前言传统到AI 大数据分析的演变 前言 水电作为一种重要的能源形式&#xff0c;一直在我们的生活中扮演着至关重要的角色。而如今&#xff0c;随着科技的飞速发展&#xff0c;智慧水电和 AI 大数据应用的…...

浅谈 React Hooks

React Hooks 是 React 16.8 引入的一组 API&#xff0c;用于在函数组件中使用 state 和其他 React 特性&#xff08;例如生命周期方法、context 等&#xff09;。Hooks 通过简洁的函数接口&#xff0c;解决了状态与 UI 的高度解耦&#xff0c;通过函数式编程范式实现更灵活 Rea…...

变量 varablie 声明- Rust 变量 let mut 声明与 C/C++ 变量声明对比分析

一、变量声明设计&#xff1a;let 与 mut 的哲学解析 Rust 采用 let 声明变量并通过 mut 显式标记可变性&#xff0c;这种设计体现了语言的核心哲学。以下是深度解析&#xff1a; 1.1 设计理念剖析 安全优先原则&#xff1a;默认不可变强制开发者明确声明意图 let x 5; …...

云计算——弹性云计算器(ECS)

弹性云服务器&#xff1a;ECS 概述 云计算重构了ICT系统&#xff0c;云计算平台厂商推出使得厂家能够主要关注应用管理而非平台管理的云平台&#xff0c;包含如下主要概念。 ECS&#xff08;Elastic Cloud Server&#xff09;&#xff1a;即弹性云服务器&#xff0c;是云计算…...

遍历 Map 类型集合的方法汇总

1 方法一 先用方法 keySet() 获取集合中的所有键。再通过 gey(key) 方法用对应键获取值 import java.util.HashMap; import java.util.Set;public class Test {public static void main(String[] args) {HashMap hashMap new HashMap();hashMap.put("语文",99);has…...

(二)TensorRT-LLM | 模型导出(v0.20.0rc3)

0. 概述 上一节 对安装和使用有个基本介绍。根据这个 issue 的描述&#xff0c;后续 TensorRT-LLM 团队可能更专注于更新和维护 pytorch backend。但 tensorrt backend 作为先前一直开发的工作&#xff0c;其中包含了大量可以学习的地方。本文主要看看它导出模型的部分&#x…...

STM32标准库-DMA直接存储器存取

文章目录 一、DMA1.1简介1.2存储器映像1.3DMA框图1.4DMA基本结构1.5DMA请求1.6数据宽度与对齐1.7数据转运DMA1.8ADC扫描模式DMA 二、数据转运DMA2.1接线图2.2代码2.3相关API 一、DMA 1.1简介 DMA&#xff08;Direct Memory Access&#xff09;直接存储器存取 DMA可以提供外设…...

JDK 17 新特性

#JDK 17 新特性 /**************** 文本块 *****************/ python/scala中早就支持&#xff0c;不稀奇 String json “”" { “name”: “Java”, “version”: 17 } “”"; /**************** Switch 语句 -> 表达式 *****************/ 挺好的&#xff…...

JVM暂停(Stop-The-World,STW)的原因分类及对应排查方案

JVM暂停(Stop-The-World,STW)的完整原因分类及对应排查方案,结合JVM运行机制和常见故障场景整理而成: 一、GC相关暂停​​ 1. ​​安全点(Safepoint)阻塞​​ ​​现象​​:JVM暂停但无GC日志,日志显示No GCs detected。​​原因​​:JVM等待所有线程进入安全点(如…...

React---day11

14.4 react-redux第三方库 提供connect、thunk之类的函数 以获取一个banner数据为例子 store&#xff1a; 我们在使用异步的时候理应是要使用中间件的&#xff0c;但是configureStore 已经自动集成了 redux-thunk&#xff0c;注意action里面要返回函数 import { configureS…...

C++使用 new 来创建动态数组

问题&#xff1a; 不能使用变量定义数组大小 原因&#xff1a; 这是因为数组在内存中是连续存储的&#xff0c;编译器需要在编译阶段就确定数组的大小&#xff0c;以便正确地分配内存空间。如果允许使用变量来定义数组的大小&#xff0c;那么编译器就无法在编译时确定数组的大…...