Android 12 客制化修改初探-Launcher/Settings/Bootanimation

在这里插入图片描述
Android 12

    使用 Material You 打造的全新系统界面,富有表现力、活力和个性。使用重新设计的微件、AppSearch、游戏模式和新的编解码器扩展您的应用。支持隐私信息中心和大致位置等新的保护功能。使用富媒体内容插入功能、更简便的模糊处理功能、经过改进的原生调试功能等提高工作效率.


-----------------------------正文-------------------------------

平台: RK3588 + Android 12
本文用于记录一些基于RK3588 Android12 的客制化修改内容


Launcher & 导航栏

12带来的一个巨大的变化之一就是导航栏从SystemUI整合到了Launcher3QuickStep
在这里插入图片描述
众所周知, 曾经的SystemUI才是导航栏的拥有者, 把导航栏交给Launcher这意味着, 以后的Launcher, 不是你想动就能动的了.
要替换Launcher的就好好考虑清楚了.

从布局上看, 位于底部, 占满宽度:

packages/apps/Launcher3/quickstep/res/layout/taskbar.xml

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2021 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<com.android.launcher3.taskbar.TaskbarDragLayer
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/taskbar_container"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:clipChildren="false">

    <com.android.launcher3.taskbar.TaskbarView
        android:id="@+id/taskbar_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:forceHasOverlappingRendering="false"
        android:layout_gravity="bottom"
        android:clipChildren="false" />

    <com.android.launcher3.taskbar.TaskbarScrimView
        android:id="@+id/taskbar_scrim"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

    <FrameLayout
        android:id="@+id/navbuttons_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom">

        <FrameLayout
            android:id="@+id/start_contextual_buttons"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
            android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
            android:paddingTop="@dimen/taskbar_contextual_padding_top"
            android:gravity="center_vertical"
            android:layout_gravity="start"/>

        <LinearLayout
            android:id="@+id/end_nav_buttons"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:orientation="horizontal"
            android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
            android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
            android:layout_marginEnd="@dimen/taskbar_contextual_button_margin"
            android:gravity="center_vertical"
            android:layout_gravity="end"/>

        <FrameLayout
            android:id="@+id/end_contextual_buttons"
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:paddingLeft="@dimen/taskbar_nav_buttons_spacing"
            android:paddingRight="@dimen/taskbar_nav_buttons_spacing"
            android:paddingTop="@dimen/taskbar_contextual_padding_top"
            android:gravity="center_vertical"
            android:layout_gravity="end"/>
    </FrameLayout>

    <com.android.launcher3.taskbar.StashedHandleView
        android:id="@+id/stashed_handle"
        tools:comment1="The actual size and shape will be set as a ViewOutlineProvider at runtime"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/taskbar_stashed_handle_dark_color"
        android:clipToOutline="true"
        android:layout_gravity="bottom"/>

</com.android.launcher3.taskbar.TaskbarDragLayer>

end_nav_buttons 里包含了3个功能键, 动态增加按键控件

packages/apps/Launcher3/quickstep/src/com/android/launcher3/taskbar/NavbarButtonsViewController.java

    private void initButtons(ViewGroup navContainer, ViewGroup endContainer,
            TaskbarNavButtonController navButtonController) {

        mBackButton = addButton(R.drawable.ic_sysbar_back, BUTTON_BACK,
                mNavButtonContainer, mControllers.navButtonController, R.id.back);
        mPropertyHolders.add(new StatePropertyHolder(mBackButton,
                flags -> {
                    // Show only if not disabled, and if not on the keyguard or otherwise only when
                    // the bouncer or a lockscreen app is showing above the keyguard
                    boolean showingOnKeyguard = (flags & FLAG_KEYGUARD_VISIBLE) == 0 ||
                            (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0 ||
                            (flags & FLAG_KEYGUARD_OCCLUDED) != 0;
                    return (flags & FLAG_DISABLE_BACK) == 0
                            && ((flags & FLAG_KEYGUARD_VISIBLE) == 0 || showingOnKeyguard);
                }));
        boolean isRtl = Utilities.isRtl(mContext.getResources());
        mPropertyHolders.add(new StatePropertyHolder(
                mBackButton, flags -> (flags & FLAG_IME_VISIBLE) != 0, View.ROTATION,
                isRtl ? 90 : -90, 0));
        // Translate back button to be at end/start of other buttons for keyguard
        int navButtonSize = mContext.getResources().getDimensionPixelSize(
                R.dimen.taskbar_nav_buttons_size);
        mPropertyHolders.add(new StatePropertyHolder(
                mBackButton, flags -> (flags & FLAG_ONLY_BACK_FOR_BOUNCER_VISIBLE) != 0
                        || (flags & FLAG_KEYGUARD_VISIBLE) != 0,
                VIEW_TRANSLATE_X, navButtonSize * (isRtl ? -2 : 2), 0));


        // home and recents buttons
        View homeButton = addButton(R.drawable.ic_sysbar_home, BUTTON_HOME, navContainer,
                navButtonController, R.id.home);
        mPropertyHolders.add(new StatePropertyHolder(homeButton,
                flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
                        (flags & FLAG_DISABLE_HOME) == 0));
        View recentsButton = addButton(R.drawable.ic_sysbar_recent, BUTTON_RECENTS,
                navContainer, navButtonController, R.id.recent_apps);
        mPropertyHolders.add(new StatePropertyHolder(recentsButton,
                flags -> (flags & FLAG_KEYGUARD_VISIBLE) == 0 &&
                        (flags & FLAG_DISABLE_RECENTS) == 0));
    

按键的点击处理:

packages/apps/Launcher3/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java

    public void onButtonClick(@TaskbarButton int buttonType) {
        switch (buttonType) {
            case BUTTON_BACK:
                executeBack();
                break;
            case BUTTON_HOME:
                navigateHome();
                break;
            case BUTTON_RECENTS:
                navigateToOverview();
                break;
            case BUTTON_IME_SWITCH:
                showIMESwitcher();
                break;
            case BUTTON_A11Y:
                notifyA11yClick(false /* longClick */);
                break;
        }
    }

    private void navigateHome() {
        mService.getOverviewCommandHelper().addCommand(OverviewCommandHelper.TYPE_HOME);
    }

    private void navigateToOverview() {
        if (mScreenPinned) {
            return;
        }
        TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onOverviewToggle");
        mService.getOverviewCommandHelper().addCommand(OverviewCommandHelper.TYPE_TOGGLE);
    }

    private void executeBack() {
        mSystemUiProxy.onBackPressed();
    }

packages/apps/Launcher3/quickstep/src/com/android/quickstep/OverviewCommandHelper.java

    /**
     * Adds a command to be executed next, after all pending tasks are completed
     */
    @BinderThread
    public void addCommand(int type) {
        CommandInfo cmd = new CommandInfo(type);
        MAIN_EXECUTOR.execute(() -> addCommand(cmd));
    }

在Launcher3QuickStep存在以下服务:

packages/apps/Launcher3/quickstep/AndroidManifest.xml

        <service android:name="com.android.quickstep.TouchInteractionService"
             android:permission="android.permission.STATUS_BAR_SERVICE"
             android:directBootAware="true"
             android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.QUICKSTEP_SERVICE"/>
            </intent-filter>
        </service>

导航栏离不开SystemUI, 该服务由SystemUI绑定:

frameworks/base/packages/SystemUI/src/com/android/systemui/recents/OverviewProxyService.java

    private void internalConnectToCurrentUser() {
        disconnectFromLauncherService();

        // If user has not setup yet or already connected, do not try to connect
        if (!isEnabled()) {
            Log.v(TAG_OPS, "Cannot attempt connection, is enabled " + isEnabled());
            return;
        }
        mHandler.removeCallbacks(mConnectionRunnable);
        Intent launcherServiceIntent = new Intent(ACTION_QUICKSTEP)
                .setPackage(mRecentsComponentName.getPackageName());
        try {
            mBound = mContext.bindServiceAsUser(launcherServiceIntent,
                    mOverviewServiceConnection,
                    Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE,
                    UserHandle.of(getCurrentUserId()));
        } catch (SecurityException e) {
            Log.e(TAG_OPS, "Unable to bind because of security error", e);
        }
        if (mBound) {
            // Ensure that connection has been established even if it thinks it is bound
            mHandler.postDelayed(mDeferredConnectionCallback, DEFERRED_CALLBACK_MILLIS);
        } else {
            // Retry after exponential backoff timeout
            retryConnectionWithBackoff();
        }
    }

替换Launcher
前面提过, 要替换Launcher需要考虑的比以前更多的, 首先, Launcher3QuickStep不能删除, 在设置中依然可以选择默认的Launcher,(这和现在某些国内的手机厂商不一样).
Settings > Apps > Default Apps > Home app
在这里插入图片描述
Launcher3QuickStep 默认桌面图标
去掉所有的桌面图标

packages/apps/Launcher3/res/xml/default_workspace_6x5.xml

diff --git a/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml b/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
index b078cfd7f8..4300258cc4 100644
--- a/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
+++ b/packages/apps/Launcher3/res/xml/default_workspace_6x5.xml
@@ -15,10 +15,10 @@
 -->
 
 <favorites xmlns:launcher="http://schemas.android.com/apk/res-auto/com.android.launcher3">
-
+       <!--AnsonCode remove appicons-->
     <!-- Hotseat (We use the screen as the position of the item in the hotseat) -->
     <!-- Mail Calendar Gallery Store Internet Camera -->
-    <resolve
+    <!--resolve
         launcher:container="-101"
         launcher:screen="0"
         launcher:x="0"
@@ -61,9 +61,9 @@
         <favorite
             launcher:uri="#Intent;action=android.intent.action.MAIN;category=android.intent.category.APP_BROWSER;end" />
         <favorite launcher:uri="http://www.example.com/" />
-    </resolve>
+    </resolve-->
 
-    <!-- Resolve camera intent if GoogleCamera is not available e.g. on emulator -->
+    <!-- Resolve camera intent if GoogleCamera is not available e.g. on emulator >
     <resolve
         launcher:container="-101"
         launcher:screen="5"
@@ -71,6 +71,6 @@
         launcher:y="0" >
         <favorite launcher:uri="#Intent;action=android.media.action.STILL_IMAGE_CAMERA;end" />
         <favorite launcher:uri="#Intent;action=android.intent.action.CAMERA_BUTTON;end" />
-    </resolve>
+    </resolve-->
 
 </favorites>

Bootanimation

修改动画文件检测路径:

frameworks/base/cmds/bootanimation/BootAnimation.cpp


static const char OEM_BOOTANIMATION_FILE[] = "/cache/bootanimation.zip";
static const char PRODUCT_BOOTANIMATION_DARK_FILE[] = "/product/media/bootanimation-dark.zip";
static const char PRODUCT_BOOTANIMATION_FILE[] = "/data/bootanimation.zip";
static const char SYSTEM_BOOTANIMATION_FILE[] = "/system/media/bootanimation.zip";
static const char APEX_BOOTANIMATION_FILE[] = "/apex/com.android.bootanimation/etc/bootanimation.zip";
static const char PRODUCT_ENCRYPTED_BOOTANIMATION_FILE[] = "/product/media/bootanimation-encrypted.zip";
static const char SYSTEM_ENCRYPTED_BOOTANIMATION_FILE[] = "/system/media/bootanimation-encrypted.zip";
static const char OEM_SHUTDOWNANIMATION_FILE[] = "/odm/media/shutdownanimation.zip";
static const char PRODUCT_SHUTDOWNANIMATION_FILE[] = "/product/media/shutdownanimation.zip";
static const char SYSTEM_SHUTDOWNANIMATION_FILE[] = "/system/media/shutdownanimation.zip";

一个小插曲: /data/bootanimation.zip 开机时读取不到. 开完机后, 调试过程中通过命令启动动画, 又可以正常读取, 很是怪异.
启动命令:

setprop ctl.start bootanim

/data/local/bootanimation.ts开机视频读取正常, 于是尝试把检测开机.zip动画的函数放到视频检测里:

void BootAnimation::checkVideoFile() {
    // add for boot video
    mVideoAnimation = false;
    if (access(SYSTEM_BOOTVIDEO_FILE, R_OK) == 0) {
        mVideoFile = (char*)SYSTEM_BOOTVIDEO_FILE;
    }
    if (access(DATA_BOOTVIDEO_FILE, R_OK) == 0) {
        mVideoFile = (char*)DATA_BOOTVIDEO_FILE;
    }
    //增加一行用于检测开机 ZIP 动画.
	findBootAnimationFile();
    std::string bootVideoEnable = android::base::GetProperty("persist.sys.bootvideo.enable", "false");
    std::string showTime = android::base::GetProperty("persist.sys.bootvideo.showtime", "-1");
    ALOGD("checkVideoFile()-->bootvideo.enable=%s, showtime=%s", bootVideoEnable.c_str(), showTime.c_str());
    if (mVideoFile != NULL && !strcmp(bootVideoEnable.c_str(), "true") && (atoi(showTime.c_str()) != 0)) {
        mVideoAnimation = true;
        ALOGD("mVideoAnimation = true");
    } else {
        ALOGD("bootvideo:No boot video animation,EXIT_VIDEO_NAME:%s,bootvideo.showtime:%s\n",
        bootVideoEnable.c_str(), showTime.c_str());
    }
    // add end
}

PS: 未解

  • ZIP动画文件检测需要放在checkVideoFile
  • /cache/bootanimation.zip 死活读不到.

Activity/Service 保持高优先级运行

首先可以编写一个简单的Activity

new Thread(){
	public void run(){
		while(true){
			//print....
			sleep(1);
		}
	}
}

实际测试会发现, 当Activity切到后台后, sleep的实际时间被拉长了, 线程优先级降下来了.
可以尝试修改保证Activity的线程优先级:

frameworks/base/services/core/java/com/android/server/am/ProcessStateRecord.java

    void setCurrentSchedulingGroup(int curSchedGroup) {
		//增加代码,
		//比如修改为前台APP:
		//curSchedGroup = ProcessList.SCHED_GROUP_TOP_APP;
        mCurSchedGroup = curSchedGroup;
        mApp.getWindowProcessController().setCurrentSchedulingGroup(curSchedGroup);
    }

Settings

  • 去除Usb调试开关

packages/apps/Settings/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java

    public void onActivityCreated(Bundle icicle) {
        super.onActivityCreated(icicle);
        //......
		PreferenceCategory cat = (PreferenceCategory)getPreferenceScreen().findPreference("debug_debugging_category");
		cat.removePreference(cat.findPreference("enable_adb"));
    }

单独写出来是因为刚开始写成了:

    getPreferenceScreen().findPreference("enable_adb");

正确的方式, 是先找到对应的PreferenceCategory, 在调用findPreference

  • 增加屏幕信息显示

packages/apps/Settings/res/xml/my_device_info.xml

//....
    <PreferenceCategory
        android:key="device_detail_category"
        android:selectable="false"
        android:title="@string/my_device_info_device_details_category_title">

		<Preference
            android:key="screen_info"
            android:order="19"
            android:title="屏幕信息"
            android:summary="分辨率1920x1080 DPI 240"/>

        <!-- SIM status -->
        <Preference
            android:key="sim_status"
            android:order="18"
            android:title="@string/sim_status_title"
            settings:keywords="@string/keywords_sim_status"
            android:summary="@string/summary_placeholder"
            settings:enableCopying="true"/>
//...            

packages/apps/Settings/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java

    private void initHeader() {
        //.....
        //增加代码
		androidx.preference.PreferenceCategory cat = (androidx.preference.PreferenceCategory)getPreferenceScreen().findPreference("device_detail_category");
		android.hardware.display.DisplayManager displayMgr = (android.hardware.display.DisplayManager)getContext().getSystemService(Context.DISPLAY_SERVICE);
		android.view.Display[] displays = displayMgr.getDisplays();
		int x = 0;
		int y = 0;
		int dpi = 0;
		if(displays != null && displays.length > 0){
			android.graphics.Point rSize = new android.graphics.Point();
            displays[0].getRealSize(rSize);
			android.util.DisplayMetrics dmOut = new android.util.DisplayMetrics();
            displays[0].getMetrics(dmOut);
			x = rSize.x;
			y = rSize.y;
			dpi = dmOut.densityDpi;
		}
		cat.findPreference("screen_info").setSummary("分辨率 " + x + "x" + y + " DPI " + dpi);
    }

其他

系统存储分区

device/rockchip/common/scripts/fstab_tools/fstab.in

# Android fstab file.
#<src>                                          <mnt_point>         <type>    <mnt_flags and options>                       <fs_mgr_flags>
# The filesystem that contains the filesystem checker binary (typically /system) cannot
# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
${_block_prefix}system  /system   ext4 ro,barrier=1 ${_flags_vbmeta},first_stage_mount${_flags_avbpubkey}
${_block_prefix}vendor  /vendor   ext4 ro,barrier=1 ${_flags},first_stage_mount
${_block_prefix}odm     /odm      ext4 ro,barrier=1 ${_flags},first_stage_mount

/dev/block/by-name/boot     /boot       emmc defaults     ${_flags_chained}first_stage_mount
/dev/block/by-name/cache    /cache      ext4 noatime,nodiratime,nosuid,nodev,noauto_da_alloc,discard    wait,check
/dev/block/by-name/metadata /metadata   ext4 nodev,noatime,nosuid,discard,sync                          wait,formattable,first_stage_mount,check
/dev/block/by-name/misc     /misc       emmc defaults     defaults

/devices/platform/*usb*   auto vfat defaults      voldmanaged=usb:auto

# For sata
/devices/platform/*.sata* auto vfat defaults voldmanaged=sata:auto

# For pcie ssd
/devices/platform/*.pcie* auto vfat defaults voldmanaged=pcie:auto

/dev/block/zram0                                none                swap      defaults                                              zramsize=50%
# For sdmmc
/devices/platform/${_sdmmc_device}/mmc_host*        auto  auto    defaults        voldmanaged=sdcard1:auto
#  Full disk encryption has less effect on rk3326, so default to enable this.
/dev/block/by-name/userdata /data f2fs noatime,nosuid,nodev,discard,reserve_root=32768,resgid=1065 latemount,wait,check,fileencryption=aes-256-xts:aes-256-cts:v2+inlinecrypt_optimized,keydirectory=/metadata/vold/metadata_encryption,quota,formattable,reservedsize=128M,checkpoint=fs
# for ext4
#/dev/block/by-name/userdata    /data      ext4    discard,noatime,nosuid,nodev,noauto_da_alloc,data=ordered,user_xattr,barrier=1    latemount,wait,formattable,check,fileencryption=software,quota,reservedsize=128M,checkpoint=block

默认关闭USB调试
默认persist.sys.usb.config的属性值去掉adb
如果打开了ro.debuggable, 以下代码会重新加回去.

system/core/init/property_service.cpp

static void update_sys_usb_config() {
    bool is_debuggable = android::base::GetBoolProperty("ro.debuggable", false);
    std::string config = android::base::GetProperty("persist.sys.usb.config", "");
    // b/150130503, add (config == "none") condition here to prevent appending
    // ",adb" if "none" is explicitly defined in default prop.
    if (config.empty() || config == "none") {
        InitPropertySet("persist.sys.usb.config", is_debuggable ? "adb" : "none");
    } else if (is_debuggable && config.find("adb") == std::string::npos &&
               config.length() + 4 < PROP_VALUE_MAX) {
        config.append(",adb");
        InitPropertySet("persist.sys.usb.config", config);
    }
}

参考

  1. Android进程管理1—进程优先级adj

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

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

Redis分布式锁(上)

不论面试还是实际工作中&#xff0c;Redis都是避无可避的技术点。在我心里&#xff0c;MySQL和Redis是衡量一个程序员是否“小有所成”的两把标尺。如果他能熟练使用MySQL和Redis&#xff0c;以小化大&#xff0c;充分利用现有资源出色地完成当下需求&#xff0c;说明他已经成长…

生命在于学习——主板跳线的学习

一、前言 好吧&#xff0c;又是一个我之前没接触过的东西&#xff0c;秉持遇到什么就学什么的精神&#xff0c;来学&#xff01; 我一发小来找我&#xff0c;问我关于跳线的事情&#xff0c;我就一个表情&#xff1a; 好吧&#xff0c;我承认&#xff0c;纵观我23岁&#xf…

【通往架构师之路】并没有捷径可走,除非站在巨人的肩膀之上

通往架构师之路 市面有流传《人人都是产品经理》&#xff0c;却很少听到《人人都是架构师》这种说法&#xff0c;大概是因为架构师在整个研发体系上来说&#xff0c;总是比较稀缺的吧。本文结合工程的需要&#xff0c;给大家推荐10本通过架构师之路的绝佳图书&#xff0c;希望对…

第二证券:今日投资前瞻:小米汽车引关注 全球风光有望持续高速发展

昨日&#xff0c;两市股指盘中轰动上扬&#xff0c;深成指、创业板指一度涨超1%。到收盘&#xff0c;沪指涨0.55%报3072.83点&#xff0c;深成指涨0.72%报10077.96点&#xff0c;创业板指涨0.53%报2015.36点&#xff0c;北证50指数涨2.64%&#xff1b;两市算计成交9900亿元&…

智慧城市大脑数据中台解决方案:PPT全套37页,附下载

关键词&#xff1a;智慧城市大脑解决方案&#xff0c;数据中台解决方案&#xff0c;智慧城市建设&#xff0c;数据中台建设&#xff0c;智慧城市大脑建设&#xff0c;数据中台建设架构 一、智慧城市大脑数据中台建设背景 智慧城市大脑数据中台是一个面向城市级数据管理、开发和…

PowerConsume功耗计算器

嵌入式低功耗产品开发&#xff0c;功耗计算器资源-CSDN文库 PowerConsume使用说明 安装说明 需要安装在无空格等特殊字符的路径&#xff0c;不推荐安装在C盘。 功能说明 已知条件 电池容量 各状态的电流和运行时间 自动计算出设备运行时间 启动界面如下 添加状态 在空白处…

深入解析Vue中的keep-alive组件:优化组件切换与DOM渲染!

&#x1f3ac; 江城开朗的豌豆&#xff1a;个人主页 &#x1f525; 个人专栏 :《 VUE 》 《 javaScript 》 &#x1f4dd; 个人网站 :《 江城开朗的豌豆&#x1fadb; 》 ⛺️ 生活的理想&#xff0c;就是为了理想的生活 ! 目录 ⭐ 专栏简介 &#x1f4d8; 文章引言 一、K…

超详细 | 萤火虫算法原理及其实现(Matlab)

群智能(Swarm Intelligence&#xff0c;SI)是一类分散自组织系统的集体智能行为的总称&#xff0c;该表述最早在1989年由Gerardo Beni在分子自动机系统中提出。SI系统可视作一组简单的个体&#xff0c;其个体与个体、个体与环境之间存在交互作用&#xff0c;最终表征出智能行为…

通往优秀软件架构师之路:掌握技术核心,修炼基础原理【文中送书,十本任选】

通往优秀软件架构师之路&#xff1a;掌握技术核心&#xff0c;修炼基础原理 《高并发架构实战&#xff1a;从需求分析到系统设计》《架构师的自我修炼&#xff1a;技术、架构和未来》《中台架构与实现&#xff1a;基于DDD和微服务》《分布式系统架构&#xff1a;架构策略与难题…

Python利器:Requests-HTML——网络爬虫的得力助手

概要 在Python的世界里&#xff0c;网络爬虫是一个非常热门的领域。而在这个领域中&#xff0c;Requests-HTML是一个强大的工具&#xff0c;它能够让我们轻松地处理HTML页面&#xff0c;从而获取需要的数据。本文将详细介绍Requests-HTML的特点、使用方法和一些实际应用案例&a…

JS-项目实战-删除库存记录

1、fruit.js function $(name) {if (name) {//假设name是 #fruit_tblif (name.startsWith("#")) {name name.substring(1); //fruit_tblreturn document.getElementById(name);}} }//当页面加载完成后执行后面的匿名函数 window.onload function () {//get:获取…

为什么都说学医的转行网络安全行业更容易些?

网络系统坏了&#xff0c;被入侵破坏了&#xff0c;找安全工程师防护修补。如果没有修好&#xff0c;我可以不给钱&#xff0c;再找一家能修好的。但是看病就不一样了&#xff0c;就算医生没有给我治好病&#xff0c;也照样要收医疗费。 这样的类比乍一听上去好像挺有道理&…

Redis集群介绍及安装Redis7.2.3集群

概念&#xff1a; 【Redis】高可用之三&#xff1a;集群&#xff08;cluster&#xff09; - 知乎 实操&#xff1a; Redis集群三种模式 主从模式 优势&#xff1a; 主节点可读可写 从节点只能读&#xff08;从节点从主节点同步数据&#xff09; 缺点&#xff1a; 当主节点…

自动驾驶大模型,是怎么学习「世界知识」的?

近期&#xff0c;科技产业大佬不约而同地发出一个非常强烈的信号&#xff1a;自动驾驶走向完全的成熟&#xff0c;必须要被AI大模型重构。 中国工程院院士、清华大学教授、清华智能产业研究院&#xff08;AIR&#xff09;院长张亚勤认为&#xff0c;「自动驾驶是高度复杂的、最…

2023 年 数维杯(D题)国际大学生数学建模挑战赛 |数学建模完整代码+建模过程全解全析

大家面临着复杂的数学建模问题时&#xff0c;你是否曾经感到茫然无措&#xff1f;作为2022年美国大学生数学建模比赛的O奖得主&#xff0c;我为大家提供了一套优秀的解题思路&#xff0c;让你轻松应对各种难题。 让我们来看看数维杯D题&#xff01; 问题一&#xff1a;最佳清…

python3.8 安装 ssl 模块 和 _ctypes 模块

这文章目录 前情提要安装 openssl-1.1.1重新编译安装 python3.8-rpath 编译选项介绍python3.8 跟 python3.10 的区别那要怎么解决这个问题呢&#xff0c;我想到有四种解决方案&#xff1a; 前情提要 我在之前给 python3.10 安装 ssl 模块后以为该步骤 “对于 python3.6、pytho…

wpf devexpress 自定义统计

总计统计和分组统计包含预定义总计函数。这些函数允许你计算如下&#xff1a; 数据列的数量&#xff08;Count&#xff09; 最大和最小值(Max和Min) 总计和平均值&#xff08;Sum和Average&#xff09; 处理GridControl.CustomSummary 事件或者使用 GridControl.CustomSumm…

Ubuntu 22.04 LTS ffmpeg mp4 gif 添加图片水印

ffmpeg编译安装6.0.1&#xff0c;参考 Ubuntu 20.04 LTS ffmpeg gif mp4 互转 许编译安装ffmpeg &#xff1b;解决gif转mp4转换后无法播放问题-CSDN博客 准备一个logo MP4添加水印 ffmpeg -i 2.mp4 -vf "movielogo.png[watermark];[in][watermark]overlayx10:y10[out]&…

给出n个学生的考试成绩表,每条信息由姓名与分数组成,试设计一算法:

1.给出n个学生的考试成绩表&#xff0c;每条信息由姓名与分数组成&#xff0c;试设计一个算法: (1)按分数高低次序&#xff0c;打印出每个学生在考试中获得的名次&#xff0c;分数相同的为同一名次。 (2)按名次列出每个学生的姓名与分数。 学生的考试成绩通过键盘输入数据建立…

RK3588平台开发系列讲解(项目篇)嵌入式AI的学习步骤

文章目录 一、嵌入式AI的学习步骤1.1、入门Linux1.2、入门AI 二、瑞芯微嵌入式AI2.1、瑞芯微的嵌入式AI关键词2.2、AI模型部署流程 沉淀、分享、成长&#xff0c;让自己和他人都能有所收获&#xff01;&#x1f604; &#x1f4e2; 本篇将给大家介绍什么是嵌入式AI。 一、嵌入…