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

JDK 8 函数式接口全集

JDK 8 函数式接口全集

  • 函数式接口如何定义
    • 关于注解 @FunctionalInterface
  • 函数式接口的分类与简单使用
    • 生产型接口 Supplier
      • 使用
    • 消费型接口 Consumer
      • 使用
    • ​​函数型接口(Function)​​
      • 实例(合并字符串)
    • ​​断言型接口(Predicate)​​
      • 示例
    • 操作型接口(Operator)​​
      • 示例

函数式接口如何定义

所谓的函数式接口,当然首先是一个接口,然后就是在这个接口里面只能有一个抽象方法

注意,在JDK8 以后,接口内,也支持 默认方法(default)和静态方法(static
所以,在一个函数式接口内是可能有多个方法的。

关于注解 @FunctionalInterface

在这里插入图片描述

错误案例(定义两个抽象方法)

    @FunctionalInterfacepublic interface CompareHandler {Integer theBigger(Integer i1, Integer i2);Integer theSmaller(Integer i1, Integer i2);}

直接报错

合法接口

	@FunctionalInterfacepublic interface CompareHandler {Integer theBigger(Integer i1, Integer i2);default Integer theSmaller(Integer i1, Integer i2){return i1>i2?i2:i1;}static Boolean compare100(Integer i1){return i1>100;}}

使用

        CompareHandler handler = (i3, i4)->{return i3>i4?i3:i4;};System.out.println(handler.theSmaller(1, 2));System.out.println(handler.theBigger(1,2));System.out.println(CompareHandler.compare100(1));//1//2//false

函数式接口的分类与简单使用

在 JDK 8 中,函数式接口(Functional Interface)是指仅包含一个抽象方法的接口,支持通过 Lambda 表达式或方法引用来实现。

方法引用: 不使用匿名函数,而是在类中直接定义一个 参数和返回值 与定义的函数式接口一致的的方法。
doBusiness(“wu”, this::methed1)
public static String doBusiness(String name , CompareHandler compareHandler){……}

java.util.function 包中预定义了丰富的函数式接口,按功能可分为以下几类:

生产型接口 Supplier

功能​​:无输入参数,返回一个结果。
​​核心接口​​:

  • ​​Supplier​​
    方法:T get()
    示例:延迟生成对象或值
@FunctionalInterface
public interface Supplier<T> {/*** Gets a result.** @return a result*/T get();
}

使用

Supplier<LocalDate> dateSupplier = () -> LocalDate.now();
System.out.println(dateSupplier.get()); // 当前日期

消费型接口 Consumer

功能​​:接收参数但不返回结果。

@FunctionalInterface
public interface Consumer<T> {/*** Performs this operation on the given argument.** @param t the input argument*/void accept(T t);/*** Returns a composed {@code Consumer} that performs, in sequence, this* operation followed by the {@code after} operation. If performing either* operation throws an exception, it is relayed to the caller of the* composed operation.  If performing this operation throws an exception,* the {@code after} operation will not be performed.** @param after the operation to perform after this operation* @return a composed {@code Consumer} that performs in sequence this* operation followed by the {@code after} operation* @throws NullPointerException if {@code after} is null*/default Consumer<T> andThen(Consumer<? super T> after) {Objects.requireNonNull(after);return (T t) -> { /*** 联系起来看:con1.andThen(con2).accept(name);* accept(t); 就是调用 con1 的 消费方法* after.accept(t); 就是调用 con2 的 消费方法*/accept(t); after.accept(t);};}
}

使用

import java.util.function.Consumer;public class ConsumerDemo {public static void main(String[] args) {operatorString("张三", (s) -> System.out.println(s));operatorString("张三", (s) -> System.out.println(s), (s)-> System.out.println(new StringBuilder(s).reverse().toString()));}//定义一个方法,消费一个字符串数据private static void operatorString(String name, Consumer<String> con) {con.accept(name);}//定义一个方法,用不同的方式消费同一个字符串两次private static void operatorString(String name, Consumer<String> con1,Consumer<String> con2) {
//        con1.accept(name);
//        con2.accept(name);//返回一个组合的Consumercon1.andThen(con2).accept(name);}
}

​​函数型接口(Function)​​

​​功能​​:接收一个参数,返回转换后的结果。

核心接口​​:

  • Function<T, R>
  • BiFunction<T, U, R>
@FunctionalInterface
public interface Function<T, R> {/*** Applies this function to the given argument.** @param t the function argument* @return the function result*/R apply(T t);/*** Returns a composed function that first applies the {@code before}* function to its input, and then applies this function to the result.* If evaluation of either function throws an exception, it is relayed to* the caller of the composed function.** @param <V> the type of input to the {@code before} function, and to the*           composed function* @param before the function to apply before this function is applied* @return a composed function that first applies the {@code before}* function and then applies this function* @throws NullPointerException if before is null** @see #andThen(Function)*/default <V> Function<V, R> compose(Function<? super V, ? extends T> before) {Objects.requireNonNull(before);return (V v) -> apply(before.apply(v));}/*** Returns a composed function that first applies this function to* its input, and then applies the {@code after} function to the result.* If evaluation of either function throws an exception, it is relayed to* the caller of the composed function.** @param <V> the type of output of the {@code after} function, and of the*           composed function* @param after the function to apply after this function is applied* @return a composed function that first applies this function and then* applies the {@code after} function* @throws NullPointerException if after is null** @see #compose(Function)*/default <V> Function<T, V> andThen(Function<? super R, ? extends V> after) {Objects.requireNonNull(after);return (T t) -> after.apply(apply(t));}/*** Returns a function that always returns its input argument.** @param <T> the type of the input and output objects to the function* @return a function that always returns its input argument*/static <T> Function<T, T> identity() {return t -> t;}
}

实例(合并字符串)

BiFunction<String, String, String> concat = (s1, s2) -> s1 + s2;
System.out.println(concat.apply("Hello", "World")); // HelloWorld

​​断言型接口(Predicate)​​

​​功能​​:接收参数,返回布尔值。

方法介绍

  1. boolean test(T t):对给定的参数进行判断(判断逻辑由Lambda表达式实现),返回一个布尔值
  2. default Predicate< T > negate():返回一个逻辑的否定,对应逻辑非
  3. default Predicate< T > and():返回一个组合判断,对应短路与
  4. default Predicate< T > or():返回一个组合判断,对应短路或
  5. isEqual():测试两个参数是否相等
  6. Predicate< T >:接口通常用于判断参数是否满足指定的条件

/*** Represents a predicate (boolean-valued function) of one argument.** <p>This is a <a href="package-summary.html">functional interface</a>* whose functional method is {@link #test(Object)}.** @param <T> the type of the input to the predicate** @since 1.8*/
@FunctionalInterface
public interface Predicate<T> {/*** Evaluates this predicate on the given argument.** @param t the input argument* @return {@code true} if the input argument matches the predicate,* otherwise {@code false}*/boolean test(T t);/*** Returns a composed predicate that represents a short-circuiting logical* AND of this predicate and another.  When evaluating the composed* predicate, if this predicate is {@code false}, then the {@code other}* predicate is not evaluated.** <p>Any exceptions thrown during evaluation of either predicate are relayed* to the caller; if evaluation of this predicate throws an exception, the* {@code other} predicate will not be evaluated.** @param other a predicate that will be logically-ANDed with this*              predicate* @return a composed predicate that represents the short-circuiting logical* AND of this predicate and the {@code other} predicate* @throws NullPointerException if other is null*/default Predicate<T> and(Predicate<? super T> other) {Objects.requireNonNull(other);return (t) -> test(t) && other.test(t);}/*** Returns a predicate that represents the logical negation of this* predicate.** @return a predicate that represents the logical negation of this* predicate*/default Predicate<T> negate() {return (t) -> !test(t);}/*** Returns a composed predicate that represents a short-circuiting logical* OR of this predicate and another.  When evaluating the composed* predicate, if this predicate is {@code true}, then the {@code other}* predicate is not evaluated.** <p>Any exceptions thrown during evaluation of either predicate are relayed* to the caller; if evaluation of this predicate throws an exception, the* {@code other} predicate will not be evaluated.** @param other a predicate that will be logically-ORed with this*              predicate* @return a composed predicate that represents the short-circuiting logical* OR of this predicate and the {@code other} predicate* @throws NullPointerException if other is null*/default Predicate<T> or(Predicate<? super T> other) {Objects.requireNonNull(other);return (t) -> test(t) || other.test(t);}/*** Returns a predicate that tests if two arguments are equal according* to {@link Objects#equals(Object, Object)}.** @param <T> the type of arguments to the predicate* @param targetRef the object reference with which to compare for equality,*               which may be {@code null}* @return a predicate that tests if two arguments are equal according* to {@link Objects#equals(Object, Object)}*/static <T> Predicate<T> isEqual(Object targetRef) {return (null == targetRef)? Objects::isNull: object -> targetRef.equals(object);}
}

示例

import java.util.function.Predicate;public class ConsumerTest {public static void main(String[] args) {boolean string = chenkString("张三", s -> s.equals("张三"));System.out.println(string);boolean hello = chenkString("hello", s -> s.length() > 8, s -> s.length() < 18);System.out.println(hello);}//判定给定的字符串是否满足要求
//    private static boolean chenkString(String s, Predicate<String> pre){
//        return pre.test(s);
//    }private static boolean chenkString(String s, Predicate<String> pre){return pre.negate().test(s);}//    private static boolean chenkString(String s, Predicate<String> pre, Predicate<String> pre1){
//        return pre.and(pre1).test(s);
//    }private static boolean chenkString(String s, Predicate<String> pre, Predicate<String> pre1){return pre.or(pre1).test(s);}
}

操作型接口(Operator)​​

​​功能​​:输入与输出类型相同,用于数据转换或计算。
核心接口​​:

  • UnaryOperator​​(继承 Function<T, T>)
    方法:T apply(T t)
  • BinaryOperator​​(继承 BiFunction<T, T, T>)
    方法:T apply(T t1, T t2)

示例

UnaryOperator<Integer> square = n -> n * n;
System.out.println(square.apply(3)); // 9BinaryOperator<Integer> sum = (a, b) -> a + b;
System.out.println(sum.apply(2, 3)); // 5

相关文章:

JDK 8 函数式接口全集

JDK 8 函数式接口全集 函数式接口如何定义关于注解 FunctionalInterface 函数式接口的分类与简单使用生产型接口 Supplier使用 消费型接口 Consumer使用 ​​函数型接口&#xff08;Function&#xff09;​​实例(合并字符串) ​​断言型接口&#xff08;Predicate&#xff09;…...

网站防护无惧DDoS攻击:2025年实战指南

在数字化时代&#xff0c;DDoS攻击已成为企业生存的“生死线”。2024年全球日均攻击峰值突破5.4Tbps&#xff08;Cloudflare数据&#xff09;&#xff0c;电商、金融行业更是重灾区。本文将结合最新技术趋势和实战案例&#xff0c;为你提供一套低成本、高可靠的防御方案。 一、…...

【AI论文】BitNet v2:针对1位LLM的原生4位激活和哈达玛变换

摘要&#xff1a;激活异常值阻碍了1位大型语言模型&#xff08;LLM&#xff09;的有效部署&#xff0c;这使得低比特宽度的量化变得复杂。 我们介绍了BitNet v2&#xff0c;这是一个新的框架&#xff0c;支持1位LLM的原生4位激活量化。 为了解决注意力和前馈网络激活中的异常值…...

windows 使用 FFmpeg 放大视频原声

问题&#xff1a;原视频声音太小&#xff0c;就算把视频音量调到最大&#xff0c;声音也听不太清 一、下载 下载地址&#xff1a;Download FFmpeg 根据需要选择合适版本下载解压&#xff0c;如浏览器下载速度慢&#xff0c;可使用迅雷下载 二、配置环境变量 1.把解压的文件放…...

RHCE第七章:SElinux

一、SElinux SELinux 是一套安全策略系统 1.作用&#xff1a; &#xff08;1&#xff09;SELinux 域限制&#xff1a;对服务程序的功能进行限制&#xff0c;以确保服务程序做不了出格的事 &#xff08;2&#xff09;SELinux 安全上下文&#xff1a;对文件资源的访问限制&am…...

一文简单记录打通K8s+Kibana流程如何启动(Windows下的Docker版本)

为ES和Kibana组建Docker网络 docker network create elastic下载8.18.0版本镜像Es并启动 docker run --name es-node01 --net elastic -p 9200:9200 -p 9300:9300 -t docker.elastic.co/elasticsearch/elasticsearch:8.18.0启动Kibana&#xff08;简单一些直接咯和ES对应版本…...

【系统参数合法性校验】spring-boot-starter-validation

JSR303校验 统一校验的需求 前端请求后端接口传输参数&#xff0c;是在controller中校验还是在Service中校验&#xff1f; 答案是都需要校验&#xff0c;只是分工不同。 Contoller中校验请求参数的合法性&#xff0c;包括&#xff1a;必填项校验&#xff0c;数据格式校验&…...

蓝桥杯 10. 凯撒加密

凯撒加密 原题目链接 题目描述 给定一个单词&#xff0c;请使用凯撒密码将这个单词加密。 凯撒密码是一种替换加密的技术&#xff0c;单词中的所有字母都在字母表上向后偏移 3 位后被替换成密文。 即&#xff1a; a → db → e⋯w → zx → ay → bz → c 输入描述 输入…...

Discord多账号注册登录:如何同时管理多个账户?

Discord是许多人、特别是游戏玩家和社区管理者的重要沟通工具。随着用户需求的增长&#xff0c;越来越多的人开始在Discord上注册多个账号进行管理。例如&#xff0c;个人和工作账号的区分&#xff0c;多个游戏社区的参与&#xff0c;或者通过不同的身份进行更灵活的社交互动。…...

Harbor默认Redis与Notary组件弱口令漏洞分析与修复指南

一、 背景 某资源池控制面和运行面生产环境部署的harbor被漏扫出弱口令需要进行整改&#xff0c;主要涉及 default、server、signer用户存在弱口令。 二、 分析与处理 首先需求确认这三个用户是harbor那个组件使用&#xff0c;最好确认的是default这个用户&#xff0c;它是r…...

【Prometheus-Postgres Exporter安装配置指南,开机自启】

目录 内容概述 一、安装步骤1. 安装 PostgreSQL Exporter2. 创建 PostgreSQL 监控用户3. 配置 Systemd 服务4. 启动并验证服务5. 集成到 Prometheus 内容概述 本教程详细指导如何安装 PostgreSQL Exporter&#xff08;版本 0.15.0&#xff09;&#xff0c;包括&#xff1a; 软…...

leetcode:3005. 最大频率元素计数(python3解法)

难度&#xff1a;简单 给你一个由 正整数 组成的数组 nums 。 返回数组 nums 中所有具有 最大 频率的元素的 总频率 。 元素的 频率 是指该元素在数组中出现的次数。 示例 1&#xff1a; 输入&#xff1a;nums [1,2,2,3,1,4] 输出&#xff1a;4 解释&#xff1a;元素 1 和 2 的…...

论文导读 - 基于特征融合的电子鼻多任务深度学习模型研究

基于特征融合的电子鼻多任务深度学习模型研究 原论文地址&#xff1a;https://www.sciencedirect.com/science/article/pii/S0925400524009365 引用此论文&#xff08;GB/T 7714-2015&#xff09;&#xff1a; NI W, WANG T, WU Y, et al. Multi-task deep learning model f…...

VSCode突然连接不上服务器(已解决)

可恶&#xff0c;不知道昨天还好好的VSCode还可以连接到服务器&#xff0c;今天打开就连接不上了&#xff0c;搜了一圈很多都说是服务端的vscode-server这个文件里面保存的commitID与当前我们VSCode上的ID不一致导致连接失败&#xff08;据说是因为VSCode自动更新导致的&#x…...

解决Ollama run qwen3:32b: Error: unable to load model问题

问题描述 在尝试使用Ollama部署Qwen3模型时&#xff0c;许多用户遇到了以下错误&#xff1a; ollama run qwen3:32b Error: unable to load model: /Users/xxxx/.ollama/models/blobs/sha256-3291abe70f16ee9682de7bfae08db5373ea9d6497e614aaad63340ad421d6312这个错误通常会…...

C++ 单例对象自动释放(保姆级讲解)

目录 单例对象自动释放&#xff08;重点*&#xff09; 方式一&#xff1a;利用另一个对象的生命周期管理资源 方式二&#xff1a;嵌套类 静态对象&#xff08;重点&#xff09; 方式三&#xff1a;atexit destroy 方式四&#xff1a;atexit pthread_once 单例对象自动释…...

李录谈卖出股票的时机:价值投资的动态决策框架

作为最贴近芒格与巴菲特投资理念的中国投资人&#xff0c;李录对卖出时机的思考融合了价值投资的核心逻辑与实战经验。通过其在哥伦比亚大学的多场演讲及访谈&#xff08;主要集中于2006年、2013年及后续公开内容&#xff09;&#xff0c;我们可以将其观点归纳为以下五个维度&a…...

Docker的简单使用(不全)

Docker Hello World Docker 允许在容器内运行应用程序&#xff0c;使用docker run命令来在容器内运行一个应用程序 输出Hello World runoobrunoob:~$ docker run ubuntu:15.10 /bin/echo "Hello world"Hello world docker&#xff1a;Docker的二进制执行文件 run…...

A2A与MCP:理解它们的区别以及何时使用

随着AI不断深入到商业工作流中&#xff0c;多个AI代理&#xff08;Agent&#xff09;之间的无缝协作成为了一个主要挑战。 为了解决这个问题&#xff0c;Google Cloud推出了一种名为Agent2Agent&#xff08;A2A&#xff09;的开放协议&#xff0c;旨在使不同平台和系统中的AI代…...

AI Agent开源技术栈

构建和编排Agent的框架 如果您是从头开始构建&#xff0c;请从这里开始。这些工具可以帮助您构建Agent的逻辑——做什么、何时做以及如何处理工具。您可以将其视为将原始语言模型转化为更自主的模型的核心大脑。 2. 计算机和浏览器的使用 一旦你的Agent能够规划&#xff0c…...

判断用户选择的Excel单元格区域是否跨页?

VBA应用程序开发过程中&#xff0c;经常需要处理用户选中的单元格区域&#xff0c;有的应用场景中&#xff0c;需要限制用户选中区域位于同一页中&#xff08;以打印预览显示的分页划分&#xff09;&#xff0c;但是VBA对象模型中并没有提供相应的接口&#xff0c;用于快速查询…...

驱动开发硬核特训 · Day 24(上篇):走进Linux内核时钟子系统 —— 硬件基础全解析

一、前言 在 SoC&#xff08;System on Chip&#xff09;设计中&#xff0c;“时钟&#xff08;Clock&#xff09;”不仅是信号同步的基石&#xff0c;也是各个模块协调运作的前提。没有合理的时钟体系&#xff0c;CPU无法运行&#xff0c;外设无法通信&#xff0c;存储器无法…...

【GPU 微架构技术】Pending Request Table(PRT)技术详解

PRT&#xff08;Pending Request Table&#xff09;是 GPU 中用于管理 未完成内存请求&#xff08;outstanding memory requests&#xff09;的一种硬件结构&#xff0c;旨在高效处理大规模并行线程的内存访问需求。与传统的 MSHR&#xff08;Miss Status Handling Registers&a…...

角度(degrees)和弧度(radians)转换关系

目录 1.从角度转换到弧度&#xff1a; 2.从弧度转换到角度&#xff1a; 示例 将90度转换为弧度&#xff1a; 将π/3​弧度转换为角度&#xff1a; 角度&#xff08;degrees&#xff09;和弧度&#xff08;radians&#xff09;之间的转换关系可以通过以下公式来实现&#xff…...

【大语言模型DeepSeek+ChatGPT+GIS+Python】AI大语言模型驱动的地质灾害全流程智能防治:风险评估、易发性分析与灾后重建多技术融合应用

地质灾害是指全球地壳自然地质演化过程中&#xff0c;由于地球内动力、外动力或者人为地质动力作用下导致的自然地质和人类的自然灾害突发事件。在降水、地震等自然诱因的作用下&#xff0c;地质灾害在全球范围内频繁发生。我国不仅常见滑坡灾害&#xff0c;还包括崩塌、泥石流…...

第十六届蓝桥杯 2025 C/C++组 25之和

目录 题目&#xff1a; 题目描述&#xff1a; 题目链接&#xff1a; 思路&#xff1a; 思路详解&#xff1a; 代码&#xff1a; 代码详解&#xff1a; 题目&#xff1a; 题目描述&#xff1a; 题目链接&#xff1a; P12339 [蓝桥杯 2025 省 B/Python B 第二场] 25 之和…...

万界星空科技QMS质量管理系统几大核心功能详解

QMS质量管理系统&#xff08;Quality Management System&#xff09;是一款专为现代企业设计的、全面且高效的质量管理工具&#xff0c;融合了现代质量管理理念与前沿的信息技术&#xff0c;旨在帮助企业构建完善的质量管理体系&#xff0c;确保产品和服务质量。以下为你详细介…...

SSR同构渲染深度解析

同构渲染&#xff08;Isomorphic Rendering&#xff09;是SSR&#xff08;服务器端渲染&#xff09;的核心概念&#xff0c;指同一套代码既能在服务器端运行&#xff0c;也能在客户端运行。下面我将从原理到实践全面介绍SSR同构渲染。 一、同构渲染核心原理 1. 基本工作流程 …...

【论文阅读/复现】RT-DETR的网络结构/训练/推理/验证/导出模型

利用ultralytics仓库&#xff0c;复现RT-DETR官方实验环境。 使用基于ResNet50和ResNet101的RT-DETR。 目录 一 RT-DETR的网络结构 1 编码器结构 2 RT-DETR 3 CCFF中的融合块 4 实验结果 二 RT-DETR的安装/训练/推理/验证/导出模型 1 安装 2 配置文件 3 训练 4 推理 …...

KUKA机器人关机时冷启动介绍

KUKA机器人在正常关机时&#xff0c;可以从示教器上操作。在示教器上操作时需要选择“冷启动”方式关闭计算机。等示教器屏幕关闭之后&#xff0c;再把主开关旋钮关闭。 一、先登录【管理员】权限&#xff0c;再在【主菜单】下选择【关机】。 二、在关机的默认中&#xff0c;…...

MCP Java SDK 介绍与使用指南

MCP与MCP Java SDK 概念 MCP 是什么&#xff1f; 模型上下文协议&#xff08;Model Context Protocol, MCP&#xff09;是用于标准化AI模型与工具间通信的规范。通过定义通用接口&#xff0c;确保不同AI组件&#xff08;如模型推理服务、工具插件&#xff09;能无缝协作。MCP …...

【Java核心】一文理解Java面向对象(超级详细!)

一&#xff1a;概述 1.1Java类及类的成员 属性、方法、构造器、代码块、内部类 1.2 面向对象的特征 封装、继承、多态&#xff08;抽象&#xff09; 1.3 其它关键字的使用 This、super、package、import、static、final、interface、abstract 1.4 面向对象和面向过程 &…...

2025年DDoS攻击防御全解析:应对超大流量的实战策略

一、2025年DDoS攻击的新趋势 超大规模攻击常态化&#xff1a;攻击流量突破300Gbps&#xff0c;部分案例甚至达到T级规模&#xff0c;传统单点防御已无法应对。 混合攻击模式盛行&#xff1a;攻击者结合应用层&#xff08;HTTP Flood、CC攻击&#xff09;与网络层&#xff08;U…...

【动态导通电阻】 GaN PiN二极管电导调制对动态 RON 的影响

2020 年,浙江大学电气工程学院的Shaowen Han等人采用实验研究的方法,对垂直 GaN-on-GaN PiN 二极管中电导调制的瞬态行为及其对动态导通电阻(RON)的影响进行了深入探究。他们基于高质量的 GaN 基板开发的垂直 GaN-on-GaN 功率器件具有高电流容量和高击穿电压等优势,而与间…...

第十六届蓝桥杯 2025 C/C++B组第一轮省赛 全部题解(未完结)

目录 前言&#xff1a; 试题A&#xff1a;移动距离 试题C&#xff1a;可分解的正整数 试题D&#xff1a;产值调整 试题E&#xff1a;画展布置 前言&#xff1a; 我参加的是第一轮省赛&#xff0c;说实话第一次参加还是比较紧张的&#xff0c;真到考场上看啥都想打暴力&…...

MySQL 实战 45 讲 笔记 ----来源《极客时间》

01 | 基础架构&#xff1a;一条SQL查询语句是如何执行的&#xff1f; 1. MySQL 可以分为 Server层 和 存储引擎层 两部分。Server 层包括连接器、查询缓存、分析器、优化器、执行器等。存储引擎层支持 InnoDB、MyISAM等. (1) 连接器&#xff1a;管理连接&#xff0c;权限认证…...

海思SD3403边缘计算AI核心设备概述

1、海思SD3403边缘计算AI设备4TOPS算力&#xff08;SD3403模组&#xff09; 2、AI训练服务器 (≥60TOPS算力 INT8 算力越高AI训练速度越快&#xff09; 3、普通监控IPC摄像机&#xff08;低成本&#xff0c;批量化安装项目&#xff09; 4、AI数据标定工作终端 (≥10TOPS算力 IN…...

算法设计:回溯法的基础原理与应用

目录 一、基本概念 二、适用问题 三、基本步骤 四、算法模式 递归回溯算法模式&#xff08;求一个解&#xff09; 非递归回溯算法模式&#xff08;求一个解&#xff09; 非递归回溯算法模式&#xff08;求所有解&#xff09; 五、经典应用 1数字组合问题 2数字排列问题…...

PyTorch 深度学习实战(23):多任务强化学习(Multi-Task RL)之扩展

之前的PyTorch 深度学习实战&#xff08;23&#xff09;&#xff1a;多任务强化学习&#xff08;Multi-Task RL)总结扩展运用代码如下&#xff1a; import torch import torch.nn as nn import torch.optim as optim import numpy as np from torch.distributions import Norm…...

音视频开发---视频编码基础

一、视频编码的必要性 1. 存储与传输成本高 未经编码压缩的原始视频的数据量极大,例如:一般电影的亮度信号采样频率为13.5MHz;色度信号的频带通常为亮度信号的一半或更少,为6.75MHz或3.375MHz。以4:2:2的采样频率为例,Y信号采用13.5MHz,色度信号U和V采用6.75MHz采样,…...

深入蜂窝物联网 第四章 Cat-1 与 5G RedCap:带宽、低时延与未来趋势

1. 前言与应用场景 随着物联网对带宽与时延的需求不断增长,LTE Cat-1 和 5G RedCap(Reduced Capability)应运而生: Cat-1:在传统 LTE 网络上提供最高 10 Mbps 下行、5 Mbps 上行,兼容性佳; 5G RedCap:在 5G NSA/SA 网络中提供 1–20 Mbps,时延可降至 10 ms 级,且模组…...

FPGA 39 ,FPGA 网络通信协议栈进阶,RGMII、ARP 与 UDP 协议与模块设计( RGMII、ARP、UDP原理与模块设计 )

目录 目录​​​​​​​​​​​​​​ 一、核心原理 1.1 RGMII 接口&#xff1a;高效数据传输的物理桥梁 1.2 ARP 协议&#xff1a;IP 与 MAC 地址的动态映射引擎 1.3 UDP 协议&#xff1a;轻量级数据传输的高效选择 1.4 FPGA 实现流程 二、时序约束 2.1 时序约束理论…...

《系统分析师-第三阶段—总结(七)》

背景 采用三遍读书法进行阅读&#xff0c;此阶段是第三遍。 过程 本篇总结第13章第14章的内容 第13章 第14章 总结 系统设计分为概要设计与详细设计&#xff0c;然后重点讲解了处理流程设计&#xff0c;输入输出原型设计&#xff0c;面向对象设计、人机交互设计&#xff1…...

Lightroom 2025手机版:专业编辑,轻松上手

在摄影和图像编辑的世界里&#xff0c;Adobe Lightroom一直是一个不可或缺的工具。无论是专业摄影师还是摄影爱好者&#xff0c;都依赖它来提升照片的质量和视觉效果。今天&#xff0c;我们要介绍的 Lightroom 2025手机版&#xff0c;是Adobe公司为移动设备量身定制的照片编辑器…...

Cursor:AI时代的智能编辑器

在开发者社区掀起热潮的Cursor&#xff0c;正以破竹之势重塑编程工具格局。这款基于VS Code的AI优先编辑器&#xff0c;不仅延续了经典IDE的稳定基因&#xff0c;更通过深度集成的智能能力&#xff0c;将开发效率推向全新维度。2023年Anysphere公司获得的6000万美元A轮融资&…...

x86架构-k8s设置openebs的hostpath作为默认存储类的部署记录

文章目录 前言一、openebs是什么&#xff1f;二、准备步骤1.下载yaml文件2.准备一个新的单点k8s用于测试2.将openebs-operator.yaml中的镜像修改成使用国内加速源的 三、执行yaml1.openebs-operator.yaml2.local-hostpath-pvc.yaml和local-hostpath-pod.yaml 四、关于默认存储路…...

废品回收小程序:全链路数字化解决方案,赋能绿色未来

用户端&#xff1a;一键触达&#xff0c;便捷回收新体验 废品百科与估价指南&#xff1a;分类标准与实时价格一目了然&#xff0c;用户轻松掌握废品价值。一键预约&#xff0c;轻松回收&#xff1a;指尖轻点即可完成预约&#xff0c;上门服务省时省力。精准定位&#xff0c;导…...

Kotlin和JavaScript的对比

Kotlin和JavaScript有一些相似之处&#xff0c;但也存在显著的差异&#xff0c;下面从多个方面为你详细分析&#xff1a; 相似点 1. 语法灵活性 变量声明&#xff1a;二者在变量声明上都较为灵活。在JavaScript里&#xff0c;借助var、let和const可以声明变量。其中&#xf…...

蓝桥杯 5. 拼数

拼数 原题目链接 题目描述 给定 n 个正整数 a1, a2, …, an&#xff0c;你可以将它们任意排序。 现要将这 n 个数字连接成一排&#xff0c;即令相邻数字收尾相接&#xff0c;组成一个数。 问&#xff0c;这个数最大可以是多少。 输入格式 第一行输入一个正整数 n&#x…...

(即插即用模块-特征处理部分) 四十四、(2024 TGRS) FEM 特征增强模块

文章目录 1、Feature Enhancement Module2、代码实现 paper&#xff1a;FFCA-YOLO for Small Object Detection in Remote Sensing Images Code&#xff1a;https://github.com/yemu1138178251/FFCA-YOLO 1、Feature Enhancement Module 遥感图像中&#xff0c;小目标的特征通…...