【几何】多少正方形?

题目

多少正方形?
在这里插入图片描述


枚举

设每个横纵相邻点得间距为1,则我们可以依次输出下列边长为 a a a的正方形的数量:

边长为1

a = 1 a=1 a=1
在这里插入图片描述


边长为 2 \sqrt{2} 2

a = 1 2 + 1 2 = 2 a=\sqrt{1^2+1^2}=\sqrt{2} a=12+12 =2
在这里插入图片描述


边长为 5 \sqrt{5} 5

a = 1 2 + 2 2 = 5 a=\sqrt{1^2+2^2}=\sqrt{5} a=12+22 =5
在这里插入图片描述


边长为 8 \sqrt{8} 8

a = 2 2 + 2 2 = 8 a=\sqrt{2^2+2^2}=\sqrt{8} a=22+22 =8

在这里插入图片描述


边长为 13 \sqrt{13} 13

a = 2 2 + 3 2 = 13 a=\sqrt{2^2+3^2}=\sqrt{13} a=22+32 =13
在这里插入图片描述

按上述尺寸数得各个大小正方形数量如下:

{ C 1 = 9 a = 1 C 2 = 4 a = 1 2 + 1 2 = 2 C 3 = 2 a = 1 2 + 2 2 = 5 C 4 = 4 a = 2 2 + 2 2 = 2 2 C 5 = 2 a = 2 2 + 3 2 = 13 \begin{cases} C_1=9 &\text{ } a=1 \\ C_2=4 &\text{ } a=\sqrt{1^2+1^2}=\sqrt{2}\\ C_3=2 &\text{ } a=\sqrt{1^2+2^2}=\sqrt{5}\\ C_4=4 &\text{ } a=\sqrt{2^2+2^2}=2\sqrt{2}\\ C_5=2 &\text{ } a=\sqrt{2^2+3^2}=\sqrt{13} \end{cases} C1=9C2=4C3=2C4=4C5=2 a=1 a=12+12 =2  a=12+22 =5  a=22+22 =22  a=22+32 =13

C = C 1 + C 2 + C 3 + C 4 + C 5 = 9 + 4 + 2 + 4 + 2 = 21 \begin{equation} \begin{split} C&=C_1+C_2+C_3+C_4+C_5 \\ &=9+4+2+4+2 \\ &=21 \end{split} \end{equation} C=C1+C2+C3+C4+C5=9+4+2+4+2=21
在这里插入图片描述

扩展-使用代码来数

1、定义点对象

        /// <summary>/// 点对象/// </summary>public class CPoint{/// <summary>/// 点横坐标/// </summary>public double X { get; set; }/// <summary>/// 点纵坐标/// </summary>public double Y { get; set; }/// <summary>/// 点相对位置角度/// </summary>public double Angle { get; set; }/// <summary>/// 点编号/// </summary>public int Index { get; set; }public CPoint(int index,double x,double y,double a = 0){this.X = x;this.Y = y;this.Index = index;this.Angle = a;}/// <summary>/// 判断两个点是否是同一个点/// </summary>/// <param name="obj"></param>/// <returns></returns>public override bool Equals(object obj){if (obj == null) return false;if (obj.GetType() != typeof(CPoint)) return false;var val =(CPoint) obj;if(this.X == val.X && this.Y == val.Y){return true;}return false;}/// <summary>/// 格式化点对象/// </summary>/// <returns></returns>public override string ToString(){return $"{Index}.({X},{Y}){Angle}";}/// <summary>/// 50倍绘制圆点/// </summary>/// <returns></returns>public RectangleF DrawCircle(){float size = 10;return new RectangleF((float)(X *50 - size / 2), (float)(Y *50 - size / 2), size, size);}/// <summary>/// 50倍绘制点/// </summary>/// <returns></returns>public PointF DrawPnt(){return new PointF((float)(X * 50), (float)(Y * 50));}}

2、定义正方形对象

        /// <summary>/// 正方形对象/// </summary>public class CSqure{/// <summary>/// 正方形的点/// </summary>public List<CPoint> Points { get; set; }/// <summary>/// 正方形边长/// </summary>public double C { get; set; }/// <summary>/// 正方形中心点横坐标/// </summary>public double CenterX { get; set; }/// <summary>/// 正方形中心点纵坐标/// </summary>public double CenterY { get; set; }public CSqure(CPoint pnt1, CPoint pnt2, CPoint pnt3, CPoint pnt4){if (Points == null){Points = new List<CPoint>();}Points.Add(pnt1);Points.Add(pnt2);Points.Add(pnt3);Points.Add(pnt4);}public PointF[] DrawSqure(){return new PointF[4] { Points[0].DrawPnt(), Points[1].DrawPnt(), Points[2].DrawPnt(), Points[3].DrawPnt() };}public PointF DrawCenter(SizeF size){var center = CalculateCenter();var pnt = center.DrawPnt();return new PointF(pnt.X - size.Width / 2, pnt.Y - size.Height / 2);}/// <summary>/// 判断是否正方形/// </summary>/// <returns></returns>public bool IsSqure(){List<double> distances = new List<double>();// Calculate all pairwise distancesfor (int i = 0; i < Points.Count; i++){for (int j = i + 1; j < Points.Count; j++){distances.Add(Distance(Points[i], Points[j]));}}// 将所有点得距离进行排序distances.Sort();// 第一个距离必须大于0,前四个距离依次相等是边,后两个距离是对象线。四边相等且对角线相等为正方形if (distances[0] > 0 && Equal(distances[0], distances[1]) && Equal(distances[1], distances[2]) && Equal(distances[2], distances[3]) &&Equal(distances[4], distances[5])){C = distances[0]; //计算每个点得顺序List<CPoint> polygons = new List<CPoint>();var center = CalculateCenter();CenterX = center.X;CenterY = center.Y;for (int i = 0; i < Points.Count; i++){var angle = CalculateAngle(center, Points[i]);if (angle < 0){angle += 360;}else if (angle >= 360){angle -= 360;}polygons.Add(new CPoint(Points[i].Index, Points[i].X, Points[i].Y, angle));}Points = polygons.OrderBy(o => o.Angle).ToList();return true;}return false;}/// <summary>/// 计算正方形中心点/// </summary>/// <returns></returns>public CPoint CalculateCenter(){double centerX = Points.Average(o => o.X);double centerY = Points.Average(o => o.Y);return new CPoint(0, centerX, centerY);}/// <summary>/// 计算旋转角/// </summary>/// <param name="center"></param>/// <param name="point"></param>/// <returns></returns>public double CalculateAngle(CPoint center, CPoint point){double deltaY = point.Y - center.Y;double deltaX = point.X - center.X;double angleInRadians = Math.Atan2(deltaY, deltaX);double angleInDegrees = angleInRadians * (180.0 / Math.PI);return angleInDegrees;}/// <summary>/// 判断两个距离是否相等/// </summary>/// <param name="d1"></param>/// <param name="d2"></param>/// <returns></returns>public bool Equal(double d1, double d2){if (Math.Abs(d2 - d1) < 0.000001){return true;}return false;}/// <summary>/// 计算两点之间的距离/// </summary>/// <param name="pnt1"></param>/// <param name="pnt2"></param>/// <returns></returns>public double Distance(CPoint pnt1, CPoint pnt2){double a = pnt1.X - pnt2.X;double b = pnt1.Y - pnt2.Y;double c = Math.Sqrt(a * a + b * b);return c;}/// <summary>/// 判断两个正方形是否是同一个正方形/// </summary>/// <param name="obj"></param>/// <returns></returns>public override bool Equals(object obj){if (obj == null) return false;if (obj.GetType() != typeof(CSqure)) return false;var val = (CSqure)obj;if (this.ToString() == obj.ToString()){return true;}return false;}/// <summary>/// 格式化正方形对象/// </summary>/// <returns></returns>public override string ToString(){var temps = Points.OrderBy(o => o.Index);return string.Join("-", temps.Select(o => o.Index));}/// <summary>/// 根据点获取所有正方形/// </summary>/// <param name="Points"></param>/// <returns></returns>public static List<CSqure> GetAllSqures(List<CPoint> Points){List<CSqure> Squres = new List<CSqure>();for (int i = 0; i < Points.Count(); i++){for (int j = 0; j < Points.Count(); j++){for (int k = 0; k < Points.Count(); k++){for (int l = 0; l < Points.Count(); l++){CSqure squre = new CSqure(Points[i], Points[j], Points[k], Points[l]);if (squre.IsSqure())//判断是不是正方形{bool isExist = false;foreach (var item in Squres){if (item.ToString() == squre.ToString()) //判断是不是已经存在{isExist = true;break;}}if (!isExist)//没有找到过则添加到列表{Squres.Add(squre);}}}}}}Squres = Squres.OrderBy(o => o.C).ThenBy(o => o.CenterY).ThenBy(o => o.CenterX).ToList();return Squres;}}

3、初始化所有点

			//Points.Add(new CPoint(index++, 1, 1, 0));//Points.Add(new CPoint(index++, 1, 2, 0));Points.Add(new CPoint(index++, 1, 3, 0));Points.Add(new CPoint(index++, 1, 4, 0));//Points.Add(new CPoint(index++, 1, 5, 0));//Points.Add(new CPoint(index++, 1, 6, 0));//Points.Add(new CPoint(index++, 2, 1, 0));//Points.Add(new CPoint(index++, 2, 2, 0));Points.Add(new CPoint(index++, 2, 3, 0));Points.Add(new CPoint(index++, 2, 4, 0));//Points.Add(new CPoint(index++, 2, 5, 0));//Points.Add(new CPoint(index++, 2, 6, 0));Points.Add(new CPoint(index++, 3, 1, 0));Points.Add(new CPoint(index++, 3, 2, 0));Points.Add(new CPoint(index++, 3, 3, 0));Points.Add(new CPoint(index++, 3, 4, 0));Points.Add(new CPoint(index++, 3, 5, 0));Points.Add(new CPoint(index++, 3, 6, 0));Points.Add(new CPoint(index++, 4, 1, 0));Points.Add(new CPoint(index++, 4, 2, 0));Points.Add(new CPoint(index++, 4, 3, 0));Points.Add(new CPoint(index++, 4, 4, 0));Points.Add(new CPoint(index++, 4, 5, 0));Points.Add(new CPoint(index++, 4, 6, 0));//Points.Add(new CPoint(index++, 5, 1, 0));//Points.Add(new CPoint(index++, 5, 2, 0));Points.Add(new CPoint(index++, 5, 3, 0));Points.Add(new CPoint(index++, 5, 4, 0));//Points.Add(new CPoint(index++, 5, 5, 0));//Points.Add(new CPoint(index++, 5, 6, 0));//Points.Add(new CPoint(index++, 6, 1, 0));//Points.Add(new CPoint(index++, 6, 2, 0));Points.Add(new CPoint(index++, 6, 3, 0));Points.Add(new CPoint(index++, 6, 4, 0));//Points.Add(new CPoint(index++, 6, 5, 0));//Points.Add(new CPoint(index++, 6, 6, 0));

4、调用

public List<CSqure> Squres = CSqure.GetAllSqures(Points);

完整代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;namespace WindowsFormsApp1
{public partial class Form1 : Form{/// <summary>/// 点对象/// </summary>public class CPoint{/// <summary>/// 点横坐标/// </summary>public double X { get; set; }/// <summary>/// 点纵坐标/// </summary>public double Y { get; set; }/// <summary>/// 点相对位置角度/// </summary>public double Angle { get; set; }/// <summary>/// 点编号/// </summary>public int Index { get; set; }public CPoint(int index,double x,double y,double a = 0){this.X = x;this.Y = y;this.Index = index;this.Angle = a;}/// <summary>/// 判断两个点是否是同一个点/// </summary>/// <param name="obj"></param>/// <returns></returns>public override bool Equals(object obj){if (obj == null) return false;if (obj.GetType() != typeof(CPoint)) return false;var val =(CPoint) obj;if(this.X == val.X && this.Y == val.Y){return true;}return false;}/// <summary>/// 格式化点对象/// </summary>/// <returns></returns>public override string ToString(){return $"{Index}.({X},{Y}){Angle}";}/// <summary>/// 50倍绘制圆点/// </summary>/// <returns></returns>public RectangleF DrawCircle(){float size = 10;return new RectangleF((float)(X *50 - size / 2), (float)(Y *50 - size / 2), size, size);}/// <summary>/// 50倍绘制点/// </summary>/// <returns></returns>public PointF DrawPnt(){return new PointF((float)(X * 50), (float)(Y * 50));}}/// <summary>/// 正方形对象/// </summary>public class CSqure{/// <summary>/// 正方形的点/// </summary>public List<CPoint> Points { get; set; }/// <summary>/// 正方形边长/// </summary>public double C { get; set; }/// <summary>/// 正方形中心点横坐标/// </summary>public double CenterX { get; set; }/// <summary>/// 正方形中心点纵坐标/// </summary>public double CenterY { get; set; }public CSqure(CPoint pnt1, CPoint pnt2, CPoint pnt3, CPoint pnt4){if (Points == null){Points = new List<CPoint>();}Points.Add(pnt1);Points.Add(pnt2);Points.Add(pnt3);Points.Add(pnt4);}public PointF[] DrawSqure(){return new PointF[4] { Points[0].DrawPnt(), Points[1].DrawPnt(), Points[2].DrawPnt(), Points[3].DrawPnt() };}public PointF DrawCenter(SizeF size){var center = CalculateCenter();var pnt = center.DrawPnt();return new PointF(pnt.X - size.Width / 2, pnt.Y - size.Height / 2);}/// <summary>/// 判断是否正方形/// </summary>/// <returns></returns>public bool IsSqure(){List<double> distances = new List<double>();// Calculate all pairwise distancesfor (int i = 0; i < Points.Count; i++){for (int j = i + 1; j < Points.Count; j++){distances.Add(Distance(Points[i], Points[j]));}}// 将所有点得距离进行排序distances.Sort();// 第一个距离必须大于0,前四个距离依次相等是边,后两个距离是对象线。四边相等且对角线相等为正方形if (distances[0] > 0 && Equal(distances[0], distances[1]) && Equal(distances[1], distances[2]) && Equal(distances[2], distances[3]) &&Equal(distances[4], distances[5])){C = distances[0]; //计算每个点得顺序List<CPoint> polygons = new List<CPoint>();var center = CalculateCenter();CenterX = center.X;CenterY = center.Y;for (int i = 0; i < Points.Count; i++){var angle = CalculateAngle(center, Points[i]);if (angle < 0){angle += 360;}else if (angle >= 360){angle -= 360;}polygons.Add(new CPoint(Points[i].Index, Points[i].X, Points[i].Y, angle));}Points = polygons.OrderBy(o => o.Angle).ToList();return true;}return false;}/// <summary>/// 计算正方形中心点/// </summary>/// <returns></returns>public CPoint CalculateCenter(){double centerX = Points.Average(o => o.X);double centerY = Points.Average(o => o.Y);return new CPoint(0, centerX, centerY);}/// <summary>/// 计算旋转角/// </summary>/// <param name="center"></param>/// <param name="point"></param>/// <returns></returns>public double CalculateAngle(CPoint center, CPoint point){double deltaY = point.Y - center.Y;double deltaX = point.X - center.X;double angleInRadians = Math.Atan2(deltaY, deltaX);double angleInDegrees = angleInRadians * (180.0 / Math.PI);return angleInDegrees;}/// <summary>/// 判断两个距离是否相等/// </summary>/// <param name="d1"></param>/// <param name="d2"></param>/// <returns></returns>public bool Equal(double d1, double d2){if (Math.Abs(d2 - d1) < 0.000001){return true;}return false;}/// <summary>/// 计算两点之间的距离/// </summary>/// <param name="pnt1"></param>/// <param name="pnt2"></param>/// <returns></returns>public double Distance(CPoint pnt1, CPoint pnt2){double a = pnt1.X - pnt2.X;double b = pnt1.Y - pnt2.Y;double c = Math.Sqrt(a * a + b * b);return c;}/// <summary>/// 判断两个正方形是否是同一个正方形/// </summary>/// <param name="obj"></param>/// <returns></returns>public override bool Equals(object obj){if (obj == null) return false;if (obj.GetType() != typeof(CSqure)) return false;var val = (CSqure)obj;if (this.ToString() == obj.ToString()){return true;}return false;}/// <summary>/// 格式化正方形对象/// </summary>/// <returns></returns>public override string ToString(){var temps = Points.OrderBy(o => o.Index);return string.Join("-", temps.Select(o => o.Index));}/// <summary>/// 根据点获取所有正方形/// </summary>/// <param name="Points"></param>/// <returns></returns>public static List<CSqure> GetAllSqures(List<CPoint> Points){List<CSqure> Squres = new List<CSqure>();for (int i = 0; i < Points.Count(); i++){for (int j = 0; j < Points.Count(); j++){for (int k = 0; k < Points.Count(); k++){for (int l = 0; l < Points.Count(); l++){CSqure squre = new CSqure(Points[i], Points[j], Points[k], Points[l]);if (squre.IsSqure())//判断是不是正方形{bool isExist = false;foreach (var item in Squres){if (item.ToString() == squre.ToString()) //判断是不是已经存在{isExist = true;break;}}if (!isExist)//没有找到过则添加到列表{Squres.Add(squre);}}}}}}Squres = Squres.OrderBy(o => o.C).ThenBy(o => o.CenterY).ThenBy(o => o.CenterX).ToList();return Squres;}}public List<CPoint> Points = new List<CPoint>();public List<CSqure> Squres = new List<CSqure>();Timer timer = new Timer();public Form1(){InitializeComponent();this.DoubleBuffered = true;timer.Tick += Timer_Tick;timer.Interval = 600;timer.Start();int index = 1;//Points.Add(new CPoint(index++, 1, 1, 0));//Points.Add(new CPoint(index++, 1, 2, 0));Points.Add(new CPoint(index++, 1, 3, 0));Points.Add(new CPoint(index++, 1, 4, 0));//Points.Add(new CPoint(index++, 1, 5, 0));//Points.Add(new CPoint(index++, 1, 6, 0));//Points.Add(new CPoint(index++, 2, 1, 0));//Points.Add(new CPoint(index++, 2, 2, 0));Points.Add(new CPoint(index++, 2, 3, 0));Points.Add(new CPoint(index++, 2, 4, 0));//Points.Add(new CPoint(index++, 2, 5, 0));//Points.Add(new CPoint(index++, 2, 6, 0));Points.Add(new CPoint(index++, 3, 1, 0));Points.Add(new CPoint(index++, 3, 2, 0));Points.Add(new CPoint(index++, 3, 3, 0));Points.Add(new CPoint(index++, 3, 4, 0));Points.Add(new CPoint(index++, 3, 5, 0));Points.Add(new CPoint(index++, 3, 6, 0));Points.Add(new CPoint(index++, 4, 1, 0));Points.Add(new CPoint(index++, 4, 2, 0));Points.Add(new CPoint(index++, 4, 3, 0));Points.Add(new CPoint(index++, 4, 4, 0));Points.Add(new CPoint(index++, 4, 5, 0));Points.Add(new CPoint(index++, 4, 6, 0));//Points.Add(new CPoint(index++, 5, 1, 0));//Points.Add(new CPoint(index++, 5, 2, 0));Points.Add(new CPoint(index++, 5, 3, 0));Points.Add(new CPoint(index++, 5, 4, 0));//Points.Add(new CPoint(index++, 5, 5, 0));//Points.Add(new CPoint(index++, 5, 6, 0));//Points.Add(new CPoint(index++, 6, 1, 0));//Points.Add(new CPoint(index++, 6, 2, 0));Points.Add(new CPoint(index++, 6, 3, 0));Points.Add(new CPoint(index++, 6, 4, 0));//Points.Add(new CPoint(index++, 6, 5, 0));//Points.Add(new CPoint(index++, 6, 6, 0));Squres = CSqure.GetAllSqures(Points);}private int drawIndex = 0;private void Timer_Tick(object sender, EventArgs e){drawIndex++;if(drawIndex>Squres.Count()){drawIndex = 1;}Invalidate();}protected override void OnPaint(PaintEventArgs e){e.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;foreach (var item in Points){e.Graphics.FillEllipse(SystemBrushes.GrayText, item.DrawCircle()) ;}return;int indexr = 0;int indexg = 0;int indexb = 0;int start = 127;int r = start;int g = start;int b = start;int step = 40;int index=0;foreach (var item in Squres){index++;indexr += step;if(index != drawIndex){continue;}if(indexr>255- start){indexg += step;if (indexg > 255 - start){indexb += step;if (indexb > 255 - start){indexb = 0;indexg = 0;indexb = 0;}indexg = 0;}indexr = 0;}var color = Color.FromArgb(255, r + indexr, g + indexg, b + indexb);var color2 = Color.FromArgb(255,255- r - indexr, 255 - g - indexg, 255 - b - indexb);using (Pen p = new Pen(color))using (Brush b2 = new SolidBrush(color))using (Brush b3 = new SolidBrush(color2)){e.Graphics.FillPolygon(b2, item.DrawSqure());e.Graphics.DrawPolygon(p, item.DrawSqure());var size = e.Graphics.MeasureString($"{index}",this.Font);e.Graphics.DrawString($"{index}",this.Font, b3, item.DrawCenter(size));e.Graphics.DrawString($"{index}.边长:{item.C.ToString("0.00")}", this.Font, b3, new PointF(50,53));}}base.OnPaint(e);}}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/34270.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

线程池概念、线程池的不同创建方式、线程池的拒绝策略

文章目录 &#x1f490;线程池概念以及什么是工厂模式&#x1f490;标准库中的线程池&#x1f490;什么是工厂模式&#xff1f;&#x1f490;ThreadPoolExecutor&#x1f490;模拟实现线程池 &#x1f490;线程池概念以及什么是工厂模式 线程的诞生是因为&#xff0c;频繁的创…

3D Web轻量化引擎HOOPS Commuicator是如何创建AEC查看器的?

在当今数字化时代&#xff0c;建筑、工程和施工&#xff08;AEC&#xff09;行业正经历着一场技术革命。HOOPS Communicator&#xff0c;一款基于HOOPS Web平台的3D Web轻量化引擎&#xff0c;正是这场革命的先锋之一。本文将探讨HOOPS Communicator是如何创建AEC查看器的&…

【CentOS 7】深入指南:使用LVM和扩展文件系统增加root分区存储容量

【CentOS 7】深入指南&#xff1a;使用LVM和扩展文件系统增加root分区存储容量 大家好 我是寸铁&#x1f44a; 【CentOS 7】深入指南&#xff1a;使用LVM和扩展文件系统增加root分区存储容量 ✨ 喜欢的小伙伴可以点点关注 &#x1f49d; 前言 在运行CentOS 7服务器或虚拟机时&a…

【扫雷游戏】C语言详解

Hi~&#xff01;这里是奋斗的小羊&#xff0c;很荣幸您能阅读我的文章&#xff0c;诚请评论指点&#xff0c;欢迎欢迎 ~~ &#x1f4a5;&#x1f4a5;个人主页&#xff1a;奋斗的小羊 &#x1f4a5;&#x1f4a5;所属专栏&#xff1a;C语言 &#x1f680;本系列文章为个人学习…

lvs集群 Keepalived

Keepalived高可用集群 Keepalived概述 功能 LVS规则管理LVS集群真实服务器状态监测管理VIP Keepalived实现web高可用 安装keepalived软件 在webservers上配置 启动服务 webservers systemctl start keepalived.service ip a s | grep 192.168 #web1主机绑定vip 测试…

Windows资源管理器down了,怎么解

ctrlshiftesc 打开任务管理器 文件 运行新任务 输入 Explorer.exe 资源管理器重启 问题解决 桌面也回来了

MoonBit 周报 Vol.46:支持32位无符号整数!

MoonBit 更新 支持了 32 位无符号整数 let num 100U // 32位无符号整数的字面量需要后缀U在 wasm 后端导出返回值类型为 Unit 的函数时&#xff0c;之前导出函数的类型中会有 (result i32)&#xff0c;现在 MoonBit 编译器会自动生成一个没有返回值 wrapper 函数&#xff0c…

爬虫day3

爬虫如何提高效率&#xff1f; 我们可以选择多线程&#xff0c;多进程&#xff0c;协程等操作完成异步爬取。 异步&#xff1a;把一个变成多个 线程&#xff1a;执行单位 进程&#xff1a;资源单位&#xff0c;每一个进程至少有一个线程 if __name__ __main__: print(&qu…

都说HCIE“烂大街”了,说难考都是假的?

在网络技术领域&#xff0c;华为认证互联网专家&#xff08;HCIE&#xff09;长期以来被视为一项高端认证&#xff0c;代表着专业技能和知识水平。 然而&#xff0c;近几年来&#xff0c;考证的重视度直线上升&#xff0c;考HCIE的人越来越多了&#xff0c;考过的人好像也越来越…

C++ | Leetcode C++题解之第162题寻找峰值

题目&#xff1a; 题解&#xff1a; class Solution { public:int findPeakElement(vector<int>& nums) {int n nums.size();// 辅助函数&#xff0c;输入下标 i&#xff0c;返回一个二元组 (0/1, nums[i])// 方便处理 nums[-1] 以及 nums[n] 的边界情况auto get …

android adb常用命令集

1、系统调试 #adb shell&#xff1a;进入设备的 shell 命令行界面&#xff0c;可以在此执行各种 Linux 命令和特定的 Android 命令。 #adb shell dumpsys&#xff1a;提供关于系统服务和其状态的详细信息。 #adb logcat&#xff1a;实时查看设备的日志信息。可以使用过滤条件来…

震惊!这样制作宣传册,效果竟然如此惊人!

在当今社会&#xff0c;宣传册作为一种重要的宣传手段&#xff0c;其制作质量直接影响到宣传效果。而令人震惊的是&#xff0c;现在有些制作宣传册的方法&#xff0c;其效果竟然如此惊人&#xff01;今天&#xff0c;教大家如何制作宣传册吧&#xff01; 首先&#xff0c;我们要…

群晖NAS部署VoceChat私人聊天系统并一键发布公网分享好友访问

文章目录 前言1. 拉取Vocechat2. 运行Vocechat3. 本地局域网访问4. 群晖安装Cpolar5. 配置公网地址6. 公网访问小结 7. 固定公网地址 前言 本文主要介绍如何在本地群晖NAS搭建一个自己的聊天服务Vocechat&#xff0c;并结合内网穿透工具实现使用任意浏览器远程访问进行智能聊天…

数据挖掘常见算法(关联)

Apriori算法 Apriori算法基于频繁项集性质的先验知识&#xff0c;使用由下至上逐层搜索的迭代方法&#xff0c;即从频繁1项集开始&#xff0c;采用频繁k项集搜索频繁k1项集&#xff0c;直到不能找到包含更多项的频繁项集为止。 Apriori算法由以下步骤组成&#xff0c;其中的核…

“硝烟下的量子”:以色列为何坚持让量子计算中心落地?

自2023年10月7日新一轮巴以冲突爆发以来&#xff0c;支持巴勒斯坦伊斯兰抵抗运动&#xff08;哈马斯&#xff09;的黎巴嫩真主党不时自黎巴嫩南部向以色列北部发动袭击&#xff0c;以军则用空袭和炮击黎南部目标进行报复&#xff0c;双方在以黎边境的冲突持续至今。 冲突走向扑…

AI风险管理新利器:SAIF CHECK利用Meta Llama 3保障合规与安全

每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗&#xff1f;订阅我们的简报&#xff0c;深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同&#xff0c;从行业内部的深度分析和实用指南中受益。不要错过这个机会&#xff0c;成为AI领…

ONLYOFFICE 文档 8.1 现已发布:功能全面的 PDF 编辑器、幻灯片版式、优化电子表格的协作等等

&#x1f525; 个人主页&#xff1a;空白诗 文章目录 一、引言二、ONLYOFFICE简介1. 文档编辑器2. 电子表格编辑器3. 演示文稿编辑器4. 项目管理5. 邮件和日历6. 客户关系管理&#xff08;CRM&#xff09;7. 安全性和权限管理8. 多平台和第三方集成 三、安装1. Windows/Mac 安装…

以AI之盾防AI之矛,效果其实非常棒!

以ChatGPT与Sora为代表的AIGC技术&#xff0c;正在以令人惊叹的自动化、智能化能力席卷文字创作、软件开发、影视后期等领域。打工人的“技能树”上若缺少了AI方向的技能&#xff0c;都可能会让自己在AI时代的竞争力大幅降低。那么不妨猜猜看&#xff0c;一向会第一时间利用各类…

论坛实现随机发帖的学习

1、badboy操作&#xff0c;录制发帖全过程&#xff0c;录制结果保存&#xff0c;生成为.jmx格式的文件 2、在Jmeter中打开该.jmx文件&#xff0c;重命名&#xff0c;便于了解步骤 3、生成结果树&#xff0c;查看所以步骤是否正确 4、实现随机发帖 断言&#xff1a;具有唯一表…

Apple - Game Center Programming Guide

本文翻译整理自&#xff1a;Game Center Programming Guide&#xff08; Updated: 2016-06-13 https://developer.apple.com/library/archive/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40008304 文章…