测试工程师首chatGPT,编写python读取xmind测试用例chatgtp+python+xmind

news2024/10/7 1:50:52

背景

有用xmind写测试用例的吧,统计一个xmind的条,需要花大量的时间,还有要统计有多少条冒烟的,多少条不通过的,还有通过的条数。

需求

快速使用python,写一个简单的脚本,统计所有xmind节点,分别统计出,冒烟,通过,不通过的条数

方案

使用chatGPT编写python脚本,通过脚本读取xmind文件,统计特定标签数,特定的标签相当于表示冒烟用例,通过用例,不通过用例,解决人工统计的困难,通过程序统计一个比较准确的数值,允许有一定的偏差,偏差来自于xmind的版本,格式,编写规范等

过程

为chatGTP建立角色

先给chatGTP建立一个角色:测试开发、python开发

给chatGTP提出简单的需求

我:用python,分别读取xmind文件,每个一个画布
AI:要读取xmind文件,需要使用外部库xmind。首先,你需要使用pip在Python环境中安装xmind库。打开终端或命令行,输入以下命令进行安装:

pip install xmind

解析xmind文件

AI:安装完成后,就可以使用xmind库来读取并操作xmind文件了。

以下是一个读取xmind文件,并将每个画布输出为图片的代码示例:

import xmind
import os

# 读取xmind文件
workbook = xmind.load('/path/to/your/xmind/file.xmind')

# 获取每个画布并输出为图片
for sheet in workbook.getSheets():
    # 获取画布名称
    sheet_name = sheet.getTitle()

    # 创建输出目录
    output_dir = f'{os.getcwd()}/{sheet_name}'
    os.makedirs(output_dir, exist_ok=True)

    # 输出画布中的每个主题为图片
    for topic in sheet.getRootTopic().getSubTopics():
        # 获取主题文本
        topic_title = topic.getTitle()

        # 创建输出文件路径
        output_file = f'{output_dir}/{topic_title}.png'

        # 输出主题为图片
        topic.getImage(output_file)

AI对代码的解析

AI:代码中,xmind.load()方法读取指定路径的xmind文件,并返回一个workbook对象。getSheets()方法获取xmind文件中的所有画布。遍历每个画布,获取画布名称并创建输出目录。

然后,遍历每个画布中的主题,获取主题文字并创建输出文件的路径。getImage()方法将主题输出为png格式的图片。

这个示例代码可以帮助你开始读取和处理xmind文件。你可以根据自己的需求,进一步扩展和优化代码。


AI明细是要输出图片,这也明细不是我的本意,我意思是输出每个sheet的名字

矫正AI的理解重写需求

我:只需要在python里面print一下所有的画布名称

AI:

import xmind

# 读取xmind文件
workbook = xmind.load('/path/to/your/xmind/file.xmind')

# 遍历每个画布并打印画布名称
for sheet in workbook.getSheets():
    print(sheet.getTitle())

代码中,workbook.getSheets()方法获取xmind文件中的所有画布,
然后使用for循环遍历每个画布,打印出画布的名称。
运行代码,即可在控制台上看到所有画布的名称。

我:xmind这个库无法打开最新的xmind

AI:如果xmind库无法打开最新格式的xmind文件,可能需要使用最新的xmind库或者其他支持最新xmind格式的库。

可以尝试使用xmind-sdk-python库来打开最新版本的xmind文件,它是Xmind的官方开发工具,支持最新版本的xmind文件。

以下是一个使用xmind-sdk-python库打开xmind文件,并打印所有画布名称的示例代码:

from xmind import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典
xmind_dict = xmind_to_dict(xmind_file)

# 获取画布列表
sheets = xmind_dict.get('sheets')

# 打印所有画布名称
if sheets:
    for sheet in sheets:
        print(sheet.get('title'))


代码中,xmind_to_dict()方法将xmind文件读入,并将其转换成一个包含所有信息的字典。
然后通过获取字典中的'sheets'键,获取所有画布的信息。
对于每个画布,使用get()方法获取名称信息并打印。

这个示例代码可以帮助你使用xmind-sdk-python库,打开最新版本的xmind文件并打印出画布名称。
你可以根据自己的需求,进一步扩展和优化代码。

指定AI使用指定类库

我:用这个库:xmindparser

AI:xmindparser是第三方库,可以解析最新版本Xmind文件,进行导入和导出,同时提供方便的API,方便对Xmind文件进行修改和处理。以下是一个使用xmindparser库读取xmind文件,并打印所有画布名称的代码示例:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典
xmind_dict = xmind_to_dict(xmind_file)

# 获取画布列表
sheets = xmind_dict.get('topic-refs')

# 打印所有画布名称
if sheets:
    for sheet in sheets:
        sheet_id = sheet.get('id')
        sheet_title = xmind_dict.get(sheet_id, {}).get('title')
        print(sheet_title)

代码中,xmind_to_dict()方法读取xmind文件,并将其转换成一个字典。
使用xmind_dict.get()方法,获取字典中的'topic-refs'键,它包含了所有画布的引用。
对于每个画布引用,获取它的id并使用xmind_dict.get()方法获取对应的画布信息,
包括标题信息,并打印出标题信息。

这个示例代码可以帮助你使用xmindparser库,打开最新版本的xmind文件并打印出画布名称。
你可以根据自己的需求,进一步扩展和优化代码。

到这里把代码贴上去,还是有报错的,再一次调教一下AI,再完善一下需求的方向

我:用python的xmindparser库,分别读取xmind文件中每个画布的名称

AI:使用xmindparser库,可以通过以下代码读取xmind文件中每个画布的所有主题及其名称信息:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典
xmind_dict = xmind_to_dict(xmind_file)

# 获取画布列表
sheets = xmind_dict.get('topic-refs')

# 遍历所有画布的主题并打印主题名称
if sheets:
    for sheet in sheets:
        sheet_id = sheet.get('id')
        sheet_title = xmind_dict.get(sheet_id, {}).get('title')
        sheet_topics = xmind_dict.get(sheet_id, {}).get('topics')

        if sheet_topics:
            for topic in sheet_topics:
                topic_title = topic.get('title')
                print(f'画布: {sheet_title}, 主题: {topic_title}')

代码中,xmind_to_dict()方法读取xmind文件,并将其转换成一个字典。
使用xmind_dict.get()方法,获取字典中的'topic-refs'键,它包含了所有画布的引用。
对于每个画布引用,获取它的id,并使用xmind_dict.get()方法获取对应的画布信息,包括标题信息和主题信息。

对于每个画布,遍历主题信息,获取主题标题信息并打印。

这个示例代码可以帮助你使用xmindparser库读取xmind文件中所有画布的主题及其名称信息。
你可以根据自己的需求,进一步扩展和优化代码。

'list' object has no attribute 'get'

运行之后,发送报错了,把错误在抛给gtp,sheets = xmind_dict.get('topic-refs')
AttributeError: 'list' object has no attribute 'get'

AI:如果你遇到'list' object has no attribute 'get'错误,可能是由于读取xmind文件后返回了列表而非字典对象。

这种情况下,你可以尝试使用以下代码,从列表中获取字典对象:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 如果返回的是列表,则获取第一个元素
if isinstance(xmind_data, list):
    xmind_data = xmind_data[0]

# 获取画布列表
sheets = xmind_data.get('topic-refs')

# 遍历所有画布的主题并打印主题名称
if sheets:
    for sheet in sheets:
        sheet_id = sheet.get('id')
        sheet_title = xmind_data.get(sheet_id, {}).get('title')
        sheet_topics = xmind_data.get(sheet_id, {}).get('topics')

        if sheet_topics:
            for topic in sheet_topics:
                topic_title = topic.get('title')
                print(f'画布: {sheet_title}, 主题: {topic_title}')

代码中,使用isinstance()方法判断返回值的类型,如果是列表类型,则获取第一个元素。
获取画布列表后,遍历所有画布的主题并打印主题名称。

使用这个代码可以解决'list' object has no attribute 'get'错误,帮助你使用xmindparser库读取xmind文件中所有画布的主题及其名称信息。

 运行了一下代码,结果打印为空

继续给AI抛出错误:打印的结果为什么会为空?

下面是AI给出的意见,大概是个说,xmind的文件没有对应字段

可以先通过xmind的类库打开文件,读取并打印信息,看看文件的字段名叫什么

from xmind import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典
xmind_dict = xmind_to_dict(xmind_file)

 我:我的内容不包含topic-refs,替换成‘title’,而且个列表

AI:如果你的xmind文件中没有topic-refs键,但是有title键,可以按照以下代码读取画布名称和主题名称。

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 如果返回的是列表,则获取第一个元素
if isinstance(xmind_data, list):
    xmind_data = xmind_data[0]

# 获取画布列表
sheets = xmind_data.get('title')

# 处理每个画布
for sheet in sheets:
    sheet_title = sheet['title']

    # 处理画布中的主题
    root_topic = sheet.get('topics', {})
    topics = root_topic.get('children', [])

    # 处理每个主题
    for topic in topics:
        topic_title = topic.get('title', '')
        print(f'画布: {sheet_title}, 主题: {topic_title}')

代码中,我们先使用xmindparser库将xmind文件转换成字典或列表格式。
如果返回的是一个列表,则需要获取列表中的第一个元素。

然后,获取画布列表。在这种情况下,'title'键返回的值是一个列表,我们需要处理每个画布。

对于每个画布,获取其标题,并处理其中的主题。在这个例子中,我们使用根主题作为画布的主题,
然后获取主题下的所有子主题。对于每个主题,获取其标题,打印输出画布名称和主题名称。

这个代码可以帮助你使用xmindparser库读取xmind文件中所有画布和主题名称信息,
并对其进行处理和扩展。

string indices must be integers

我:sheet_title = sheet['title']
TypeError: string indices must be integers

AI:如果你遇到TypeError: string indices must be integers错误,可能是由于代码中对字符串类型的变量进行了索引,而字符串类型是不支持索引操作的。

针对这种情况,你可以使用以下代码:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 如果返回的是列表,则获取第一个元素
if isinstance(xmind_data, list):
    xmind_data = xmind_data[0]

# 获取画布列表
sheets = xmind_data.get('title')

# 处理每个画布
for sheet in sheets:
    if isinstance(sheet, str):
        sheet_title = sheet
    else:
        sheet_title = sheet.get('title', '')

    # 处理画布中的主题
    root_topic = sheet.get('topics', {})
    topics = root_topic.get('children', [])

    # 处理每个主题
    for topic in topics:
        topic_title = topic.get('title', '')
        print(f'画布: {sheet_title}, 主题: {topic_title}')

在这个代码中,我们增加了一个判断:如果当前画布的类型是字符串,
直接将其作为画布标题;否则,使用get()方法获取其标题,如果无法获取,则将其设为空字符串。

这个代码可以解决TypeError: string indices must be integers错误,
帮助你使用xmindparser库读取xmind文件中所有画布和主题名称信息,并对其进行处理和扩展。

AttributeError: 'str' object has no attribute

我:root_topic = sheet.get('topics', {}) AttributeError: 'str' object has no attribute 'get'

AI:

如果你遇到了AttributeError: 'str' object has no attribute 'get'错误,在这种情况下是因为原先的代码设定先判断json中的'title'键是否存在,若存在后继续操作,但'title'返回的是字符串,字符串类型是不支持使用get方法的。

因此,需要先判断获取到的变量是否为字典类型,如果是则使用get()方法获取'topics'键对应的值,否则设置root_topic为一个空字典。

修改后的代码如下:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 如果返回的是列表,则获取第一个元素
if isinstance(xmind_data, list):
    xmind_data = xmind_data[0]

# 获取画布列表
sheets = xmind_data.get('title')

# 处理每个画布
for sheet in sheets:
    if isinstance(sheet, str):
        sheet_title = sheet
    else:
        sheet_title = sheet.get('title', '')

    # 处理画布中的主题
    if isinstance(sheet, dict):
        root_topic = sheet.get('topics', {})
        topics = root_topic.get('children', [])
    else:
        topics = []

    # 处理每个主题
    for topic in topics:
        topic_title = topic.get('title', '')
        print(f'画布: {sheet_title}, 主题: {topic_title}')

在这个代码中,我们增加了一个判断:如果当前画布的类型是字典,
使用get()方法获取'topics'键对应的值,否则将topics设置为空列表。

这个代码可以解决AttributeError: 'str' object has no attribute 'get'错误,
帮助你使用xmindparser库读取xmind文件中所有画布和主题名称信息,并对其进行处理和扩展。

来到这里,代码没有报错,运行也没有打印结果,由于上面我们看过数据格式,在一次告诉AI我们的结果格式

向AI提出我需要的结果

我:我告诉你一下,这是xmind_data结果:[{'title': '画布 1', 'topic': {'title': '中心主题', 'topics': [{'title': '分支主题 1', 'makers': ['tag-red']}, {'title': '分支主题 2', 'makers': ['tag-orange']}, {'title': '分支主题 3', 'makers': ['tag-green'], 'topics': [{'title': '子主题 1', 'makers': ['priority-1']}, {'title': '子主题 2', 'makers': ['flag-red']}]}, {'title': '分支主题 4'}]}, 'structure': 'org.xmind.ui.map.unbalanced'}, {'title': '画布 2', 'topic': {'title': '中心主题', 'topics': [{'title': '分支主题 1'}, {'title': '分支主题 2'}]}, 'structure': 'org.xmind.ui.map.unbalanced'}]

AI:好的,根据你提供的内容,可以按照以下代码处理xmind_data:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 处理每个画布
for sheet in xmind_data:
    sheet_title = sheet.get('title', '')

    # 处理画布中的主题
    root_topic = sheet.get('topic', {})
    topics = root_topic.get('topics', [])

    # 处理每个主题
    for topic in topics:
        topic_title = topic.get('title', '')
        print(f'画布: {sheet_title}, 主题: {topic_title}')

来到这里由于有运行结果,当然结果还是需要进一步优化的,需要优化画布的名称重复输出

我:只需要打印,画布名称就可以了

AI: 如果你只需要打印画布名称,可以按照以下代码处理xmind_data:

from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 打印每个画布的名称
for sheet in xmind_data:
    sheet_title = sheet.get('title', '')
    print(f'画布: {sheet_title}')


这个代码会遍历xmind_data中所有的画布,获取画布的名称并打印出来。

如果你需要获取更多的信息,比如主题的数量或者关系,可以对代码进行相应的修改,
比如添加一个计数器获取主题数量等。

这里只统计了一个结果,需要遍历所有结果出来

我:继续完善这个代码,for循环遍历xmind_data,得到每个一个画布,循环遍历找到每个画布里面的makers键的值,且统计值的个数

AI:继续完善这个代码,for循环遍历xmind_data,得到每个一个画布,循环遍历找到每个画布里面的makers键的值,且统计值的个数

from collections import Counter
from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 遍历每个画布
for sheet in xmind_data:
    sheet_title = sheet.get('title')

    markers = []
    # 遍历每个主题,获取标签列表
    for topic in sheet.get('topic', {}).get('topics', []):
        markers += topic.get('markers', [])

    # 统计每个标签出现的次数
    marker_count = Counter(markers)

    # 输出结果
    print(f'画布: {sheet_title}')
    for marker, count in marker_count.items():
        print(f'标签:{marker},出现次数:{count}')
    print('\n')

我:完善代码makers的值分别为:tag-green,tag-red,tag-yellow

AI:好的,如果你需要在上面的代码基础上进一步筛选标签,使其仅包含值为’tag-green’、'tag-red’和’tag-yellow’的标签,并统计其出现次数,可以按照以下代码进行修改:

from collections import Counter
from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 遍历每个画布
for sheet in xmind_data:
    sheet_title = sheet.get('title')

    markers = []
    # 遍历每个主题,获取标签列表
    for topic in sheet.get('topic', {}).get('topics', []):
        for marker in topic.get('markers', []):
            if marker in ['tag-green', 'tag-red', 'tag-yellow']:
                markers.append(marker)

    # 统计每个标签出现的次数
    marker_count = Counter(markers)

    # 输出结果
    print(f'画布: {sheet_title}')
    for marker, count in marker_count.items():
        print(f'标签:{marker},出现次数:{count}')
    print('\n')

我:我告诉你一下,这是xmind_data结果,有‘画布1’和‘画布2’,分别统计出'tag-green', 'tag-red', 'tag-yellow'的标签数量:[{'title': '画布 1', 'topic': {'title': '中心主题', 'topics': [{'title': '分支主题 1', 'makers': ['tag-red']}, {'title': '分支主题 2', 'makers': ['tag-orange']}, {'title': '分支主题 3', 'makers': ['tag-green'], 'topics': [{'title': '子主题 1', 'makers': ['priority-1']}, {'title': '子主题 2', 'makers': ['flag-red']}]}, {'title': '分支主题 4'}]}, 'structure': 'org.xmind.ui.map.unbalanced'}, {'title': '画布 2', 'topic': {'title': '中心主题', 'topics': [{'title': '分支主题 1'}, {'title': '分支主题 2'}]}, 'structure': 'org.xmind.ui.map.unbalanced'}] 

AI:好的,那么可以按照如下代码对xmind_data进行进一步筛选和统计:

from collections import Counter
from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 定义要统计的标签
target_tags = ['tag-green', 'tag-red', 'tag-yellow']

# 遍历每个画布
for sheet in xmind_data:
    sheet_title = sheet.get('title')

    markers = []
    # 遍历每个主题,获取标签列表
    for topic in sheet.get('topic', {}).get('topics', []):
        makers = topic.get('makers', [])
        # 筛选出目标标签
        target_makers = [maker for maker in makers if maker in target_tags]
        markers.extend(target_makers)

    # 统计每个标签出现的次数
    marker_count = Counter(markers)

    # 输出结果
    print(f'画布: {sheet_title}')
    for target_tag in target_tags:
        count = marker_count[target_tag]
        print(f'标签:{target_tag},出现次数:{count}')
    print('\n')

我:然后将这几个标签的数相加'tag-green', 'tag-red', 'tag-yellow'

AI:

from collections import Counter
from xmindparser import xmind_to_dict

# 读取xmind文件
xmind_file = '/path/to/your/xmind/file.xmind'

# 将xmind文件转换成字典或列表
xmind_data = xmind_to_dict(xmind_file)

# 定义要统计的标签
target_tags = ['tag-green', 'tag-red', 'tag-yellow']

# 初始化标签数量
total_count = 0

# 遍历每个画布
for sheet in xmind_data:
    markers = []
    # 遍历每个主题,获取标签列表
    for topic in sheet.get('topic', {}).get('topics', []):
        makers = topic.get('makers', [])
        # 筛选出目标标签
        target_makers = [maker for maker in makers if maker in target_tags]
        markers.extend(target_makers)

    # 统计每个标签出现的次数
    marker_count = Counter(markers)

    # 累加每个目标标签的出现次数
    for target_tag in target_tags:
        count = marker_count[target_tag]
        total_count += count
        print(f'标签:{target_tag},出现次数:{count}')

    print(f"目标标签共出现了{total_count}次\n")

 最后面,就不断和AI沟通,完善代码

from xmindparser import xmind_to_dict

xmind_file = 'test.xmind'

xmind_dict = xmind_to_dict(xmind_file)


def count_titles_and_tags(topics):
    """
    递归地统计所有的title和tag数量
    """
    title_count = len(topics)  # 统计当前主题块的数量
    tag_red_count = 0
    tag_orange_count = 0
    tag_green_count = 0

    for topic in topics:
        if 'makers' in topic and 'tag-red' in topic['makers']:
            tag_red_count += 1
        if 'makers' in topic and 'tag-yellow' in topic['makers']:
            tag_orange_count += 1
        if 'makers' in topic and 'tag-green' in topic['makers']:
            tag_green_count += 1

        if 'topics' in topic:
            sub_topics = topic['topics']
            sub_counts = count_titles_and_tags(sub_topics)
            title_count += sub_counts[0]
            tag_red_count += sub_counts[1]
            tag_orange_count += sub_counts[2]
            tag_green_count += sub_counts[3]

    return title_count, tag_red_count, tag_orange_count, tag_green_count


# 统计所有的title和tag数量
# total_counts = count_titles_and_tags(xmind_dict[0]['topic']['topics'])
# print("Total number of titles:", total_counts[0])
# print("Total number of tag-red:", total_counts[1])
# print("Total number of tag-orange:", total_counts[2])
# print("Total number of tag-green:", total_counts[3])


# for canvas in xmind_dict:
#     print("Canvas name:", canvas['title'])
#     topics = canvas['topic']['topics']
#     total_counts = count_titles_and_tags(topics)
#     print("Total number of titles in canvas:", total_counts[0])
#     print("Total number of tag-red in canvas:", total_counts[1])
#     print("Total number of tag-orange in canvas:", total_counts[2])
#     print("Total number of tag-green in canvas:", total_counts[3])


# 初始化总计数器
total_counts = [0, 0, 0, 0]  # title计数器,tag-red计数器,tag-orange计数器,tag-green计数器

for canvas in xmind_dict:
    print("Canvas name:", canvas['title'])
    topics = canvas['topic']['topics']
    canvas_counts = count_titles_and_tags(topics)
    print("Total number of titles in canvas:", canvas_counts[0])
    print("Total number of tag-red in canvas:", canvas_counts[1])
    print("Total number of tag-orange in canvas:", canvas_counts[2])
    print("Total number of tag-green in canvas:", canvas_counts[3])

    # 累加计数器
    total_counts[0] += canvas_counts[0]  # title计数器累加
    total_counts[1] += canvas_counts[1]  # tag-red计数器累加
    total_counts[2] += canvas_counts[2]  # tag-orange计数器累加
    total_counts[3] += canvas_counts[3]  # tag-green计数器累加

# 输出总计数器结果
print("Canvas name:总计数")
print("Total number of titles:", total_counts[0])
print("Total number of tag-red:", total_counts[1])
print("Total number of tag-orange:", total_counts[2])
print("Total number of tag-green:", total_counts[3])

运行结果

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

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

相关文章

【IP地址与子网掩码】网络杂谈(19)之IP地址分类与子网掩码的概念

涉及知识点 什么是子网掩码,IP地址的分类,子网掩码的概念,深入了解子网掩码与IP地址,A类,B类,C类,D类,E类ip地址范围。 原创于:CSDN博主-《拄杖盲学轻声码》,更多内容可…

Linux调试笔记

gdb调试----------------------------------------------------------------------------------------- CMakeFile.txt加入set(CMAKE_BUILD_TYPE Debug) gdb ./rknn_MNIST 打断点 b 110/main(行号/函数名) 单步调试 s(step) 单步跳过 n(n…

计算机组成原理(2)_计算机基本组成

计算机组成系列文章目录 第一章 计算机的基本组成 1. 大致简介 2. 计算机基本组成 第二章 计算机的指令和运算 第三章 处理器设计 第四章 存储器和IO系统 文章目录 计算机组成系列文章目录前言参考资料一、组成架构(冯/图)1. 组成架构2. 冯诺依曼3. 图灵…

力扣 530. 二叉搜索树的最小绝对差 / 783. 二叉搜索树节点最小距离

题目来源 530:https://leetcode.cn/problems/minimum-absolute-difference-in-bst/description/ 783: https://leetcode.cn/problems/minimum-distance-between-bst-nodes/ C题解1:递归法,中序遍历。通过中序遍历将二叉搜索树转…

【Android】Android类加载机制

ClassLoader介绍 任何一个 Java 程序都是由一个或多个 class 文件组成,在程序运行时,需要将 class 文件加载到 JVM 中才可以使用,负责加载这些 class 文件的就是 Java 的类加载机制。ClassLoader 的作用简单来说就是加载 class 文件&#xf…

echarts图表-实现中国地图的绘制

第一步:引入中国地图的json数据,初始化echarts的dom结构,使用registerMap方法加载地图数据(注:echarts5.X版本后删除了中国地图的JSON,需自行下载JSON或降低echarts版本) 第二步:传输…

React通过props的children实现插槽功能

可能会比较遗憾的说 React中并没有vue中的 slot 插槽概念 不过 可以通过props.children 实现类似功能 我们先创建一个React项目 在src下创建目录components 在下面创建一个dom.jsx组件 参考代码如下 import React from "react" export default class dom extends R…

Android学习日志 一、滚动视图的嵌套

文章目录 滚动视图的嵌套创建项目(前期准备)工程搭建编写XML正式代码 By-Round Moon 滚动视图的嵌套 说明:本博客是博主学习安卓开发的第一个案例。接下来会进行一系列的样例,含很多基础部分,各位观众老爷请见谅。 Android Studio 版本:2022.2.1 patch …

如何将MBR转为GUID?这方法易于使用且安全!

为什么要将MBR转为GUID(GPT)? MBR代表主引导记录,它使用Legacy BIOS分区表。而GPT磁盘,也就是GUID分区表的缩写,是一种引入了统一可扩展固件接口 (UEFI) 的新布局。GPT磁盘有2个主要优势: GPT磁盘每个分区…

前端-CSS 字体和文本样式

字体大小 /* 浏览器默认字体大小 16px */ font-size: 16px;<div style"font-size: 16px;">Hello World!</div> <div style"font-size: 26px;">Hello World!</div>字体粗细 font-weight: 400;<div style"font-weight: no…

JumpServer开源堡垒机页面配置

JumpServer开源堡垒机页面配置 一、登录二、功能模块2.1、控制台2.1.1、用户管理2.1.1.1、用户列表2.1.1.2、用户组 2.1.2、资产管理2.1.2.1、资产列表2.1.2.1.1、创建服务器链接2.1.2.1.2、创建数据库MySQL链接 2.1.2.2、网域列表2.1.2.3、平台列表2.1.2.4、标签列表 2.1.3、账…

同源建模MOE:请叫我永远的神!

同源建模 实/操/篇 1.分子力场的设置 MOE中缺省的分子力场MMFF94x是一个用于小分子和复合物模拟的力场,不能很好地适用于大分子模拟,由于这里我们要进行同源模建,模拟对象是蛋白质结构,因此首先要将缺省分子力场MMFF94x更改为适用于蛋白质模拟的相关分子力场&#xff0c;如A…

【PCL】Ouster 和 Velodyne 激光雷达的 PCL 点云数据格式

【PCL】Ouster 和 Velodyne 激光雷达的 PCL 点云数据格式 0 news1 Ouster2 Velodyne3 数据类型转换 0 news Ouster 和 Velodyne 两公司合并。 1 Ouster GitHub: Link namespace ouster_ros {struct EIGEN_ALIGN16 Point {PCL_ADD_POINT4D;float intensity;uint32_t t;uint16_t…

conda 根目录内存满,更换新的目录

默认conda环境是在根目录&#xff0c;只需修改默认的目录即可 1 修改.condarc文件 vim ~/.condarc# 添加一行即可 envs_dirs:- /disk3/miniconda_envs/envs2 验证 创建一个conda环境 查看创建的路径 conda env list 这样以后都换把相关创建的包安装在disk3下&#xff0c;缓…

C++ - 20230630

一 . 思维导图 二. #include <iostream> using namespace std;class Person { private:int age;int p; public://无参构造Person(){age 0;p 0;}//有参构造Person(int age,int p):age(age), p(p){}//拷贝构造函数Person(Person &other) {this->age other.age;t…

《移动互联网技术》第九章 感知与多媒体: 了解质感设计的基本原则和设计方法

&#x1f337;&#x1f341; 博主 libin9iOak带您 Go to New World.✨&#x1f341; &#x1f984; 个人主页——libin9iOak的博客&#x1f390; &#x1f433; 《面试题大全》 文章图文并茂&#x1f995;生动形象&#x1f996;简单易学&#xff01;欢迎大家来踩踩~&#x1f33…

Tomcat 部署优化

目录 一.Tomcat介绍 二.了解Tomcat里面里面是放什么的 三. Tomcat&#xff1a;是一个特殊的服务 有两个领域 四.tomcat概述 五.再加上那个扩展java虚拟机&#xff08;JVM&#xff09; 调优 tomcat 优化分两种 六.Tomcat核心组件 ​编辑 容器&#xff1a;什么是容器 …

Dart语法01-变量、内置类型、操作符、方法与异常

Dart基础 文章目录 Dart基础变量final与const 内置的类型Numbers&#xff08;数值&#xff09;Strings&#xff08;字符串&#xff09;Booleans&#xff08;布尔值&#xff09;Lists&#xff08;列表&#xff09;Maps&#xff08;映射集合&#xff09;Runes&#xff08;用于在字…

用八叉树检测点云是否发生变化

检测点云数据集之间的空间变化有以下几个用处&#xff1a; 目标跟踪与物体识别&#xff1a;空间变化检测可以用于实时更新点云数据中的物体位置、姿态、形状等信息。这对于目标跟踪和物体识别非常重要&#xff0c;可以帮助我们在动态场景中准确地识别和跟踪物体&#xff0c;从而…

Maven下载安装及其配置

Maven下载安装及其配置 文章目录 Maven下载安装及其配置1、Maven介绍2、Maven下载安装2.1、最新2.2、旧版3.8 3、Maven环境配置3.1、配置3.2、验证3.3、 配置本地仓库 4、Maven使用4.1、Maven常用命令4.2、IDEA中的使用 1、Maven介绍 Maven 是一个流行的构建工具和依赖管理工具…