Android13系统导航栏添加音量加减键按钮功能
不知道为什么拿到芯片原厂发布给我们的Android13系统源码编译后,导航栏没有音量加减键,客户有反馈这个问题,所以特意加了一下,修改记录如下:frameworks/base目录下
commit 9cb2244d61a237cab03c540bfcca6e4fac2bea2c
Author: incar <chs@incartech.cn>
Date: Fri Jun 21 19:05:47 2024 +0800导航栏添加音量加减键Change-Id: Ia1811c7a94aa2f9e175b7725f96370925c5055ebdiff --git a/packages/SystemUI/res/drawable/ic_sysbar_volume_add_button.xml b/packages/SystemUI/res/drawable/ic_sysbar_volume_add_button.xml
new file mode 100755
index 000000000000..76a145eff0cb
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_volume_add_button.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="?attr/singleToneColor"
+ android:pathData="M3,9v6h4l5,5L12,4L7,9L3,9zM16.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM14,3.23v2.06c2.89,0.86 5,3.54 5,6.71s-2.11,5.85 -5,6.71v2.06c4.01,-0.91 7,-4.49 7,-8.77s-2.99,-7.86 -7,-8.77z"/>
+</vector>
diff --git a/packages/SystemUI/res/drawable/ic_sysbar_volume_sub_button.xml b/packages/SystemUI/res/drawable/ic_sysbar_volume_sub_button.xml
new file mode 100755
index 000000000000..69d86071ce10
--- /dev/null
+++ b/packages/SystemUI/res/drawable/ic_sysbar_volume_sub_button.xml
@@ -0,0 +1,9 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="28dp"
+ android:height="28dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ <path
+ android:fillColor="?attr/singleToneColor"
+ android:pathData="M18.5,12c0,-1.77 -1.02,-3.29 -2.5,-4.03v8.05c1.48,-0.73 2.5,-2.25 2.5,-4.02zM5,9v6h4l5,5V4L9,9H5z"/>
+</vector>
diff --git a/packages/SystemUI/res/layout/volume_add.xml b/packages/SystemUI/res/layout/volume_add.xml
new file mode 100755
index 000000000000..882c855a3a03
--- /dev/null
+++ b/packages/SystemUI/res/layout/volume_add.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.systemui.navigationbar.buttons.KeyButtonView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:systemui="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/volume_add"
+ android:layout_width="@dimen/navigation_key_width"
+ android:layout_height="match_parent"
+ android:layout_weight="0"
+ systemui:keyCode="24"
+ android:scaleType="center"
+ android:paddingStart="@dimen/navigation_key_padding"
+ android:paddingEnd="@dimen/navigation_key_padding"
+ />
+
diff --git a/packages/SystemUI/res/layout/volume_sub.xml b/packages/SystemUI/res/layout/volume_sub.xml
new file mode 100755
index 000000000000..4b687bd52079
--- /dev/null
+++ b/packages/SystemUI/res/layout/volume_sub.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 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.systemui.navigationbar.buttons.KeyButtonView
+ xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:systemui="http://schemas.android.com/apk/res-auto"
+ android:id="@+id/volume_sub"
+ android:layout_width="@dimen/navigation_key_width"
+ android:layout_height="match_parent"
+ android:layout_weight="0"
+ systemui:keyCode="25"
+ android:scaleType="center"
+ android:paddingStart="@dimen/navigation_key_padding"
+ android:paddingEnd="@dimen/navigation_key_padding"
+ />
+
diff --git a/packages/SystemUI/res/values-sw400dp/config.xml b/packages/SystemUI/res/values-sw400dp/config.xml
new file mode 100755
index 000000000000..5c37bfb34f68
--- /dev/null
+++ b/packages/SystemUI/res/values-sw400dp/config.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 2012, 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.
+*/
+-->
+
+<!-- These resources are around just to allow their values to be customized
+ for different hardware and product builds. -->
+<resources>
+
+ <!-- Nav bar button default ordering/layout -->
+ <string name="config_navBarLayout" translatable="false">left;volume_sub,back,home,recent,volume_add;right</string>
+
+</resources>
diff --git a/packages/SystemUI/res/values-sw400dp/dimens.xml b/packages/SystemUI/res/values-sw400dp/dimens.xml
old mode 100644
new mode 100755
index f19335bc6285..340697a37fcb
--- a/packages/SystemUI/res/values-sw400dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw400dp/dimens.xml
@@ -17,7 +17,8 @@<resources><!-- The width of the view containing navigation buttons -->
- <dimen name="navigation_key_width">80dip</dimen>
+ <dimen name="navigation_key_width">50dp</dimen>
+ <dimen name="navigation_key_padding">30dp</dimen><!-- The padding on the side of the navigation bar. Must be greater than or equal tonavigation_extra_key_width -->
diff --git a/packages/SystemUI/res/values-sw410dp/dimens.xml b/packages/SystemUI/res/values-sw410dp/dimens.xml
old mode 100644
new mode 100755
index 7da47e5089be..62285f56c45f
--- a/packages/SystemUI/res/values-sw410dp/dimens.xml
+++ b/packages/SystemUI/res/values-sw410dp/dimens.xml
@@ -26,5 +26,8 @@<dimen name="global_actions_grid_item_side_margin">12dp</dimen><dimen name="global_actions_grid_item_height">72dp</dimen>
+
+ <dimen name="navigation_key_width">55dp</dimen>
+ <dimen name="navigation_key_padding">33dp</dimen></resources>
diff --git a/packages/SystemUI/res/values-sw600dp-land/dimens.xml b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
old mode 100644
new mode 100755
index b24ce122208f..12973fe351a1
--- a/packages/SystemUI/res/values-sw600dp-land/dimens.xml
+++ b/packages/SystemUI/res/values-sw600dp-land/dimens.xml
@@ -77,4 +77,7 @@<dimen name="lockscreen_shade_keyguard_transition_vertical_offset">83dp</dimen><dimen name="notification_panel_margin_horizontal">24dp</dimen>
+
+ <dimen name="navigation_key_width">120dp</dimen>
+ <dimen name="navigation_key_padding">50dp</dimen></resources>
diff --git a/packages/SystemUI/res/values-sw600dp/config.xml b/packages/SystemUI/res/values-sw600dp/config.xml
old mode 100644
new mode 100755
index 80628f903e76..9ea9eedb3cc5
--- a/packages/SystemUI/res/values-sw600dp/config.xml
+++ b/packages/SystemUI/res/values-sw600dp/config.xml
@@ -27,7 +27,7 @@<bool name="config_quickSettingsMediaLandscapeCollapsed">false</bool><!-- Nav bar button default ordering/layout -->
- <string name="config_navBarLayout" translatable="false">left;back,home,recent;right</string>
+ <string name="config_navBarLayout" translatable="false">left;volume_sub,back,home,recent,volume_add;right</string><!-- orientation of the dead zone when touches have recently occurred elsewhere on screen --><integer name="navigation_bar_deadzone_orientation">0</integer>
diff --git a/packages/SystemUI/res/values/config.xml b/packages/SystemUI/res/values/config.xml
index df3c8bedf1bb..ccc2b8c6604f 100755
--- a/packages/SystemUI/res/values/config.xml
+++ b/packages/SystemUI/res/values/config.xml
@@ -301,7 +301,7 @@</string-array><!-- Nav bar button default ordering/layout -->
- <string name="config_navBarLayout" translatable="false">left[.5W],back[1WC];home;recent[1WC],right[.5W]</string>
+ <string name="config_navBarLayout" translatable="false">left[.5W];volume_sub,back,home,recent,volume_add;right[.5W]</string><string name="config_navBarLayoutQuickstep" translatable="false">back[1.7WC];home;contextual[1.7WC]</string><string name="config_navBarLayoutHandle" translatable="false">back[70AC];home_handle;ime_switcher[70AC]</string>diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
index 1ef2b3c98859..bf152b112e86 100755
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
@@ -1187,6 +1187,21 @@ public class NavigationBar extends ViewController<NavigationBarView> implementsaccessibilityButton.setOnClickListener(this::onAccessibilityClick);accessibilityButton.setOnLongClickListener(this::onAccessibilityLongClick);updateAccessibilityStateFlags();
+ ButtonDispatcher volumeAddButton=mView.getVolumeAddButton();
+ ButtonDispatcher volumeSubButton=mView.getVolumeSubButton();
+ //boolean isShowVolumeButton = "true".equals(SystemProperties.get("ro.rk.systembar.voiceicon","true"));
+ boolean isShowVolumeButton = true;
+ if(isShowVolumeButton){
+ volumeAddButton.setVisibility(View.VISIBLE);
+ volumeSubButton.setVisibility(View.VISIBLE);
+ }else{
+ volumeAddButton.setVisibility(View.GONE);
+ volumeSubButton.setVisibility(View.GONE);
+ }
+ if (mContext.getResources().getConfiguration().smallestScreenWidthDp < 400) {
+ volumeAddButton.setVisibility(View.GONE);
+ volumeSubButton.setVisibility(View.GONE);
+ }ButtonDispatcher imeSwitcherButton = mView.getImeSwitchButton();imeSwitcherButton.setOnClickListener(this::onImeSwitcherClick);
@@ -1699,6 +1714,10 @@ public class NavigationBar extends ViewController<NavigationBarView> implementsupdateButtonLocation(region, touchRegionCache, mView.getAccessibilityButton(), inScreenSpace,useNearestRegion);
+ updateButtonLocation(region, touchRegionCache, mView.getVolumeAddButton(), inScreenSpace,
+ useNearestRegion);
+ updateButtonLocation(region, touchRegionCache, mView.getVolumeSubButton(), inScreenSpace,
+ useNearestRegion);if (includeFloatingButtons && mView.getFloatingRotationButton().isVisible()) {// Note: this button is floating so the nearest region doesn't applyupdateButtonLocation(
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
old mode 100644
new mode 100755
index 59bb2278edfe..70fb8a920ca0
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
@@ -68,6 +68,8 @@ public class NavigationBarInflaterView extends FrameLayoutpublic static final String RIGHT = "right";public static final String CONTEXTUAL = "contextual";public static final String IME_SWITCHER = "ime_switcher";
+ public static final String VOLUME_ADD = "volume_add";
+ public static final String VOLUME_SUB = "volume_sub";public static final String GRAVITY_SEPARATOR = ";";public static final String BUTTON_SEPARATOR = ",";
@@ -99,11 +101,13 @@ public class NavigationBarInflaterView extends FrameLayoutprivate boolean mIsVertical;private boolean mAlternativeOrder;+ private int mDensity;private OverviewProxyService mOverviewProxyService;private int mNavBarMode = NAV_BAR_MODE_3BUTTON;public NavigationBarInflaterView(Context context, AttributeSet attrs) {super(context, attrs);
+ mDensity = context.getResources().getConfiguration().densityDpi;createInflaters();mOverviewProxyService = Dependency.get(OverviewProxyService.class);mNavBarMode = Dependency.get(NavigationModeController.class).addListener(this);
@@ -118,6 +122,16 @@ public class NavigationBarInflaterView extends FrameLayoutmLandscapeInflater = LayoutInflater.from(mContext.createConfigurationContext(landscape));}+ @Override
+ protected void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ if(mDensity != newConfig.densityDpi || mDensity < 600){
+ mDensity = newConfig.densityDpi;
+ clearViews();
+ inflateLayout(mCurrentLayout);
+ }
+ }
+@Overrideprotected void onFinishInflate() {super.onFinishInflate();
@@ -387,6 +401,10 @@ public class NavigationBarInflaterView extends FrameLayoutv = inflater.inflate(R.layout.home_handle, parent, false);} else if (IME_SWITCHER.equals(button)) {v = inflater.inflate(R.layout.ime_switcher, parent, false);
+ } else if (VOLUME_ADD.equals(button)) {
+ v = inflater.inflate(R.layout.volume_add, parent, false);
+ } else if (VOLUME_SUB.equals(button)) {
+ v = inflater.inflate(R.layout.volume_sub, parent, false);} else if (button.startsWith(KEY)) {String uri = extractImage(button);int code = extractKeycode(button);
diff --git a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
old mode 100644
new mode 100755
index 97024881ca62..8c5c589fdc22
--- a/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
+++ b/packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
@@ -45,6 +45,7 @@ import android.util.Log;import android.util.SparseArray;import android.view.ContextThemeWrapper;import android.view.Display;
+import android.view.Display.Mode;import android.view.MotionEvent;import android.view.Surface;import android.view.View;
@@ -120,6 +121,8 @@ public class NavigationBarView extends FrameLayout {private KeyButtonDrawable mHomeDefaultIcon;private KeyButtonDrawable mRecentIcon;private KeyButtonDrawable mDockedIcon;
+ private KeyButtonDrawable mVolumeAddIcon;
+ private KeyButtonDrawable mVolumeSubIcon;private Context mLightContext;private int mLightIconColor;private int mDarkIconColor;
@@ -159,6 +162,7 @@ public class NavigationBarView extends FrameLayout {* fully locked mode we only show that unlocking is blocked.*/private ScreenPinningNotify mScreenPinningNotify;
+ private boolean mIsRot0Landscape = true;/*** {@code true} if the IME can render the back button and the IME switcher button.
@@ -311,6 +315,10 @@ public class NavigationBarView extends FrameLayout {mTmpLastConfiguration = new Configuration();mConfiguration.updateFrom(context.getResources().getConfiguration());+ Display display = ((WindowManager)context.getSystemService(Context.WINDOW_SERVICE)).getDefaultDisplay();
+ Mode displayMode = display.getMode();
+ mIsRot0Landscape = displayMode.getPhysicalWidth() > displayMode.getPhysicalHeight();
+ Log.v(TAG, "PW=" + displayMode.getPhysicalWidth() + ", PH=" + displayMode.getPhysicalHeight());mScreenPinningNotify = new ScreenPinningNotify(mContext);mButtonDispatchers.put(R.id.back, new ButtonDispatcher(R.id.back));
@@ -320,6 +328,8 @@ public class NavigationBarView extends FrameLayout {mButtonDispatchers.put(R.id.ime_switcher, imeSwitcherButton);mButtonDispatchers.put(R.id.accessibility_button, accessibilityButton);mButtonDispatchers.put(R.id.menu_container, mContextualButtonGroup);
+ mButtonDispatchers.put(R.id.volume_add, new ButtonDispatcher(R.id.volume_add));
+ mButtonDispatchers.put(R.id.volume_sub, new ButtonDispatcher(R.id.volume_sub));mDeadZone = new DeadZone(this);}@@ -420,6 +430,13 @@ public class NavigationBarView extends FrameLayout {return mButtonDispatchers.get(R.id.accessibility_button);}+ public ButtonDispatcher getVolumeAddButton() {
+ return mButtonDispatchers.get(R.id.volume_add);
+ }
+
+ public ButtonDispatcher getVolumeSubButton() {
+ return mButtonDispatchers.get(R.id.volume_sub);
+ }public RotationContextButton getRotateSuggestionButton() {return (RotationContextButton) mButtonDispatchers.get(R.id.rotate_suggestion);}
@@ -464,6 +481,8 @@ public class NavigationBarView extends FrameLayout {if (orientationChange || densityChange || dirChange) {mBackIcon = getBackDrawable();}
+ mVolumeAddIcon = getDrawable(R.drawable.ic_sysbar_volume_add_button);
+ mVolumeSubIcon = getDrawable(R.drawable.ic_sysbar_volume_sub_button);}/**
@@ -607,6 +626,8 @@ public class NavigationBarView extends FrameLayout {}getHomeButton().setImageDrawable(homeIcon);getBackButton().setImageDrawable(backIcon);
+ getVolumeAddButton().setImageDrawable(mVolumeAddIcon);
+ getVolumeSubButton().setImageDrawable(mVolumeSubIcon);updateRecentsIcon();
涉及到修改的文件如下:注意别遗漏了
packages/SystemUI/res/drawable/ic_sysbar_volume_add_button.xml
packages/SystemUI/res/drawable/ic_sysbar_volume_sub_button.xml
packages/SystemUI/res/layout/volume_add.xml
packages/SystemUI/res/layout/volume_sub.xml
packages/SystemUI/res/values-sw400dp/config.xml
packages/SystemUI/res/values-sw400dp/dimens.xml
packages/SystemUI/res/values-sw410dp/dimens.xml
packages/SystemUI/res/values-sw600dp-land/dimens.xml
packages/SystemUI/res/values-sw600dp/config.xml
packages/SystemUI/res/values/config.xml
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBar.java
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarInflaterView.java
packages/SystemUI/src/com/android/systemui/navigationbar/NavigationBarView.java
相关文章:
![](https://www.ngui.cc/images/no-images.jpg)
Android13系统导航栏添加音量加减键按钮功能
不知道为什么拿到芯片原厂发布给我们的Android13系统源码编译后,导航栏没有音量加减键,客户有反馈这个问题,所以特意加了一下,修改记录如下:frameworks/base目录下 commit 9cb2244d61a237cab03c540bfcca6e4fac2bea2c …...
![](https://img-blog.csdnimg.cn/direct/cb0c06083f464519ad8e3f97c35e84da.png#pic_center)
普及GIS知识,推动产业发展
915 GIS节:普及GIS知识,推动产业发展 自2008年起,每年的9月15日被定为“GIS节”,这一特殊的节日由超图首次发起倡议,旨在打造一个普及和传播GIS(地理信息系统)知识的平台,促进大众对…...
![](https://img-blog.csdnimg.cn/img_convert/d96679b3e8dc3993a95688af7c22ad32.png)
第2章-Python编程基础
#本章目标 1,了解什么是计算机程序 2,了解什么是编程语言 3,了解编程语言的分类 4,了解静态语言与脚本语言的区别 5,掌握IPO程序编写方法 6,熟练应用输出函数print与输入函数input 7,掌握Python…...
![](https://img-blog.csdnimg.cn/img_convert/60ab4d1bae9899290a9b06f6f19bab5a.png)
LDO产品的基础知识解析
低压降稳压器 (LDO)是一种用于调节较高电压输入产生的输出电压的简单方法。在大多数情况下,低压降稳压器都易于设计和使用。然而,如今的现代应用都包括各种各样的模拟和数字系统,而有些系统和工作条件将决定哪种LDO最适合相关电路,…...
![](https://img-blog.csdnimg.cn/direct/7dc40ea6e73f48f9bca3ae4b90e4614a.png)
如何利用python画出AHP-SWOT的战略四边形(四象限图)
在企业或产业发展的相关论文分析中,常用到AHP-SWOT法进行定量分析,形成判断矩阵后,如何构造整洁的战略四边形是分析的最后一个环节,本文现将相关代码发布如下: import mpl_toolkits.axisartist as axisartist import …...
![](https://img-blog.csdnimg.cn/img_convert/60e244ad8e9ffe70794083594fc412aa.webp?x-oss-process=image/format,png)
适用于智慧城市、智慧文旅等在线场景的轻量级3D数字人引擎MyAvatar简介
本人研发的国内首个纯面向web应用和小程序的轻量级3D虚拟人引擎MyAvatar。 功能简述 支持3D模型定制(写实或卡通风格均可,人物模型需实现绑定和变形)动画可以内置于模型中,也可以单独以glb或fbx格式导出并动态加载支持readyplay…...
![](https://img-blog.csdnimg.cn/img_convert/76003c0ecbaebe231aee9afa556fa5a2.png)
Excel显示/隐藏批注按钮为什么是灰色?
在excel中,经常使用批注来加强数据信息的提示,有时候会把很多的批注显示出来,但是再想将它们隐藏起来,全选工作表后,“显示/隐藏批注”按钮是灰色的,不可用。 二、可操作方法 批注在excel、WPS表格中都是按…...
![](https://img-blog.csdnimg.cn/direct/7e7b2dca254c4f6b9b74a46e1c6ab7e1.gif#pic_center)
ArtTS系统能力-通知的学习(3.1)
上篇回顾: ArtTS语言基础类库-容器类库内容的学习(2.10.2) 本篇内容: ArtTS系统能力-通知的学习(3.1) 一、 知识储备 1. 基础类型通知 按内容分成四类: 类型描述NOTIFICATION_CONTENT_BASIC_TEXT普通文…...
![](https://www.ngui.cc/images/no-images.jpg)
Apollo9.0 PNC源码学习之Planning模块(三)—— public_road_planner
前面文章: (1)Apollo9.0 PNC源码学习之Planning模块(一)—— 规划概览 (2)Apollo9.0 PNC源码学习之Planning模块(二)—— planning_component 1 planning_interface_base 规划接口基类: planning\planning_interface_base\planner_base\planner.h #pragma once#in…...
![](https://img-blog.csdnimg.cn/direct/49aa1855d16f463090641dda47635d0a.png)
【Elasticsearch】linux使用supervisor常驻Elasticsearch,centos6.10安装 supervisor
背景: linux服务器,CentOS 6操作系统,默认版本python2.6.6,避免安装过多的依赖不升级python 在网上查的资料python2.6.6兼容supervisor版本 3.1.3 安装supervisor 手动在python官网下载supervisor,并上传到服务器 下…...
![](https://img-blog.csdnimg.cn/direct/850e5974e6f440b6ba0ac566b7275275.png)
推荐系统三十六式学习笔记:原理篇.模型融合14|一网打尽协同过滤、矩阵分解和线性模型
目录 从特征组合说起FM模型1.原理2.模型训练3.预测阶段4.一网打尽其他模型5.FFM 总结 在上一篇文章中,我们讲到了使用逻辑回归和梯度提升决策树组合的模型融合办法,用于CTR预估,给这个组合起了个名字,叫“辑度组合”。这对组合中&…...
![](https://img-blog.csdnimg.cn/img_convert/aaa840459092ebddc691d98f536247ca.jpeg)
如何使用mapXplore将SQLMap数据转储到关系型数据库中
关于mapXplore mapXplore是一款功能强大的SQLMap数据转储与管理工具,该工具基于模块化的理念开发,可以帮助广大研究人员将SQLMap数据提取出来,并转储到类似PostgreSQL或SQLite等关系型数据库中。 功能介绍 当前版本的mapXplore支持下列功能…...
![](https://img-blog.csdnimg.cn/direct/c2d9114822db4cc59a6c9c1a8188fe59.png)
JAVA设计模式-大集合数据拆分
背景 我们在做软件开发时,经常会遇到把大集合的数据,拆分成子集合处理。例如批量数据插入数据库时,一次大约插入5000条数据比较合理,但是有时候待插入的数据远远大于5000条。这时候就需要进行数据拆分。数据拆分基本逻辑并不复杂&…...
![](https://img-blog.csdnimg.cn/img_convert/62f6840adee7b7b23071d2ed59d81942.jpeg)
如何使用sr2t将你的安全扫描报告转换为表格格式
关于sr2t sr2t是一款针对安全扫描报告的格式转换工具,全称为“Scanning reports to tabular”,该工具可以获取扫描工具的输出文件,并将文件数据转换为表格格式,例如CSV、XLSX或文本表格等,能够为广大研究人员提供一个…...
![](https://img-blog.csdnimg.cn/direct/f97fa48283b94d9d949b1562afadcf28.png)
ansible自动化运维,(2)ansible-playbook
三种常见的数据格式: XML:可扩展标记语言,用于数据交换和配置 JSON:对象标记法,主要用来数据交换或配置,不支持注释 YAML:不是一种标记语言,主要用来配置,大小写敏感&…...
![](https://img-blog.csdnimg.cn/direct/19806ebfeca046d382dba6006295d4be.png)
一分钟学习数据安全—自主管理身份SSI分布式标识DID介绍
SSI标准化的两大支柱,一个是VC,之前简单介绍过,另一个就是DID。基本层次上,DID就是一种新型的全局唯一标识符,跟浏览器的URL没有什么不同。深层次上,DID是互联网分布式数字身份和PKI新层级的原子构件。 一…...
![](https://www.ngui.cc/images/no-images.jpg)
[单master节点k8s部署]11.服务service
service service是一个固定接入层,客户端 可以访问service的ip和端口,访问到service关联的后端pod,这个service工作依赖于dns服务(coredns) 每一个k8s节点上都有一个组件叫做kube-proxy,始终监视着apiser…...
![](https://www.ngui.cc/images/no-images.jpg)
ES6面试题——箭头函数和普通函数有什么区别
1. this指向问题 <script> let obj {a: function () {console.log(this); // 打印出:{a: ƒ, b: ƒ}},b: () > {console.log(this); // 打印出Window {window: Window, self: Window,...}}, }; obj.a(); obj.b(); </script> 箭头函数中的this是在箭…...
![](https://img-blog.csdnimg.cn/img_convert/e66e0a1404dfd6d516e231d2ef843a3a.png)
WordPress中文网址导航栏主题风格模版HaoWa
模板介绍 WordPress响应式网站中文网址导航栏主题风格模版HaoWa1.3.1源码 HaoWA主题风格除行为主体导航栏目录外,对主题风格需要的小控制模块都开展了敞开式的HTML在线编辑器方式的作用配备,另外预埋出默认设置的编码构造,便捷大伙儿在目前…...
![](https://img-blog.csdnimg.cn/img_convert/7e93029307c4a376c1c90751d7622ade.png)
ThreadPoolExecutor基于ctl变量的声明周期管理
个人博客 ThreadPoolExecutor基于ctl变量的声明周期管理 | iwts’s blog 总集 想要完整了解下ThreadPoolExecutor?可以参考: 基于源码详解ThreadPoolExecutor实现原理 | iwts’s blog ctl字段的应用 线程池内部使用一个变量ctl维护两个值ÿ…...
![](https://img-blog.csdnimg.cn/direct/e7468eb51dab4b05b3ee845cf4267dbc.png)
运维锅总详解Prometheus
本文尝试从Prometheus简介、架构、各重要组件详解、relable_configs最佳实践、性能能优化及常见高可用解决方案等方面对Prometheus进行详细阐述。希望对您有所帮助! 一、Prometheus简介 Prometheus 是一个开源的系统监控和报警工具,最初由 SoundCloud …...
![](https://www.ngui.cc/images/no-images.jpg)
深入解析Tomcat:Java Web服务器(上)
深入解析Tomcat:Java Web服务器(上) Apache Tomcat是一个开源的Java Web服务器和Servlet容器,用于运行Java Servlets和JavaServer Pages (JSP)。Tomcat在Java Web应用开发中扮演着重要角色。本文将详细介绍Tomcat的基本概念、安装…...
![](https://www.ngui.cc/images/no-images.jpg)
【第9章】MyBatis-Plus持久层接口之SimpleQuery
文章目录 前言一、使用步骤1.引入 SimpleQuery 工具类2.使用 SimpleQuery 进行查询 二、使用提示三、功能详解1. keyMap1.1 方法签名1.2 参数说明1.3 使用示例1.4 使用提示 2. map2.1 方法签名2.2 参数说明2.3 使用示例2.4 使用提示 3. group3.1 方法签名3.2 参数说明3.3 使用示…...
![](https://img-blog.csdnimg.cn/direct/71a52bdae16b465ea73bbb7809104611.png)
一文带你了解乐观锁和悲观锁的本质区别!
文章目录 悲观锁是什么?乐观锁是什么?如何实现乐观锁?什么是CAS应用局限性ABA问题是什么? 悲观锁是什么? 悲观锁它总是假设最坏的情况,它会认为共享资源在每次被访问的时候就会出现线程安全问题࿰…...
![](https://img-blog.csdnimg.cn/direct/7332f974ea6c48719a8c9745c6107588.png)
Android Studio环境搭建(4.03)和报错解决记录
1.本地SDK包导入 安装好IDE以及下好SDK包后,先不要管IDE的引导配置,直接新建一个新工程,进到开发界面。 SDK路径配置:File---->>Other Settings---->>Default Project Structure 拷贝你SDK解压的路径来这,…...
![](https://img-blog.csdnimg.cn/direct/d0e1b40494b645ce8e9a3b77f3ff17d9.jpeg#pic_center)
基于协同过滤的电影推荐与大数据分析的可视化系统
基于协同过滤的电影推荐与大数据分析的可视化系统 在大数据时代,数据分析和可视化是从大量数据中提取有价值信息的关键步骤。本文将介绍如何使用Python进行数据爬取,Hive进行数据分析,ECharts进行数据可视化,以及基于协同过滤算法…...
![](https://img-blog.csdnimg.cn/direct/38c711ab62d046a7b4f9ebc228dd1e43.png)
修复vcruntime140.dll方法分享
修复vcruntime140.dll方法分享 最近在破解typora的时候出现了缺失vcruntime140.dll文件的报错导致软件启动失败。所以找了一番资料发现都不是很方便的处理,甚至有的dll处理工具还需要花钱????,我本来就是为…...
![](https://www.ngui.cc/images/no-images.jpg)
PostgreSQL的系统视图pg_stat_wal_receiver
PostgreSQL的系统视图pg_stat_wal_receiver 在 PostgreSQL 中,pg_stat_wal_receiver 视图提供了关于 WAL(Write-Ahead Logging)接收进程的统计信息。WAL 接收器是 PostgreSQL 集群中流复制的一部分,它在从节点中工作,…...
![](https://img-blog.csdnimg.cn/direct/9b221bc402284c79850eb87d2079f9b7.png)
Qt之Pdb生成及Dump崩溃文件生成与调试(含注释和源码)
文章目录 一、Pdb生成及Dump文件使用示例图1.Pdb文件生成2.Dump文件调试3.参数不全Pdb生成的Dump文件调试 二、个人理解1.生成Pdb文件的方式2.Dump文件不生产的情况 三、源码Pro文件mian.cppMainWindowUi文件 总结 一、Pdb生成及Dump文件使用示例图 1.Pdb文件生成 下图先通过…...
![](https://img-blog.csdnimg.cn/direct/de5703e751a94b21956e8801c97a1db0.jpeg)
视频号视频怎么保存到手机,视频号视频怎么保存到手机相册里,苹果手机电脑都可以用
随着数字媒体的蓬勃发展,视频已成为我们日常生活中不可或缺的一部分。视频号作为众多视频分享平台中的一员,吸引了大量用户上传和分享各类精彩视频。然而,有时我们可能希望将视频号上的视频下载下来,以下将详细介绍如何将视频号的视频。 方法…...
![](https://img-blog.csdnimg.cn/direct/8dcc58fd58684e07a76a7295e6da4c85.png)
Softmax函数的作用
Softmax 函数主要用于多类别分类问题,它将输入的数值转换为概率分布。 具体来说,对于给定的输入向量 x [x_1, x_2,..., x_n] ,Softmax 函数的输出为 y [y_1, y_2,..., y_n] ,其中: 这样,Softmax 函数的输…...
![](https://img-blog.csdnimg.cn/direct/a7e6ce10b0e54b8d9b2a012117c9279b.gif#pic_center)
cesium 添加 Echarts 图层(空气质量点图)
cesium 添加 Echarts 图层(下面附有源码) 1、实现思路 1、在scene上面新增一个canvas画布 2、通坐标转换,将经纬度坐标转为屏幕坐标来实现 3、将ecarts 中每个series数组中元素都加 coordinateSystem: ‘cesiumEcharts’ 2、示例代码 <!DOCTYPE html> <html lan…...
![](https://img-blog.csdnimg.cn/direct/f0ee1c828df1462fa60fbc8611bc6560.jpeg)
Python技术笔记汇总(含语法、工具库、数科、爬虫等)
对Python学习方法及入门、语法、数据处理、数据可视化、空间地理信息、爬虫、自动化办公和数据科学的相关内容可以归纳如下: 一、Python学习方法 分解自己的学习目标:可以将学习目标分基础知识,进阶知识,高级应用,实…...
![](https://img-blog.csdnimg.cn/direct/97315ed78906465b9005d111e24251c5.png)
Nacos-注册中心
一、注册中心的交互流程 注册中心通常有两个角色: 服务提供者(生产者):对外提供服务的微服务应用。它会把自身的服务地址注册到注册中心,以供消费者发现和调用。服务调用者(消费者):调用其他微服务的应用程序。它会向注册中心订阅自己需要的服…...
![](https://img-blog.csdnimg.cn/direct/6322a7afd8844813b94c508fe9d99412.png)
Unity制作一个简单抽卡系统(简单好抄)
业务流程:点击抽卡——>播放动画——>显示抽卡面板——>将随机结果添加到面板中——>关闭面板 1.准备素材并导入Unity中(包含2个抽卡动画,抽卡结果的图片,一个背景图片,一个你的展示图片) 2.给…...
![](https://img-blog.csdnimg.cn/direct/2ef7b349bad04516958520dc3b249445.png)
简单多状态DP问题
这里写目录标题 什么是多状态DP解决多状态DP问题应该怎么做?关于多状态DP问题的几道题1.按摩师2.打家劫舍Ⅱ3.删除并获得点数4.粉刷房子5.买卖股票的最佳时期含手冷冻期 总结 什么是多状态DP 多状态动态规划(Multi-State Dynamic Programming, Multi-St…...
![](https://img-blog.csdnimg.cn/direct/0cd4d3b9e36f41369546d45aadceac11.png)
cpu,缓存,辅存,主存之间的关系及特点
关系图 示意图: ------------------- | CPU | | ------------- | | | 寄存器 | | | ------------- | | | L1缓存 | | | ------------- | | | L2缓存 | | | ------------- | | | L3缓存 | | | ------------- | ----…...
![](https://img-blog.csdnimg.cn/direct/85ce8be6fb80424295b29ee4a15b80ce.gif)
【每日刷题】Day77
【每日刷题】Day77 🥕个人主页:开敲🍉 🔥所属专栏:每日刷题🍍 🌼文章目录🌼 1. LCR 159. 库存管理 III - 力扣(LeetCode) 2. LCR 075. 数组的相对排序 - 力…...
![](https://www.ngui.cc/images/no-images.jpg)
chrome-base源码分析(1)macros模块
Chrome-base源码分析(2)之Macros模块 Author:Once Day Date:2024年6月29日 漫漫长路,才刚刚开始… 全系列文章请查看专栏: 源码分析_Once-Day的博客-CSDN博客 参考文档: macros - Chromium Code SearchChrome base 库详解:工…...
![](https://www.ngui.cc/images/no-images.jpg)
玩转springboot之springboot定制嵌入式的servlet
springboot定制嵌入式的servlet容器 修改容器配置 有两种方式可以修改容器的配置 可以直接在配置文件中修改和server有关的配置 server.port8081 server.tomcat.uri-encodingUTF-8//通用的Servlet容器设置 server.xxx //指定Tomcat的设置 server.tomcat.xxx编写一个EmbeddedSer…...
![](https://img-blog.csdnimg.cn/direct/65672821635f4a0ab3c0be87bcc6e4aa.png)
dell服务器RAID5磁盘阵列出现故障的解决过程二——热备盘制作与坏盘替换过程
目录 背景方案概念全局热备(Global Hot Spare):独立热备(Dedicated Hot Spare): 过程8号制作成热备清除配置制作独立热备热备顶替坏盘直接rebuild 更换2号盘2号热备 注意注意事项foreign状态要先清除配置 背…...
![](https://img-blog.csdnimg.cn/direct/69b7a5575ae247cea51c4deaf5ad40df.png)
Elasticsearch开启认证|为ES设置账号密码|ES账号密码设置|ES单机开启认证|ES集群开启认证
文章目录 前言单节点模式开启认证生成节点证书修改ES配置文件为内置账号添加密码Kibana修改配置验证 ES集群开启认证验证 前言 ES安装完成并运行,默认情况下是允许任何用户访问的,这样并不安全,可以为ES开启认证,设置账号密码。 …...
![](https://img-blog.csdnimg.cn/img_convert/753bbe661495e5ee305533b9b6062a1d.png)
Excel 数据筛选难题解决
人不走空 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌赋:斯是陋室,惟吾德馨 目录 🌈个人主页:人不走空 💖系列专栏:算法专题 ⏰诗词歌…...
![](https://img-blog.csdnimg.cn/direct/9818fa50f19f458aa709d5ffaed2b754.png#pic_center)
Web实时通信的学习之旅:WebSocket入门指南及示例演示
文章目录 WebSocket的特点1、工作原理2、特点3、WebSocket 协议介绍4、安全性 WebSocket的使用一、服务端1、创建实例:创建一个webScoket实例对象1.1、WebSocket.Server(options[,callback])方法中options对象所支持的参数1.2、同样也有一个加密的 wss:/…...
![](https://img-blog.csdnimg.cn/direct/fdd1f8a0f7c04eb688510543d8824642.gif)
分治精炼宝库-----快速排序运用(⌯꒪꒫꒪)੭
目录 一.基本概念: 一.颜色分类: 二.排序数组: 三.数组中的第k个最大元素: 解法一:快速选择算法 解法二:简单粗暴优先级队列 四.库存管理Ⅲ: 解法一:快速选择 解法二:简单粗…...
![](https://img-blog.csdnimg.cn/direct/84ef9308c598495f9de0123cb391f28d.png)
快速修复mfc100u.dll丢失解决方案
相连文章:SecureCRT的安装破解 [详细过程2024] 有小伙伴向我反馈在打开SecureFX注册机之后显示【mfc100u.dll找不到】重装之后也没有用,这个是因为Microsoft Visual C的运行时组件和库出现了错误,直接选择重新安装就可以 出现这种情况的原因…...
![](https://img-blog.csdnimg.cn/direct/642b0d560888443c99dcfd30af980b3e.png)
【C++深度探索】继承机制详解(一)
hello hello~ ,这里是大耳朵土土垚~💖💖 ,欢迎大家点赞🥳🥳关注💥💥收藏🌹🌹🌹 💥个人主页:大耳朵土土垚的博客 …...
![](https://www.ngui.cc/images/no-images.jpg)
力扣第218题“天际线问题”
在本篇文章中,我们将详细解读力扣第218题“天际线问题”。通过学习本篇文章,读者将掌握如何使用扫描线算法和堆来解决这一问题,并了解相关的复杂度分析和模拟面试问答。每种方法都将配以详细的解释,以便于理解。 问题描述 力扣第…...
![](https://img-blog.csdnimg.cn/direct/08bc72f63b6c4b4bb85280f22436f70d.jpeg)
帝国cms未审核文章可视化预览效果
有时候为了让编辑更加清楚的看到别人审核之后的效果,同时文章有需要下一级审核才能在前端展示出来,今天就来展示一个未审核文章预览审核后的效果 这次给某出版社开发的时候,他们需要实现编辑能够预览自己发布之后的审核效果,所以就…...
![](https://img-blog.csdnimg.cn/direct/e59cca1aa65048a9a415105be0022f79.png)
医院管理系统带万字文档医院预约挂号管理系统基于spingboot和vue的前后端分离java项目java课程设计java毕业设计
文章目录 仓库管理系统一、项目演示二、项目介绍三、万字项目文档四、部分功能截图五、部分代码展示六、底部获取项目源码带万字文档(9.9¥带走) 仓库管理系统 一、项目演示 医院管理系统 二、项目介绍 基于springbootvue的前后端分离医院管…...
![](https://www.ngui.cc/images/no-images.jpg)
论文学习 --- RL Maximumdiffusion reinforcement learning
前言 个人拙见,如果我的理解有问题欢迎讨论 (●′ω`●) 文章出处:https://techxplore.com/news/2024-05-random-robots-reliable-ai-algorithm.html 研究背景 最大扩散强化学习(MaxDiff RL)是一种创新的强化学习方法,借鉴了统计力学中的扩散过程和最大熵原理。该方法在…...
![](https://www.ngui.cc/images/no-images.jpg)
antd vue a-select 下拉框模糊查询失效解决方法
我原以为这是一个简单的配置,写上就好了,没想到竟然无法搜索,原因是antd下拉框模糊搜索(show-search)是默认按照value字段来查询的,但是一般我们的都是需要按照label这个属性来查询的。简单点按照我下面标红…...
![](https://www.ngui.cc/images/no-images.jpg)
Python考前复习
选择题易错: python3不能完全兼容python2内置函数是python的内置对象之一,无需导入其他模块python中汉字变量合法,如“小李123”合法;但T-C不合法,因为有“-”集合无顺序,不能索引;range(5)[2]…...
![](https://img-blog.csdnimg.cn/direct/0fdbec200c11438a9c7b6c4b76f3761e.png)
STM32-HAL-FATFS(文件系统)(没做完,stm32f103zet6(有大佬的可以在评论区说一下次板子为什么挂载失败了))
1STM32Cube配置 1-1配置时钟 1-2配置调试端口 1-3配置uart 1-4配置SDIO(注意参数)(其中他的初始化的异常函数给注释,SD卡文件写了) 配置了还要打开中断和DMA可在我的其他文章中看一样的 1-5配置FatFs (只改了图选中…...
![](https://img-blog.csdnimg.cn/direct/ec4ce7f90f90443eb41512a946d2eb1b.png)
自动驾驶AVM环视算法--相机的联合标定算法实现和exe测试demo
更新:测试的exe程序,无需解压码就可以体验算法测试效果 链接:https://pan.baidu.com/s/1OfuslVNcTXAZWvwiqflWsA 提取码:zoef 1、压缩包解压后显示如下所示 测试文件包括:可执行的exe文件、测试的图片等。 2.双击ex…...
![](https://www.ngui.cc/images/no-images.jpg)
Java 家庭物联网
家庭物联网系统的代码和说明,包括用户认证、设备控制、数据监控、通知和警报、日志记录以及WebSocket实时更新功能。 ### 项目结构 plaintext home-iot-system ├── backend │ └── src │ └── main │ └── java │ └…...
![](https://www.ngui.cc/images/no-images.jpg)
问界新M7Ultra上市,配置大升级,理想L7有压力吗?
2024年5月31日夜晚,问界新M7 Max焕新版正式上市,新车主要针对外观、配置作出调整,新车型命名问界新M7 Ultra,官方分别推出了2款配置车型,这两款配置又分别推出五座版和六座版,官方指导价在28.98-32.98万元。根据外观可以看到,问界新M7 Ultra的前脸设计更加简约,车辆换装…...
![](https://www.ngui.cc/images/no-images.jpg)
相差8000元!全新凯美瑞买燃油版,还是混动版?
前不久,广汽丰田全新凯美瑞正式上市,新车共有9款配置,分为2.0L燃油版和2.0L混动版,售价从17.18-20.68万元。全新凯美瑞在搭载2.0L混合动力总成后,售价方面有了大幅度的下调,17.98万元起步,顶配20.68万元,确实很有诚意。本期话题,我们就以凯美瑞入门的精英版两款车型来…...
![](https://img-blog.csdnimg.cn/direct/d154db3dd6f845cf9bec2579465ed0c7.png)
css卡片翻转 父元素翻转子元素不翻转效果
css卡片翻转 父元素翻转子元素不翻转效果 vue <div class"moduleBox"><div class"headTitle"><span class"headName">大额案例</span></div><div class"moduleItem"><span class"module…...
![](https://img-blog.csdnimg.cn/direct/c1e4d4ff87ed46d9825091e942b3163c.jpeg)
云原生架构内涵_3.主要架构模式
云原生架构有非常多的架构模式,这里列举一些对应用收益更大的主要架构模式,如服务化架构模式、Mesh化架构模式、Serverless模式、存储计算分离模式、分布式事务模式、可观测架构、事件驱动架构等。 1.服务化架构模式 服务化架构是云时代构建云原生应用的…...
![](https://img-blog.csdnimg.cn/direct/3fbabd06ea344f348d536ef833e9ec39.png)
系统架构设计师【第3章】: 信息系统基础知识 (核心总结)
文章目录 3.1 信息系统概述3.1.1 信息系统的定义3.1.2 信息系统的发展3.1.3 信息系统的分类3.1.4 信息系统的生命周期3.1.5 信息系统建设原则3.1.6 信息系统开发方法 3.2 业务处理系统(TPS)3.2.1 业务处理系统的概念3.2.2 业务处理系统的功能 …...
![](https://www.ngui.cc/images/no-images.jpg)
docker mqqt 安装
安装 cd /data/mqqt/ 目录准备 mkdir /data/mqqt/mosquitto/config/ #vim Dockerfile # 使用官方Eclipse Mosquitto镜像作为基础镜像 FROM eclipse-mosquitto:latest # 复制配置文件到容器内 COPY mosquitto.conf /data/mqqt/mosquitto/config/mosquitto.conf# 暴露默认的M…...