rearrangement-challenge-2022环境使用学习(一)

搭建了rearrangement-challenge-2022的环境:
https://github.com/facebookresearch/habitat-challenge/tree/rearrangement-challenge-2022
habitat最大的缺点是对不同的版本非常的敏感。本文只是针对rearrangement-challenge-2022的学习。

文档一开始会很不完善,会慢慢的补齐。

1、如何使用配置文件初始化环境

主要使用 habitat.Env类进行初始化。传一个config参数,该参数可以通过habitat.get_config()得到,该函数需要指定一个配置文件的路径,举例如下:

import habitat
env = habitat.Env(config=habitat.get_config("/home/yons/LK/habitat-challenge/habitat-lab/configs/datasets/pointnav/habitat_test.yaml")    

配置环境的过程会打印很多信息如下:

# 2024-03-04 21:17:09,546 Initializing dataset PointNav-v1
# 2024-03-04 21:17:09,708 initializing sim Sim-v0
# [21:17:09:715104]:[Metadata] AttributesManagerBase.h(380)::createFromJsonOrDefaultInternal : <Dataset>: Proposing JSON name : default.scene_dataset_config.json from original name : default| This file does not exist.
# [21:17:09:715197]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (capsule3DSolid:capsule3DSolid_hemiRings_4_cylRings_1_segments_12_halfLen_0.75_useTexCoords_false_useTangents_false) created and registered.
# [21:17:09:715224]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (capsule3DWireframe:capsule3DWireframe_hemiRings_8_cylRings_1_segments_16_halfLen_1) created and registered.
# [21:17:09:715242]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (coneSolid:coneSolid_segments_12_halfLen_1.25_rings_1_useTexCoords_false_useTangents_false_capEnd_true) created and registered.
# [21:17:09:715258]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (coneWireframe:coneWireframe_segments_32_halfLen_1.25) created and registered.
# [21:17:09:715270]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (cubeSolid:cubeSolid) created and registered.
# [21:17:09:715282]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (cubeWireframe:cubeWireframe) created and registered.
# [21:17:09:715299]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (cylinderSolid:cylinderSolid_rings_1_segments_12_halfLen_1_useTexCoords_false_useTangents_false_capEnds_true) created and registered.
# [21:17:09:715314]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (cylinderWireframe:cylinderWireframe_rings_1_segments_32_halfLen_1) created and registered.
# [21:17:09:715326]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (icosphereSolid:icosphereSolid_subdivs_1) created and registered.
# [21:17:09:715369]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (icosphereWireframe:icosphereWireframe_subdivs_1) created and registered.
# [21:17:09:715397]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (uvSphereSolid:uvSphereSolid_rings_8_segments_16_useTexCoords_false_useTangents_false) created and registered.
# [21:17:09:715429]:[Metadata] AssetAttributesManager.cpp(121)::createObject : Asset attributes (uvSphereWireframe:uvSphereWireframe_rings_16_segments_32) created and registered.
# [21:17:09:715438]:[Metadata] AssetAttributesManager.cpp(110)::AssetAttributesManager : Built default primitive asset templates : 12
# [21:17:09:715778]:[Metadata] SceneDatasetAttributesManager.cpp(35)::createObject : File (default) not found, so new default dataset attributes created  and registered.
# [21:17:09:715787]:[Metadata] MetadataMediator.cpp(120)::createSceneDataset : Dataset default successfully created.
# [21:17:09:715798]:[Metadata] AttributesManagerBase.h(380)::createFromJsonOrDefaultInternal : <Physics Manager>: Proposing JSON name : ./data/default.physics_config.json from original name : ./data/default.physics_config.json| This file exists.
# [21:17:09:715881]:[Metadata] PhysicsAttributesManager.cpp(26)::createObject : JSON Configuration File (./data/default.physics_config.json) based physics manager attributes created and registered.
# [21:17:09:715890]:[Metadata] MetadataMediator.cpp(203)::setActiveSceneDatasetName : Previous active dataset  changed to default successfully.
# [21:17:09:715896]:[Metadata] MetadataMediator.cpp(175)::setCurrPhysicsAttributesHandle : Old physics manager attributes  changed to ./data/default.physics_config.json successfully.
# [21:17:09:715902]:[Metadata] MetadataMediator.cpp(66)::setSimulatorConfiguration : Set new simulator config for scene/stage : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb and dataset : default which is currently active dataset.
# Renderer: NVIDIA GeForce RTX 2080 Ti/PCIe/SSE2 by NVIDIA Corporation
# OpenGL version: 4.6.0 NVIDIA 510.108.03
# Using optional features:
#     GL_ARB_vertex_array_object
#     GL_ARB_ES2_compatibility
#     GL_ARB_separate_shader_objects
#     GL_ARB_robustness
#     GL_ARB_texture_storage
#     GL_ARB_invalidate_subdata
#     GL_ARB_texture_storage_multisample
#     GL_ARB_multi_bind
#     GL_ARB_direct_state_access
#     GL_ARB_get_texture_sub_image
#     GL_ARB_texture_filter_anisotropic
#     GL_KHR_debug
# Using driver workarounds:
#     no-forward-compatible-core-context
#     no-layout-qualifiers-on-old-glsl
#     nv-zero-context-profile-mask
#     nv-implementation-color-read-format-dsa-broken
#     nv-cubemap-inconsistent-compressed-image-size
#     nv-cubemap-broken-full-compressed-image-query
#     nv-compressed-block-size-in-bits
# [21:17:09:817318]:[Metadata] MetadataMediator.cpp(297)::getSceneInstanceAttributesByName : Dataset : default has no preloaded SceneInstanceAttributes or StageAttributes named : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb so loading/creating a new StageAttributes with this name, and then creating a SceneInstanceAttributes with the same name that references this stage.
# [21:17:09:817339]:[Metadata] AttributesManagerBase.h(380)::createFromJsonOrDefaultInternal : <Stage Template>: Proposing JSON name : data/scene_datasets/habitat-test-scenes/skokloster-castle.stage_config.json from original name : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb| This file does not exist.
# [21:17:09:817384]:[Metadata] AbstractObjectAttributesManagerBase.h(184)::createObject : File (data/scene_datasets/habitat-test-scenes/skokloster-castle.glb) exists but is not a recognized config filename extension, so new default Stage Template attributes created and registered.
# [21:17:09:817412]:[Metadata] SceneDatasetAttributes.cpp(47)::addNewSceneInstanceToDataset : Dataset : 'default' : Stage Attributes 'data/scene_datasets/habitat-test-scenes/skokloster-castle.glb' specified in Scene Attributes exists in dataset library.
# [21:17:09:817418]:[Metadata] SceneDatasetAttributes.cpp(84)::addNewSceneInstanceToDataset : Dataset : 'default' : Lighting Layout Attributes 'no_lights' specified in Scene Attributes but does not exist in dataset, so creating.
# [21:17:09:817426]:[Metadata] AttributesManagerBase.h(380)::createFromJsonOrDefaultInternal : <Lighting Layout>: Proposing JSON name : no_lights.lighting_config.json from original name : no_lights| This file does not exist.
# [21:17:09:817437]:[Metadata] LightLayoutAttributesManager.cpp(36)::createObject : File (no_lights) not found, so new default light layout attributes created and registered.
# [21:17:09:817445]:[Sim] Simulator.cpp(237)::createSceneInstance : Navmesh file location in scene instance : data/scene_datasets/habitat-test-scenes/skokloster-castle.navmesh
# [21:17:09:817455]:[Sim] Simulator.cpp(242)::createSceneInstance : Loading navmesh from data/scene_datasets/habitat-test-scenes/skokloster-castle.navmesh
# [21:17:09:817468]:[Nav] PathFinder.cpp(852)::loadNavMesh : NavMeshSettings aren't present, guessing that they are the default
# [21:17:09:817532]:[Sim] Simulator.cpp(244)::createSceneInstance : Navmesh Loaded.
# [21:17:09:817545]:[Scene] SceneGraph.h(85)::createDrawableGroup : Created DrawableGroup: 
# [21:17:09:817552]:[Assets] ResourceManager.cpp(297)::loadSemanticSceneDescriptor : SceneInstance : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb proposed Semantic Scene Descriptor filename : data/scene_datasets/habitat-test-scenes/skokloster-castle.scn
# [21:17:09:817560]:[Assets] ResourceManager.cpp(344)::loadSemanticSceneDescriptor : SSD File Naming Issue! Neither SceneInstanceAttributes-provided name : data/scene_datasets/habitat-test-scenes/skokloster-castle.scn  nor constructed filename : data/scene_datasets/habitat-test-scenes/info_semantic.json exist on disk.
# [21:17:09:817579]:[Assets] ResourceManager.cpp(1652)::ConfigureImporterManagerGLExtensions : Importing Basis files as BC7.
# [21:17:09:817696]:[Sim] Simulator.cpp(302)::createSceneInstance : Using scene instance-specified Light key : - no_lights -
# [21:17:09:817708]:[Metadata] MetadataMediator.cpp(66)::setSimulatorConfiguration : Set new simulator config for scene/stage : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb and dataset : default which is currently active dataset.
# [21:17:09:817723]:[Sim] Simulator.cpp(412)::instanceStageForSceneAttributes : Start to load stage named : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb with render asset : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb and collision asset : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
# [21:17:09:817752]:[Assets] ResourceManager.cpp(691)::createStageAssetInfosFromAttributes : Frame :{"up":[0,0,1],"front":[0,1,0],"origin":[0,0,0]} for render mesh named : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb|{"up":[0,0,1],"front":[0,1,0],"origin":[0,0,0]} for semantic mesh named :  with type specified as semantic|Semantic Txtrs : False
# [21:17:09:817760]:[Assets] ResourceManager.cpp(507)::loadStage : Start load render asset data/scene_datasets/habitat-test-scenes/skokloster-castle.glb .
# [21:17:09:817765]:[Assets] ResourceManager.cpp(973)::loadStageInternal : Attempting to load stage data/scene_datasets/habitat-test-scenes/skokloster-castle.glb 
# [21:17:09:817779]:[Assets] ResourceManager.cpp(855)::loadRenderAsset : Loading general asset named: data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
# [21:17:09:817785]:[Assets] ResourceManager.cpp(1652)::ConfigureImporterManagerGLExtensions : Importing Basis files as BC7.
# [21:17:10:458713]:[Assets] ResourceManager.cpp(2089)::loadMaterials : Building 2 materials for asset named 'skokloster-castle.glb' : 
# [21:17:10:458752]:[Assets] ResourceManager.cpp(2194)::loadMaterials : Idx 00:Flat.
# [21:17:10:458766]:[Assets] ResourceManager.cpp(2194)::loadMaterials : Idx 01:Flat.
# [21:17:10:516568]:[Sim] Simulator.cpp(439)::instanceStageForSceneAttributes : Successfully loaded stage named : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb
# [21:17:10:516599]:[Sim] Simulator.cpp(471)::instanceStageForSceneAttributes : 
# ---
# The active scene does not contain semantic annotations : activeSemanticSceneID_ = 0  
# ---
# [21:17:10:516615]:[Sim] Simulator.cpp(205)::reconfigure : CreateSceneInstance success == true for active scene name : data/scene_datasets/habitat-test-scenes/skokloster-castle.glb  with renderer.
# 2024-03-04 21:17:10,517 Initializing task Nav-v0    

这其中有很多子问题如下:

1.1 如何设置配置文件中要配置的参数

办法一:直接在yaml配置文件中修改

该方法简单直接不需要举例

办法二:在代码中修改

通过habitat.get_config()获取到config变量后,通过config.defrost()之后便可以在代码中设置一些变量,设置完后通过config.freeze()冻结配置参数

config=habitat.get_config("/home/yons/LK/habitat-challenge/habitat-lab/configs/datasets/pointnav/habitat_test.yaml"
config.defrost()
config.DATASET.SPLIT = "val"
config.freeze()

1.2 habitat.get_config在哪里定义

在…/habitat-challenge/habitat-lab/habitat/config/default.py中定义。该文件中定义了:
1) get_config()方法
2)所有配置变量的默认值

2 关于动作

…/habitat-lab/habitat/sims/habitat_simulator/actions.py中定义了默认的动作:

class _DefaultHabitatSimActions(Enum):STOP = 0MOVE_FORWARD = 1TURN_LEFT = 2TURN_RIGHT = 3LOOK_UP = 4LOOK_DOWN = 5

要执行动作需要初始化环境,然后通过HabitatSimActions获取动作,然后通过env.step执行动作

from habitat.sims.habitat_simulator.actions import HabitatSimActions
env = habitat.Env( config=habitat.get_config("/home/yons/LK/habitat-challenge/habitat-lab/configs/datasets/pointnav/habitat_test.yaml")
observations = env.reset()
action = HabitatSimActions.MOVE_FORWARD
observations = env.step(action)

一个通过键盘与环境交互的示例代码(quick_start3.py文件)如下:

import habitat
from habitat.sims.habitat_simulator.actions import HabitatSimActions
import cv2FORWARD_KEY="w"
LEFT_KEY="a"
RIGHT_KEY="d"
FINISH="f"
####下面是向上看和向下看的动作,并不是所有的agent都可以向上看和向下看
###一个问题是为什么没有后退的动作?
# LOOKUP_KEY="u"
# LOOKDOWN_KEY="j"def transform_rgb_bgr(image):return image[:, :, [2, 1, 0]]def example():#选择一个配置文件初始化环境(配置文件需要有什么参数?)env = habitat.Env(config=habitat.get_config("/home/yons/LK/habitat-challenge/habitat-lab/configs/datasets/pointnav/habitat_test.yaml"))print("Environment creation successful")observations = env.reset()  #print('type(observations):',type(observations))    #type(observations): <class 'habitat.core.simulator.Observations'>print('observations["rgb"].shape:',observations["rgb"].shape)  #observations["rgb"].shape: (480, 640, 3)# cv2.imshow("RGB", transform_rgb_bgr(observations["rgb"]))cv2.imshow("RGB", observations["rgb"])  ####不知道为啥要转化rgb信号的顺序,经过测试,不转换的确看着不自然。print("Agent stepping around inside environment.")count_steps = 0while not env.episode_over:keystroke = cv2.waitKey(0)  #等待用户输入,操纵agent左右转和前进,与环境进行交互if keystroke == ord(FORWARD_KEY):  #如果是敲击的我们在最上面定义的某个键,做对应的事情,并打印action = HabitatSimActions.MOVE_FORWARDprint("action: FORWARD")elif keystroke == ord(LEFT_KEY):action = HabitatSimActions.TURN_LEFTprint("action: LEFT")elif keystroke == ord(RIGHT_KEY):action = HabitatSimActions.TURN_RIGHTprint("action: RIGHT")elif keystroke == ord(FINISH):action = HabitatSimActions.STOPprint("action: FINISH")else:print("INVALID KEY")continueobservations = env.step(action)####env.step(action)里面的action是HabitatSimActions中定义的动作count_steps += 1# cv2.imshow("RGB", transform_rgb_bgr(observations["rgb"]))cv2.imshow("RGB", observations["rgb"])print("Episode finished after {} steps.".format(count_steps))if (action == HabitatSimActions.STOP# and observations["pointgoal_with_gps_compass"][0] < 0.2):print("you successfully navigated to destination point")else:print("your navigation was unsuccessful")if __name__ == "__main__":example()

3获取habitat-lab路径

通过habitat.utils.gym_definitions.base_dir获取

import habitat.utils.gym_definitions as habitat_gym
print('habitat_gym.base_dir:',habitat_gym.base_dir)

下面是一个例子:

import habitat.utils.gym_definitions as habitat_gym
print('habitat_gym.base_dir:',habitat_gym.base_dir)
import osimport gym
import gym.spaces as spaces
import numpy as npimport habitat
import habitat.utils.gym_definitions as habitat_gym
from habitat.core.embodied_task import Measure
from habitat.core.registry import registry
from habitat.core.simulator import Sensor, SensorTypes
from habitat.tasks.rearrange.rearrange_sensors import RearrangeReward
from habitat.tasks.rearrange.rearrange_task import RearrangeTask
from habitat.utils.render_wrapper import overlay_frame
from habitat.utils.visualizations.utils import observations_to_image
from habitat_sim.utils import viz_utils as vut# Quiet the Habitat simulator logging
os.environ["MAGNUM_LOG"] = "quiet"
os.environ["HABITAT_SIM_LOG"] = "quiet"def insert_render_options(config):# Added settings to make rendering higher resolution for better visualizationconfig.defrost()config.SIMULATOR.THIRD_RGB_SENSOR.WIDTH = 512config.SIMULATOR.THIRD_RGB_SENSOR.HEIGHT = 512config.SIMULATOR.CONCUR_RENDER = Falseconfig.SIMULATOR.AGENT_0.SENSORS.append("THIRD_RGB_SENSOR")config.freeze()return configimport importlib# If the import block fails due to an error like "'PIL.TiffTags' has no attribute
# 'IFD'", then restart the Colab runtime instance and rerun this cell and the previous cell.
import PILimportlib.reload(PIL.TiffTags)  # To potentially avoid PIL problemprint('habitat_gym.base_dir:',habitat_gym.base_dir)##################用habitat自己的方式###########################
with habitat.Env(config=insert_render_options(habitat.get_config(os.path.join(habitat_gym.base_dir,"configs/tasks/rearrange/pick.yaml",)))
) as env:observations = env.reset()  # noqa: F841print("Agent acting inside environment.")count_steps = 0# To save the videovideo_file_path = "data/example_interact.mp4"video_writer = vut.get_fast_video_writer(video_file_path, fps=30)while not env.episode_over:observations = env.step(env.action_space.sample())  # noqa: F841,随机动作info = env.get_metrics()render_obs = observations_to_image(observations, info)render_obs = overlay_frame(render_obs, info)video_writer.append_data(render_obs)count_steps += 1print("Episode finished after {} steps.".format(count_steps))video_writer.close()if vut.is_notebook():#此处并没有播放vut.display_video(video_file_path)

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

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

信息安全系列04-安全启动介绍

本文框架 1. 基本概念1.1 基本概念回顾1.2 数字签名及验签流程 2. 安全启动实施2.1 信任根选择2.1.1 使用HSM作为信任根2.1.2 使用最底层Bootloader作为信任根 2.2 校验方法确认2.2.1 基于非对称加密算法&#xff08;数字签名&#xff09;2.2.2 基于对称加密算法 2.3 安全启动方…

llvm AST consumer 示例

示例源码 Makefile LLVM_CONFIG ? llvm-config #CXX : clang ifndef VERBOSE QUIET : endifSRC_DIR ? $(PWD) LDFLAGS $(shell $(LLVM_CONFIG) --ldflags) COMMON_FLAGS -Wall -Wextra CXXFLAGS $(COMMON_FLAGS) $(shell $(LLVM_CONFIG) --cxxflags) LCXX :$(shell $(L…

前端面试题 ===> 【JavaScript - 高级】

公众号&#xff1a;需要以下pdf&#xff0c;关注下方 2023已经过完了&#xff0c;让我们来把今年的面试题统计号&#xff0c;来备战今年的金三银四&#xff01;所以&#xff0c;不管你是社招还是校招&#xff0c;下面这份前端面试工程师高频面试题&#xff0c;请收好。 JavaScr…

【MGR】MySQL Group Replication 中文官方文档

MySQL 组复制官方文档翻译 背景&#xff1a; 由于中文版的官方文档应该是通过谷歌翻译直接进行翻译&#xff0c;读起来晦涩难懂&#xff0c;刚好最近在调研MGR&#xff0c;所以对官方文档进行了翻译&#xff0c;翻译版本是5.7。 翻译的英文官方文档&#xff1a; Chapter 17 …

百度AI千帆大模型示例代码 GO语言版

前端&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>Sample</title> </head> <body><label for"textInput">Prompt&#xff1a;</label><i…

Kubernetes基础(二十七)-nodePort/targetPort/port/containerPort/hostPort

1 nodePort/targetPort/port/containerPort 1.1 实现层级 1.2 配置方式 ########service########### apiVersion: v1 kind: Service metadata: labels: name: app1 name: app1 namespace: default spec: type: NodePort ports: - <strong>port: 8080 t…

基于C#开发OPC DA客户端——搭建KEPServerEX服务

简介 OPC DA (OLE for Process Control Data Access) 是一种工业自动化领域中的通信协议标准&#xff0c;它定义了应用程序如何访问由OPC服务器提供的过程控制数据。OPC DA标准允许软件应用程序&#xff08;客户端&#xff09;从OPC服务器读取实时数据或向服务器写入数据&…

python:pyecharts 画基金净值 月K线图

pip install pyecharts1.9.1 pyecharts-1.9.1-py3-none-any.whl 我想在本地&#xff08;PC) 画出 基金净值 月K线图&#xff0c;不想每次看图都需联网。 cd my_dir mkdir echarts cd echarts curl -O https://assets.pyecharts.org/assets/echarts.min.js 修改一下开源代码 …

题目 1041: [编程入门]宏定义之找最大数

问题描述&#xff1a; 分别用函数和带参的宏&#xff0c;从三个数中找出最大的数。 样例输入&#xff1a; 1 2 3 样例输出&#xff1a; 3.000 3.000 代码分析&#xff1a; 函数与宏的使用&#xff1a; 函数 max() 用于找出三个实数中的最大值&#xff0c;通过比较大小并…

记录前端面试的一些笔试题(持续更新......)

文章目录 js相关数组去重数组对象去重 实现数组unshift数组扁平化tree型数据扁平化list数据转tree型数据 对象深拷贝防抖/节流函数柯里化函数管道 随便记录一些&#xff0c;面试或者工作中都会用到&#xff0c;实现的方法很多&#xff0c;这里只是一小部分&#xff0c;有更好的…

蓝桥集训之棋盘

蓝桥集训之棋盘 核心思想&#xff1a;差分二进制 因为最终输出的棋盘为01组成k&1 –> 奇1偶0 所以每次差分时元素 最中&1输出即可 #include<iostream>#include<cstring>using namespace std;const int N 2010;int b[N][N];int n,m;int main(){cin&g…

Kubernetes(k8s第四部分之servers)

1&#xff0c;为什么不使用round-robin DNS&#xff1f; 因为DNS有缓存&#xff0c;不会清理&#xff0c;无法负载均衡 ipvs代理模式&#xff0c;这种模式&#xff0c;kube-proxy会监视Kubernetes Service 对象和Endpoints&#xff0c;调用netlink接口以相应地创建ipvs规则并…

理解Linux环境变量及export命令

主要看三个问题 在Linux和Unix系统中&#xff0c;环境变量对于管理系统和应用程序的行为至关重要。本文将介绍Linux环境变量的概念&#xff0c;以及使用export命令设置环境变量的原理和作用。 什么是环境变量&#xff1f; 在Linux和Unix系统中&#xff0c;环境变量是一种可以…

将字典中的键和值对换

Python中要将字典中的键和值对换比如&#xff1a; {daisy: 0, dandelion: 1, roses: 2, sunflower: 3, tulips: 4} 变成 {0: daisy, 1: dandelion, 2: roses, 3: sunflower, 4: tulipsoriginal_dict {daisy: 0, dandelion: 1, roses: 2, sunflower: 3, tulips: 4} new_dict {…

pwn学习笔记(5)--格式化字符串漏洞(未完全完成)

pwn学习笔记&#xff08;5&#xff09;–格式化字符串漏洞 ​ 前言&#xff1a;由于条件有限&#xff0c;因此对于该漏洞的学习不算很多&#xff0c; 格式化字符串漏洞基础&#xff1a; 格式化字符串介绍&#xff1a; ​ 格式化字符串函数可以接收可变数量的参数&#xff0…

清除注册表的U盘(USB盘)使用记录,或者电脑的U盘记录

清除注册表的U盘(USB盘)使用记录&#xff0c;或者电脑的U盘记录 1、可以考虑使用psexec.exe&#xff0c;在Windows图标按右键选择Windows PowerShell(管理员)(A)&#xff0c;然后输入PsExec.exe -i -d -s regedit.exe就可以删除(如果打开注册表&#xff0c;删除id需要右键修改…

鸿蒙学习-数据持久化

应用数据持久化概述 应用数据持久化&#xff0c;是指应用将内存中的数据通过文件或数据库的形式保存到设备上。内存中的数据形态通常是任意的数据结构或数据对象&#xff0c;存储介质上的数据形态可能是文本、数据库、二进制文件等。 HarmonyOS标准系统支持典型的存储数据形态…

win11下安装mysql

一、下载MySQL 官方下载传送门 我安装的版本是5.7.83 二、安装MySQL 1.双击安装包 2.选择Custom(自定义安装)&#xff0c;然后Next> 3.根据你的系统做选择&#xff0c;我的是64位&#xff0c;所选MySQL Servers 5.7.38 -x64&#xff0c;然后按箭头将选中的版本移到右边…

qt学习:QPaintEvent绘图事件+QPainter画家

目录 QPaintEvent绘图事件 常见事件 QPainter 初始化 QPainter 设置画笔和画刷 绘制图形 结束绘制 画线 画矩形 画圆形 画弧线 画扇形 指定画笔大小 QPen 抗锯齿 无边框 画指针 多边形 渐变色 QLinearGradient 使用步骤 示例一 线性渐变 示例二 径向渐…

Java基于springboot的社区团购系统设计论文

摘 要 本课题是根据用户的需要以及网络的优势建立的一个社区团购系统&#xff0c;来满足用户团购的需求。 本社区团购系统应用Java技术&#xff0c;MYSQL数据库存储数据&#xff0c;基于Spring Boot框架开发。在网站的整个开发过程中&#xff0c;首先对系统进行了需求分析&…