EasyExcel
概述
GitHub - alibaba/easyexcel: 快速、简洁、解决大文件内存溢出的java处理Excel工具
EasyExcel官方文档 - 基于Java的Excel处理工具 | Easy Excel
EasyExcel是一个基于Java的、快速、简洁、解决大文件内存溢出的Excel处理工具。 他能让你在不用考虑性能、内存的等因素的情况下,快速完成Excel的读、写等功能。
Java解析、生成Excel比较有名的框架有Apache poi、jxl。但他们都存在一个严重的问题就是非常的耗内存,poi有一套SAX模式的API可以一定程度的解决一些内存溢出的问题,但POI还是有一些缺陷,比如07版Excel解压缩以及解压后存储都是在内存中完成的,内存消耗依然很大。 easyexcel重写了poi对07版Excel的解析,一个3M的excel用POI sax解析依然需要100M左右内存,改用easyexcel可以降低到几M,并且再大的excel也不会出现内存溢出;03版依赖POI的sax模式,在上层做了模型转换的封装,让使用者更加简单方便
EasyExcel
快速入门
<dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>3.2.1</version>
</dependency>
<dependency><groupId>ch.qos.logback</groupId><artifactId>logback-classic</artifactId><version>1.2.3</version>
</dependency>
这个错误通常是由于您的项目使用了 SLF4J 日志框架(Simple Logging Facade for Java),但无法找到对应的日志实现。
SLF4J 只是一个日志框架,它并不提供具体的日志实现。
要解决这个问题,您需要添加一个 SLF4J 的日志实现,例如 Logback 或 Log4j。
这些实现可以将 SLF4J 的 API 转换为特定的日志系统的 API,并提供日志记录功能。
如果使用的是 Maven,则可以通过以上方式添加 Logback 日志实现:
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {@ExcelProperty("序号")private Integer id;@ExcelProperty("姓名")private String name;@ExcelProperty("年龄")private Integer age;@ExcelProperty("生日")private Date birthday;
}
写操作
方式一
@Testvoid test1() {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表1.xlsx";EasyExcel.write(fileName,User.class).sheet("用户信息1").doWrite(userList);}
方式二
@Testvoid test2() {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表2.xlsx";// 创建excelWriter对象ExcelWriter excelWriter = EasyExcel.write(fileName, User.class).build();// 创建writeSheet对象WriteSheet writeSheet = EasyExcel.writerSheet("用户信息2").build();// 写入数据excelWriter.write(userList,writeSheet);// 关闭流操作excelWriter.finish();}
排除写入的字段
@Testvoid test3() {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表3.xlsx";
Set<String> set = new HashSet<>();set.add("age");set.add("birthday");
EasyExcel.write(fileName,User.class)// 排除列.excludeColumnFieldNames(set).sheet("用户信息3").doWrite(userList);}
允许写入的字段
@Testvoid test4() {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表4.xlsx";
Set<String> set = new HashSet<>();set.add("age");set.add("birthday");
EasyExcel.write(fileName,User.class)// 指定列.includeColumnFieldNames(set).sheet("用户信息4").doWrite(userList);}
对Excel列排序
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {@ExcelProperty(value = "序号",index = 0)private Integer id;@ExcelProperty(value = "姓名",index = 1)private String name;@ExcelProperty(value = "年龄",index = 3)private Integer age;@ExcelProperty(value = "生日",index = 2)private Date birthday;
}
复杂头数据写入
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Emp {@ExcelProperty({"基本信息","编号"})private Integer id;@ExcelProperty({"基本信息","姓名"})private String name;@ExcelProperty({"基本信息","年龄"})private Integer age;@ExcelProperty({"日期","入职"})private Date entry;@ExcelProperty({"日期","离职"})private Date leave;
}
@Testvoid test5() {List<Emp> empList = new ArrayList<>();// 添加用户信息empList.add(new Emp(1, "张三", 23, new Date(),new Date()));empList.add(new Emp(2, "李四", 24, new Date(),new Date()));empList.add(new Emp(3, "王五", 25, new Date(),new Date()));empList.add(new Emp(4, "赵六", 26, new Date(),new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/员工信息表1.xlsx";EasyExcel.write(fileName,Emp.class).sheet("员工信息表1").doWrite(empList);}
重复多次写入
写到单个Sheet
@Testvoid test6 () {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表5.xlsx";// 创建excelWriter对象ExcelWriter excelWriter = EasyExcel.write(fileName, User.class).build();// 创建writeSheet对象WriteSheet writeSheet = EasyExcel.writerSheet("用户信息5").build();// 写10次for (int i = 0; i < 10; i++) {excelWriter.write(userList,writeSheet);}// 关闭流excelWriter.finish();}
写到多个Sheet
@Testvoid test7 () {List<User> userList = new ArrayList<>();// 添加用户信息userList.add(new User(1, "张三", 23, new Date()));userList.add(new User(2, "李四", 24, new Date()));userList.add(new User(3, "王五", 25, new Date()));userList.add(new User(4, "赵六", 26, new Date()));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/用户信息表6.xlsx";// 创建excelWriter对象ExcelWriter excelWriter = EasyExcel.write(fileName, User.class).build();// 写10次for (int i = 1; i <= 10; i++) {// 创建writeSheet对象WriteSheet writeSheet = EasyExcel.writerSheet("用户信息"+i).build();excelWriter.write(userList,writeSheet);}// 关闭流excelWriter.finish();}
日期、数字或者自定义格式转换
@NumberFormat("#.##")
@ExcelProperty("薪资")
日期格式化
@DateTimeFormat("yyyy年MM月dd日")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Emp {@ExcelProperty({"基本信息","编号"})private Integer id;@ExcelProperty({"基本信息","姓名"})private String name;@ExcelProperty({"基本信息","年龄"})private Integer age;@DateTimeFormat("yyyy年MM月dd日")@ExcelProperty({"日期","入职"})private Date entry;@DateTimeFormat("yyyy年MM月dd日")@ExcelProperty({"日期","离职"})private Date leave;@NumberFormat("#.##")@ExcelProperty({"薪资"})private Double salary;
}
@Testvoid test8() {List<Emp> empList = new ArrayList<>();// 添加用户信息empList.add(new Emp(1, "张三", 23, new Date(),new Date(),8234.333));empList.add(new Emp(2, "李四", 24, new Date(),new Date(),8234.333));empList.add(new Emp(3, "王五", 25, new Date(),new Date(),8234.333));empList.add(new Emp(4, "赵六", 26, new Date(),new Date(),8234.333));// 输出目录String fileName = "/Users/whitecamellia/Desktop/test/员工信息表2.xlsx";EasyExcel.write(fileName,Emp.class).sheet("员工信息表2").doWrite(empList);}
图片导出
ImageData
@Data
public class ImageData {// 抽象文件表示图片@ExcelProperty(value = "图1")private File file;// 输入流表示一个图片@ExcelProperty(value = "图2")private InputStream inputStream;/** 如果string类型保存一个图片,必须使用StringImageConverter转换器*/@ExcelProperty(converter = StringImageConverter.class,value = "图3")private String string;// 二进制数组表示图片@ExcelProperty(value = "图4")private byte[] byteArray;// 网络链接表示图片 */@ExcelProperty(value = "图5")private URL url;
}@Testvoid test9 () throws Exception {String fileName = "/Users/whitecamellia/Desktop/test/xxx.xlsx";String imageLocalUrl = "/Users/whitecamellia/资料/xx/xxx/xxxx .jpg";String imageUrl = "https://www.mianfeiwendang.com/pic/1da74e363276b769ac770539/4-810-jpg_6-1080-0-0-1080.jpg";List<ImageData> list = new ArrayList<>();ImageData imageData = new ImageData();imageData.setFile(new File(imageLocalUrl));imageData.setInputStream(new FileInputStream(imageLocalUrl));imageData.setString(imageLocalUrl);byte[] b = new byte[(int) new File(imageLocalUrl).length()];FileInputStream fileInputStream = new FileInputStream(imageLocalUrl);fileInputStream.read(b);imageData.setByteArray(b);imageData.setUrl(new URL(imageUrl));list.add(imageData);EasyExcel.write(fileName, ImageData.class).sheet("图片").doWrite(list);}
列宽行高设置
@ContentRowHeight(2000)//设置内容高度
@HeadRowHeight(50)//设置标题高度
@ColumnWidth(45)//设置列宽
@Data
public class ImageData {// 抽象文件表示图片@ColumnWidth(255)//设置列宽@ExcelProperty(value = "图1")private File file;....
}@Testvoid test9 () {.....}
样式
StyleDate
@HeadRowHeight(50) //设置标题高度
// 头背景设置为红色(10) enum IndexedColors
@HeadStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 10)
// 头字体 设置为40
@HeadFontStyle(fontHeightInPoints = 40)
// 内容背景设置为红色(10)
@ContentStyle(fillPatternType = FillPatternTypeEnum.SOLID_FOREGROUND,fillForegroundColor = 14)
// 内容字体 设置为30
@ContentFontStyle(fontHeightInPoints = 30)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Emp {@ExcelProperty({"基本信息","编号"})private Integer id;@ExcelProperty({"基本信息","姓名"})private String name;@ExcelProperty({"基本信息","年龄"})private Integer age;@DateTimeFormat("yyyy年MM月dd日")@ExcelProperty({"日期","入职"})private Date entry;@DateTimeFormat("yyyy年MM月dd日")@ExcelProperty({"日期","离职"})private Date leave;@NumberFormat("#.##")@ExcelProperty({"薪资"})private Double salary;
}
@Testvoid test8 () {.....}
合并单元格
@OnceAbsoluteMerge(firstRowIndex = 2, lastRowIndex = 3, firstColumnIndex = 2, lastColumnIndex = 3)
public class Emp {@ExcelProperty({"基本信息","编号"})private Integer id;@ExcelProperty({"基本信息","姓名"}).....
}@Testvoid test8 () {.....}
读操作
方式一
@Testvoid test1 () {String fileName = "/Users/whitecamellia/Desktop/test/用户信息表1.xlsx";EasyExcel.read(fileName, User.class, new AnalysisEventListener<User>() {@Overridepublic void invoke(User user, AnalysisContext analysisContext) {// 每读一行 执行一次 ,可以在这里执行db操作,这里读取时尽量不要在User上加indexSystem.out.println("读取到的数据是:" + user);}
@Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {// 读完数据 最后做一次System.out.println("全部读取完毕!");
}}).sheet().doRead();}
DemoData
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {private Integer id;private String name;private Integer age;private Date birthday;
}
方式二
@Testvoid test2 () {String fileName = "/Users/whitecamellia/Desktop/test/用户信息表1.xlsx";ExcelReader excelReader = EasyExcel.read(fileName, User.class, new AnalysisEventListener<User>() {
@Overridepublic void invoke(User user, AnalysisContext analysisContext) {// 每读一行 执行一次 ,可以在这里执行db操作,这里读取时尽量不要在User上加indexSystem.out.println("读取到的数据是:" + user);}
@Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {// 读完数据 最后做一次System.out.println("全部读取完毕!");}}).build();
ReadSheet readSheet = EasyExcel.readSheet(0).build();excelReader.read(readSheet);//关闭流资源,在读取文件时,会创建临时文件,如果不关闭,磁盘会挂掉。excelReader.finish();}
通过名称读取列
通过名称或者下标读取列
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {@ExcelProperty(value = "年龄")private Integer age;@ExcelProperty(value = "生日")private Date birthday;@ExcelProperty(value = "序号")private Integer id;@ExcelProperty(value = "姓名")private String name;
}
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {@ExcelProperty(index = 2)private Integer age;@ExcelProperty(index = 3)private Date birthday;@ExcelProperty(index = 0)private Integer id;@ExcelProperty(index = 1)private String name;
}
数据格式化
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {@ExcelProperty(index = 2)private Integer age;@ExcelProperty(index = 3)@DateTimeFormat("yyyy年MM月dd日 HH:mm:ss")private Date birthday;@ExcelProperty(index = 0)private Integer id;@ExcelProperty(index = 1)private String name;@ExcelProperty(index = 4)@NumberFormat("#.##") //小数点后保留2位,注意,必须用String类型,不可以用Double类型private String salary;
}
读取全部或者多个Sheet
doReadAll();
sheet(0).doRead();
@Testvoid test4 () {String fileName = "/Users/whitecamellia/Desktop/test/用户信息表1.xlsx";EasyExcel.read(fileName, User.class, new AnalysisEventListener<User>() {@Overridepublic void invoke(User user, AnalysisContext analysisContext) {// 每读一行 执行一次 ,可以在这里执行db操作,这里读取时尽量不要在User上加indexSystem.out.println("读取到的数据是:" + user);}
@Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {// 读完数据 最后做一次System.out.println("全部读取完毕!");
}}).doReadAll();}
@Testvoid test5 () {String fileName = "/Users/whitecamellia/Desktop/test/用户信息表1.xlsx";// 读取文件ExcelReader excelReader = EasyExcel.read(fileName).build();// 构建sheet0ReadSheet sheet0 = EasyExcel.readSheet(0).head(User.class).registerReadListener(new AnalysisEventListener<User>() {@Overridepublic void invoke(User user, AnalysisContext analysisContext) {System.out.println("sheet0读取到的数据是:" + user);}
@Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {System.out.println("sheet0全部读取完毕!");}}).build();
// 构建sheet1ReadSheet sheet1 = EasyExcel.readSheet(1).head(User.class).registerReadListener(new AnalysisEventListener<User>() {@Overridepublic void invoke(User user, AnalysisContext analysisContext) {System.out.println("sheet1读取到的数据是:" + user);}
@Overridepublic void doAfterAllAnalysed(AnalysisContext analysisContext) {System.out.println("sheet1全部读取完毕!");}}).build();// 读取sheet0,sheet1excelReader.read(sheet0,sheet1);//关闭流资源,在读取文件时,会创建临时文件,如果不关闭,磁盘会挂掉。excelReader.finish();}
填充Excel
填充类
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FillData {private String name;private Integer age;private String clazz;private double score;private String desc;
}
简单填充
@Testvoid test6 () {// 1.根据哪个模版进行填充String templateName = "/Users/whitecamellia/Desktop/test/template.xlsx";// 2.填充完成之后的ExcelString fullFileName = "/Users/whitecamellia/Desktop/test/fullFileName.xlsx";// 3.构建填充数据FillData fillData = new FillData("小明",20,"3年2班",85.5,"这次没考好!");// 4.进行填充EasyExcel.write(fullFileName).withTemplate(templateName).sheet().doFill(fillData);}
列表填充
@Testvoid test7 () {// 1.根据哪个模版进行填充String templateName = "/Users/whitecamellia/Desktop/test/template.xlsx";// 2.填充完成之后的ExcelString fullFileName = "/Users/whitecamellia/Desktop/test/fullFileName.xlsx";// 3.构建填充数据FillData fillData1 = new FillData("小明",20,"3年2班",85.5,"这次没考好!");FillData fillData2 = new FillData("小红",21,"3年3班",99.5,"这次还不错!");List<FillData> list = new ArrayList<>();list.add(fillData1);list.add(fillData2);// 4.进行填充EasyExcel.write(fullFileName).withTemplate(templateName).sheet(0).doFill(list);}
相关文章:

EasyExcel
概述 GitHub - alibaba/easyexcel: 快速、简洁、解决大文件内存溢出的java处理Excel工具 EasyExcel官方文档 - 基于Java的Excel处理工具 | Easy Excel EasyExcel是一个基于Java的、快速、简洁、解决大文件内存溢出的Excel处理工具。 他能让你在不用考虑性能、内存的等因素的…...
java 探针两种模式实战
分为两种 程序运行前的agent:premain 程序运行中的agent:agentmain 在程序运行前的agent javaagent是java命令的一个参数,所以需要通过-javaagent 来指定一个jar包(就是我们要做的代理包)能够实现在主程序运行前来执行…...

uniGUI之MASK遮罩
在页面进行后台数据库操作的时候,不想 用户再进行 页面上的 其他操作,这时候就要 将页面 遮罩。例如UniDBGrid有LoadMask属性。 1]使用ScreenMask函数 2]JS调用 3]一个控件控制遮罩另一个控件(如Button遮罩UniDBGrid) //很简单,本例子就是告…...

DevOps云原生创建devops流水线(微服务项目上传git,打包镜像,部署k8s)
开发和运维人员的解决方案 一、中间件的部署(Sentinel/MongoDB/MySQL) 二、创建DevOps工程 邀请成员 三、创建流水线 四、编辑流水线 ①、拉取代码(若失败,则将制定容器改为maven) 若失败,则将命令改…...
【vim 学习系列文章 13.1 -- 自动命令autocmd 根据文件类型设置vim参数】
文章目录 autocmd 根据文件类型配置vim参数vim 文本类型 autocmd 根据文件类型配置vim参数 在 Vim 中,你可以使用 autocmd (自动命令)来根据文件类型自动执行特定的函数。首先,你需要定义这些函数,然后使用 autocmd 与…...

算法基础概念之数据结构
邻接表 每个点作为头节点接一条链表 链表中元素均为该头节点指向的点 优先队列 参数: ①储存元素类型 ②底层使用的存储结构(一般为vector) ③比较方式(默认小于)...

解决ES伪慢查询
一、问题现象 服务现象 服务接口的TP99性能降低 ES现象 YGC:耗时极其不正常, 峰值200次,耗时7sFULL GC:不正常,次数为1但是频繁,STW 5s慢查询:存在慢查询5 二 解决过程 1、去除干扰因素 从现象上看应用是由于某种…...

关于Ubuntu22.04恢复误删文件的记录
挂载在Ubuntu22.04下的固态盘有文件被误删了,该固态盘是ntfs格式的。 在网上找了很多教程,最后决定用TestDisk工具进行恢复。 现记录如下: Ubuntu安装testdisk sudo apt-get install testdisk运行testdisk sudo testdisk得到 我选择的是…...
Docker笔记:Docker Swarm, Consul, Gateway, Microservices 集群部署
关于 Consul 服务 Consul是Go语言写的开源的服务发现软件Consul具有服务发现、健康检查、 服务治理、微服务熔断处理等功能 Consul 部署方式1: 直接在linux 上面部署 consul 集群 1 )下载 在各个服务器上 下载 consul 后解压并将其目录配置到环境变量中ÿ…...

浅析AI视频分析与视频管理系统EasyCVR平台及场景应用
人工智能的战略重要性导致对视频智能分析的需求不断增加。鉴于人工智能视觉技术的巨大潜力,人们的注意力正在从传统的视频监控转移到计算机视觉的监控过程自动化。 1、什么是视频分析? 视频分析或视频识别技术,是指从视频片段中提取有用信息…...
跨站点分布式多活存储建设方案概述
1-伴随着私有云、海量非结构数据的爆炸性增长,软件定义存储已经成为用户构建“敏捷IT” 架构的数据基石,同时越来越多的关键业务接入“敏捷IT” 架构。在分布式软件定义存储的产品架构下,怎样既保证对爆炸数据量的平稳承接,又能对…...

Github 2023-12-16开源项目日报Top10
根据Github Trendings的统计,今日(2023-12-16统计)共有10个项目上榜。根据开发语言中项目的数量,汇总情况如下: 开发语言项目数量Python项目2非开发语言项目2TypeScript项目1Jupyter Notebook项目1Go项目1PHP项目1JavaScript项目1C#项目1 精…...

c++ 中多线程的相关概念与多线程类的使用
1、多线程相关概念 1.1 并发、并行、串行 并发(Concurrent):并发是指两个或多个事件在同一时间间隔内运行。在操作系统中,是指一个时间段中有几个程序都处于已启动运行到运行完毕之间,且这几个程序都是在同一个处理机…...

深入理解 hash 和 history:网页导航的基础(下)
🤍 前端开发工程师(主业)、技术博主(副业)、已过CET6 🍨 阿珊和她的猫_CSDN个人主页 🕠 牛客高级专题作者、在牛客打造高质量专栏《前端面试必备》 🍚 蓝桥云课签约作者、已在蓝桥云…...

腾讯文档助力CRM集成:无代码连接电商与广告
腾讯文档API的简介与优势 腾讯文档API是一个强大的工具,它允许企业通过简单的无代码开发来实现与电商平台和客服系统的智能连接。这种连接不仅提高了工作效率,还优化了数据管理。使用腾讯文档智能表,商家可以享受多样的列类型、多维视图展示…...

学习使用echarts漏斗图的参数配置和应用场景
学习使用echarts漏斗图的参数配置和应用场景 前言什么是漏斗图漏斗图的特点及应用场景漏斗图的特点漏斗图常见的的应用场景: echarts中漏斗的常用属性echart漏斗代码美化漏斗图样式1、设置标题字体大小2、设置标签样式3、设置漏斗图为渐变颜色4、设置高亮效果5、设置…...

npm ,yarn 更换使用国内镜像源,阿里源,清华大学源
在平时开发当中,我们经常会使用 Npm,yarn 来构建 web 项目。但是npm默认的源的服务器是在国外的,如果没有梯子的话。会感觉特别特别慢,所以,使用国内的源是非常有必要的。 在这里插入图片描述 Nnpm, yarn …...
vue+react题集整理
1.Typescript中 interface 和 type 的差别是什么? interface只能用来描述对象类型 type可以描述任何类型组合 type后边需要有 interface后边没有 当多次使用相同名称定义一个 interface 时,它们会自动合并为一个接口。同名属性的不能进行类型覆盖修改&am…...
线程池ThreadPoolExecutor详解
线程池ThreadPoolExecutor详解 大家好,我是微赚淘客系统3.0的小编,也是冬天不穿秋裤,天冷也要风度的程序猿!今天,让我们深入研究Java中线程池的强大工具——ThreadPoolExecutor,解析它的工作原理、配置参数…...

elasticsearch|大数据|kibana的安装(https+密码)
前言: kibana是比较好安装的,但https密码就比较麻烦一些了,下面将就如何安装一个可在生产使用的kibana做一个简单的讲述 一, kibana版本和下载地址 这里我想还是强调一下,kibana的版本需要和elasticsearch的版本一…...

未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?
编辑:陈萍萍的公主一点人工一点智能 未来机器人的大脑:如何用神经网络模拟器实现更智能的决策?RWM通过双自回归机制有效解决了复合误差、部分可观测性和随机动力学等关键挑战,在不依赖领域特定归纳偏见的条件下实现了卓越的预测准…...

React第五十七节 Router中RouterProvider使用详解及注意事项
前言 在 React Router v6.4 中,RouterProvider 是一个核心组件,用于提供基于数据路由(data routers)的新型路由方案。 它替代了传统的 <BrowserRouter>,支持更强大的数据加载和操作功能(如 loader 和…...
在四层代理中还原真实客户端ngx_stream_realip_module
一、模块原理与价值 PROXY Protocol 回溯 第三方负载均衡(如 HAProxy、AWS NLB、阿里 SLB)发起上游连接时,将真实客户端 IP/Port 写入 PROXY Protocol v1/v2 头。Stream 层接收到头部后,ngx_stream_realip_module 从中提取原始信息…...
OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别
OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别 直接训练提示词嵌入向量的核心区别 您提到的代码: prompt_embedding = initial_embedding.clone().requires_grad_(True) optimizer = torch.optim.Adam([prompt_embedding...

第 86 场周赛:矩阵中的幻方、钥匙和房间、将数组拆分成斐波那契序列、猜猜这个单词
Q1、[中等] 矩阵中的幻方 1、题目描述 3 x 3 的幻方是一个填充有 从 1 到 9 的不同数字的 3 x 3 矩阵,其中每行,每列以及两条对角线上的各数之和都相等。 给定一个由整数组成的row x col 的 grid,其中有多少个 3 3 的 “幻方” 子矩阵&am…...
大学生职业发展与就业创业指导教学评价
这里是引用 作为软工2203/2204班的学生,我们非常感谢您在《大学生职业发展与就业创业指导》课程中的悉心教导。这门课程对我们即将面临实习和就业的工科学生来说至关重要,而您认真负责的教学态度,让课程的每一部分都充满了实用价值。 尤其让我…...

HashMap中的put方法执行流程(流程图)
1 put操作整体流程 HashMap 的 put 操作是其最核心的功能之一。在 JDK 1.8 及以后版本中,其主要逻辑封装在 putVal 这个内部方法中。整个过程大致如下: 初始判断与哈希计算: 首先,putVal 方法会检查当前的 table(也就…...

2025季度云服务器排行榜
在全球云服务器市场,各厂商的排名和地位并非一成不变,而是由其独特的优势、战略布局和市场适应性共同决定的。以下是根据2025年市场趋势,对主要云服务器厂商在排行榜中占据重要位置的原因和优势进行深度分析: 一、全球“三巨头”…...

搭建DNS域名解析服务器(正向解析资源文件)
正向解析资源文件 1)准备工作 服务端及客户端都关闭安全软件 [rootlocalhost ~]# systemctl stop firewalld [rootlocalhost ~]# setenforce 0 2)服务端安装软件:bind 1.配置yum源 [rootlocalhost ~]# cat /etc/yum.repos.d/base.repo [Base…...

逻辑回归暴力训练预测金融欺诈
简述 「使用逻辑回归暴力预测金融欺诈,并不断增加特征维度持续测试」的做法,体现了一种逐步建模与迭代验证的实验思路,在金融欺诈检测中非常有价值,本文作为一篇回顾性记录了早年间公司给某行做反欺诈预测用到的技术和思路。百度…...