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

面向对象设计(大三上)--往年试卷题+答案

目录

1. UML以及相关概念

1.1 动态图&静态图

1.2 交互图

1.3 序列图

1.4 类图以及关联关系

1.4.1类图

1.4.2 关系类型

(1) 用例图中的包含、扩展关系(include & extend)

(2) 类图中的聚合、组合关系(aggragation & composition)

1.5 图对象以及职责划分 boundary/entity/control objects

2. 开发模型与方法

2.1 迭代开发&增量开发

2.2 开发流程以及风险管理 UP & XP

2.3 凝聚力与类设计 cohesion

3. 面向对象设计原则

3.1 6个主要设计原则

4. 实现策略

4.1 自顶向下&自底向上 top-down & bottom-up strategies

4.2 依赖管理

5. 设计模式

5.1 MVC模式 Model View Controller design pattern

5.2 单例模式

6. 质量评估指标

6.1 类之间的耦合性 CBO

6.2 类的响应数 RFC

6.3 类的方法权重 WMC

7. 实例分析与建模

7.1 基于已知信息去建模

(1) 已知用例描述文档,要求绘制序列图

(2) 已知类图,要求绘制序列图

7.2 场景建模

(1) 航班情景

(2) 商店情景

(3) 在线书城情景

(4) 医院情景

(5) 电影院情景

(6) 运动会场景

7.3 代码设计与分析

(1) 单例模式代码撰写

(2) 接口方法更新

(3) 依赖管理&组件构造顺序

8.在PPT中提到但没展开讲的概念

8.1 UML概念

8.1.1 UML图

8.1.1.0 UML所有图的简介

8.1.1.1 状态图 statechart diagram

8.1.1.2 部署图 deployment diagram

8.1.1.3 组件图 component diagram

8.1.2 UML五视图

8.1.3 N元关联 (N-ary Association)

8.1.4 观察者模式 (Observer Pattern)

8.2 分层架构 layered architecture

8.3 螺旋模型 spiral model

8.4 框架中的热点 hotspot

8.5 数据存储 data storage

8.6 对象标识 object identity


补充,部分题前的“【...次】”是综合出现次数。

1. UML以及相关概念

1.1 动态图&静态图

UML diagrams can be described as either dynamic or static. Explain the difference between these two types of diagrams. Name one example of each type. (5%)【22 final】

答案:Dynamic diagrams describe what happens in the object network. example: Sequence Diagram.Static diagrams describe properties the object network can have. example: Class Diagram.动态图描述系统随时间的行为,主要关注交互和过程。例如:时序图。静态图展示系统的结构,主要关注组件及其关系。例如:类图。

1.2 交互图

In modelling with UML, what is the key goal in building interaction diagrams? What models may change as a result of this process? (5%)【22 final】

答案:The purpose of an interaction diagram is to show how objects collaborate over time through method calls and information exchange. Its change will affect the resulting sequence diagram and interaction diagram.

交互图的目的是显示对象如何通过方法调用和信息交换来随时间推移进行协作。它的改变会影响到导致序列图、交互图。

1.3 序列图

单例模式的序列图

Draw 2 interaction diagrams showing a client calling the getInstance method of a singleton class. One diagram should show what happens the first time the method is called and one should show the second time the method is called. (10%)【22 final】

答案:左图展示了第一次调用时创建的instance,有图展示了第二次调用时不再创建新的而是返回同一个instance。

1.4 类图以及关联关系

1.4.1类图

【2次】Given the class diagram below showing an association class (Attempt), give an example in Java code of how these classes could be implemented. Ensure that the implementation allows the record recording of students having multiple attempts on a single module. (5%)【】

答案:Iterative development is where development is organized as a repeated completion of the development activities. Wach iteration of development process will achieve a part of the overall development or potentially refactor a part that has already been completed. Increment development organize development into phases. By adding new functionalities or improving the existing functionalities in prototype. 

迭代开发指循环完成或改进系统的部分,每次迭代完成一个新部分或重构已完成的旧部分。增量开发指将开发划分为小而可管理的prototype模块并逐步增加系统功能,每次给prototype加新功能或改进旧功能。

1.4.2 关系类型

(1) 用例图中的包含、扩展关系(include & extend)

Include关系用于表示一个用例(基用例)包含另一个用例(子用例)的行为。这种关系通常用于抽象出公共的行为,将其放入单独的用例中,然后由其他用例包含。Extend关系则表示一个用例(基用例)可以在某些条件下扩展另一个用例(扩展用例)的行为。基用例本身是完整的,即使没有扩展用例的参与也能完成其功能。

What is the includes relationship? Explain how an includes relationship defined in the use case diagram has an effect on the development of the system. (5%)【22 final】

答案:

Use case inclusion refers one use case may be performed as a part of another.

Effect: improve code reuse and modular design by identifying and extracting common behaviors early in development, ensuring the shared behavior is only developed once.

用例图中的包含关系表示可重用的功能,可被多个用例包含。

影响:通过在开发初期识别通用行为,促进代码重用和模块化设计,确保共享功能只需开发一次。

【2次】Explain the includes and extends relationships in use case modelling.(5%)【22 final & 15 final】

答案:

inclusion指用例作为其他用例的一部分来执行,通过分解并合并公共功能来避免重复。比如alter booking和delete booking都包括display booking。

extends表示在特定条件下用例的扩展可选行为,在不改变原始流的情况下增加了额外的功能。比如如果用户有优惠券,Complete Order可以扩展为Apply Discount。

(2) 类图中的聚合、组合关系(aggragation & composition)

What type of object structure is denoted by the following class diagram? Why might aggregation be more appropriate?(5%)【21 resit】

答案:

•Component is the base class. Assembly and Part are subclasses of Component.

Assembly contains Component objects, which suggests that an assembly can contain multiple components.

In composition, the lifecycle of the Component is tightly bound to the lifecycle of the Assembly. When an Assembly is destroyed, its Component objects are also destroyed. In aggregation, the Component could exist independently of the Assembly, allowing it to be shared across multiple assemblies. This means the components can exist without the whole, making aggregation more suitable if the parts can exist outside of the assembly context.

Component是基础类,Assembly和Part是它的子类。
程序集包含组件对象,这表明程序集可以包含多个组件。

在组合中,组件的生命周期与程序集的生命周期紧密相连。当一个Assembly元素被销毁时,它的Component对象也会被销毁。在聚合中,组件可以独立于程序集存在,允许它在多个程序集之间共享。这意味着组件可以在没有整体的情况下存在,如果部件可以存在于组装上下文之外,则聚合更加合适。

Describe the meaning of aggregation in UML. What are the formal properties of aggregation? (5%)

答案:

Aggregation in UML represents a "whole-part" relationship, where the part can exist independently of the whole. It's a weaker association compared to composition, where the whole class doesn't own the part. The part can exist without the whole, and multiple parts can be associated with one whole. Aggregation is denoted by a hollow diamond at the association end, and the multiplicity of parts is usually greater than one. Aggregation represents a "has-a" relationship, implying that the whole contains the part, but the part's lifecycle is independent.

Formal Properties of Aggregation:

  1. Independent Lifecycles: The part can exist without the whole.
  2. Representation: Depicted by a hollow diamond at the whole end of the association.
  3. Multiplicity: A whole can have multiple parts, but each part belongs to one whole.
  4. Non-strong Ownership: The whole doesn’t own the part, unlike in composition.

UML中的聚合表示“整体-部分”关系,其中部分可以独立于整体存在。与作文相比,这是一种较弱的联系,在作文中,整个班级并不拥有这个部分。局部可以脱离整体而存在,多个部分可以与一个整体相关联。聚合用关联端的空心菱形表示,部分的数量通常大于1。聚合表示一种“有”关系,这意味着整体包含部分,但部分的生命周期是独立的。
聚合的形式性质:
1. 独立的生命周期:部分可以脱离整体而存在。
2. 代表:在协会的整个末端用一个空心钻石来描绘。
3. 多元性:一个整体可以有多个部分,但每个部分都属于一个整体。
4. 非强所有权:整体不拥有部分,不像组成部分。

1.5 图对象以及职责划分 boundary/entity/control objects

Distinguish between boundary, control and entity objects in the context of the Unified Process. (5%)【15 final】

答案:

entity: store data (Represent core data and business logic)

boundary: handle interaction between system and external uses (Handle user interaction and system input/output.)

control: ensure interaction undergo correctly (manage the system’s logic and flow)

实体:存储数据(表示核心数据和业务逻辑)
边界:处理系统与外部用户之间的交互(处理用户交互和系统输入/输出)。
控制:确保交互正确进行(管理系统的逻辑和流程)

【2次】For each of the three class diagrams below (a, b & c), what type of class is being represented? For each explain what this tells us about the class. (5%)【21 resit & 15 final】

答案:

a: email boundary class, acting as an interface to deal with interactions between system and external uses. Under this condition, email boundary may represent an Email UI or API to handle sending and receiving emails.

b: email control class, to handle the logic flow or processing in system, ensuring interactions happen correctly. Under this condition, email control may handle email management.

c: email entity, to maintain data that closely related to system and databases. Under this condition, it may store the content and state of an email.

a:电子邮件边界类,作为处理系统和外部使用之间交互的接口。在这种情况下,email边界可以代表一个email UI或API来处理发送和接收email。

b:邮件控制类,处理系统中的逻辑流或处理,确保交互正确发生。在这种情况下,邮件控制可以处理邮件管理。

c:电子邮件实体,维护与系统和数据库密切相关的数据。在这种情况下,它可以存储电子邮件的内容和状态。

【3次】For each of the three diagrams below (a, b & c), name the type of connection between the classes. What is the difference between b and c? (5%)【16 final & 18 final & 19 final】

答案:

a: a simple association between email and body, meaning that the email class has no responsible for the lifecycle of the body class

b: email class aggregates body class, body class can exist independently of the email class, and the destruction of the email class does not result in the destruction of the body class

c: email class composites of body class, body class depends on email class, and the destruction of the email class would result body class’s destruction

2. 开发模型与方法

2.1 迭代开发&增量开发

【4次】Distinguish between Iterative development and Incremental development. (5%)【22 final】

答案:

Iterative development is where development is organized as a repeated completion of the development activities. Wach iteration of development process will achieve a part of the overall development or potentially refactor a part that has already been completed.

Increment development organize development into phases. By adding new functionalities or improving the existing functionalities in prototype.

迭代开发指循环完成或改进系统的部分,每次迭代完成一个新部分或重构已完成的旧部分。

增量开发指将开发划分为小而可管理的prototype模块并逐步增加系统功能,每次给prototype加新功能或改进旧功能。

【3次】When using modelling in an iterative process it can be difficult to maintain consistency between models and code. What causes this difficulty? Compare and contrast two possible solutions to this problem. (10%)【21 Final & 20 Final & 19 Final】

答案:

In an iterative process, maintaining consistency between models and code is challenging due to frequent changes in both. As the code evolves with each iteration, the models may become outdated or inaccurate, leading to discrepancies. This occurs because models often represent the design at a specific point in time, while the code might reflect ongoing changes.

Two solutions to this problem are model-driven development (MDD) and code generation.Both solutions aim to bridge the gap, but MDD emphasizes design consistency, while code generation focuses on reducing manual discrepancies.

• MDD focuses on keeping models as the primary source of truth, ensuring that any changes to the code are reflected in the models. However, it requires rigorous model management and frequent updates.

• Code generation uses models to automatically generate code, maintaining consistency by reducing manual changes. But this may limit flexibility and control over the final implementation.

在迭代过程中,由于模型和代码的频繁变化,维护两者之间的一致性是具有挑战性的。随着代码不断更迭,模型可能会变得过时或不准确,从而导致差异。这是因为模型通常表示特定时间点的设计,而代码可能反映正在进行的更改。
这个问题的两个解决方案是模型驱动开发(MDD)和代码生成。这两种解决方案都旨在弥合差距,但是MDD强调设计一致性,而代码生成侧重于减少手工差异。

mdd关注于保持模型作为事实的主要来源,确保对代码的任何更改都反映在模型中。然而,它需要严格的模型管理和频繁的更新。

代码生成使用模型自动生成代码,通过减少手工更改来保持一致性。但这可能会限制最终实现的灵活性和控制力。

2.2 开发流程以及风险管理 UP & XP

During the analysis workflow, what is the goal of realizing use cases? What models/diagrams are created or updated as a result of this process? (5%)【22 final】

答案:

The goal is to describe how interacting objects can perform the specified use cases, which involves identifying the classes and objects needed to achieve these interactions

Models: Domain model, Interaction diagrams (sequence diagram), Class diagram (update new attributes and operations).

目标:定义系统如何通过确定所需的交互和组件来实现用例。

模型:域模型、交互图(比如序列图)、类图(更新属性和方法函数)。

Name the five core work flows of the Unified Process (UP). (5%)【19 final】

答案:

1. Requirements: Define what the system must do.
2. Analysis: Analyze the problem domain and behavior.
3. Design: Specify the architecture and components.
4. Implementation: Convert the design into code.
5. Test: Verify functions and fix defects.

1. 需求:定义系统必须做什么。
2. 分析:分析问题域和行为。
3. 设计:指定体系结构和组件。
4. 实现:将设计转换为代码。
5. 测试:验证功能并修复缺陷。
这些工作流迭代地发生,以确保项目的稳定性和完整性。

Describe how the work flows (and the amount of time spent on each work ow) in the Unified Process change as a project moves through various iterations and phases. You should support your explanation with a diagram. (10%)【19 final】

答案:

In the Unified Process (UP), workflows evolve across 4 phases:

1. Inception: Focuses on business modeling & requirements to establish feasibility.

2. Elaboration: Emphasizes analysis & design, refining architecture while reducing risks.

3. Construction: The bulk of implementation & testing occurs, developing a functional system.

4. Transition: Concentrates on deployment & user feedback, ensuring a smooth release.

diagram:

+------------+-------------+-------------+--------------+------------+
| Workflow   | Inception   | Elaboration | Construction | Transition |
+------------+-------------+-------------+--------------+------------+
| Business   | High        | Medium      | Low          | Low        |
| Analysis   | Medium      | High        | Medium       | Low        |
| Design     | Low         | High        | Medium       | Low        |
| Impl/Test  | Low         | Medium      | High         | Medium     |
| Deploy     | None        | Low         | Medium       | High       |
+------------+-------------+-------------+--------------+------------+

【2次】Name the 5 core values of eXtreme Programming (XP). (5%)【18 final & 22 final】

答案:

1. Communication: Open communication between team members.
2. Simplicity: Focus on simple, workable solutions.
3. Feedback: Regular feedback from users and testing.
4. Courage: Take risks and make necessary changes.
5. Respect: Value the contributions of each team member.

1. 沟通:团队成员之间开放的沟通。
2. 简单:专注于简单可行的解决方案。
3. 反馈:来自用户和测试的定期反馈。
4. 勇气:敢于冒险,做出必要的改变。
5. 尊重:重视每个团队成员的贡献。
这些价值有助于指导XP实践并改进软件开发。

【3次】Discuss the importance of testing in large scale software development. In particular, contrast the approaches to testing in the waterfall model and in the unified process. Discuss one risk that the Unified Process minimises in its approach. (10%)【21 resit & 19 final 16 final】

答案:

The importance of testing: Testing can ensure the re

相关文章:

面向对象设计(大三上)--往年试卷题+答案

目录 1. UML以及相关概念 1.1 动态图&静态图 1.2 交互图 1.3 序列图 1.4 类图以及关联关系 1.4.1类图 1.4.2 关系类型 (1) 用例图中的包含、扩展关系(include & extend) (2) 类图中的聚合、组合关系(aggragation & composition) 1.5 图对象以及职责划…...

Java基础知识总结(二十四)--Collections

它的出现给集合操作提供了更多的功能。这个类不需要创建对象,内部提供的都是静态方法。 静态方法: Collections.sort(list);//list集合进行元素的自然顺序排序。 Collections.sort(list,new ComparatorByLen());//按指定的比较器方法排序。 class Co…...

大语言模型的API接口如何操作

选择大语言模型 根据自身需求和应用场景选择合适的大语言模型,如 OpenAI 的 GPT 系列、百度的文心一言、智谱的 GLM 等。需要考虑模型的性能、功能特点、适用领域、成本等因素。 获取 API 密钥和凭证 注册账号:访问所选大语言模型的官方平台或相关开发…...

【漫话机器学习系列】067.希腊字母(greek letters)-写法、名称、读法和常见用途

希腊字母(Greek Letters) 希腊字母在数学、科学、工程学和编程中广泛使用,常用于表示变量、常量、参数、角度等。以下是希腊字母的完整列表及其常见用途。 大写与小写希腊字母表 大写小写名称(英文)名称(…...

Kotlin判空辅助工具

1)?.操作符 //执行逻辑 if (person ! null) {person.doSomething() } //表达式 person?.doSomething() 2)?:操作符 //执行逻辑 val c if (a ! null) {a } else {b } //表达式 val c a ?: b 3)!!表达式 var message: String? &qu…...

【Python-办公自动化】实现自动化输出json数据类型的分析报告和正逆转换

分析报告 import json from pprint import pprint, PrettyPrinterdef analyze_energy_data(file_path):"""能源数据分析与结构查看函数参数:file_path (str): JSON文件路径功能:1. 加载并解析JSON数据2. 显示数据结构概览3. 交互式结构探索"""…...

深入理解指针(2)

数组名的理解 什么是数组名&#xff1f;在计算机编程中&#xff0c;数组名是用于标识一个数组的名称。那应当如何来理解数组名呢&#xff1f;事实上&#xff0c;在数组中数组名就是数组首元素的地址。 示例1&#xff1a; #include<stdio.h> int main() {int arr[10] …...

SOME/IP--协议英文原文讲解3

前言 SOME/IP协议越来越多的用于汽车电子行业中&#xff0c;关于协议详细完全的中文资料却没有&#xff0c;所以我将结合工作经验并对照英文原版协议做一系列的文章。基本分三大块&#xff1a; 1. SOME/IP协议讲解 2. SOME/IP-SD协议讲解 3. python/C举例调试讲解 Note: Thi…...

计算机网络之计算机网络主要性能

一、速率与带宽 速率&#xff1a; 定义&#xff1a;数据的传送速率&#xff0c;也称数据率或比特率&#xff0c;表示单位时间内传输的比特数。 单位&#xff1a;比特/秒&#xff08;bit/s&#xff09;&#xff0c;常用单位有千比特/秒&#xff08;kb/s&#xff09;、兆比特/秒…...

家居 EDI:Haverty‘s EDI 需求分析

Havertys 成立于 1885 年&#xff0c;是一家历史悠久的美国家具零售商。公司致力于为客户提供高品质的家具和家居饰品&#xff0c;其产品线涵盖客厅、卧室、餐厅及办公家具等多个领域。 电子数据交换&#xff08;EDI&#xff09;是一种通过标准化电子格式在商业伙伴之间进行数据…...

JavaScript - Web APIs(上)

Web API 介绍 严格意义上讲&#xff0c;我们在 JavaScript 阶段学习的知识绝大部分属于 ECMAScript 的知识体系&#xff0c;ECMAScript 简称 ES 它提供了一套语言标准规范&#xff0c;如变量、数据类型、表达式、语句、函数等语法规则都是由 ECMAScript 规定的。浏览器将 ECM…...

【漫话机器学习系列】068.网格搜索(GridSearch)

网格搜索&#xff08;Grid Search&#xff09; 网格搜索&#xff08;Grid Search&#xff09;是一种用于优化机器学习模型超参数的技术。它通过系统地遍历给定的参数组合&#xff0c;找出使模型性能达到最优的参数配置。 网格搜索的核心思想 定义参数网格 创建一个包含超参数值…...

MySQL 的索引类型【图文并茂】

基本分类 文本生成MindMap:https://app.pollyoyo.com/planttext <style> mindmapDiagram {node {BackgroundColor yellow}:depth(0) {BackGroundColor SkyBlue}:depth(1) {BackGroundColor lightGreen} } </style> * MySQL 索引** 数据结构角度 *** B树索引*** 哈…...

OSCP:发送钓鱼电子邮件执行客户端攻击

概述 在渗透测试领域&#xff0c;钓鱼攻击是一种有效的客户端攻击手段&#xff0c;尤其在目标用户缺乏安全意识或系统存在未修复漏洞时&#xff0c;成功率较高。针对Windows平台&#xff0c;滥用Windows库文件&#xff08;.Library-ms&#xff09;是一种技术性较强但易于实施的…...

Oracle 普通用户连接hang住处理方法

一、现象说明 $ sqlplus / as sysdbaSQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 18 16:49:19 2024 Version 19.11.0.0.0Copyright (c) 1982, 2020, Oracle. All rights reserved.Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Pro…...

C++ ——— 学习并使用 priority_queue 类

目录 何为 priority_queue 类 学习并使用 priority_queue 类 实例化一个 priority_queue 类对象 插入数据 遍历堆&#xff08;默认是大堆&#xff09; 通过改变实例化的模板参数修改为小堆 何为 priority_queue 类 priority_queue 类为 优先级队列&#xff0c;其本质就是…...

JVM--类加载器

概念 类加载器&#xff1a;只参与加载过程中的字节码获取并加载到内存中的部分&#xff1b;java虚拟机提供给应用程序去实现获取类和接口字节码数据的一种技术&#xff0c;也就是说java虚拟机是允许程序员写代码去获取字节码信息 类加载是加载的第一步&#xff0c;主要有以下三…...

【C++】类与对象初级应用篇:打造自定义日期类与日期计算器(2w5k字长文附源码)

文章目录 一、日期类的实现1. 日期类的默认成员函数的分析与实现构造函数其它默认成员函数 2. 各种逻辑比较运算符重载3. 日期加与减天数日期加天数系列日期减天数系列日期加减天数的最后修定和- -系列 4. 日期减日期方法一方法二 5. 流插入与流提取重载流插入重载流提取重载(含…...

ROS应用之SwarmSim在ROS 中的协同路径规划

SwarmSim 在 ROS 中的协同路径规划 前言 在多机器人系统&#xff08;Multi-Robot Systems, MRS&#xff09;中&#xff0c;SwarmSim 是一个常用的模拟工具&#xff0c;可以对多机器人进行仿真以实现复杂任务的协同。除了任务分配逻辑以外&#xff0c;SwarmSim 在协同路径规划方…...

Shell特殊位置变量以及常用内置变量总结

目录 1. 特殊的状态变量 1.1 $?&#xff08;上一个命令的退出状态&#xff09; 1.2 $$&#xff08;当前进程的 PID&#xff09; 1.3 $!&#xff08;后台进程的 PID&#xff09; 1.4 $_&#xff08;上一条命令的最后一个参数&#xff09; 2.常用shell内置变量 2.1 echo&…...

【ollama通过命令行启动后如何在网页端查看运行】

ollama通过命令行启动后如何在网页端查看运行 http://localhost:11434/...

【MySQL】初始MySQL、库与表的操作

目录 基本使用 使用案例 SQL分类 存储引擎 库的操作 字符集和校验规则 查看系统默认字符集和校验规则 查看数据库支持的字符集 查看数据库支持的字符集校验规则 指定编码常见数据库 校验规则对数据库的影响 操纵数据库 库的备份与恢复 表的操作 创建表 查看表 …...

信息学奥赛一本通 1342:【例4-1】最短路径问题

【题目描述】 平面上有n个点&#xff08;n<100&#xff09;&#xff0c;每个点的坐标均在-10000~10000之间。其中的一些点之间有连线。 若有连线&#xff0c;则表示可从一个点到达另一个点&#xff0c;即两点间有通路&#xff0c;通路的距离为两点间的直线距离。现在的任务是…...

芯片AI深度实战:基础篇之langchain

基于ollama, langchain,可以构建一个自己的知识库&#xff0c;比如这个 Build Your Own RAG App: A Step-by-Step Guide to Setup LLM locally using Ollama, Python, and ChromaDB | HackerNoon 这是因为&#xff1a; 以上范例就实现了这样一个流程&#xff1a; 系列文章&…...

Autogen_core 测试代码:test_cache_store.py

目录 原始代码测试代码代码中用到的typing注解 原始代码 from typing import Dict, Generic, Optional, Protocol, TypeVarT TypeVar("T")class CacheStore(Protocol, Generic[T]):"""This protocol defines the basic interface for store/cache o…...

AI大模型开发原理篇-1:语言模型雏形之N-Gram模型

N-Gram模型概念 N-Gram模型是一种基于统计的语言模型&#xff0c;用于预测文本中某个词语的出现概率。它通过分析一个词语序列中前面N-1个词的出现频率来预测下一个词的出现。具体来说&#xff0c;N-Gram模型通过将文本切分为长度为N的词序列来进行建模。 注意&#xff1a;这…...

Haproxy入门学习二

一、Haproxy的算法 1.haproxy通过固定参数balance指明对后端服务器的调度算法&#xff0c;其中balance参数可以配置在listen或backend选项中 2.haproxy的调度算法分为静态和动态调度算法&#xff0c;其中有些算法可以根据参数在静态和动态算法中相互转换 3.静态算法&#xff1a…...

【C++题解】1014. 编程求1+1/2+1/3+...+1/n

问题&#xff1a;1014. 编程求11/21/3…1/n 类型&#xff1a;简单循环 题目描述&#xff1a; 编程求 11/21/3⋯1/n 。 输入&#xff1a; 输入一行&#xff0c;只有一个整数 n(1≤n≤200) 。 输出&#xff1a; 输出只有一行&#xff08;这意味着末尾有一个回车符号&#x…...

Java基础知识-第14章-Java注解

1、注解(Annotation)概述 从JDK5.0开始&#xff0c;Java增加了对元数据(MetaData) 的支持&#xff0c;也就是Annotation(注解)Annotation其实就是代码里的特殊标记&#xff0c;这些标记可以在编译&#xff0c;类加载&#xff0c;运行时被读取&#xff0c;并执行相应的处理。通…...

python算法和数据结构刷题[1]:数组、矩阵、字符串

一画图二伪代码三写代码 LeetCode必刷100题&#xff1a;一份来自面试官的算法地图&#xff08;题解持续更新中&#xff09;-CSDN博客 算法通关手册&#xff08;LeetCode&#xff09; | 算法通关手册&#xff08;LeetCode&#xff09; (itcharge.cn) 面试经典 150 题 - 学习计…...

【javaweb项目idea版】蛋糕商城(可复用成其他商城项目)

该项目虽然是蛋糕商城项目&#xff0c;但是可以复用成其他商城项目或者购物车项目 想要源码的uu可点赞后私聊 技术栈 主要为&#xff1a;javawebservletmvcc3p0idea运行 功能模块 主要分为用户模块和后台管理员模块 具有商城购物的完整功能 基础模块 登录注册个人信息编辑…...

人格分裂(交互问答)-小白想懂Elasticsearch

通过交互式追问了解一个中间件 ? 啥是Elasticsearch ! 分布式搜索和分析引擎 ? 为啥是分布式搜索&#xff0c;单体难道用不了吗 ? 实际上是说这个东西可以分布式部署 ! 单机可用但扩展性差&#xff0c;分布式通过分片、副本和负载均衡实现海量数据存储与高并发处理 ? 提…...

独立开发者日刊 | Deepseek 统一多模态 AI Janus 开源 |语音秒变文章 | 免费 AI 视频答案引擎

独立开发者产品日刊&#xff0c;每日汇集 ProductHunt 热榜产品介绍&#xff0c;⚡️ 1句Slogan榨干产品灵魂&#xff0c;⚡️ 3秒 get 全球独立开发者的爆款灵感。关注小前&#xff0c;每日捕获全球产品灵感。 Jotform for Canva 标语&#xff1a;为 Canva 创建强大表单类别&a…...

1999-2020年 全国各地区-财政状况分析-一般预算收入-各项税收-个人所得税

1999-2020年 全国各地区-财政状况分析-一般预算收入-各项税收-个人所得税https://download.csdn.net/download/2401_84585615/89575946 https://download.csdn.net/download/2401_84585615/89575946 一般预算收入是指各级政府按照预算法规定&#xff0c;将预计取得的各项收入纳…...

基础项目实战——3D赛车(c++)

目录 前言一、渲染引擎二、关闭事件三、梯形绘制四、轨道绘制五、边缘绘制六、草坪绘制七、前后移动八、左右移动​九、曲线轨道​十、课山坡轨道​十一、循环轨道​十二、背景展示​十三、引入速度​十四、物品绘制​十五、课数字路障​十六、分数展示​十七、重新生成​十八、…...

AboutDialog组件的功能和用法

文章目录 1 概念介绍2 使用方法3 示例代码 我们在上一章回中介绍了AlertDialog Widget相关的内容,本章回中将介绍AboutDialog Widget.闲话休提&#xff0c;让我们一起Talk Flutter吧。 1 概念介绍 我们在这里说的AboutDialog是一种弹出式窗口&#xff0c;和上一章回中介绍的Al…...

hdfs之读写流程

写入流程&#xff1a; 客户端Client想将文件a.txt上传至hdfs&#xff0c;首先向Namenode发送请求进行权限校验&#xff0c;Namenode通过后会计算出来三个节点&#xff0c;并将这三个节点告知客户端&#xff0c;客户端将输入进行切割成块&#xff0c;一个一个的块进行传输&…...

链表的介绍

目录 引言优缺点与链表相似的数据结构注意事项单向链表的实现基础实现创建类创建成员变量创建特殊方法 增加数据push_back方法insert方法 删除数据del_back方法del_index方法 clear方法查询数据at方法与重载的中括号运算符toArray方法indexOf方法 修改数据获取链表大小测试方法…...

背着开发板回家过年~

大家好&#xff0c;我是bug菌~ 小明&#xff0c;过年了&#xff0c; 别再死磕什么STM32底层驱动、linux平台总线驱动框架、嵌入式实时操作系统源码这些了。 你背着电脑和开发板回家&#xff0c;压根没一点实际用处。 发小们潇洒地出入各种娱乐场所&#xff0c;唱着歌&#xff0…...

Kafka 日志存储 — 磁盘存储

Kafka 依赖与磁盘来存储和缓存消息&#xff0c;采用文件追加的方式来写入消息。顺序写盘的速度快于随机写内存。 1 磁盘存储 除顺序写入外&#xff0c;Kafka中大量使用了页缓存、零拷贝等技术来进一步提升吞吐性能。 1.1 页缓存 页缓存是操作系统实现的一种磁盘缓存&#x…...

【机器学习】自定义数据集 使用tensorflow框架实现逻辑回归并保存模型,然后保存模型后再加载模型进行预测

一、使用tensorflow框架实现逻辑回归 1. 数据部分&#xff1a; 首先自定义了一个简单的数据集&#xff0c;特征 X 是 100 个随机样本&#xff0c;每个样本一个特征&#xff0c;目标值 y 基于线性关系并添加了噪声。tensorflow框架不需要numpy 数组转换为相应的张量&#xff0…...

RK3568中使用QT opencv(显示基础图像)

文章目录 一、查看对应的开发环境是否有opencv的库二、QT使用opencv 一、查看对应的开发环境是否有opencv的库 在开发板中的/usr/lib目录下查看是否有opencv的库&#xff1a; 这里使用的是正点原子的ubuntu虚拟机&#xff0c;在他的虚拟机里面已经安装好了opencv的库。 二、…...

Brave132 编译指南 Windows 篇:获取源码(六)

1. 引言 在 Brave 浏览器 132 版本的编译过程中&#xff0c;获取源代码是至关重要的第一步。源代码包含了 Brave 浏览器的所有核心功能、特性和组件的实现细节&#xff0c;是深入理解、定制和优化 Brave 的基础。通过获取和管理源代码&#xff0c;开发者能够深入探索 Brave 的…...

解决 pip install 出现 error: subprocess-exited-with-error 错误的方法

解决 pip install 出现 error: subprocess-exited-with-error 错误的方法_pip安装报错 subprocess-CSDN博客文章浏览阅读10w次&#xff0c;点赞62次&#xff0c;收藏86次。通过上述步骤&#xff0c;我们成功解决了 pip install 时出现的 error: subprocess-exited-with-error 错…...

网络安全攻防实战:从基础防护到高级对抗

&#x1f4dd;个人主页&#x1f339;&#xff1a;一ge科研小菜鸡-CSDN博客 &#x1f339;&#x1f339;期待您的关注 &#x1f339;&#x1f339; 引言 在信息化时代&#xff0c;网络安全已经成为企业、政府和个人必须重视的问题。从数据泄露到勒索软件攻击&#xff0c;每一次…...

DeepSeek大模型技术解析:从架构到应用的全面探索

一、引言 在人工智能领域&#xff0c;大模型的发展日新月异&#xff0c;其中DeepSeek大模型凭借其卓越的性能和广泛的应用场景&#xff0c;迅速成为业界的焦点。本文旨在深入剖析DeepSeek大模型的技术细节&#xff0c;从架构到应用进行全面探索&#xff0c;以期为读者提供一个…...

Deepseek的api调用报错乱码问题

最近的deepseek也是很火&#xff0c;但是在调用api的过程中也会出现一些大大小小的问题&#xff0c;所以这里也给出一种问题和他的解决方案&#xff0c;报错的类型如下图所示 API Streaming Failed Command failed with exit code 1: powershell (Get-CimInstance -ClassName W…...

.NET Core 中依赖注入的使用

ASP.NET Core中服务注入的地方 在ASP.NET Core项目中一般不需要自己创建ServiceCollection、IServiceProvider。在Program.cs的builder.Build()之前向builder.Services中注入。在Controller中可以通过构造方法注入服务。 低使用频率的服务 把Action用到的服务通过Action的参…...

Mysql Resultset 解析记录

Mysql Resultset 解析记录 结果集消息头字段定义结果数据完整spicy文件 结果集消息头 消息头由消息体长度消息序列号消息体组成&#xff1b;消息头长度为3字节&#xff0c;消息序列号长度为1字节。 结果集的消息头消息体内容为结果集的列数。 结果集消息头的spicy1格式如下&a…...

ThinkPhp伪静态设置后,访问静态资源也提示找不到Controller

ThinkPhp没有配置伪静态时&#xff0c;除了默认的IndexController能访问&#xff0c;其他路由Controller都访问不到&#xff0c;提示404错误。配置了伪静态后就解决了这个问题。 但是当我的ThinkPhp后台项目中有静态资源放在public目录&#xff08;或子目录&#xff09;中需要…...