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

UEC++ 探索虚幻5笔记(捡金币案例) day12

吃金币案例

创建金币逻辑

  • 之前的MyActor_One.cpp,直接添加几个资源拿着就用
	//静态网格UPROPERTY(VisibleAnywhere, BlueprintReadOnly)class UStaticMeshComponent* StaticMesh;//球形碰撞体UPROPERTY(VisibleAnywhere, BlueprintReadWrite)class USphereComponent* TriggerVolume;//粒子系统组件UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Particle")class UParticleSystemComponent* ParticleEffectsComponent;//粒子系统UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Particle")class UParticleSystem* Particle;//声音系统UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Sounds")class USoundCue* Sound;//是否旋转UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable Item|Properties")bool bRotate = true;//旋转速率UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable Item|Properties")float RotationRate = 45.f;
  • 逻辑编写
// Fill out your copyright notice in the Description page of Project Settings.#include "MyActor_One.h"
#include "Engine/Engine.h"
#include "UObject/ConstructorHelpers.h"
#include "Components/StaticMeshComponent.h"
#include "Components/SphereComponent.h"
#include "Particles/ParticleSystemComponent.h"
#include "MyObjectUE5/MyCharacters/MyCharacter.h"
#include "Kismet/GamePlayStatics.h"
#include "Sound/SoundCue.h"// Sets default values
AMyActor_One::AMyActor_One()
{// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));RootComponent = StaticMesh;TriggerVolume = CreateDefaultSubobject<USphereComponent>(TEXT("TriggerVolume"));TriggerVolume->SetupAttachment(GetRootComponent());ParticleEffectsComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("ParticleEffects"));ParticleEffectsComponent->SetupAttachment(GetRootComponent());//设置TriggerVolume碰撞的硬编码TriggerVolume->SetCollisionEnabled(ECollisionEnabled::QueryOnly);//设置碰撞类型TriggerVolume->SetCollisionObjectType(ECollisionChannel::ECC_WorldStatic);//设置对象移动时其应视为某种物体TriggerVolume->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);//设置所有的碰撞响应为忽略TriggerVolume->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);//设置Pawn碰撞响应为重叠
}// Called when the game starts or when spawned
void AMyActor_One::BeginPlay()
{Super::BeginPlay();TriggerVolume->OnComponentBeginOverlap.AddDynamic(this, &AMyActor_One::OnOverlapBegin);TriggerVolume->OnComponentEndOverlap.AddDynamic(this, &AMyActor_One::OnOverlapEnd);
}void AMyActor_One::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{if (OtherActor){AMyCharacter* Player = Cast<AMyCharacter>(OtherActor);if (Player){if (Particle){UGameplayStatics::SpawnEmitterAtLocation(this, Particle, GetActorLocation(), FRotator(0.f), true);}if (Sound){UGameplayStatics::PlaySound2D(this, Sound);}Destroy();}}}void AMyActor_One::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{}// Called every frame
void AMyActor_One::Tick(float DeltaTime)
{Super::Tick(DeltaTime);if (bRotate){FRotator rotator = GetActorRotation();rotator.Yaw += RotationRate * DeltaTime;SetActorRotation(rotator);}
}

角色吃到金币逻辑

  • 给角色类添加一个变量用来记录金币数
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Coin")
int Coin = 0;
  • 将金币的Actor类碰撞处理函数测试一下是否能捡到金币
void AMyActor_One::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{if (OtherActor){AMyCharacter* Player = Cast<AMyCharacter>(OtherActor);if (Player){if (Particle){UGameplayStatics::SpawnEmitterAtLocation(this, Particle, GetActorLocation(), FRotator(0.f), true);}if (Sound){UGameplayStatics::PlaySound2D(this, Sound);}//吃到金币打印金币数Player->Coin++;GEngine->AddOnScreenDebugMessage(2, 10, FColor::Red, FString::Printf(TEXT("%d"), Player->Coin));Destroy();}}
}

UE5中的UI控件

  • 新建一个UI控件蓝图后,UE5中的控件蓝图默认是什么都没有要添加一个画布面板之后才能添加控件在蓝图上
    在这里插入图片描述
  • 获取控件就得把控件提升为变量就可以在蓝图中调用了
    在这里插入图片描述
  • 编写获取金币逻辑
    在这里插入图片描述
  • 在关卡蓝图中创建自己的UI就完成啦
    在这里插入图片描述
  • 运行效果
    请添加图片描述

MyCharacter.h

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "InputActionValue.h"
#include "MyCharacter.generated.h"UCLASS()
class MYOBJECTUE5_API AMyCharacter : public ACharacter
{GENERATED_BODY()public:// Sets default values for this character's propertiesAMyCharacter();UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllPrivateAccess = "true"))class USpringArmComponent* SpringArm;UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Camera", meta = (AllPrivateAccess = "true"))class UCameraComponent* MyCamera;//映射绑定UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))class UInputMappingContext* DefaultMappingContext;//移动绑定UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))class UInputAction* MoveAction;//视角绑定UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Input", meta = (AllPrivateAccess = "true"))class UInputAction* LookAction;UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Coin")int Coin = 0;
protected:// Called when the game starts or when spawnedvirtual void BeginPlay() override;void CharacterMove(const FInputActionValue& value);void CharacterLook(const FInputActionValue& value);public:	// Called every framevirtual void Tick(float DeltaTime) override;// Called to bind functionality to inputvirtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;};

MyCharacter.cpp

// Fill out your copyright notice in the Description page of Project Settings.#include "MyCharacter.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/SpringArmComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "EnhancedInputComponent.h"
#include "EnhancedInputSubsystems.h"
#include "Engine/Engine.h"
#include "MyObjectUE5/MyActors/MyActor_One.h"// Sets default values
AMyCharacter::AMyCharacter()
{// Set this character to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;GetCharacterMovement()->bOrientRotationToMovement = true;GetCharacterMovement()->RotationRate = FRotator(0.f, 500.f, 0.f);GetCharacterMovement()->MaxWalkSpeed = 500.f;GetCharacterMovement()->MinAnalogWalkSpeed = 20.f;GetCharacterMovement()->BrakingDecelerationWalking = 2000.f;//相机臂SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));SpringArm->SetupAttachment(GetRootComponent());SpringArm->TargetArmLength = 400.f;SpringArm->bUsePawnControlRotation = true;//相机MyCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("MyCamera"));MyCamera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);//附加到末尾MyCamera->bUsePawnControlRotation = false;
}// Called when the game starts or when spawned
void AMyCharacter::BeginPlay()
{Super::BeginPlay();APlayerController* PlayerController = Cast<APlayerController>(Controller);if (PlayerController){UEnhancedInputLocalPlayerSubsystem* Subsystem = ULocalPlayer::GetSubsystem<UEnhancedInputLocalPlayerSubsystem>(PlayerController->GetLocalPlayer());if (Subsystem){//映射到上下文Subsystem->AddMappingContext(DefaultMappingContext, 0);}}
}void AMyCharacter::CharacterMove(const FInputActionValue& value)
{FVector2D MovementVector = value.Get<FVector2D>();//获取速度if (Controller!=nullptr){FRotator Rotation = Controller->GetControlRotation();FRotator YawRotation = FRotator(0, Rotation.Yaw, 0);//获取到前后单位向量FVector ForwardDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::X);//获取左右单位向量FVector RightDirection = FRotationMatrix(YawRotation).GetUnitAxis(EAxis::Y);AddMovementInput(ForwardDirection, MovementVector.Y);AddMovementInput(RightDirection, MovementVector.X);}
}void AMyCharacter::CharacterLook(const FInputActionValue& value)
{FVector2D LookAxisVector = value.Get<FVector2D>();if (Controller != nullptr){//GEngine->AddOnScreenDebugMessage(1, 10, FColor::Red, FString::Printf(TEXT("%f"),(GetControlRotation().Pitch)));AddControllerYawInput(LookAxisVector.X);if (GetControlRotation().Pitch < 270.f && GetControlRotation().Pitch>180.f && LookAxisVector.Y > 0.f){return;}if (GetControlRotation().Pitch < 180.f && GetControlRotation().Pitch>45.f && LookAxisVector.Y < 0.f){return;}AddControllerPitchInput(LookAxisVector.Y);}
}// Called every frame
void AMyCharacter::Tick(float DeltaTime)
{Super::Tick(DeltaTime);}// Called to bind functionality to input
void AMyCharacter::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{Super::SetupPlayerInputComponent(PlayerInputComponent);UEnhancedInputComponent* EnhancedInputComponent = Cast<UEnhancedInputComponent>(PlayerInputComponent);if (EnhancedInputComponent){//移动绑定EnhancedInputComponent->BindAction(MoveAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterMove);EnhancedInputComponent->BindAction(LookAction, ETriggerEvent::Triggered, this, &AMyCharacter::CharacterLook);}
}

MyActor_One.h

// Fill out your copyright notice in the Description page of Project Settings.#pragma once#include "CoreMinimal.h"
#include "GameFramework/Actor.h"
#include "MyActor_One.generated.h"UCLASS()
class MYOBJECTUE5_API AMyActor_One : public AActor
{GENERATED_BODY()public:	// Sets default values for this actor's propertiesAMyActor_One();UPROPERTY(VisibleAnywhere, BlueprintReadOnly)class UStaticMeshComponent* StaticMesh;UPROPERTY(VisibleAnywhere, BlueprintReadWrite)class USphereComponent* TriggerVolume;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Particle")class UParticleSystemComponent* ParticleEffectsComponent;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Particle")class UParticleSystem* Particle;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable|Sounds")class USoundCue* Sound;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable Item|Properties")bool bRotate = true;UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Interoperable Item|Properties")float RotationRate = 45.f;protected:// Called when the game starts or when spawnedvirtual void BeginPlay() override;UFUNCTION()void OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult);UFUNCTION()void OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex);public:	// Called every framevirtual void Tick(float DeltaTime) override;};

MyActor_One.cpp

// Fill out your copyright notice in the Description page of Project Settings.#include "MyActor_One.h"
#include "Engine/Engine.h"
#include "UObject/ConstructorHelpers.h"
#include "Components/StaticMeshComponent.h"
#include "Components/SphereComponent.h"
#include "Particles/ParticleSystemComponent.h"
#include "MyObjectUE5/MyCharacters/MyCharacter.h"
#include "Kismet/GamePlayStatics.h"
#include "Sound/SoundCue.h"// Sets default values
AMyActor_One::AMyActor_One()
{// Set this actor to call Tick() every frame.  You can turn this off to improve performance if you don't need it.PrimaryActorTick.bCanEverTick = true;StaticMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("StaticMesh"));RootComponent = StaticMesh;TriggerVolume = CreateDefaultSubobject<USphereComponent>(TEXT("TriggerVolume"));TriggerVolume->SetupAttachment(GetRootComponent());ParticleEffectsComponent = CreateDefaultSubobject<UParticleSystemComponent>(TEXT("ParticleEffects"));ParticleEffectsComponent->SetupAttachment(GetRootComponent());//设置TriggerVolume碰撞的硬编码TriggerVolume->SetCollisionEnabled(ECollisionEnabled::QueryOnly);//设置碰撞类型TriggerVolume->SetCollisionObjectType(ECollisionChannel::ECC_WorldStatic);//设置对象移动时其应视为某种物体TriggerVolume->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);//设置所有的碰撞响应为忽略TriggerVolume->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap);//设置Pawn碰撞响应为重叠
}// Called when the game starts or when spawned
void AMyActor_One::BeginPlay()
{Super::BeginPlay();TriggerVolume->OnComponentBeginOverlap.AddDynamic(this, &AMyActor_One::OnOverlapBegin);TriggerVolume->OnComponentEndOverlap.AddDynamic(this, &AMyActor_One::OnOverlapEnd);
}void AMyActor_One::OnOverlapBegin(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult)
{if (OtherActor){AMyCharacter* Player = Cast<AMyCharacter>(OtherActor);if (Player){if (Particle){UGameplayStatics::SpawnEmitterAtLocation(this, Particle, GetActorLocation(), FRotator(0.f), true);}if (Sound){UGameplayStatics::PlaySound2D(this, Sound);}Player->Coin++;GEngine->AddOnScreenDebugMessage(2, 10, FColor::Red, FString::Printf(TEXT("%d"), Player->Coin));Destroy();}}
}void AMyActor_One::OnOverlapEnd(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex)
{}// Called every frame
void AMyActor_One::Tick(float DeltaTime)
{Super::Tick(DeltaTime);if (bRotate){FRotator rotator = GetActorRotation();rotator.Yaw += RotationRate * DeltaTime;SetActorRotation(rotator);}
}

相关文章:

UEC++ 探索虚幻5笔记(捡金币案例) day12

吃金币案例 创建金币逻辑 之前的MyActor_One.cpp&#xff0c;直接添加几个资源拿着就用 //静态网格UPROPERTY(VisibleAnywhere, BlueprintReadOnly)class UStaticMeshComponent* StaticMesh;//球形碰撞体UPROPERTY(VisibleAnywhere, BlueprintReadWrite)class USphereCompone…...

Docker 安装 Redis 挂载配置

1. 创建挂载文件目录 mkdir -p /home/redis/config mkdir -p /home/redis/data # 创建配置文件&#xff1a;docker容器中默认不包含配置文件 touch /home/redis/config/redis.conf2. 书写配置文件 # Redis 服务器配置# 绑定的 IP 地址&#xff0c;默认为本地回环地址 127.0.0…...

Java操作Excel之 POI介绍和入门

POI是Apache 提供的一个开源的Java API&#xff0c;用于操作Microsoft文档格式&#xff0c;如Excel、Word和PowerPoint等。POI是Java中处理Microsoft文档最受欢迎的库。 截至2023/12&#xff0c; 最新版本时 POI 5.2.5。 JDK版本兼容 POI版本JDK版本4.0及之上版本> 1.83.…...

麒麟v10 数据盘初始化 gpt分区

麒麟v10 数据盘初始化 gpt分区 1、查看磁盘 lsblk2 、分区 parted2.1、 设置磁盘分区形式2.2、 设置磁盘的计量单位为磁柱2.3、 分区2.4、 查看分区 3、分区格式化4、 挂载磁盘4.1、新建挂载目录4.2、挂载磁盘4.3、查看挂载结果 5、设置开机自动挂载磁盘分区5.1、 查询磁盘分区…...

php时间和centos时间不一致

PHP 时间和 CentOS 操作系统时间不一致的问题通常是由于时区设置不同造成的。解决这个问题可以通过以下几个步骤&#xff1a; 检查 CentOS 系统时间&#xff1a; 你可以通过在终端运行命令 date 来查看当前的系统时间和时区。 配置 CentOS 的时区&#xff1a; 如果系统时间不正…...

软件工程 复习笔记

目录 概述 软件的定义&#xff0c;特点和分类 软件的定义 软件的特点 软件的分类 软件危机的定义和表现形式 软件危机 表现形式 软件危机的产生原因及解决途径 产生软件危机的原因 软件工程 概念 软件工程的研究内容和基本原理 内容 软件工程的基本原理 软件过程…...

SpringBoot_02

Web后端开发_07 SpringBoot_02 SpringBoot原理 1.配置优先级 1.1配置 SpringBoot中支持三种格式的配置文件&#xff1a; application.propertiesapplication.ymlapplication.yaml properties、yaml、yml三种配置文件&#xff0c;优先级最高的是properties 配置文件优先级…...

实验报告-实验四(时序系统实验)

软件模拟电路图 说明 SW&#xff1a;开关&#xff0c;共六个Q1~Q3&#xff1a;输出Y0~Y3&#xff1a;输出 74LS194 首先&#xff0c;要给S1和S0高电位&#xff0c;将A~D的数据存入寄存器中&#xff08;如果开始没有存入数据&#xff0c;那么就是0000在里面移位&#xff0c;不…...

PHP+ajax+layui实现双重列表的动态绑定

需求&#xff1a;商户下面有若干个门店&#xff0c;每个门店都需要绑定上收款账户 方案一&#xff1a;每个门店下面添加页面&#xff0c;可以选择账户去绑定。&#xff08;难度&#xff1a;简单&#xff09; 方案二&#xff1a;从商户进入&#xff0c;可以自由选择门店&#…...

菜鸟学习日记(python)——条件控制

Python 中的条件语句是通过一条或多条语句的执行结果&#xff08;True 或者 False&#xff09;来决定执行的代码块。 它的一般格式为&#xff1a;if...elif...else if condition1: #条件1CodeBlock1 #代码块1 elif condition2:CodeBlock2 else:CodeBlock3 如果con…...

RabbitMQ 笔记

Message durability 确保消息在server 出现问题或者recovery能恢复&#xff1a; declare it as durable in the producer and consumer code. boolean durable true; channel.queueDeclare("hello", durable, false, false, null);Queue 指定 //使用指定的queue&…...

DNS协议(DNS规范、DNS报文、DNS智能选路)

目录 DNS协议基本概念 DNS相关规范 DNS服务器的记录 DNS报文 DNS域名查询的两种方式 DNS工作过程 DNS智能选路 DNS协议基本概念 DNS的背景 我们知道主机通信需要依靠IP地址&#xff0c;但是每次通过输入对方的IP地址和对端通信不够方便&#xff0c;IP地址不好记忆 因此提…...

Python基础知识-变量、数据类型(整型、浮点型、字符类型、布尔类型)详解

1、基本的输出和计算表达式&#xff1a; prinit(12-3) printf(12*3) printf(12/3) prinit(12-3) printf(12*3) printf(12/3) 形如12-3称为表达式 这个表达式的运算结果称为 表达式的返回值 1 2 3 这样的数字&#xff0c;叫做 字面值常量 - * /称为 运算符或者操作符 在C和j…...

信息化,数字化,智能化是3种不同概念吗?与机械化,自动化矛盾吗?

先说结论&#xff1a; 1、信息化、数字化、智能化确实是3种不同的概念&#xff01; 2、这3种概念与机械化、自动化并不矛盾&#xff0c;它们是制造业中不同发展阶段和不同层次的概念。 机械化&#xff1a;是指在生产过程中使用机械技术来辅助人工完成一些重复性、单一性、劳…...

C# WPF上位机开发(倒计时软件)

【 声明&#xff1a;版权所有&#xff0c;欢迎转载&#xff0c;请勿用于商业用途。 联系信箱&#xff1a;feixiaoxing 163.com】 生活当中&#xff0c;我们经常会遇到倒计时的场景&#xff0c;比如体育运动的时候、考试的时候等等。正好最近我们学习了c# wpf开发&#xff0c;完…...

Mysql timestamp和datetime区别

文章目录 一、存储范围和精度二、默认值和自动更新三、时区处理四、索引和性能五、存储空间和数据复制六、使用场景和注意事项七、时区转换 MySQL是一个常用的关系型数据库管理系统&#xff0c;其内置了多种数据类型用于存储和操作数据。其中&#xff0c;timestamp和datetime是…...

新手村之SQL——分组与子查询

1.GROUP BY GROUP BY 函数就是 SQL 中用来实现分组的函数&#xff0c;其用于结合聚合函数&#xff0c;能根据给定数据列的每个成员对查询结果进行分组统计&#xff0c;最终得到一个分组汇总表。 mysql> SELECT country, COUNT(country) AS teacher_count-> FROM teacher…...

【hacker送书第9期】算法训练营(入门篇)

第9期图书推荐 内容简介作者简介精彩书评图书目录概述参与方式 内容简介 本书以海量图解的形式&#xff0c;详细讲解常用的数据结构与算法&#xff0c;又融入大量的竞赛实例和解题技巧。通过对本书的学习&#xff0c;读者可掌握12种初级数据结构、15种常用STL函数、10种二叉树和…...

微服务链路追踪组件SkyWalking实战

概述 微服务调用存在的问题 串联调用链路&#xff0c;快速定位问题&#xff1b;理清服务之间的依赖关系&#xff1b;微服务接口性能分析&#xff1b;业务流程调用处理顺序&#xff1b; 全链路追踪&#xff1a;对请求源头到底层服务的调用链路中间的所有环节进行监控。 链路…...

ubuntu 更换国内镜像

备份 cd /etc/aptcp sources.list sources.list.bakup修改源为清华源 sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g sources.list更新软件源 apt-get update其他源如下&#xff1a; mirrors.ustc.edu.cn 中科大 mirrors.163.com 163 mirrors.aliyun.com 阿里云...

云原生核心技术 (7/12): K8s 核心概念白话解读(上):Pod 和 Deployment 究竟是什么?

大家好&#xff0c;欢迎来到《云原生核心技术》系列的第七篇&#xff01; 在上一篇&#xff0c;我们成功地使用 Minikube 或 kind 在自己的电脑上搭建起了一个迷你但功能完备的 Kubernetes 集群。现在&#xff0c;我们就像一个拥有了一块崭新数字土地的农场主&#xff0c;是时…...

Python爬虫实战:研究feedparser库相关技术

1. 引言 1.1 研究背景与意义 在当今信息爆炸的时代,互联网上存在着海量的信息资源。RSS(Really Simple Syndication)作为一种标准化的信息聚合技术,被广泛用于网站内容的发布和订阅。通过 RSS,用户可以方便地获取网站更新的内容,而无需频繁访问各个网站。 然而,互联网…...

前端导出带有合并单元格的列表

// 导出async function exportExcel(fileName "共识调整.xlsx") {// 所有数据const exportData await getAllMainData();// 表头内容let fitstTitleList [];const secondTitleList [];allColumns.value.forEach(column > {if (!column.children) {fitstTitleL…...

STM32F4基本定时器使用和原理详解

STM32F4基本定时器使用和原理详解 前言如何确定定时器挂载在哪条时钟线上配置及使用方法参数配置PrescalerCounter ModeCounter Periodauto-reload preloadTrigger Event Selection 中断配置生成的代码及使用方法初始化代码基本定时器触发DCA或者ADC的代码讲解中断代码定时启动…...

Qwen3-Embedding-0.6B深度解析:多语言语义检索的轻量级利器

第一章 引言&#xff1a;语义表示的新时代挑战与Qwen3的破局之路 1.1 文本嵌入的核心价值与技术演进 在人工智能领域&#xff0c;文本嵌入技术如同连接自然语言与机器理解的“神经突触”——它将人类语言转化为计算机可计算的语义向量&#xff0c;支撑着搜索引擎、推荐系统、…...

在Ubuntu中设置开机自动运行(sudo)指令的指南

在Ubuntu系统中&#xff0c;有时需要在系统启动时自动执行某些命令&#xff0c;特别是需要 sudo权限的指令。为了实现这一功能&#xff0c;可以使用多种方法&#xff0c;包括编写Systemd服务、配置 rc.local文件或使用 cron任务计划。本文将详细介绍这些方法&#xff0c;并提供…...

【决胜公务员考试】求职OMG——见面课测验1

2025最新版&#xff01;&#xff01;&#xff01;6.8截至答题&#xff0c;大家注意呀&#xff01; 博主码字不易点个关注吧,祝期末顺利~~ 1.单选题(2分) 下列说法错误的是:&#xff08; B &#xff09; A.选调生属于公务员系统 B.公务员属于事业编 C.选调生有基层锻炼的要求 D…...

根据万维钢·精英日课6的内容,使用AI(2025)可以参考以下方法:

根据万维钢精英日课6的内容&#xff0c;使用AI&#xff08;2025&#xff09;可以参考以下方法&#xff1a; 四个洞见 模型已经比人聪明&#xff1a;以ChatGPT o3为代表的AI非常强大&#xff0c;能运用高级理论解释道理、引用最新学术论文&#xff0c;生成对顶尖科学家都有用的…...

selenium学习实战【Python爬虫】

selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...

tree 树组件大数据卡顿问题优化

问题背景 项目中有用到树组件用来做文件目录&#xff0c;但是由于这个树组件的节点越来越多&#xff0c;导致页面在滚动这个树组件的时候浏览器就很容易卡死。这种问题基本上都是因为dom节点太多&#xff0c;导致的浏览器卡顿&#xff0c;这里很明显就需要用到虚拟列表的技术&…...