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

pyside6的调色板QPalette的简单应用

使用调色板需要先导入:from PySide6.QtGui import QPalette 

调色板QPalette的源代码:

class QPalette(Shiboken.Object):class ColorGroup(enum.Enum):Active                   : QPalette.ColorGroup = ... # 0x0Normal                   : QPalette.ColorGroup = ... # 0x0Disabled                 : QPalette.ColorGroup = ... # 0x1Inactive                 : QPalette.ColorGroup = ... # 0x2NColorGroups             : QPalette.ColorGroup = ... # 0x3Current                  : QPalette.ColorGroup = ... # 0x4All                      : QPalette.ColorGroup = ... # 0x5class ColorRole(enum.Enum):WindowText               : QPalette.ColorRole = ... # 0x0Button                   : QPalette.ColorRole = ... # 0x1Light                    : QPalette.ColorRole = ... # 0x2Midlight                 : QPalette.ColorRole = ... # 0x3Dark                     : QPalette.ColorRole = ... # 0x4Mid                      : QPalette.ColorRole = ... # 0x5Text                     : QPalette.ColorRole = ... # 0x6BrightText               : QPalette.ColorRole = ... # 0x7ButtonText               : QPalette.ColorRole = ... # 0x8Base                     : QPalette.ColorRole = ... # 0x9Window                   : QPalette.ColorRole = ... # 0xaShadow                   : QPalette.ColorRole = ... # 0xbHighlight                : QPalette.ColorRole = ... # 0xcHighlightedText          : QPalette.ColorRole = ... # 0xdLink                     : QPalette.ColorRole = ... # 0xeLinkVisited              : QPalette.ColorRole = ... # 0xfAlternateBase            : QPalette.ColorRole = ... # 0x10NoRole                   : QPalette.ColorRole = ... # 0x11ToolTipBase              : QPalette.ColorRole = ... # 0x12ToolTipText              : QPalette.ColorRole = ... # 0x13PlaceholderText          : QPalette.ColorRole = ... # 0x14Accent                   : QPalette.ColorRole = ... # 0x15NColorRoles              : QPalette.ColorRole = ... # 0x16@overloaddef __init__(self) -> None: ...@overloaddef __init__(self, button: PySide6.QtCore.Qt.GlobalColor) -> None: ...@overloaddef __init__(self, button: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef __init__(self, button: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], window: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef __init__(self, palette: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> None: ...@overloaddef __init__(self, windowText: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], button: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], light: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], dark: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], mid: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], bright_text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], base: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], window: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef __init__(self, windowText: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], window: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], light: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], dark: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], mid: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], text: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int], base: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@staticmethoddef __copy__() -> None: ...def __lshift__(self, ds: PySide6.QtCore.QDataStream) -> PySide6.QtCore.QDataStream: ...def __rshift__(self, ds: PySide6.QtCore.QDataStream) -> PySide6.QtCore.QDataStream: ...def accent(self) -> PySide6.QtGui.QBrush: ...def alternateBase(self) -> PySide6.QtGui.QBrush: ...def base(self) -> PySide6.QtGui.QBrush: ...def brightText(self) -> PySide6.QtGui.QBrush: ...@overloaddef brush(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QBrush: ...@overloaddef brush(self, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QBrush: ...def button(self) -> PySide6.QtGui.QBrush: ...def buttonText(self) -> PySide6.QtGui.QBrush: ...def cacheKey(self) -> int: ...@overloaddef color(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QColor: ...@overloaddef color(self, cr: PySide6.QtGui.QPalette.ColorRole) -> PySide6.QtGui.QColor: ...def currentColorGroup(self) -> PySide6.QtGui.QPalette.ColorGroup: ...def dark(self) -> PySide6.QtGui.QBrush: ...def highlight(self) -> PySide6.QtGui.QBrush: ...def highlightedText(self) -> PySide6.QtGui.QBrush: ...def isBrushSet(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole) -> bool: ...def isCopyOf(self, p: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> bool: ...def isEqual(self, cr1: PySide6.QtGui.QPalette.ColorGroup, cr2: PySide6.QtGui.QPalette.ColorGroup) -> bool: ...def light(self) -> PySide6.QtGui.QBrush: ...def link(self) -> PySide6.QtGui.QBrush: ...def linkVisited(self) -> PySide6.QtGui.QBrush: ...def mid(self) -> PySide6.QtGui.QBrush: ...def midlight(self) -> PySide6.QtGui.QBrush: ...def placeholderText(self) -> PySide6.QtGui.QBrush: ...def resolve(self, other: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> PySide6.QtGui.QPalette: ...def resolveMask(self) -> int: ...@overloaddef setBrush(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole, brush: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef setBrush(self, cr: PySide6.QtGui.QPalette.ColorRole, brush: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...@overloaddef setColor(self, cg: PySide6.QtGui.QPalette.ColorGroup, cr: PySide6.QtGui.QPalette.ColorRole, color: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...@overloaddef setColor(self, cr: PySide6.QtGui.QPalette.ColorRole, color: Union[PySide6.QtGui.QColor, PySide6.QtGui.QRgba64, Any, PySide6.QtCore.Qt.GlobalColor, str, int]) -> None: ...def setColorGroup(self, cr: PySide6.QtGui.QPalette.ColorGroup, windowText: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], button: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], light: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], dark: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], mid: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], bright_text: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], base: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap], window: Union[PySide6.QtGui.QBrush, PySide6.QtCore.Qt.BrushStyle, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor, PySide6.QtGui.QGradient, PySide6.QtGui.QImage, PySide6.QtGui.QPixmap]) -> None: ...def setCurrentColorGroup(self, cg: PySide6.QtGui.QPalette.ColorGroup) -> None: ...def setResolveMask(self, mask: int) -> None: ...def shadow(self) -> PySide6.QtGui.QBrush: ...def swap(self, other: Union[PySide6.QtGui.QPalette, PySide6.QtCore.Qt.GlobalColor, PySide6.QtGui.QColor]) -> None: ...def text(self) -> PySide6.QtGui.QBrush: ...def toolTipBase(self) -> PySide6.QtGui.QBrush: ...def toolTipText(self) -> PySide6.QtGui.QBrush: ...def window(self) -> PySide6.QtGui.QBrush: ...def windowText(self) -> PySide6.QtGui.QBrush: ...

QPalette 类有两个基本的概念,一个是颜色组ColorGroup,另一个是颜色角色ColorRole。 

1、颜色角色ColorRole:

from PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()    # 创建调色板
color_red = QColor(255, 0, 0)  # 定义红色
color_green = QColor(0, 255, 0)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色palette.setColor(QPalette.ColorRole.WindowText, color_red)    # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)    # 将调色板的窗口颜色设置为绿色label = QLabel("Hello World!")    # 创建部件
label.setPalette(palette)          # 将调色板应用到部件
label.show()                       # 显示部件app.exec()

 运行结果:这里通过setColor的方法将调色板的窗口文字和背景颜色方便设置为了红色和绿色,并应用到部件。

还可使用 palette()的方法来获取一个既有的调色板,以及通过color()来获取调色板中的某一个具体颜色:

例如:

p = label.palette()    # p是一个既有的部件label的调色板

color1 = p.color(p.ColorRole.WindowText)     # 获取调色板中的窗口文字的颜色

demo:

import timefrom PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()    # 创建调色板
color_red = QColor(255, 0, 0)  # 定义红色
color_green = QColor(0, 255, 0)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色palette.setColor(QPalette.ColorRole.WindowText, color_red)    # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)    # 将调色板的窗口颜色设置为绿色label = QLabel("Hello World!")    # 创建部件
label.setPalette(palette)          # 将调色板应用到部件
label.show()                       # 显示部件time.sleep(5)   # 延时5秒p = label.palette()      # 获取已有部件label的调色板
color1 = p.color(p.ColorRole.WindowText)    # 获取窗口文字的颜色
color2 = p.color(p.ColorRole.Window)        # 获取背景色palette.setColor(QPalette.ColorRole.WindowText, color2)    # 重新设置调色板的窗口文字颜色
palette.setColor(QPalette.ColorRole.Window, color1)    # 重新设置调色板的背景色
label.setPalette(palette)          # 将调色板应用到部件app.exec()

运行之后可以看到,首先显示了一个绿底红字的部件。 

5秒钟后,变成如下:

 


2、颜色组 ColorGroup:

ColorGroup 分为3 种情况
·  激活状态(Active,获得焦点)、 
·  非激活状态(Inactive,失去焦点) 
·  失效状态(Disabled,不可用),例如进行多窗口操作时.单击其中的一个窗口,可以在窗口中输人数据,则这个窗口是激活状态,其他窗口是非活跃状态。 将
ColorGroup 和ColorRole 结合起来,可以为控件不同部分不同状态设置不同的颜色。 

import timefrom PySide6.QtWidgets import QApplication, QLabel
from PySide6.QtGui import QColor, QPaletteapp = QApplication([])
palette = QPalette()  # 创建调色板
color_red = QColor(255, 30, 30)  # 定义红色
color_green = QColor(30, 255, 30)  # 定义绿色
color_gray = QColor(130, 130, 130)  # 定义灰色
color_black = QColor(10, 10, 10)  # 定义黑色palette.setColor(QPalette.ColorRole.WindowText, color_red)  # 将调色板的窗口文字设置为红色
palette.setColor(QPalette.ColorRole.Window, color_green)  # 将调色板的窗口颜色设置为绿色
disable_color_group = QPalette.ColorGroup(QPalette.ColorGroup.Disabled)  # 获取Disabled的颜色组
palette.setColor(disable_color_group, QPalette.ColorRole.WindowText, color_black)  # 将Disabled的颜色组的窗口文本设为灰色
palette.setColor(disable_color_group, QPalette.ColorRole.Window, color_gray)  # 将Disabled的颜色组的窗口背景设为黑色label = QLabel("Hello World!")  # 创建部件
label.setPalette(palette)  # 将调色板应用到部件
label.show()  # 显示部件time.sleep(3)  # 延时3秒
label.setDisabled(True)   # 禁用部件app.exec()

 运行截图:

相关文章:

pyside6的调色板QPalette的简单应用

使用调色板需要先导入:from PySide6.QtGui import QPalette 调色板QPalette的源代码: class QPalette(Shiboken.Object):class ColorGroup(enum.Enum):Active : QPalette.ColorGroup ... # 0x0Normal : QPalette.ColorGrou…...

苍穹外卖项目

Day01 收获 补习git Git学习之路-CSDN博客 nginx 作用:反向代理和负载均衡 swagger Swagger 与 Yapi Swagger: 可以自动的帮助开发人员生成接口文档,并对接口进行测试。 项目接口文档网址: http://localhost:8080/doc.html Da…...

error: Execution was interrupted, reason: signal SIGABRT

c json解析时&#xff0c; error: Execution was interrupted, reason: signal SIGABRT const Json::Value points root["shapes"]; if (points.isArray()) { for (unsigned int i 0; i < points.size(); i) { std::cout << " - [" <<…...

HarmaonyOS鸿蒙应用科普课

一、什么是鸿蒙OS&#xff1f; 1.概念&#xff1a; 先给大家讲讲今天讲课的主题&#xff0c;鸿蒙OS是什么&#xff1f;鸿蒙系统大家都知道&#xff0c;就是一个操作系统&#xff0c;我们未来是为的成为鸿蒙程序员。所以我们不要将鸿蒙os完全等同于手机操作系统&#xff0c;太…...

数码管的显示

静态数码管显示 数码管有两种一种的负电压促发,一种是正电压促发,上图是单数码管的引脚 上图是数码管模组的引脚,采用了引脚复用技术 咱们这个单片机由8个单数码管,所以要用上38译码器,如下图 74138使能端,单片机上电直接就默认接通了 74HC245的作用是稳定输入输出,数据缓冲作…...

关于海康相机和镜头参数的记录

对比MV-CS020-10UC和大家用的最多的MV-CS016-10UC 其实前者适合雷达站使用&#xff0c;后者适合自瞄使用 一&#xff1a;MV-CS020-10UC的参数 二&#xff1a;对比 三&#xff1a;海康镜头选型工具...

【JavaScript】运算符

算术运算符 1. 加法运算符&#xff08;&#xff09; 加法运算符用于将两个值相加。如果两个操作数都是数字&#xff0c;则它们将被加在一起。如果其中一个操作数是字符串&#xff0c;则另一个操作数将被转换为字符串&#xff0c;然后执行字符串连接。 运算子不同&#xff0c…...

LabVIEW航空发动机主轴承试验器数据采集与监测

LabVIEW航空发动机主轴承试验器数据采集与监测 随着航空技术的迅速发展&#xff0c;对航空发动机性能的测试与监测提出了更高的要求。传统的数据采集与监测方法已难以满足当前高精度和高可靠性的需求&#xff0c;特别是在主轴承试验方面。基于LabVIEW的航空发动机主轴承试验器…...

CVE-2022-2602:unix_gc 错误释放 io_uring 注册的文件从而导致的 file UAF

前言 复现该漏洞只是为了学习相关知识&#xff0c;在这里仅仅做简单记录下 exp&#xff0c;关于漏洞的详细内容请参考其他文章&#xff0c;最后在 v5.18.19 内核版本上复现成功&#xff0c;v6.0.2 复现失败 漏洞利用 diff --git a/include/linux/skbuff.h b/include/linux/s…...

LSTM实战笔记(部署到C++上)——更新中

前几天由于自己的个人原因停止了学习 接下里继续更新一些自己项目中所用到的神经网络等 ——————————————————————————————————————————— LSTM代码介绍 建立LSTM模型时需要设置一些参数&#xff0c;包括输入数据的形状、LSTM层的…...

鸿蒙内核源码分析(消息队列篇) | 进程间如何异步传递大数据

基本概念 队列又称消息队列&#xff0c;是一种常用于任务间通信的数据结构。队列接收来自任务或中断的不固定长度消息&#xff0c;并根据不同的接口确定传递的消息是否存放在队列空间中。 任务能够从队列里面读取消息&#xff0c;当队列中的消息为空时&#xff0c;挂起读取任务…...

Sentinel流量防卫兵

1、分布式服务遇到的问题 服务可用性问题 服务可用性场景 服务雪崩效应 因服务提供者的不可用导致服务调用者的不可用,并将不可用逐渐放大的过程&#xff0c;就叫服务雪崩效应导致服务不可用的原因&#xff1a; 在服务提供者不可用的时候&#xff0c;会出现大量重试的情况&…...

微信小程序:14.什么是wxs,wxs的使用

wxs是小程序独有的一套脚本语言&#xff0c;结合wxml&#xff0c;可以构建出页面的结构 wxs的应用场景 wxml中无法调用在页面的js中定义的函数&#xff0c;但是wxml可以调用wxs中定义的函数。因此小程序中wxs的典型应用场景就是过滤器 wxs和js的关系 wxs有自己的数据类型 …...

Django运行不提示网址问题

问题描述&#xff1a;运行django项目不提示网址信息&#xff0c;也就是web没有起来&#xff0c;无法访问。 (my-venv-3.8) PS D:\Project\MyGitCode\public\it_blog\blog> python .\manage.py runserver INFO autoreload 636 Watching for file changes with StatReloader …...

web安全---xss漏洞/beef-xss基本使用

what xss漏洞----跨站脚本攻击&#xff08;Cross Site Scripting&#xff09;&#xff0c;攻击者在网页中注入恶意脚本代码&#xff0c;使受害者在浏览器中运行该脚本&#xff0c;从而达到攻击目的。 分类 反射型---最常见&#xff0c;最广泛 用户将带有恶意代码的url打开&a…...

第一天学习(GPT)

1.图片和语义是如何映射的&#xff1f; **Dalle2&#xff1a;**首先会对图片和语义进行预训练&#xff0c;将二者向量存储起来&#xff0c;然后将语义的vector向量转成图片的向量&#xff0c;然后基于这个图片往回反向映射&#xff08;Diffusion&#xff09;——>根据这段描…...

【C++之AVL树旋转操作的详细图解】

C++学习笔记---022 C++之AVL树旋转操作的详细图解1、AVL树的简单介绍1.1、基本概念1.2、平衡因子1.3、AVL树的特性2、C++中pair的介绍2.1、定义和初始化2.2、访问元素2.3、作为容器的元素2.4、作为函数的返回值3、AVL树节点的定义4、AVL的插入规则探究5、AVL树的旋转操作5.1、R…...

制作Android分区镜像

1 python生成一个sector数据 def get_oem_bootmode(): # Header size SECTOR_SIZE_IN_BYTES 512 header [0 for i in \ range(SECTOR_SIZE_IN_BYTES)] # magic # The ord() built-in function in # Python converts a character # into …...

如何代码激活service——packageKit 系统更新番外

在访问packageKit服务的过程中&#xff0c;服务一直访问失败&#xff0c;PackageKit::Daemon::global()->isRunning() 一直返回false&#xff0c;他是一个用于检查 PackageKit 守护进程是否正在运行的函数调用。在 Qt 和 PackageKit 的集成中&#xff0c;isRunning 方法通常…...

音视频常用工具

VLC 播放器简介 VLC 播放器 VLC支持多种常见音视频格式&#xff0c;支持多种流媒体传输协议&#xff0c;也可当作本地流媒体服务器使用&#xff0c;功能十分强大。官网下载地址: https://www.videolan.org/ VLC media player VLC 是一款自由、开源的跨平台多媒体播放器及框架&…...

周刊是聪明人筛选优质知识的聪明手段!

这是一个信息过载的时代&#xff0c;也是一个信息匮乏的时代。 这种矛盾的现象在 Python 编程语言上的表现非常明显。 它是常年高居编程语言排行榜的最流行语言之一&#xff0c;在国外发展得如火如荼&#xff0c;开发者、项目、文章、播客、会议活动等相关信息如海如潮。 但…...

设计模式Java实现-建造者模式

楔子 小七在2019年的时候&#xff0c;就想写一个关于设计模式的专栏&#xff0c;但是最终却半途而废了。粗略一想&#xff0c;如果做完一件事要100分钟&#xff0c;小七用3分钟热情做的事&#xff0c;最少也能完成10件事情了。所以这一次&#xff0c;一定要把他做完&#xff0…...

微博视频怎么下载无水印

在当今社交媒体时代&#xff0c;微博已经成为人们获取信息、分享生活的重要平台之一。许多人在浏览微博时常常遇到一个问题&#xff1a;如何下载微博视频而不留下烦人的水印呢?今天&#xff0c;我将分享一些神秘的方法&#xff0c;让你轻松解锁微博视频的无水印下载技巧。 第…...

为什么要梯度累积

文章目录 梯度累积什么是梯度累积如何理解理解梯度累积梯度累积的工作原理 梯度累积的数学原理梯度累积过程如何实现梯度累积 梯度累积的可视化 梯度累积 什么是梯度累积 随着深度学习模型变得越来越复杂&#xff0c;模型的训练通常需要更多的计算资源&#xff0c;特别是在训…...

知识图谱在提升大语言模型性能中的应用:减少幻觉与增强推理的综述

幻觉现象指的是模型在生成文本时可能会产生一些听起来合理但实际上并不准确或相关的输出&#xff0c;这主要是由于模型在训练数据中存在知识盲区所致。 为了解决这一问题&#xff0c;研究人员采取了多种策略&#xff0c;其中包括利用知识图谱作为外部信息源。知识图谱通过将信息…...

P8800 [蓝桥杯 2022 国 B] 卡牌

P8800 [蓝桥杯 2022 国 B] 卡牌 分析 “最多” -- 二分 1.二分区间&#xff08;凑齐的卡牌套数&#xff09;&#xff1a; l&#xff1a;a[]min&#xff1b;r&#xff1a;(a[]b[])max 2.check(x)&#xff1a; &#xff08;1&#xff09;for循环内&#xff1a; 判断x - a[i…...

MySQL商城数据表(80-84)

80商品规格值表 DROP TABLE IF EXISTS niumo_spec_items; CREATE TABLE niumo_spec_items (itemId int(11) NOT NULL AUTO_INCREMENT COMMENT 自增ID,shopId int(11) NOT NULL DEFAULT 0 COMMENT 店铺ID,catId int(11) NOT NULL DEFAULT 0 COMMENT 类型ID,goodsId int(11) NOT…...

使用Gitbook生成电子书

背景 《Google工程实践文档》相对原文Google’s Engineering Practices documentation &#xff0c;部分内容过时了。需要更新中文版&#xff0c;并使用Gitbook把Markdown文件转换成对应的PDF电子书。   上一次生成PDF电子书是5年前&#xff0c;当时生成电子书的环境早已不在…...

设计模式之传输对象模式

在编程江湖里&#xff0c;有一种模式&#xff0c;它如同数据的“特快专递”&#xff0c;穿梭于系统间&#xff0c;保证信息的快速准确送达&#xff0c;它就是——传输对象模式&#xff08;Data Transfer Object, DTO&#xff09;。这不仅仅是数据的搬运工&#xff0c;更是提升系…...

Re69:读论文 LaMDA: Language Models for Dialog Applications

诸神缄默不语-个人CSDN博文目录 诸神缄默不语的论文阅读笔记和分类 论文名称&#xff1a;LaMDA: Language Models for Dialog Applications ArXiv网址&#xff1a;https://arxiv.org/abs/2201.08239 本文介绍谷歌提出的对话大模型LaMDA&#xff0c;主要关注对各项指标&#x…...

如何自己编写小程序/汕头seo收费

umask 命令允许你设定文件创建时的缺省模式&#xff0c;对应每一类用户(文件属主、同组用户、其他用户)存在一个相应的umask值中的数字。对于文件来说&#xff0c;这一数字的最 大值分别是6。系统不允许你在创建一个文本文件时就赋予它执行权限&#xff0c;必须在创建后用chmod…...

wordpress添加文件2m/深圳正规seo

replaceAll() 方法使用给定的参数 replacement 替换字符串所有匹配给定的正则表达式的子字符串。语法public String replaceAll(String regex, String replacement)参数regex -- 匹配此字符串的正则表达式。newChar -- 用来替换每个匹配项的字符串。返回值成功则返回替换的字符…...

苏州专业网站建设设计公司/世界最新新闻

文章目录前言网络相关指令远程操作指令查看本地网络状态网络测试DNS查询HTTP相关前言 文章的内容来源拉钩教育上的课程学习&#xff0c;通过写博客的方式&#xff0c;更好的提高对该知识的掌握。 网络相关指令 Linux中提供不少网络相关的指令&#xff0c;从以下几个维度&…...

陕西省建设厅网站月报/制作网页的基本步骤

前言 当你在构建现代 web 应用程序时&#xff0c;无可避免地需要在页面之间跳转。轻易地做到这一点是非常重要的。为了实现这一点&#xff0c;Angular、React 和 Vue 等框架都具有路由功能。 接下来&#xff0c;我们将会学到如何使用 vue-router 配置路由&#xff0c;并实现在不…...

四海网络网站建设/竞价推广托管公司价格

我下载过几十个安卓系统上远程桌面软件&#xff0c;但我觉得 Xtralogic Remote Desktop Client 这款软件是最好用的。它安全性高&#xff0c;支持主密码&#xff0c;防止外人使用这个软件。它功能强大&#xff0c;支持 RDP 和 VNC 协议。它易用性高&#xff0c;缩放流利&#x…...

档案信息网站建设/六年级上册数学优化设计答案

1061: [Noi2008]志愿者招募 Description 申奥成功后&#xff0c;布布经过不懈努力&#xff0c;终于成为奥组委下属公司人力资源部门的主管。布布刚上任就遇到了一个难题&#xff1a;为即将启动的奥运新项目招募一批短期志愿者。经过估算&#xff0c;这个项目需要N 天才能完成&a…...