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

Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍

目录

一:EditorGUI和EditorGUILayout区别

二:EditorGUILayout

1.EditorGUILayout.BeginFadeGroup(float value);

2.EditorGUILayout.BeginHorizontal  EditorGUILayout.BeginVertical

3.EditorGUILayout.BeginScrollView

4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle

5.EditorGUILayout.BoundsField  EditorGUILayout.BoundsIntField  public static Color ColorField   等等等....

6.EditorGUILayout.DropdownButton

7.EditorGUILayout.BeginBuildTargetSelectionGrouping

8.EditorGUILayout.EnumFlagsField

9.EditorGUILayout.EnumPopup

10.EditorGUILayout.Foldout

11.EditorGUILayout.GetControlRect

12.EditorGUILayout.GradientField

13.EditorGUILayout.HelpBox

14.EditorGUILayout.IntSlider||EditorGUILayout.Slider

15.EditorGUILayout.ObjectField

16.EditorGUILayout.PrefixLabel

17.EditorGUILayout.PropertyField

18.EditorGUILayout.SelectableLabel

19.EditorGUILayout.Space();

三.所有代码:


一:EditorGUI和EditorGUILayout区别

官方的api给出的是EditorGUILayout是EditorGUI的自动布局版本

什么意思呢?

如果我们进入到EditorGUI和EditorGUILayout的代码里可以看到EditorGUI类里有的方法 基本在EditorGUILayout类里都有相对应的方法 

区别就是:
EditorGUI类的方法基本上都要传入一个参数Rect包含了位置和大小而EditorGUILayout不需要

这样看的话我们着重了解一下EditorGUILayout

二:EditorGUILayout

常用方法:

1.EditorGUILayout.BeginFadeGroup(float value);

解释: 开始一个可隐藏/显示的组,并且过渡将生成动画。

eg:

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

修改值为0.5f

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(0.5f)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

 

修改为1

private void OnGUI() {if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();}

效果:

 

2.EditorGUILayout.BeginHorizontal
  EditorGUILayout.BeginVertical

解释:开始一个水平组/垂直组
eg:

        EditorGUILayout.BeginHorizontal();GUILayout.Button("H_Btn1");GUILayout.Button("H_Btn2");EditorGUILayout.EndHorizontal();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();

效果:

3.EditorGUILayout.BeginScrollView

解释:开始一个自动布局的滚动视图。
eg:

scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();

效果:

 

4.EditorGUILayout.BeginToggleGroup&&EditorGUILayout.Toggle

BeginToggleGroup  解释:开始一个垂直组,带有可一次性启用或禁用所有控件的开关
Toggle                       解释:创建一个开关
eg:

bool showToggle;private void OnGUI() {showToggle =  EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();}

效果:

 

5.EditorGUILayout.BoundsField
  EditorGUILayout.BoundsIntField
  public static Color ColorField   等等等....

unity的api 或者C# api 的一些类型的展示
eg:

    Bounds Bounds;BoundsInt boundsInt;Color color;private void OnGUI() {EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}

效果:

6.EditorGUILayout.DropdownButton

解释:创建一个能够对鼠标按下做出反应的按钮,用于显示您自己的下拉菜单内容
eg:

private void OnGUI() {
EditorGUILayout.BeginVertical();GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));Rect rect = GUILayoutUtility.GetLastRect();genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();
}private void Select() {Debug.Log("Select");}

效果:

修改:
            Rect rect = GUILayoutUtility.GetLastRect();
            genericMenu.DropDown(rect);

为:
            genericMenu.ShowAsContext();

效果:

拓展:GenericMenu 创建自定义上下文菜单和下拉菜单。

变量
allowDuplicateNames
允许菜单具有多个同名的菜单项。


公共函数
AddDisabledItem
向菜单添加已禁用的项。
AddItem
向菜单添加一个项。
AddSeparator
向菜单添加一个分隔符项。
DropDown
在给定屏幕矩形中显示菜单。
GetItemCount
获取菜单中的项数。
ShowAsContext
右键单击时在鼠标下显示菜单。


委托
MenuFunction
回调函数,菜单项选中时调用。
MenuFunction2
带有用户数据的回调函数,菜单项选中时调用。

7.EditorGUILayout.BeginBuildTargetSelectionGrouping

解释:开始构建目标组并返回所选 BuildTargetGroup
eg:

BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();

效果:

 

 

 

8.EditorGUILayout.EnumFlagsField

解释:单击后,系统会为枚举类型每个值显示带有选项的菜单
eg:

public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField(cONENUM);EditorGUILayout.EndVertical();
}

效果:

 

9.EditorGUILayout.EnumPopup

解释:创建一个枚举弹出选择字段
eg:

public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}
CONENUM cONENUM;private void OnGUI() {EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();
}

效果:

10.EditorGUILayout.Foldout

解释:创建一个左侧带有折叠箭头的标签
eg:

 bool foldout = false;private void OnGUI() {EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();
}

效果:

 

 

11.EditorGUILayout.GetControlRect

解释:获取编辑器控件的矩形。
eg:    

Rect controlRect;string selectPath;private void OnGUI() {EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();
}

效果:

12.EditorGUILayout.GradientField

解释:创建一个用于编辑 Gradient 的字段。
eg: 

Gradient gradient = new Gradient();private void OnGUI() {EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();}

效果:

 

 

13.EditorGUILayout.HelpBox

解释:创建一个带有发送给用户的消息的帮助框。
eg:

private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();}

效果:

 

14.EditorGUILayout.IntSlider||EditorGUILayout.Slider

解释:创建一个滑动条,用户可以进行拖动以在最小值和最大值之间更改整数值。
eg:

int sliderValue = 0;private void OnGUI() {EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();}

效果:

 

注: EditorGUILayout.Slider 区别是支持浮点类型

15.EditorGUILayout.ObjectField

解释:生成一个可接收任何对象类型的字段。
eg:

UnityEngine.Object obj;private void OnGUI() {EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();}

效果:

16.EditorGUILayout.PrefixLabel

解释:创建一个显示在特定控件前标签
eg:

Color color;
private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();}

效果:

 

17.EditorGUILayout.PropertyField

解释:为 SerializedProperty 生成一个字段
eg:

public class TestBtn: MonoBehaviour {[HideInInspector]public string _name;private void OnGUI() {EditorGUILayout.BeginHorizontal();if(GUILayout.Button(_name)) {}EditorGUILayout.EndHorizontal();}
}
[CustomEditor(typeof(TestBtn))]
public class TestBtnTool : Editor {SerializedProperty serializedProperty;GUIContent gUIContent;private void Awake() {//反射拿到_name 赋值给serializedPropertyif(serializedObject.FindProperty("_name") != null) {serializedProperty = serializedObject.FindProperty("_name");}gUIContent = new GUIContent("L_Name");}public override void OnInspectorGUI() {base.OnInspectorGUI();if(serializedProperty != null) {EditorGUILayout.PropertyField(serializedProperty, gUIContent);//保存 serializedObject  serializedObject是TestBtn 的序列化serializedObject.ApplyModifiedProperties();}}
}

效果:

 

修改L_Name

 

 

18.EditorGUILayout.SelectableLabel

解释:生成一个可选择标签字段。(用于显示可复制粘贴的只读信息。)
eg:

private void OnGUI() {EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();
}

修改:

 注:1 2 3 可复制

19.EditorGUILayout.Space();

用在两个控件中间 会有一个空格
eg:      

EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");//EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();

效果:

 

使用后:

 

三.所有代码:

using System;
using System.Collections.Generic;
using UnityEditor;
using UnityEditor.AnimatedValues;
using UnityEngine;public class EditorToolWindowOne: EditorWindow {public static EditorToolWindowOne inst;float progress;[MenuItem("EditorTool/OpenWindowOne")]public static void CreateWindow() {inst = GetWindow<EditorToolWindowOne>(true, "这是一个浮动窗口");inst.Show();}private void Awake() {}Vector2 scrolpos = new Vector2(100, 100);bool showToggle;Bounds Bounds;BoundsInt boundsInt;Color color;CONENUM cONENUM;bool foldout = false;Rect controlRect;string selectPath;Gradient gradient = new Gradient();int sliderValue = 0;UnityEngine.Object obj;private void OnGUI() {BuildTargetGroup buildTargetGroup = EditorGUILayout.BeginBuildTargetSelectionGrouping();if(buildTargetGroup == BuildTargetGroup.Android) {GUILayout.Button("A_Btn1");GUILayout.Button("A_Btn2");} else if(buildTargetGroup == BuildTargetGroup.iOS) {GUILayout.Button("I_Btn1");GUILayout.Button("I_Btn2");} else if(buildTargetGroup == BuildTargetGroup.Standalone) {GUILayout.Button("S_Btn1");GUILayout.Button("S_Btn2");} else if(buildTargetGroup == BuildTargetGroup.WebGL) {GUILayout.Button("W_Btn1");GUILayout.Button("W_Btn2");}EditorGUILayout.EndBuildTargetSelectionGrouping();if(EditorGUILayout.BeginFadeGroup(1)) {GUILayout.TextArea("1\n2\n3\n4\n");}EditorGUILayout.EndFadeGroup();EditorGUILayout.BeginVertical();GUILayout.Button("V_Btn1");EditorGUILayout.Space();GUILayout.Button("V_Btn1");EditorGUILayout.EndVertical();scrolpos = EditorGUILayout.BeginScrollView(scrolpos, GUILayout.Width(80), GUILayout.Height(80));GUILayout.Label("item1111111111111");GUILayout.Label("item2");GUILayout.Label("item3");GUILayout.Label("item4");GUILayout.Label("item5");EditorGUILayout.EndScrollView();showToggle =  EditorGUILayout.BeginToggleGroup("toggleGroup", showToggle);EditorGUILayout.Toggle("toggle1", showToggle);EditorGUILayout.Toggle("toggle2", !showToggle);EditorGUILayout.EndToggleGroup();EditorGUILayout.BeginVertical();Bounds = EditorGUILayout.BoundsField(Bounds);boundsInt = EditorGUILayout.BoundsIntField(boundsInt);color = EditorGUILayout.ColorField(color);GUIContent dropDown = new GUIContent("菜单");if(EditorGUILayout.DropdownButton(dropDown, FocusType.Keyboard)) {GenericMenu genericMenu = new GenericMenu();genericMenu.AddItem(new GUIContent("文件"), true, Select);genericMenu.AddItem(new GUIContent("工具"), false, Select);genericMenu.AddSeparator("");genericMenu.AddItem(new GUIContent("设置/设置1"), true, Select);genericMenu.AddItem(new GUIContent("设置/设置2"), false, Select);genericMenu.AddItem(new GUIContent("主题/1"), true, Select);genericMenu.AddSeparator("主题/");genericMenu.AddItem(new GUIContent("主题/2"), false, Select);genericMenu.AddDisabledItem(new GUIContent("不可更改"));genericMenu.ShowAsContext();//Rect rect = GUILayoutUtility.GetLastRect();//genericMenu.DropDown(rect);}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumFlagsField("enum", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();cONENUM = (CONENUM)EditorGUILayout.EnumPopup("ENUM", cONENUM);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();foldout = EditorGUILayout.Foldout(foldout, "这个是什么意思,带折叠箭头的标签???");if(foldout) {GUILayout.Label("来吧展示!");}EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();controlRect = EditorGUILayout.GetControlRect(true, 100);selectPath = EditorGUI.TextField(controlRect, selectPath);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();gradient = EditorGUILayout.GradientField(gradient);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.HelpBox("一个带有发送给用户消息的帮助框?", MessageType.Error);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();sliderValue = EditorGUILayout.IntSlider(sliderValue, 0, 100);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();obj = EditorGUILayout.ObjectField(obj, typeof(UnityEngine.Object), true);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.PrefixLabel("Color");color = EditorGUILayout.ColorField(color);EditorGUILayout.EndVertical();EditorGUILayout.BeginVertical();EditorGUILayout.SelectableLabel("1");EditorGUILayout.SelectableLabel("2");EditorGUILayout.SelectableLabel("3");EditorGUILayout.EndVertical();}private void Select() {Debug.Log("Select");}
}
public enum CONENUM {NONE = 1 << 0,NORMAL = 1 << 2,SPE = 1 << 3,OTHER = 1 << 4,ALL = 1 << 5,
}

 效果:

如果有不对的地方希望能指出来 感激不尽。
另外,不熟悉的代码一定要写一下加深记忆 只用看的记不了太久。 

相关文章:

Editor工具开发实用篇:EditorGUI/EditorGUILayout的区别和EditorGUILayout的方法介绍

目录 一&#xff1a;EditorGUI和EditorGUILayout区别 二&#xff1a;EditorGUILayout 1.EditorGUILayout.BeginFadeGroup(float value); 2.EditorGUILayout.BeginHorizontal EditorGUILayout.BeginVertical 3.EditorGUILayout.BeginScrollView 4.EditorGUILayout.BeginT…...

(五十二)大白话不断在表中插入数据时,物理存储是如何进行页分裂的?.md

上回我们讲到了数据页的物理存储结构&#xff0c;数据页之间是组成双向链表的&#xff0c;数据页内部的数据行是组成单向链表的&#xff0c;每个数据页内根据主键做了一个页目录 然后一般来说&#xff0c;你没有索引的情况下&#xff0c;所有的数据查询&#xff0c;其实在物理…...

Unity 渲染顺序

Unity中的渲染顺序自上而下大致分为三层渲染优先级 Camera depth > Sorting Layer > Order in Layer > RenderQueueCamera depth:越小越优先&#xff08;大的显示在小的前面&#xff09;如图&#xff1a;尽管Sphere距离摄像机较远&#xff0c;但由于Camera_Sphere dep…...

短视频美颜sdk人脸编辑技术详解、美颜sdk代码分析

短视频美颜sdk中人脸编辑技术可以将人像风格进行转变&#xff0c;小编认为这也是未来的美颜sdk的一个重要发展方向&#xff0c;下文小编将为大家讲解一下短视频美颜sdk中人脸编辑的关键点。 一、人脸编辑的细分关键点 1、年龄 通过更改人脸的年龄属性&#xff0c;可用于模仿人…...

error: expected declaration specifiers or ‘...’ before ‘(’ token

一、问题 最近写函数时&#xff0c;遇到了一个比较奇怪的问题&#xff0c;相信也好多人遇到一下的问题&#xff1a; error: expected declaration specifiers or ‘...’ before ‘(’ token代码如下&#xff1a; #include<stdio.h> struct stu{char *name;int score;…...

系列七、索引

一、索引概述 1.1、概述 索引&#xff08;index&#xff09;是帮助MySQL高效获取数据的数据结构(有序)。在数据之外&#xff0c;数据库系统还维护着满足特定查找算法的数据结构&#xff0c;这些数据结构以某种方式引用&#xff08;指向&#xff09;数据&#xff0c; 这样就可以…...

Java开发 - Elasticsearch初体验

目录 前言 什么是es&#xff1f; 为什么要使用es&#xff1f; es查询的原理&#xff1f; es需要准备什么&#xff1f; es基本用法 创建工程 添加依赖 创建操作es的文件 使用ik分词插件 Spring Data 项目中引入Spring Data 添加依赖 添加配置 创建操作es的业务逻…...

mysql进阶

mysql进阶视图视图是一个基于查询的虚拟表&#xff0c;封装了一条sql语句,通俗的解释&#xff0c;视图就是一条select查询之后的结果集&#xff0c;视图并不存储数据&#xff0c;数据仍旧存储在表中。创建视图语句&#xff1a;create view view_admin as select * from admin使…...

SD卡损坏了?储存卡恢复数据就靠这3个方法

作为一种方便的储存设备&#xff0c;SD卡在我们的日常生活中使用非常广泛。但是&#xff0c;有时候我们可能会遇到SD卡损坏的情况&#xff0c;这时候里面存储的数据就会受到影响。SD卡里面保存着我们很多重要的数据&#xff0c;有些还是工作必须要使用的。 如果您遇到了这种情…...

springboot+实践(总结到位)

一。【SpringBoot注解-1】 牛逼&#xff1a;云深i不知处 【SpringBoot注解-1】&#xff1a;常见注解总览_云深i不知处的博客-CSDN博客 二。【SpringBoot-3】Lombok使用详解 【SpringBoot-3】Lombok使用详解_云深i不知处的博客-CSDN博客_springboot lombok 三&#xff0…...

CorelDRAW2023新功能有哪些?最新版cdr下载安装教程

使用 CorelDRAW2023&#xff0c;随时随都能进行设计创作。在 Windows或Mac上使用专为此平台设计的直观界面&#xff0c;以自己的风格尽情自由创作。同全球数百万信赖CorelDRAW Graphics Suite 的艺术家、设计者及小型企业主一样&#xff0c;大胆展现真我&#xff0c;创作出众的…...

PLC 程序设计标准化方法

PLC 程序设计的标准化方法先从内容或者方法层面进行流程的分解,将分解的内容称为要素,要素的有机结合便构成了标准化的设计。流程标准化设计完成之后需要对各个要素分别进行标准化的设计。2.1、 PLC 程序设计的要素分解与有机结合根据软件程序设计的一般性方法结合PLC 程序设计…...

设计模式-笔记

文章目录七大原则单例模式桥模式 bridge观察者模式 observer责任链模式 Chain of Responsibility命令模式 Command迭代器模式 Iterator中介者模式 Mediator享元模式 Flyweight Pattern组合模式 composite装饰模式 Decorator外观模式 Facade简单工厂模式工厂方法模式工厂抽象模式…...

【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程)

【全志T113-S3_100ask】12-3 Linux蓝牙通信实战(基于BlueZ的C语言BLE蓝牙编程 背景(一)获取BlueZ源码(二)首次编译2-1 编写Makefile2-2 make编译2-3 首次测试2-3-1 开发板操作2-3-2 安卓端操作(三)源码分析3-1 程序入口3-2 蓝牙设备名称3-3 GATT服务(四)实战4-1 添加B…...

Java学习之路003——集合

1、 代码演示 【1】新增一个类&#xff0c;用来测试集合。先创建一组数组&#xff0c;数组可以存放不同的数据类型。对于Object类型的数组元素&#xff0c;可以通过.getClass方法获取到具体类型。 【2】如果数组指定类型为int的时候&#xff0c;使用.getClass()就会提示错误。 …...

生成和查看dump文件

在日常开发中&#xff0c;即使代码写得有多谨慎&#xff0c;免不了还是会发生各种意外的事件&#xff0c;比如服务器内存突然飙高&#xff0c;又或者发生内存溢出(OOM)。当发生这种情况时&#xff0c;我们怎么去排查&#xff0c;怎么去分析原因呢&#xff1f; 1. 什么是dump文…...

K8S集群1.24使用docker作为容器运行时出现就绪探针间歇性异常

文章目录1. 环境介绍2. 异常信息3. 分析问题3.1 kubernetes 健康检查3.1.1 存活探针3.1.2 就绪探针3.1.3 启动探针3.2 检测方法4. 解决办法1. 环境介绍 组件版本kubernetes1.24.2docker18.03.1-cecri-docker0.2.6 2. 异常信息 最近监测到 kubernetes 集群上 calico-node Pod 运…...

士大夫身份第三方水电费第三方

package com.snmocha.snbpm.job;import org.springframework.stereotype.Component;import com.xxl.job.core.handler.annotation.XxlJob;import lombok.extern.slf4j.Slf4j;/*** Demo定时任务.* Author&#xff1a;zhoudd* Date&#xff1a;2023-01-15*/ Component Slf4j publ…...

RDO一体化部署OpenStack

RDO一体化部署OpenStack 环境准备 安装centos7 [外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-J785hZvT-1677578418769)(C:\Users\HONOR\AppData\Roaming\Typora\typora-user-images\image-20230228171254675.png)] 使用vmware安装安装centos7&a…...

CC2530+ESP8266使用MQTT协议上传阿里云的问题

ATMQTTPUB<LinkID>,<"topic">,<"data">,<qos>,<retain>LinkID: 当前只支持 0 topic: 发布主题, 最长 64 字节 data: 发布消息, data 不能包含 \0, 请确保整条 ATMQTTPUB 不超过 AT 指令的最大长度限制 qos: 发布服务质量, 参…...

Flask RESTful 示例

目录 1. 环境准备2. 安装依赖3. 修改main.py4. 运行应用5. API使用示例获取所有任务获取单个任务创建新任务更新任务删除任务 中文乱码问题&#xff1a; 下面创建一个简单的Flask RESTful API示例。首先&#xff0c;我们需要创建环境&#xff0c;安装必要的依赖&#xff0c;然后…...

Xshell远程连接Kali(默认 | 私钥)Note版

前言:xshell远程连接&#xff0c;私钥连接和常规默认连接 任务一 开启ssh服务 service ssh status //查看ssh服务状态 service ssh start //开启ssh服务 update-rc.d ssh enable //开启自启动ssh服务 任务二 修改配置文件 vi /etc/ssh/ssh_config //第一…...

Spring Boot面试题精选汇总

&#x1f91f;致敬读者 &#x1f7e9;感谢阅读&#x1f7e6;笑口常开&#x1f7ea;生日快乐⬛早点睡觉 &#x1f4d8;博主相关 &#x1f7e7;博主信息&#x1f7e8;博客首页&#x1f7eb;专栏推荐&#x1f7e5;活动信息 文章目录 Spring Boot面试题精选汇总⚙️ **一、核心概…...

算法岗面试经验分享-大模型篇

文章目录 A 基础语言模型A.1 TransformerA.2 Bert B 大语言模型结构B.1 GPTB.2 LLamaB.3 ChatGLMB.4 Qwen C 大语言模型微调C.1 Fine-tuningC.2 Adapter-tuningC.3 Prefix-tuningC.4 P-tuningC.5 LoRA A 基础语言模型 A.1 Transformer &#xff08;1&#xff09;资源 论文&a…...

STM32HAL库USART源代码解析及应用

STM32HAL库USART源代码解析 前言STM32CubeIDE配置串口USART和UART的选择使用模式参数设置GPIO配置DMA配置中断配置硬件流控制使能生成代码解析和使用方法串口初始化__UART_HandleTypeDef结构体浅析HAL库代码实际使用方法使用轮询方式发送使用轮询方式接收使用中断方式发送使用中…...

Git 3天2K星标:Datawhale 的 Happy-LLM 项目介绍(附教程)

引言 在人工智能飞速发展的今天&#xff0c;大语言模型&#xff08;Large Language Models, LLMs&#xff09;已成为技术领域的焦点。从智能写作到代码生成&#xff0c;LLM 的应用场景不断扩展&#xff0c;深刻改变了我们的工作和生活方式。然而&#xff0c;理解这些模型的内部…...

NPOI操作EXCEL文件 ——CAD C# 二次开发

缺点:dll.版本容易加载错误。CAD加载插件时&#xff0c;没有加载所有类库。插件运行过程中用到某个类库&#xff0c;会从CAD的安装目录找&#xff0c;找不到就报错了。 【方案2】让CAD在加载过程中把类库加载到内存 【方案3】是发现缺少了哪个库&#xff0c;就用插件程序加载进…...

Web后端基础(基础知识)

BS架构&#xff1a;Browser/Server&#xff0c;浏览器/服务器架构模式。客户端只需要浏览器&#xff0c;应用程序的逻辑和数据都存储在服务端。 优点&#xff1a;维护方便缺点&#xff1a;体验一般 CS架构&#xff1a;Client/Server&#xff0c;客户端/服务器架构模式。需要单独…...

android RelativeLayout布局

<?xml version"1.0" encoding"utf-8"?> <RelativeLayout xmlns:android"http://schemas.android.com/apk/res/android"android:layout_width"match_parent"android:layout_height"match_parent"android:gravity&…...

《信号与系统》第 6 章 信号与系统的时域和频域特性

目录 6.0 引言 6.1 傅里叶变换的模和相位表示 6.2 线性时不变系统频率响应的模和相位表示 6.2.1 线性与非线性相位 6.2.2 群时延 6.2.3 对数模和相位图 6.3 理想频率选择性滤波器的时域特性 6.4 非理想滤波器的时域和频域特性讨论 6.5 一阶与二阶连续时间系统 6.5.1 …...