autogen的理解和实践

news2024/9/23 11:20:16

什么是autogen?

AutoGen 是一个框架,支持使用多个代理来开发 LLM 应用程序,这些代理可以相互对话来解决任务。AutoGen 代理是可定制的、可对话的,并且无缝地允许人类参与。他们可以采用法学硕士、人力投入和工具组合的各种模式运作。简单来说,就是设置不同的聊天代理对象来的相互对话交互来实现用户想要实现的目标和任务

基于chatgpt模型来构建,除了以下的几个chatgpt4的模型以外,它还支持fine-Truning模型

import autogen

config_list = autogen.config_list_from_json(
    "OAI_CONFIG_LIST",
    filter_dict={
        "model": ["gpt-4", "gpt4", "gpt-4-32k", "gpt-4-32k-0314", "gpt-4-32k-v0314"],
    },
)

如何使用autogen?

autogen的安装需要依赖于python>=3.8的版本,这点我们可以通过anaconda来进行环境配置和管理

pip install pyautogen

配置好环境之后,我们就可以使用autogen了

需要说明的是:autogen作用的实现主要是基于助手代理和用户代理两种对象,我们可以进行不同的配置实现代理对象对话场景的多样化:

助理代理的参数设置 

def __init__(name: str,
             system_message: Optional[str] = DEFAULT_SYSTEM_MESSAGE,
             llm_config: Optional[Union[Dict, bool]] = None,
             is_termination_msg: Optional[Callable[[Dict], bool]] = None,
             max_consecutive_auto_reply: Optional[int] = None,
             human_input_mode: Optional[str] = "NEVER",
             code_execution_config: Optional[Union[Dict, bool]] = False,
             **kwargs)
name str - 代理名称。
system_message str - ChatCompletion 推理的系统消息。如果您想重新编程代理,请覆盖此属性。
llm_config dict - llm 推理配置。
is_termination_msg function - 一个函数,它接受字典形式的消息并返回一个布尔值,指示收到的消息是否是终止消息。该字典可以包含以下键:“content”、“role”、“name”、“function_call”。
max_consecutive_auto_reply int - 连续自动回复的最大数量。默认为 None (没有提供限制,类属性 MAX_CONSECUTIVE_AUTO_REPLY 将在这种情况下用作限制)。该限制仅在 human_input_mode 不是“ALWAYS”时起作用。

用户代理的参数设置

def __init__(name: str,
             is_termination_msg: Optional[Callable[[Dict], bool]] = None,
             max_consecutive_auto_reply: Optional[int] = None,
             human_input_mode: Optional[str] = "ALWAYS",
             function_map: Optional[Dict[str, Callable]] = None,
             code_execution_config: Optional[Union[Dict, bool]] = None,
             default_auto_reply: Optional[Union[str, Dict, None]] = "",
             llm_config: Optional[Union[Dict, bool]] = False,
             system_message: Optional[str] = "")
name str - 代理的名称。
is_termination_msg function - 一个函数,它接受字典形式的消息并返回一个布尔值,指示收到的消息是否是终止消息。该字典可以包含以下键:“content”、“role”、“name”、“function_call”。
max_consecutive_auto_reply int - 连续自动回复的最大数量。默认为 None (没有提供限制,类属性 MAX_CONSECUTIVE_AUTO_REPLY 将在这种情况下用作限制)。该限制仅在 human_input_mode 不是“ALWAYS”时起作用。
human_input_mode str - 每次收到消息时是否要求人工输入。可能的值为“始终”、“终止”、“从不”。(1) 当“ALWAYS”时,代理每次收到消息时都会提示人工输入。在此模式下,当人工输入为“exit”时,或者当 is_termination_msg 为 True 并且没有人工输入时,对话停止。(2) 当“TERMINATE”时,只有当收到终止消息或自动回复次数达到 max_consecutive_auto_reply 时,代理才会提示人工输入。(3) 当“NEVER”时,代理将永远不会提示人工输入。该模式下,当自动回复次数达到 max_consecutive_auto_reply 或 is_termination_msg 为 True 时,会话停止。
function_map dict [str, callable] - 将函数名称(传递给 openai)映射到可调用函数。
code_execution_config dict 或 False - 代码执行的配置。要禁用代码执行,请设置为 False。否则,设置为具有以下键的字典:
work_dir(可选,str):代码执行的工作目录。如果没有,将使用默认工作目录。默认工作目录是“path_to_autogen”下的“extensions”目录。
use_docker (可选、list、str 或 bool):用于执行代码的 docker 映像。如果提供了图像名称的列表或字符串,则代码将在 docker 容器中执行,并成功拉取第一个图像。如果 None、False 或空,则代码将在当前环境中执行。默认为 True,将转换为列表。如果代码在当前环境中执行,则该代码必须是可信的。
timeout (可选,int):最大执行时间(以秒为单位)。
last_n_messages(实验性,可选,int):要回顾代码执行的消息数。默认为 1。
default_auto_reply str 或 dict 或 None - 当未生成代码执行或基于 llm 的回复时默认的自动回复消息。
llm_config dict 或 False - llm 推理配置。
system_message str - 用于 ChatCompletion 推理的系统消息。仅当 llm_config 不为 False 时使用。用它来重新编程代理。

autogen能做什么

1.多主体对话和任务执行

任务事例1:
今天是几号?比较一下META和特斯拉今年迄今的收益,将收益变化保存stock_price_ytd.png文件,并将该文件打开

import autogen
import openai
openai.api_key="your-api-key"
coder = autogen.AssistantAgent(
    name="coder",
    llm_config={
        "seed": 42,  # seed for caching and reproducibility
        "temperature": 0,  # temperature for sampling
    },  # configuration for autogen's enhanced inference API which is compatible with OpenAI AP
                               )
user_proxy = autogen.UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
)
# executor = autogen.AssistantAgent("executor",system_message="Executes the code generated by the coder and returns the data result")
task = "What date is today? Compare the year-to-date gain for META and TESLA"

user_proxy.initiate_chat(coder, message=task)
user_proxy.send(
    recipient=coder,
    message="""Plot a chart of their stock price change YTD and save to stock_price_ytd.png.""",
)
user_proxy.send(
    recipient= coder,
    message="open stock_price_ytd.png"
)
# print("nihao")

 结果逻辑:
他会按照以下逻辑输出任务的执行逻辑

1.编写并执行python代码计算今天日期

2.使用 `yfinance ` 获取股票价格的库,如果没有安装,将对其进行安装

3.计算 META 和 TESLA 的年初至今收益

4.在当前目录加载文件

5.打开该文件,可视化结果如下:

任务实例2:

让autogen对百度首页总结功能测试点并进行自动化测试 

import autogen
import openai
openai.api_key="your api key"
coder = autogen.AssistantAgent(
    name="coder",
    llm_config={
        "seed": 42,  # seed for caching and reproducibility
        "temperature": 0,  # temperature for sampling
    },  # configuration for autogen's enhanced inference API which is compatible with OpenAI AP
                               )
user_proxy = autogen.UserProxyAgent(
    name="user_proxy",
    human_input_mode="NEVER",
    max_consecutive_auto_reply=10,
    is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
)
# executor = autogen.AssistantAgent("executor",system_message="Executes the code generated by the coder and returns the data result")
task = "From the point of view of functional testing, analyze what test points Baidu home page has"
user_proxy.initiate_chat(coder, message=task)
# 生成对应的测试脚本
user_proxy.send("Generate automated test scripts based on these test points",coder)
From the point of view of functional testing, analyze what test points Baidu home page has

--------------------------------------------------------------------------------
coder (to user_proxy):

Functional testing is a type of software testing that validates the software system against the functional requirements/specifications. The purpose of functional tests is to test each function of the software application by providing appropriate input, verifying the output against the functional requirements.

When it comes to testing the Baidu home page, we can consider the following test points:

1. **Search Functionality**: This is the primary function of Baidu. We need to ensure that the search functionality works as expected. This includes testing with different types of input (e.g., text, numbers, special characters), checking the search results are relevant, and testing the performance of the search.

2. **Language Selection**: Baidu offers multiple language options. We need to test if the language selection works correctly and if the page content changes accordingly.

3. **Navigation Links**: The home page contains various navigation links (e.g., News, Maps, Images). We need to test if these links are working correctly and lead to the correct pages.

4. **Login Functionality**: If there is a login option, we need to test the login functionality with valid and invalid inputs.

5. **Accessibility**: We need to test if the website is accessible and usable, including testing for mobile responsiveness, browser compatibility, and accessibility for users with disabilities.

6. **Ads Display**: If there are ads on the home page, we need to test if they are displayed correctly and if they lead to the correct websites when clicked.

7. **Privacy and Security**: We need to test if the website is secure and if it respects user privacy. This includes testing for secure connections (HTTPS), checking if cookies are used appropriately, and testing the privacy settings.

8. **Performance**: We need to test the performance of the website, including load times and how the website handles high traffic.

Please note that this is a high-level analysis and the actual test points may vary based on the specific requirements and functionality of the Baidu home page.

TERMINATE

--------------------------------------------------------------------------------
user_proxy (to coder):

Generate automated test scripts based on these test points

--------------------------------------------------------------------------------
coder (to user_proxy):

To generate automated test scripts, we can use Selenium, a popular tool for automating web browsers. Here's a basic Python script using Selenium WebDriver to test some of the points mentioned above. 

Please note that this is a simplified example and real-world test scripts would be more complex. Also, you need to have Selenium and the appropriate WebDriver installed on your system to run these scripts.

```python
# filename: baidu_test.py

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

# Create a new instance of the Firefox driver
driver = webdriver.Firefox()

# Go to the Baidu home page
driver.get("https://www.baidu.com")

# Test the search functionality
search_box = driver.find_element_by_name("wd")
search_box.send_keys("Selenium")
search_box.send_keys(Keys.RETURN)
time.sleep(2)  # Wait for the page to load

# Check if the search results contain "Selenium"
assert "Selenium" in driver.page_source

# Test the navigation links
news_link = driver.find_element_by_link_text("新闻")
news_link.click()
time.sleep(2)  # Wait for the page to load

# Check if the News page is loaded
assert "新闻" in driver.title

# Close the browser
driver.quit()
```

To run this script, save it to a file named `baidu_test.py` and run it with Python.

Please note that this script only tests two points: the search functionality and one of the navigation links. Testing other points like language selection, login functionality, accessibility, ads display, privacy and security, and performance would require more complex scripts and possibly other tools in addition to Selenium.

Also, please note that the actual identifiers (like the name of the search box and the text of the navigation link) may vary, and you need to inspect the Baidu home page to get the correct identifiers.

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is python)...
execute_code was called without specifying a value for use_docker. Since the python docker package is not available, code will be run natively. Note: this fallback behavior is subject to change
user_proxy (to coder):

exitcode: 1 (execution failed)
Code output: 
Traceback (most recent call last):
  File "baidu_test.py", line 3, in <module>
    from selenium import webdriver
ModuleNotFoundError: No module named 'selenium'


--------------------------------------------------------------------------------
coder (to user_proxy):

It seems like the Selenium module is not installed in your Python environment. You can install it using pip, which is a package manager for Python. Here is the command to install Selenium:

```sh
pip install selenium
```

After installing Selenium, you should be able to run the test script without the ModuleNotFoundError. Please try running the test script again after installing Selenium.

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING CODE BLOCK 0 (inferred language is sh)...
execute_code was called without specifying a value for use_docker. Since the python docker package is not available, code will be run natively. Note: this fallback behavior is subject to change
user_proxy (to coder):

exitcode: 0 (execution succeeded)
Code output: 
Collecting selenium
  Downloading selenium-4.14.0-py3-none-any.whl.metadata (6.9 kB)
Requirement already satisfied: urllib3<3,>=1.26 in /opt/anaconda3/envs/python3/lib/python3.9/site-packages (from urllib3[socks]<3,>=1.26->selenium) (2.0.7)
Collecting trio~=0.17 (from selenium)
  Downloading trio-0.22.2-py3-none-any.whl.metadata (4.7 kB)
Collecting trio-websocket~=0.9 (from selenium)
  Downloading trio_websocket-0.11.1-py3-none-any.whl.metadata (4.7 kB)
Requirement already satisfied: certifi>=2021.10.8 in /opt/anaconda3/envs/python3/lib/python3.9/site-packages (from selenium) (2023.7.22)
Requirement already satisfied: attrs>=20.1.0 in /opt/anaconda3/envs/python3/lib/python3.9/site-packages (from trio~=0.17->selenium) (23.1.0)
Collecting sortedcontainers (from trio~=0.17->selenium)
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Requirement already satisfied: idna in /opt/anaconda3/envs/python3/lib/python3.9/site-packages (from trio~=0.17->selenium) (3.4)
Collecting outcome (from trio~=0.17->selenium)
  Downloading outcome-1.3.0.post0-py2.py3-none-any.whl.metadata (2.6 kB)
Collecting sniffio (from trio~=0.17->selenium)
  Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting exceptiongroup>=1.0.0rc9 (from trio~=0.17->selenium)
  Downloading exceptiongroup-1.1.3-py3-none-any.whl.metadata (6.1 kB)
Collecting wsproto>=0.14 (from trio-websocket~=0.9->selenium)
  Downloading wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting pysocks!=1.5.7,<2.0,>=1.5.6 (from urllib3[socks]<3,>=1.26->selenium)
  Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting h11<1,>=0.9.0 (from wsproto>=0.14->trio-websocket~=0.9->selenium)
  Downloading h11-0.14.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.3/58.3 kB 1.6 MB/s eta 0:00:00
Downloading selenium-4.14.0-py3-none-any.whl (9.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 1.7 MB/s eta 0:00:00
Downloading trio-0.22.2-py3-none-any.whl (400 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 400.2/400.2 kB 1.5 MB/s eta 0:00:00
Downloading trio_websocket-0.11.1-py3-none-any.whl (17 kB)
Downloading exceptiongroup-1.1.3-py3-none-any.whl (14 kB)
Downloading outcome-1.3.0.post0-py2.py3-none-any.whl (10 kB)
Installing collected packages: sortedcontainers, sniffio, pysocks, outcome, h11, exceptiongroup, wsproto, trio, trio-websocket, selenium
Successfully installed exceptiongroup-1.1.3 h11-0.14.0 outcome-1.3.0.post0 pysocks-1.7.1 selenium-4.14.0 sniffio-1.3.0 sortedcontainers-2.4.0 trio-0.22.2 trio-websocket-0.11.1 wsproto-1.2.0


--------------------------------------------------------------------------------
coder (to user_proxy):

Great! Now that Selenium is installed, you can run the test script again. Here is the script for your convenience:

```python
# filename: baidu_test.py

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
import time

# Create a new instance of the Firefox driver
driver = webdriver.Firefox()

# Go to the Baidu home page
driver.get("https://www.baidu.com")

# Test the search functionality
search_box = driver.find_element_by_name("wd")
search_box.send_keys("Selenium")
search_box.send_keys(Keys.RETURN)
time.sleep(2)  # Wait for the page to load

# Check if the search results contain "Selenium"
assert "Selenium" in driver.page_source

# Test the navigation links
news_link = driver.find_element_by_link_text("新闻")
news_link.click()
time.sleep(2)  # Wait for the page to load

# Check if the News page is loaded
assert "新闻" in driver.title

# Close the browser
driver.quit()
```

Please run this script and let me know the result.

--------------------------------------------------------------------------------

结果分析:

1.生成测试点

2.编写python脚本

3.执行自动化测试

2.增强推理:所谓的逻辑增强,就是我们为助手代理设置不同的参数来模拟不同的对话场景从而实现更复杂的逻辑对话

可调节的超参数包括:

  1. model - 这是必需的输入,指定要使用的模型 ID。
  2. 提示/消息 - 模型的输入提示/消息,为文本生成任务提供上下文。
  3. max_tokens - 在输出中生成的标记(单词或单词片段)的最大数量。
  4. temperature - 0 到 1 之间的值,控制生成文本的随机性。较高的温度将导致更加随机和多样化的文本,而较低的温度将导致更加可预测的文本。
  5. top_p - 0 到 1 之间的值,控制每个令牌生成的采样概率质量。较低的 top_p 值将使其更有可能根据最可能的标记生成文本,而较高的值将允许模型探索更广泛的可能标记。
  6. n - 针对给定提示生成的响应数。生成多个响应可以提供更多样化且可能更有用的输出,但它也会增加请求的成本。
  7. stop - 一个字符串列表,当在生成的文本中遇到该字符串时,将导致生成停止。这可用于控制输出的长度或有效性。
  8. Presence_penalty、Frequency_penalty - 控制生成文本中某些单词或短语的存在和频率的相对重要性的值。
  9. best_of - 为给定提示选择“最佳”(每个标记具有最高日志概率的响应)响应时生成服务器端的响应数。

autogen与chatgpt的对比

Autogen的优势: 
1. 自动化:用户可以通过代理给autogen颁布任务,这个任务可能需要划分为不同的步骤去实现,用户可以通过参数的设置使用户全程0参与,autogen生成的代理助手和用户代理可以帮我们分步骤自动化实现任务
2. 代码生成与执行:Autogen可以根据特定需求生成代码,这对需要快速创建原型或实现功能的开发人员很有帮助;除此之外,autogen因为内置了python解释器,你可以命令它执行它生成的python代码
3.面向任务:Autogen被设计为执行特定的任务,这可以使它在某些用例中更有效。 
 
Autogen的缺点: 
1. 有限的范围:Autogen是为特定任务设计的,所以它可能不像其他人工智能模型那样通用。 
2. 复杂性:根据任务的不同,Autogen可能需要大量的设置和配置。 
3.依赖于用户输入:Autogen依赖于用户输入来执行任务,因此如果用户输入不清楚或不正确,它可能不那么有效。

4.autogen没有像chatgpt那样如此稳定,虽然官方文档没有说明这一点,但是当我在本机使用autogen进行个性化提问时,有时会因为超时导致接口调用失败

5.使用chatgpt4作为模型,数据交互成本太高(太贵了)

autogen对测试QA测试效率的优化 

1.autogen可以帮我们生成一定的测试用例,完善case生成

2.autogen可以自主生成脚本并执行自动化测试,执行自动化测试时可以根据场景配合使用

3.相对于chatgpt,它能够检查并运行我们的脚本,如果出现错误,给出可能的错误原因并尝试纠正代码逻辑,提高QA效率

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

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

相关文章

高级IO select 多路转接实现思路

文章目录 select 函数fd_set 类型timeval 结构体select 函数的基本使用流程文件描述符就绪条件以select函数为中心实现多路转接的思路select 缺陷 select 函数 int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout); selec…

3款厉害的小工具,小黑子都在用!

大家好&#xff0c;我是 Javapub。 程序员与普通人最大的区别是什么&#xff0c;当然是会使用工具。基于一些同学经常问我的问题&#xff0c;接下来给大家分享几款我经常使用的工具&#xff0c;主打一个提升效率。 第一款 Everything 用 windwos 的同学都体会过&#xff0c;…

咨询+低代码,强强联合为制造业客户赋能

内容来自演讲&#xff1a;沈毅 | 遨睿智库 | 董事长 & 王劭禹 | 橙木智能 | 联合创始人 摘要 文章主要讲述了智库董事长沈毅创办广告公司的经历&#xff0c;以及他在管理公司过程中遇到的问题和挑战&#xff0c;最后通过与明道云以及橙木智能联合创始人王邵禹老师的合作&…

STM32/GD32_分散加载

Q&#xff1a;如何将一个变量、某个源文件的函数在编译阶段就存储在用户指定的区域&#xff1f; KEIL环境&#xff1a;.map后缀文件、.sct后缀文件 IAR环境&#xff1a;.map后缀文件、.icf后缀文件 【map文件】 对固件里面的变量、函数、常量等元素的存储空间进行分配的说明…

【计算机毕业设计】springboot+java高校实验室器材耗材料借用管理系统94l73

实验室耗材管理系统在Eclipse/idea环境中&#xff0c;使用Java语言进行编码&#xff0c;使用Mysql创建数据表保存本系统产生的数据。系统可以提供信息显示和相应服务&#xff0c;本系统教师和学生申请使用实验材料&#xff0c;管理员管理实验材料&#xff0c;审核实验材料的申请…

项目设计---MQ

文章目录 一. 项目描述二. 核心技术三. 需求分析概要设计四. 详细设计4.1 服务器模块4.1.1 内存管理4.1.2 硬盘管理4.1.2.1 数据库管理4.1.2.2 文件管理 4.1.3 消息转发 4.2 客户端模块4.2.1 连接管理4.2.2 信道管理 4.3 公共模块4.3.1 通信协议4.3.2 序列化/反序列化 一. 项目…

Linux 如何在文件中查找指定内容,grep的用法

Linux 如何在文件中查找指定内容 1、 如我们 查找 log_file_catalina.out 文件中&#xff0c;包含 ‘总数&#xff1a;900’ 的字符内容 2、 在日志中查看 83910_law_21CFBC7EB25B1FF60255FE7F4BE1BCCF1CE726F6_0.bdyhf 的相关内容 grep 83910_law_21CFBC7EB25B1FF60255FE7…

Redis String类型

String 类型是 Redis 最基本的数据类型&#xff0c;String 类型在 Redis 内部使用动态长度数组实现&#xff0c;Redis 在存储数据时会根据数据的大小动态地调整数组的长度。Redis 中字符串类型的值最大可以达到 512 MB。 关于字符串需要特别注意∶ 首先&#xff0c;Redis 中所…

[vue3] 使用 vite 创建vue3项目的详细流程

一、vite介绍 Vite&#xff08;法语意为 “快速的”&#xff0c;发音 /vit/&#xff0c;发音同 “veet”) 是一种新型前端构建工具&#xff0c;能够显著提升前端开发体验&#xff08;热更新、打包构建速度更快&#xff09;。 二、使用vite构建项目 【学习指南】学习新技能最…

IDE1007:当前上下文中不存在名称“xxx“

这种在Halcon中直接导出的代码不能直接放程序中&#xff0c;应该在控件中比如一个按钮中&#xff0c;就不会出错了。

MacOS + Android Studio 通过 USB 数据线真机调试

环境&#xff1a;Apple M1 MacOS Sonoma 14.1.1 软件&#xff1a;Android Studio Giraffe | 2022.3.1 Patch 3 设备&#xff1a;小米10 Android 13 一、创建测试项目 安卓 HelloWorld 项目: 安卓 HelloWorld 项目 二、数据线连接手机 1. 手机开启开发者模式 参考&#xff1…

ruoyi+Hadoop+hbase实现大数据存储查询

前言 有个现实的需求&#xff0c;数据量可能在100亿条左右。现有的数据库是SQL Server&#xff0c;随着采集的数据不断的填充&#xff0c;查询的效率越来越慢&#xff08;现有的SQL Server查询已经需要数十秒钟的时间&#xff09;&#xff0c;看看有没有优化的方案。 考虑过S…

解决webpack打包生成gz格式css/js文件没法在nginx使用的问题--全网唯一正确

本文绝对是全网解决这个问题唯一正确的文章&#xff0c;没有之一&#xff01; 很多人都说开启nginx gzip压缩&#xff0c;这些人完全是胡说八道&#xff01;你们到底懂不懂叫gzip压缩啊&#xff1f;&#xff01; 不信你就试试&#xff0c;如果css/js只有gz文件&#xff0c;ng…

国外客户跟我要佣金,该给不该给?

“Jack&#xff0c;这次你要是不帮我&#xff0c;我就死定了&#xff01;” 收到美国公司采购Antony的信息时&#xff0c;我有些哭笑不得&#xff0c;因为在我电脑屏幕上除了他的信息外&#xff0c;还有来自他公司监察部门的邮件&#xff1a; “jack先生&#xff0c;我们调查…

Java+SSM springboot+MySQL家政服务预约网站设计en24b

随着社区居民对生活品质的追求以及社会老龄化的加剧&#xff0c;社区居民对家政服务的需求越来越多&#xff0c;家政服务业逐渐成为政府推动、扶持和建设的重点行业。家政服务信息化有助于提高社区家政服务的工作效率和质量。 本次开发的家政服务网站是一个面向社区的家政服务网…

osgSim扩展库

1.osgSim扩展库 osgSim是0SG的一个工具箱(NodeKit)&#xff0c;提供了仿真系统中以及染OpenFlight 数据库所需的特殊渲染功能&#xff0c;如地形高程图、光点节点和 DOF 变换节点等。 下面对一些可能会用到的类进行简单介绍。 1.1 DOFTransform类 osgSim::DOFTransform类是对 …

冒泡排序算法是对已知的数列进行从小到大的递增排序。

题目描述冒泡排序算法是对已知的数列进行从小到大的递增排序每个实例输出两行&#xff0c;第一行输出第1轮结果, 第二行输出最终结果 它的排序方法如下: 1.对数列从头开始扫描&#xff0c;比较两个相邻的元素,如果前者大于后者,则交换两者位置 2.重复步骤1&#xff0c;直到没有…

智能优化算法应用:基于旗鱼算法无线传感器网络(WSN)覆盖优化 - 附代码

智能优化算法应用&#xff1a;基于旗鱼算法无线传感器网络(WSN)覆盖优化 - 附代码 文章目录 智能优化算法应用&#xff1a;基于旗鱼算法无线传感器网络(WSN)覆盖优化 - 附代码1.无线传感网络节点模型2.覆盖数学模型及分析3.旗鱼算法4.实验参数设定5.算法结果6.参考文献7.MATLAB…

go学习之json和单元测试知识

文章目录 一、json以及序列化1.概述2.json应用场景图3.json数据格式说明4.json的序列化1&#xff09;介绍2&#xff09;应用案例 5.json的反序列化1&#xff09;介绍2&#xff09;应用案例 二、单元测试1.引子2.单元测试-基本介绍3.代码实现4.单元测试的细节说明5.单元测试的综…

希亦、追觅和添可洗地机哪个好?3款热门洗地机测评

洗地机因为自身的超强清洁效果&#xff0c;能大大的降低家务清洁工作&#xff0c;所以近年来以及越来越成为家庭的标配家电。 地机选起来让人眼花缭乱&#xff0c;对于消费者来说&#xff0c;如何选择一台实用性价比高的洗地机已经是一个头疼的问题&#xff0c;看着宣传画面很…