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

Lineageos 22.1(Android 15)制定应用强制横屏

一、前言

有时候需要系统的某个应用强制衡平显示,不管他是如何配置的。我们只需要简单的拿到top的Task下面的ActivityRecord,并判断包名来强制实现。

二、调整wms

com.android.server.wm.DisplayRotation

 /*** Given an orientation constant, returns the appropriate surface rotation, taking into account* sensors, docking mode, rotation lock, and other factors.** @param orientation  An orientation constant, such as*                     {@link ActivityInfo#SCREEN_ORIENTATION_LANDSCAPE}.* @param lastRotation The most recently used rotation.* @return The surface rotation to use.*/@Surface.Rotationint rotationForOrientation(@ScreenOrientation int orientation,@Surface.Rotation int lastRotation) {ProtoLog.v(WM_DEBUG_ORIENTATION,"rotationForOrientation(orient=%s (%d), last=%s (%d)); user=%s (%d) %s",ActivityInfo.screenOrientationToString(orientation), orientation,Surface.rotationToString(lastRotation), lastRotation,Surface.rotationToString(mUserRotation), mUserRotation,mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED? "USER_ROTATION_LOCKED" : "");if (isFixedToUserRotation()) {return mUserRotation;}+    if(isTopActivityIsMyPackage()){+       return Surface.ROTATION_90;+    }@Surface.Rotationint sensorRotation = mOrientationListener != null? mOrientationListener.getProposedRotation() // may be -1: -1;if (mFoldController != null && mFoldController.shouldIgnoreSensorRotation()) {sensorRotation = -1;}if (mDeviceStateController.shouldReverseRotationDirectionAroundZAxis(mDisplayContent)) {sensorRotation = RotationUtils.reverseRotationDirectionAroundZAxis(sensorRotation);}mLastSensorRotation = sensorRotation;if (sensorRotation < 0) {sensorRotation = lastRotation;}final int lidState = mDisplayPolicy.getLidState();final int dockMode = mDisplayPolicy.getDockMode();final boolean hdmiPlugged = mDisplayPolicy.isHdmiPlugged();final boolean carDockEnablesAccelerometer =mDisplayPolicy.isCarDockEnablesAccelerometer();final boolean deskDockEnablesAccelerometer =mDisplayPolicy.isDeskDockEnablesAccelerometer();@Surface.Rotationfinal int preferredRotation;if (!isDefaultDisplay) {// For secondary displays we ignore things like displays sensors, docking mode and// rotation lock, and always prefer user rotation.preferredRotation = mUserRotation;} else if (lidState == LID_OPEN && mLidOpenRotation >= 0) {// Ignore sensor when lid switch is open and rotation is forced.preferredRotation = mLidOpenRotation;} else if (dockMode == Intent.EXTRA_DOCK_STATE_CAR&& (carDockEnablesAccelerometer || mCarDockRotation >= 0)) {// Ignore sensor when in car dock unless explicitly enabled.// This case can override the behavior of NOSENSOR, and can also// enable 180 degree rotation while docked.preferredRotation = carDockEnablesAccelerometer ? sensorRotation : mCarDockRotation;} else if ((dockMode == Intent.EXTRA_DOCK_STATE_DESK|| dockMode == Intent.EXTRA_DOCK_STATE_LE_DESK|| dockMode == Intent.EXTRA_DOCK_STATE_HE_DESK)&& (deskDockEnablesAccelerometer || mDeskDockRotation >= 0)&& !(orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED|| orientation == ActivityInfo.SCREEN_ORIENTATION_NOSENSOR)) {// Ignore sensor when in desk dock unless explicitly enabled.// This case can enable 180 degree rotation while docked.preferredRotation = deskDockEnablesAccelerometer ? sensorRotation : mDeskDockRotation;} else if (hdmiPlugged && mDemoHdmiRotationLock) {// Ignore sensor when plugged into HDMI when demo HDMI rotation lock enabled.// Note that the dock orientation overrides the HDMI orientation.preferredRotation = mDemoHdmiRotation;} else if (hdmiPlugged && dockMode == Intent.EXTRA_DOCK_STATE_UNDOCKED&& mUndockedHdmiRotation >= 0) {// Ignore sensor when plugged into HDMI and an undocked orientation has// been specified in the configuration (only for legacy devices without// full multi-display support).// Note that the dock orientation overrides the HDMI orientation.preferredRotation = mUndockedHdmiRotation;} else if (mDemoRotationLock) {// Ignore sensor when demo rotation lock is enabled.// Note that the dock orientation and HDMI rotation lock override this.preferredRotation = mDemoRotation;} else if (mDisplayPolicy.isPersistentVrModeEnabled()) {// While in VR, apps always prefer a portrait rotation. This does not change// any apps that explicitly set landscape, but does cause sensors be ignored,// and ignored any orientation lock that the user has set (this conditional// should remain above the ORIENTATION_LOCKED conditional below).preferredRotation = mPortraitRotation;} else if (orientation == ActivityInfo.SCREEN_ORIENTATION_LOCKED) {// Application just wants to remain locked in the last rotation.preferredRotation = lastRotation;} else if (!mSupportAutoRotation) {if (mFixedToUserRotation == IWindowManager.FIXED_TO_USER_ROTATION_IF_NO_AUTO_ROTATION) {preferredRotation = mUserRotation;} else {// If we don't support auto-rotation then bail out here and ignore// the sensor and any rotation lock settings.preferredRotation = -1;}} else if (((mUserRotationMode == WindowManagerPolicy.USER_ROTATION_FREE|| isTabletopAutoRotateOverrideEnabled())&& (orientation == ActivityInfo.SCREEN_ORIENTATION_USER|| orientation == ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED|| orientation == ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE|| orientation == ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT|| orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_USER))|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR|| orientation == ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE|| orientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT) {// Otherwise, use sensor only if requested by the application or enabled// by default for USER or UNSPECIFIED modes.  Does not apply to NOSENSOR.boolean allowed = true;if (orientation != ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR&& orientation != ActivityInfo.SCREEN_ORIENTATION_FULL_USER) {allowed = RotationPolicy.isRotationAllowed(sensorRotation, mUserRotationAngles,getAllowAllRotations() != ALLOW_ALL_ROTATIONS_DISABLED);}if (allowed) {preferredRotation = sensorRotation;} else {preferredRotation = lastRotation;}} else if (mUserRotationMode == WindowManagerPolicy.USER_ROTATION_LOCKED&& orientation != ActivityInfo.SCREEN_ORIENTATION_NOSENSOR&& orientation != ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE&& orientation != ActivityInfo.SCREEN_ORIENTATION_PORTRAIT&& orientation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE&& orientation != ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT) {// Apply rotation lock. Does not apply to NOSENSOR or specific rotations.// The idea is that the user rotation expresses a weak preference for the direction// of gravity and as NOSENSOR is never affected by gravity, then neither should// NOSENSOR be affected by rotation lock (although it will be affected by docks).// Also avoid setting user rotation when app has preference over one particular rotation// to avoid leaving the rotation to the reverse of it which has the compatible// orientation, but isn't what app wants, when the user rotation is the reverse of the// preferred rotation.preferredRotation = mUserRotation;} else {// No overriding preference.// We will do exactly what the application asked us to do.preferredRotation = -1;}switch (orientation) {case ActivityInfo.SCREEN_ORIENTATION_PORTRAIT:// Return portrait unless overridden.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}return mPortraitRotation;case ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE:// Return landscape unless overridden.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}return mLandscapeRotation;case ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT:// Return reverse portrait unless overridden.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}return mUpsideDownRotation;case ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE:// Return seascape unless overridden.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}return mSeascapeRotation;case ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE:case ActivityInfo.SCREEN_ORIENTATION_USER_LANDSCAPE:// Return either landscape rotation.if (isLandscapeOrSeascape(preferredRotation)) {return preferredRotation;}if (isLandscapeOrSeascape(lastRotation)) {return lastRotation;}return mLandscapeRotation;case ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT:case ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT:// Return either portrait rotation.if (isAnyPortrait(preferredRotation)) {return preferredRotation;}if (isAnyPortrait(lastRotation)) {return lastRotation;}return mPortraitRotation;default:// For USER, UNSPECIFIED, NOSENSOR, SENSOR and FULL_SENSOR,// just return the preferred orientation we already calculated.if (preferredRotation >= 0) {return preferredRotation;}return Surface.ROTATION_0;}}

这里是传入一个配置的选装方法和当前的方法,来判断后面要进行旋转的操作,我们Activity没有配置横竖屏的时候传入的
orientation都是SCREEN_ORIENTATION_UNSPECIFIED(-1),不过我们强制横屏可以不考虑这么多,加一个方法判断即可。

 boolean isTopActivityIsMyPackage(){try {Task rootTask = mDisplayContent.getTopRootTask();if(rootTask!=null&&rootTask.hasChild()&&rootTask.getChildAt(0) instanceof ActivityRecord){return  ((ActivityRecord) rootTask.getChildAt(0)).packageName.equals("com.example.cloudclient");}}catch (Exception e){return false;}return false;}

这里的包名换成自己的就行,然后编译打包重启

make -j12 services
adb push lineageos/out/target/product/blueline/system/framework/services.jar /system/framework/services.jar

在这里插入图片描述

相关文章:

Lineageos 22.1(Android 15)制定应用强制横屏

一、前言 有时候需要系统的某个应用强制衡平显示&#xff0c;不管他是如何配置的。我们只需要简单的拿到top的Task下面的ActivityRecord&#xff0c;并判断包名来强制实现。 二、调整wms com.android.server.wm.DisplayRotation /*** Given an orientation constant, return…...

基于deepseek的智能语音客服【第四讲】封装milvus数据库连接池封装

通过工厂模式创建链接 static {// 创建连接池工厂BasePooledObjectFactory<MilvusServiceClient> factory new BasePooledObjectFactory<MilvusServiceClient>() {Overridepublic MilvusServiceClient create() throws Exception {return new MilvusServiceClient…...

【GeeRPC】项目总结:使用 Golang 实现 RPC 框架

文章目录 项目总结&#xff1a;使用 Golang 实现 RPC 框架谈谈 RPC 框架什么是 RPC 框架实现一个 RPC 框架需要什么&#xff1f;项目总结文章结构安排 Part1&#xff1a;消息编码编解码器的实现通信过程 Part2&#xff1a;服务端Accept&#xff1a;阻塞地等待连接请求并开启 go…...

人工智能在医疗影像诊断中的应用与挑战

引言 近年来&#xff0c;人工智能&#xff08;AI&#xff09;技术在医疗领域的应用逐渐成为研究热点&#xff0c;尤其是在医疗影像诊断方面。AI技术的引入为医疗影像诊断带来了更高的效率和准确性&#xff0c;有望缓解医疗资源紧张的问题&#xff0c;同时为患者提供更优质的医疗…...

烧结银技术赋能新能源汽车超级快充与高效驱动

烧结银技术赋能新能源汽车超级快充与高效驱动 在新能源汽车领域&#xff0c;高压快充技术的突破与高功率密度驱动系统的创新正成为行业竞争的焦点。比亚迪于 2025 年发布的超级 e 平台&#xff0c;通过整合全域千伏高压架构、兆瓦级闪充技术及碳化硅&#xff08;SiC&#xff0…...

大模型幻觉产生的【九大原因】

知识问答推理幻觉产生的原因 1.知识库结构切割不合理 大段落切割向量化 切分太小可以实现更精准化的回复内&#xff0c;向量匹配相似度越高。检索内容碎片化严重、可能包含不符合内容的文本数据。切分太大内容资料更完整&#xff0c;但是会影响相似度&#xff0c;同时更消耗资…...

4小时速通shell外加100例

&#x1f525; Shell 基础——从入门到精通 &#x1f680; &#x1f331; 第一章&#xff1a;Shell&#xff0c;简单说&#xff01; &#x1f476; 什么是Shell&#xff1f;它到底能做什么&#xff1f;这章让你快速了解Shell的强大之处&#xff01; &#x1f476; 什么是Shell…...

AD(Altium Designer)更换PCB文件的器件封装

一、确定是否拥有想换的器件PCB封装 1.1 打开现有的原理图 1.2 确定是否拥有想换的器件PCB文件 1.2.1 如果有 按照1.3进行切换器件PCB封装 1.2.2 如果没有 按照如下链接进行添加 AD(Altium Designer)已有封装库的基础上添加器件封装-CSDN博客https://blog.csdn.net/XU15…...

Postgresql 删除数据库报错

1、删除数据库时&#xff0c;报错存在其他会话连接 ## 错误现象&#xff0c;存在其他的会话连接正在使用数据库 ERROR: database "cs" is being accessed by other users DETAIL: There is 1 other session using the database.2、解决方法 ## 终止被删除数据库下…...

人工智能时代——深度探索如何构建开放可控的专利生态体系

# 人工智能时代——深度探索如何构建开放可控的专利生态体系 引言&#xff1a;AI专利革命的战略抉择第一章 战略认知与基本原则1.1 人工智能专利革命的范式重构1.1.1 技术维度变革1.1.2 法律维度挑战1.1.3 文明安全的不可控风险 1.2 战略定位体系构建1.2.1 双循环治理框架的立体…...

✨【数据变形术:联合体在通信协议中的降维打击】✨

&#xff08;万字长文详解联合体的二进制魔法与工程实践&#xff09; &#x1f52e; 原理解析&#xff1a;内存空间的量子叠加态 文字叙述&#xff1a; 联合体&#xff08;union&#xff09;是C语言中最具魔法的数据结构&#xff0c;其所有成员共享同一块内存空间。这种特性使…...

docker compose部署minio报错

背景 部分服务使用docker-compose单节点编排&#xff0c;其中对象存储服务使用minio&#xff0c;在minio中配置了aksk后报错 Error: IAM sub-system is partially initialized, unable to write the IAM forma 解决 minio如果配置了aksk等iam类的配置则需要持久化存储到etcd…...

软件开发通用之状态机初认识-基本概念及简单应用

0 前言 在程序开发阶段&#xff08;其实也不限于程序&#xff0c;还包含硬件电路设计&#xff0c;协议设计等&#xff09;&#xff0c;无论使用何种语言&#xff0c;何种工具&#xff0c;何种系统&#xff0c;程序的运行必须符合开发者的预设逻辑&#xff0c;而单独通过大脑记…...

蓝桥杯 之 第27场月赛总结

文章目录 习题1.抓猪拿国一2.蓝桥字符3.蓝桥大使4.拳头对决 习题 比赛地址 1.抓猪拿国一 十分简单的签到题 print(sum(list(range(17))))2.蓝桥字符 常见的字符匹配的问题&#xff0c;是一个二维dp的问题&#xff0c;转化为对应的动态规划求解 力扣的相似题目 可以关注灵神…...

适配器模式 (Adapter Pattern)

适配器模式 (Adapter Pattern) 是一种结构型设计模式,它将一个类的接口转换成客户希望的另外一个接口,使得原本由于接口不兼容而不能一起工作的类可以一起工作。 在现实生活中,适配器的例子随处可见,比如电源适配器,它将不同电压的电流转换为设备所需的电压,确保设备能正…...

操作系统WIN11无法出现WLAN图标(解决方案)

本人操作系统WIN11之后无网络图标 于是在设置里查看了一下&#xff0c;是网卡驱动没了 网上去下载一个驱动类软件自行处理即可。 本人使用手机USB网络连的电脑&#xff0c;然后发现网卡驱动凭空出现了&#xff0c;就很困惑&#xff0c;没有下载驱动就恢复了。...

HCL—我与虚拟机的爱恨情仇[特殊字符][特殊字符]‍[特殊字符]️

时隔了三周&#xff0c;我可能算是了解了虚拟机了吧。自从上一次的安装虚拟机&#xff0c;我与HCL、虚拟机就没有停止过纠缠。 为什么很多win11电脑使用不了HCL&#xff0c;或者无法启动HCL设备&#xff1f; 首先来解答&#xff0c;为什么很多win11电脑使用不了HCL&#xff0c…...

illustrate:一款蛋白/核酸结构快速渲染为“卡通风格”的小工具

本期向大家介绍一款蛋白/核酸结构快速渲染&#xff08;卡通风格&#xff09;的小工具——illustrate。放心&#xff01;本期完全不涉及代码&#xff0c;不折腾人&#xff0c;请放心食用。 结构渲染效果示例如下&#xff1a; PDB ID: 1ttt 该小工具适用绘制蛋白或复合物整体轮廓…...

Linux上位机开发实战(能用的开发板计算资源)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 大家所能想到的嵌入式上位机开发&#xff0c;如果是linux&#xff0c;同时涉及到嵌入式的话&#xff0c;一般都会认为是把pc linux的软件port到板子…...

kotlin 内联函数 inline

高阶函数实现的原理&#xff1a;函数类型其实是生成了一个对象 。 inline翻译成中文的意思就是内联&#xff0c;在kotlin里面inline被用来修饰函数&#xff0c;表明当前函数在编译时是以内嵌的形式进行编译的&#xff0c;从而减少了一层函数调用栈&#xff1a; inline fun fun…...

vue3配置代理实现axios请求本地接口返回PG库数据【前后端实操】

前端编写 安装 axios 如果当前未安装axios&#xff0c;可以执行如下指令安装 npm install axios配置代理 当前为基于Vite构建的项目&#xff0c;在 vite.config.ts 中配置代理&#xff0c;在defineConfig中新增server配置&#xff0c;主要关注两个点&#xff1a; 一、需要代…...

论文阅读:2023 arxiv Multiscale Positive-Unlabeled Detection of AI-Generated Texts

总目录 大模型安全相关研究:https://blog.csdn.net/WhiffeYF/article/details/142132328 Multiscale Positive-Unlabeled Detection of AI-Generated Texts https://arxiv.org/abs/2305.18149 https://www.doubao.com/chat/2114270649152258 https://github.com/YuchuanTi…...

【数学建模】最大最小值模型详解

数学建模中的最大最小值模型详解 文章目录 数学建模中的最大最小值模型详解引言最大最小值模型的基本概念最大化问题最小化问题 常见的求解方法1. 微积分法2. 线性规划3. 非线性规划4. 动态规划 实际应用案例案例1&#xff1a;生产规划问题案例2&#xff1a;投资组合优化 最大最…...

Camera2 实现重力感应四个方向调试相机预览

Camera2API 实现重力感应四个方向调试相机预览 文章目录 需求场景 需求实现setAspectRatio 设置显示长宽postScale postRotate 设置缩放和旋转manager.openCamera 打开相机startPreviewgetPreviewRequestBuilder 设置预览参数&#xff1a;createCaptureSession 预览准备工作set…...

C++::多态

目录 一.多态的概念 二.多态的定义及实现 二.1多态的构成条件 二.2虚函数 1.虚函数的写法 2.虚函数的重写/覆盖 3.协变 二.3析构函数的重写 二.4override和final关键字 ​编辑二.5重载/重写/隐藏的对比 三.多态的运行原理&#xff08;一部分&#xff09; 四.多态的常…...

278.缀点成线

1232. 缀点成线 - 力扣&#xff08;LeetCode&#xff09; class Solution {public boolean checkStraightLine(int[][] coordinates) {if(coordinates.length2){return true;}int xcoordinates[1][0]-coordinates[0][0];int ycoordinates[1][1]-coordinates[0][1];for(int i1;i…...

xssgame第8关注入详解

1.SVG利用实现xss攻击 1.代码如下&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><meta name"viewport" content"widthdevice-width, initial-scale1.0"><title>tes…...

《数据库原理》SQLServer期末复习_题型+考点

目录 题型&#xff1a; 一. 概况分析题&#xff08;5小题&#xff0c;每小题2分&#xff0c;共10分&#xff09; 二. 计算题&#xff08;3小题&#xff0c;每小题5分&#xff0c;共15分&#xff09; 三. 数据库设计&#xff08;2小题&#xff0c;每小题10分&#xff0c;共2…...

RK3588开发笔记-RTL8852wifi6模块驱动编译报错解决

目录 前言 一、问题背景 二、驱动编译 总结 前言 在基于 RK3588 进行开发,使用 RTL8852 WiFi6 模块时,遇到了一个让人头疼的驱动编译报错问题:“VFs_internal_I_am_really_a_filesystem_and_am_NoT_a_driver, but does”。经过一番摸索和尝试,最终成功解决了这个问题,在…...

机器学习算法实战——天气数据分析(主页有源码)

✨个人主页欢迎您的访问 ✨期待您的三连 ✨ ✨个人主页欢迎您的访问 ✨期待您的三连 ✨ ✨个人主页欢迎您的访问 ✨期待您的三连✨ ​ ​​​ 1. 引言 天气数据分析是气象学和数据科学交叉领域的一个重要研究方向。随着大数据技术的发展&#xff0c;气象数据的采集、存储和分…...

java项目之基于ssm的毕业论文管理系统(源码+文档)

项目简介 毕业论文管理系统实现了以下功能&#xff1a; 本毕业论文管理系统主要实现的功能模块包括学生模块、导师模块和管理员模块三大部分&#xff0c;具体功能分析如下&#xff1a; &#xff08;1&#xff09;导师功能模块&#xff1a;导师注册登录后主要功能模块包括个人…...

【Vue3入门1】02- vue3的基本操作(上)

本文介绍vue3中的一些方法的操作。 目录 1. 绑定事件 v-on 2. 按键修饰符 3. 显示和隐藏 v-show 4. 条件渲染 v-if 5. 条件渲染if-else 1. 绑定事件 v-on 点击事件 v-on:click" 发生事件 " <body><div id"app">{{ msg }} <h2&g…...

Redis集群搭建和高可用方案(Java实现)

Redis集群搭建和高可用方案(Java实现) 我将详细介绍如何使用Java技术搭建Redis集群并实现高可用方案。 1. Redis集群架构概述 Redis集群可以通过以下几种方式实现: 主从复制Sentinel哨兵模式Redis Cluster集群模式2. 使用Java实现Redis集群连接 2.1 使用Jedis客户端 Je…...

【大模型算法工程】大模型应用工具化、忠诚度以及知识库场景下PDF双栏解析问题的讨论

1. 大模型时代应用工具化以及无忠诚度现象讨论 接触大模型久了&#xff0c;也慢慢探到一些大模型能力表现非常自然和突出的场景&#xff0c;比如AI搜索&#xff08;依赖大模型的理解总结能力&#xff09;、AI对话&#xff08;即chat&#xff0c;依赖大模型的生成能力&#xff0…...

Rust语言学习

Rust语言学习 通用编程概念所有权所有权引用和借用slice struct(结构体)定义并实例化一个结构体使用结构体方法语法 枚举 enums定义枚举match控制流运算符if let 简单控制流 使用包、Crate和模块管理不断增长的项目&#xff08;模块系统&#xff09;包和crate定义模块来控制作用…...

AI比人脑更强,因为被植入思维模型【16】反脆弱

毛选中就有言&#xff0c;不经历困难&#xff0c;我们就不会掌握战胜困难的方法。 这个世界纷繁复杂&#xff0c;不是强者总是运气好&#xff0c;而是他们能够失败后快速复原&#xff0c;不断找到战胜困难的方法。 定义 马斯洛需求层次模型是一种将人类需求从低到高按层次进…...

系统架构设计知识体系总结

1.技术选型 1.什么是技术选型&#xff1f; 技术选型是指评估和选择在项目或系统开发中使用的最合适的技术和工具的过程。这涉及考虑基于其能力、特性、与项目需求的兼容性、可扩展性、性能、维护和其他因素的各种可用选项。技术选型的目标是确定与项目目标相符合、能够有效解…...

计算机视觉的多模态模型

计算机视觉的多模态模型 是指能够同时处理和理解 多种类型数据&#xff08;模态&#xff09; 的模型。这些模态可以包括图像、文本、音频、视频、深度信息等。多模态模型的核心目标是利用不同模态之间的互补信息&#xff0c;提升模型的性能和泛化能力。 1. 多模态模型的核心思想…...

Scrapy 入门教程

Scrapy 入门教程 Scrapy 是一个用于爬取网站数据的 Python 框架&#xff0c;功能强大且易于扩展。本文将介绍 Scrapy 的基本概念、安装方法、使用示例&#xff0c;并展示如何编写一个基本的爬虫。 1. 什么是 Scrapy&#xff1f; Scrapy 是一个开源的、用于爬取网站数据的框架…...

Oracle OCP认证是否值得考?

Oracle OCP&#xff08;Oracle Certified Professional&#xff09;认证是数据库领域的传统权威认证&#xff0c;但随着云数据库和开源技术的崛起&#xff0c;其价值正面临分化。是否值得考取&#xff0c;需结合你的职业定位、行业需求及长期规划综合判断。以下是关键分析&…...

OpenCV中距离公式

一、各类距离公式总结 常见距离公式 欧氏距离&#xff1a; 曼哈顿距离&#xff08;L1&#xff09;‌&#xff1a; 切比雪夫距离&#xff08;Chessboard&#xff09;‌&#xff1a; 1、点与点距离(欧氏距离) ‌二维空间‌ 设两点坐标为 P1(x1,y1)、P2(x2,y2)&#xff0c;其距离…...

DeepSeek自学手册:《从理论(模型训练)到实践(模型应用)》|73页|附PPT下载方法

导 读INTRODUCTION 今天分享是由ai呀蔡蔡团队带来的DeepSeek自学手册&#xff1a;《从理论&#xff08;模型训练&#xff09;到实践&#xff08;模型应用&#xff09;》&#xff0c;这是一篇关于DeepSeek模型训练、应用场景及替代方案的综合指南文章&#xff0c;主要介绍了Deep…...

Doris官网上没有的一些Fe参数了,都在源码中

一、FE配置源码 apache-doris-src\fe\fe-common\src\main\java\org\apache\doris\common\Config.java 二、BE配置源码 apache-doris-src\be\src\common\config.cpp 三、FE源码 package org.apache.doris.common;public class Config extends ConfigBase {ConfField(descri…...

(一)丶Windows安装RabbitMQ可能会遇到的问题

一丶可能会忘了配置ERLang的环境变量 二丶执行命令时报错 第一步 rabbitmq-plugins enable rabbitmq_management 第二部 rabbitmqctl status 三丶修改.erlang.cookie 文件 1.找到C盘目下的.erlang.cookie文件 C:\Users\admin\.erlang.cookie C:\Windows\System32\config\sys…...

stm32g030移植RT-Thread

移植流程 移植前需要安装Keil.STM32G0xx_DFP.1.2.0.pack组件&#xff0c;大致的移植过程&#xff1a; CubeMX配置RT-Thread组件配置工程模板配置 参考例程配置&#xff1a;拷贝仓库原有的stm32g070-st-nucleo工程&#xff0c;然后另起一个名字&#xff0c;目录结构如下 完整…...

Parsing error: Unexpected token, expected “,“

今天在使用Trae AI 编程工具开发大文件切片上传功能&#xff0c;使用的是VUE3,TS技术栈&#xff0c;开发完成运行时&#xff0c;编译报错&#xff08;Parsing error: Unexpected token, expected ","&#xff09;&#xff0c;让AI自行修复此问题多次后还是没有解决&a…...

Day23: 数组中数字出现的次数

整数数组 sockets 记录了一个袜子礼盒的颜色分布情况&#xff0c;其中 sockets[i] 表示该袜子的颜色编号。礼盒中除了一款撞色搭配的袜子&#xff0c;每种颜色的袜子均有两只。请设计一个程序&#xff0c;在时间复杂度 O(n)&#xff0c;空间复杂度O(1) 内找到这双撞色搭配袜子的…...

目标检测——清洗数据

清洗VOC格式数据集代码示例 import os import xml.etree.ElementTree as ETdef process_annotations(image_folder, annotation_folder):# 遍历标签文件夹中的所有XML文件for xml_file in os.listdir(annotation_folder):if not xml_file.endswith(.xml):continuexml_path os…...

嵌入式基础知识学习:UART是什么?

UART&#xff08;Universal Asynchronous Receiver/Transmitter&#xff0c;通用异步收发传输器&#xff09;是一种广泛应用于嵌入式系统和通信设备的异步串行通信协议。它通过两根数据线&#xff08;TX和RX&#xff09;实现设备间的全双工数据传输&#xff0c;无需共享时钟信号…...

SpringBoot项目实战(初级)

目录 一、数据库搭建 二、代码开发 1.pom.xml 2.thymeleaf模块处理的配置类 3.application配置文件 4.配置&#xff08;在启动类中&#xff09; 5.编写数据层 ②编写dao层 ③编写service层 接口 实现类 注意 补充&#xff08;注入的3个注解&#xff09; 1.AutoWir…...