POI 和 EasyExcel 操作 Excel

一、概述

        目前操作 Excel 比较流行的就是 Apache POI 和阿里巴巴的 easyExcel。

1.1 POI 简介

        Apache POI 是用 Java 编写的免费开源的跨平台的 Java API,Apache POI 提供 API 给 Java 程序对 Microsoft Office 格式文档读和写的常用功能。POI 为 “Poor Obfuscation Implementation” 的首字母缩写,意为“简洁版的模糊实现”。其常用的结构如下:

        HSSF -- 提供读写 03 版本的 Excel 常用功能。

        XSSF -- 提供读写 07 版本的 Excel 常用功能。

        HWPF -- 提供读写 Word 格式的常用功能

        HSLF -- 提供读写 ppt 格式的常用功能。

        HDGF -- 提供读写 visio 格式的常用功能

1.2 easyExcel 简介

        easyExcel 是阿里巴巴开源的一个 excel 处理框架,以使用简单、节省内存著称。easyExcel 能大大减少占用内存的主要原因是在解析 Excel 时没有将文件数据一次性全部加载到内存中,而是从磁盘上一行行读取数据,逐个解析。

        easyExcel 官网地址:https://github.com/alibaba/easyexcel

1.3 xls 和 xlsx 区别

        常用的 excel 文档有两种结尾形式,分别为 xls 和 xlsx,其中以 xls 结尾的文档属于 03 版本的,它里面最多可以存储 65536 行数据。而以 xlsx 结尾的文档属于 07 版本的,它理论上可以存储无限行数据,这就是两者之前的区别。

二、POI 常用操作

2.1 添加 maven 依赖

    <dependencies><!--xls(03 版本)--><dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>3.9</version></dependency><!--xlsx(07 版本)--><dependency><groupId>org.apache.poi</groupId><artifactId>poi-ooxml</artifactId><version>3.9</version></dependency><!-- 日期格式化工具--><dependency><groupId>joda-time</groupId><artifactId>joda-time</artifactId><version>2.10.1</version></dependency><!--test--><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency></dependencies>

2.2 写入 Excel 操作

2.2.1 一般文件写入

2.2.1.1 03 版本
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.joda.time.DateTime;
import org.junit.Test;import java.io.FileOutputStream;public class ExcelWriteTest {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testWrite03() throws Exception {// 1、创建一个工作簿Workbook workbook = new HSSFWorkbook();// 2、创建一个工作表Sheet sheet = workbook.createSheet("我是 sheet1 页");// 3、创建一行Row row1  = sheet.createRow(0);// 4、创建一个单元格Cell cell11 = row1.createCell(0);cell11.setCellValue("我是第一行第一个单元格");Cell cell12 = row1.createCell(1);cell12.setCellValue("我是第一行第二个单元格");// 第二行Row row2  = sheet.createRow(1);Cell cell21 = row2.createCell(0);cell21.setCellValue("我是第二行第一个单元格");Cell cell22 = row2.createCell(1);String time = new DateTime().toString("yyyy-MM-dd HH:mm:ss");cell22.setCellValue(time);// 03 版本的使用 xls 结尾FileOutputStream fileOutputStream  = new FileOutputStream(PATH+"统计表03类型.xls");workbook.write(fileOutputStream);fileOutputStream.close();System.out.println("Excel03 写入完成了");}
}

2.2.2.2 07 版本
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.joda.time.DateTime;
import org.junit.Test;import java.io.FileOutputStream;public class ExcelWriteTest {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testWrite07() throws Exception {// 1、创建一个工作簿Workbook workbook = new XSSFWorkbook();// 2、创建一个工作表Sheet sheet = workbook.createSheet("我是 sheet1 页");// 3、创建一行Row row1  = sheet.createRow(0);// 4、创建一个单元格Cell cell11 = row1.createCell(0);cell11.setCellValue("我是第一行第一个单元格");Cell cell12 = row1.createCell(1);cell12.setCellValue("我是第一行第二个单元格");// 第二行Row row2  = sheet.createRow(1);Cell cell21 = row2.createCell(0);cell21.setCellValue("我是第二行第一个单元格");Cell cell22 = row2.createCell(1);String time = new DateTime().toString("yyyy-MM-dd HH:mm:ss");cell22.setCellValue(time);// 07 版本的使用 xlsx 结尾FileOutputStream fileOutputStream  = new FileOutputStream(PATH+"统计表07类型.xlsx");workbook.write(fileOutputStream);fileOutputStream.close();System.out.println("Excel07 写入完成了");}
}

2.2.2 大文件写入

2.2.2.1 03 版本
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.junit.Test;import java.io.FileOutputStream;public class ExcelWriteTest {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testWrite03BigData() throws Exception {long begin = System.currentTimeMillis();// 1、创建一个工作簿Workbook workbook = new HSSFWorkbook();// 2、创建一个工作表Sheet sheet = workbook.createSheet();// 3、写入数据for(int rowNum =0;rowNum<65537;rowNum++){Row row = sheet.createRow(rowNum);for(int cellNum=0;cellNum<10;cellNum++){Cell cell = row.createCell(cellNum);cell.setCellValue(cellNum);}}System.out.println("over");FileOutputStream fileOutputStream  = new FileOutputStream(PATH+"统计表03大数据类型.xls");workbook.write(fileOutputStream);fileOutputStream.close();long end = System.currentTimeMillis();System.out.println((double)(end-begin)/1000);}
}

        缺点:最多只能处理 65536 行,否则会抛出异常。

        优点:写入过程中写入缓存,不操作磁盘,最后一次性写入磁盘,速度快。将 65537 改成65536 再次执行程序,结果如下,可以看到 1.692s 就完成了写入操作,速度还是很快的。

2.2.2.2 07 版本
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;import java.io.FileOutputStream;public class ExcelWriteTest {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testWrite07BigData() throws Exception {long begin = System.currentTimeMillis();// 1、创建一个工作簿Workbook workbook = new XSSFWorkbook();// 2、创建一个工作表Sheet sheet = workbook.createSheet();// 3、写入数据for(int rowNum =0;rowNum<100000;rowNum++){Row row = sheet.createRow(rowNum);for(int cellNum=0;cellNum<10;cellNum++){Cell cell = row.createCell(cellNum);cell.setCellValue(cellNum);}}System.out.println("over");FileOutputStream fileOutputStream  = new FileOutputStream(PATH+"统计表07大数据类型.xlsx");workbook.write(fileOutputStream);fileOutputStream.close();long end = System.currentTimeMillis();System.out.println((double)(end-begin)/1000);}
}

        缺点:写数据时速度非常慢,非常耗内存,也会发生内存溢出,如100万条。

        优点:可以写较大的数据量,如20万条。

2.2.2.3 07 版本优化
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.junit.Test;import java.io.FileOutputStream;public class ExcelWriteTest {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testWrite07BigDataS() throws Exception {long begin = System.currentTimeMillis();// 1、创建一个工作簿Workbook workbook = new SXSSFWorkbook();// 2、创建一个工作表Sheet sheet = workbook.createSheet();// 3、写入数据for(int rowNum =0;rowNum<100000;rowNum++){Row row = sheet.createRow(rowNum);for(int cellNum=0;cellNum<10;cellNum++){Cell cell = row.createCell(cellNum);cell.setCellValue(cellNum);}}System.out.println("over");FileOutputStream fileOutputStream  = new FileOutputStream(PATH+"统计表07大数据类型优化.xlsx");workbook.write(fileOutputStream);// 清除产生的临时文件((SXSSFWorkbook)workbook).dispose();fileOutputStream.close();long end = System.currentTimeMillis();System.out.println((double)(end-begin)/1000);}
}

        优点:可以写非常大的数据量,如 100万 条甚至更多条,数据速度快,占用更少的内存。

        需要注意的是:代码在过程中会产生临时文件,需要清理临时文件。默认有 100 条记录被保存在内存中,如果超过这数量,则最前面的数据被写入临时文件。如果想自定义内存中数据的数量,可以使用 new SXSSFWorkbook(数量) 。

        SXSSFWorkbook 来至官方的解释:实现 “BigGridDemo” 策略的流式 XSSFWorkbook 版本。这允许写入非常大的文件而不会耗尽内存,因为任何时候只有可配置的行部分被保存在内存中。请注意,仍然可能会消耗大量内存,这些内存基于您正在使用的功能,例如合并区域,注释……仍然只存储在内存中,因此如果广泛使用,可能需要大量内存。

2.3 读取 Excel 操作

2.3.1 03 版本

import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.junit.Test;
import java.io.FileInputStream;public class ExcelRead {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testRead03() throws Exception {// 1、获取文件流FileInputStream fileInputStream = new FileInputStream(PATH+"统计表03类型.xls");// 2、创建文件簿,使用 excel 能操作的这边都可以操作Workbook workbook = new HSSFWorkbook(fileInputStream);// 3、得到表Sheet sheet = workbook.getSheetAt(0);// 4、得到行Row row  = sheet.getRow(0);// 5、得到列Cell cell = row.getCell(0);// 读取值的时候需要注意类型,String 和数字调用的方法是不同的。System.out.println(cell.getStringCellValue());fileInputStream.close();}
}

2.3.2 07 版本

import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;
import java.io.FileInputStream;public class ExcelRead {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testRead07() throws Exception {// 1、获取文件流FileInputStream fileInputStream = new FileInputStream(PATH+"统计表07类型.xlsx");// 2、创建文件簿,使用 excel 能操作的这边都可以操作Workbook workbook = new XSSFWorkbook(fileInputStream);// 3、得到表Sheet sheet = workbook.getSheetAt(0);// 4、得到行Row row  = sheet.getRow(0);// 5、得到列Cell cell = row.getCell(1);// 读取值的时候需要注意类型,String 和数字调用的方法是不同的。System.out.println(cell.getStringCellValue());fileInputStream.close();}
}

2.3.3 读取不同类型

        表格的内容如下所示:

        代码如下所示:

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.joda.time.DateTime;
import org.junit.Test;
import java.io.FileInputStream;
import java.util.Date;public class ExcelRead {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testCellType() throws Exception{// 1、获取文件流FileInputStream fileInputStream = new FileInputStream(PATH+"03商品信息.xls");// 2、创建文件簿,使用 excel 能操作的这边都可以操作Workbook workbook = new HSSFWorkbook(fileInputStream);// 3、得到表Sheet sheet = workbook.getSheetAt(0);// 4、获取标题内容Row rowTitle  = sheet.getRow(0);if(rowTitle != null){// 获取列的数量int cellCount = rowTitle.getPhysicalNumberOfCells();for(int cellNum=0;cellNum<cellCount;cellNum++){Cell cell = rowTitle.getCell(cellNum);if(cell != null){// 获取列的类型int cellType = cell.getCellType();// 获取具体的列名String cellValue = cell.getStringCellValue();System.out.print(cellValue+" | ");}}}System.out.println();// 5、获取表中的内容// 获取有多少行的记录int rowCount = sheet.getPhysicalNumberOfRows();for(int rowNum=1;rowNum<rowCount;rowNum++){// 获取第一行数据Row rowData = sheet.getRow(rowNum);if(rowData !=null){// 读取行中的列int cellCount = rowTitle.getPhysicalNumberOfCells();for(int cellNum=0;cellNum<cellCount;cellNum++){System.out.print("["+(rowNum+1)+"-"+(cellNum+1)+"]");Cell cell = rowData.getCell(cellNum);// 匹配类的数据类型if(cell != null){int cellType = cell.getCellType();String cellValue="";switch(cellType){case HSSFCell.CELL_TYPE_STRING:   //字符串System.out.print("【STRING】");cellValue = cell.getStringCellValue();break;case HSSFCell.CELL_TYPE_BOOLEAN:   //布尔System.out.print("【BOOLEAN】");cellValue = String.valueOf(cell.getBooleanCellValue());break;case HSSFCell.CELL_TYPE_BLANK:   //空System.out.print("【BLANK】");break;case HSSFCell.CELL_TYPE_NUMERIC:   //数字(分为日期和普通数字)System.out.print("【NUMERIC】");if(HSSFDateUtil.isCellDateFormatted(cell)){ // 日期System.out.print("【日期】");Date date = cell.getDateCellValue();cellValue = new DateTime(date).toString("yyyy-MM-dd");}else{// 非日期格式,转换成字符串格式System.out.print("【转化为字符串输出】");cell.setCellType(HSSFCell.CELL_TYPE_STRING);cellValue = cell.toString();}break;case HSSFCell.CELL_TYPE_ERROR:   //字符串System.out.print("【数据类型错误】");break;}System.out.println(cellValue);}}}}fileInputStream.close();}
}

2.3.4 读取公式

        操作的表格内容如下所示:

        代码如下所示:

import org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.junit.Test;
import java.io.FileInputStream;public class ExcelRead {String PATH ="F:\\idea_home\\poi-excel\\";@Testpublic void testFormula() throws Exception {FileInputStream fileInputStream = new FileInputStream(PATH + "03求和.xls");// 1.创建一个工作簿。使得excel能操作的,这边他也能操作。Workbook workbook = new HSSFWorkbook(fileInputStream);// 2.得到表。Sheet sheet = workbook.getSheetAt(0);Row row = sheet.getRow(6);Cell cell = row.getCell(0);// 拿到计算公司FormulaEvaluator formulaEvaluator = new HSSFFormulaEvaluator((HSSFWorkbook) workbook);// 输出单元格内容int cellType = cell.getCellType();switch (cellType){case Cell.CELL_TYPE_FORMULA:String cellFormula = cell.getCellFormula();System.out.println(cellFormula);// 计算CellValue evaluate = formulaEvaluator.evaluate(cell);String cellValue = evaluate.formatAsString();System.out.println(cellValue);break;}}
}

三、EasyExcel 常用操作

3.1 添加 maven 依赖

    <dependencies><!-- 主要是这个依赖,剩下的依赖都是测试用到的 --><dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>3.0.5</version></dependency><dependency><groupId>lambada</groupId><artifactId>lambada</artifactId><version>1.0.3</version></dependency><dependency><groupId>org.projectlombok</groupId><artifactId>lombok</artifactId><version>RELEASE</version><scope>compile</scope></dependency><!--test--><dependency><groupId>junit</groupId><artifactId>junit</artifactId><version>4.12</version></dependency><dependency><groupId>com.alibaba</groupId><artifactId>fastjson</artifactId><version>1.2.7</version></dependency></dependencies>

3.2 写操作

        先模拟一个实体类,如下所示:

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;import java.util.Date;@Getter
@Setter
@EqualsAndHashCode
public class DemoData {@ExcelProperty("字符串标题")private String string;@ExcelProperty("日期标题")private Date date;@ExcelProperty("数字标题")private Double doubleData;/*** 忽略这个字段*/@ExcelIgnoreprivate String ignore;
}

        然后写入文档即可,如下所示: 

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.util.ListUtils;
import org.junit.Test;import java.util.Date;
import java.util.List;public class TestWrite {@Testpublic void simpleWrite() {String PATH ="F:\\idea_home\\poi-excel\\easyexcel统计表03类型.xlsx";EasyExcel.write(PATH, DemoData.class).sheet("模板").doWrite(() -> {// 分页查询数据return data();});}private List<DemoData> data() {List<DemoData> list = ListUtils.newArrayList();for (int i = 0; i < 10; i++) {DemoData data = new DemoData();data.setString("字符串" + i);data.setDate(new Date());data.setDoubleData(0.56);list.add(data);}return list;}
}

3.3 读操作

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;import java.util.Date;@Getter
@Setter
@EqualsAndHashCode
public class DemoData {private String string;private Date date;private Double doubleData;
}
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.read.listener.PageReadListener;
import com.alibaba.fastjson.JSON;
import org.junit.Test;public class TestRead {@Testpublic void simpleRead() {String PATH ="F:\\idea_home\\poi-excel\\easyexcel统计表03类型.xlsx";// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭// 这里每次会读取3000条数据 然后返回过来 直接调用使用数据就行EasyExcel.read(PATH, DemoData.class, new PageReadListener<DemoData>(dataList -> {for (DemoData demoData : dataList) {System.out.println(JSON.toJSONString(demoData));}})).sheet().doRead();}
}

3.4 更多操作

        详细的文档地址:https://www.yuque.com/easyexcel/doc/easyexcel

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

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

相关文章

一般香港服务器带宽选多大够用?(带宽计算方法)

​  在海外IDC市场份额中&#xff0c;香港服务器依托自身优越的服务器资源条件&#xff0c;在各个行业中发挥的重要作用。但是&#xff0c;不同业务对网络带宽的要求各不相同&#xff0c;弄清楚如何计算带宽需求对于确保业务平稳运行至关重要&#xff0c;最好从一开始就使用正…

039:mapboxGL更换地图上的鼠标样式

第039个 点击查看专栏目录 本示例的目的是介绍演示如何在vue+mapbox中更换地图上的鼠标的样式。 直接复制下面的 vue+mapbox源代码,操作2分钟即可运行实现效果 文章目录 示例效果配置方式示例源代码(共74行)相关API参考:专栏目标示例效果 配置方式 1)查看基础设置:htt…

012-第二代硬件选型

第二代硬件选型 文章目录 第二代硬件选型项目介绍重新换平台缘由X86 && Arm 架构切换 ARM Linux 硬件选型系统确定Qt 版本确定总结一下 关键字&#xff1a; Qt、 Qml、 Arm、 X86、 linux 项目介绍 欢迎来到我们的 QML & C 项目&#xff01;这个项目结合了 QM…

判断一个整数是否回文

回文数字的定义&#xff1a;第一位和最后一位相等&#xff0c;第二位和倒数第二位相等...依次类推&#xff0c;比如1221,12321等等&#xff0c;也就是说一个数字如果是回文&#xff0c;那么将它反转之后&#xff0c;一定和原来的值相等 解法一&#xff1a;投机取巧&#xff0c…

学生管理系统

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言0. 准备0-0 头文件0-1 封装学生和结点数据0-2 创建头结点0-3 系统功能提示0-4 根据用户输入选择功能 1. 录入学生信息1-0 实现循环录入1-1 程序暂停和清空控制台…

【jvm--方法区】

文章目录 1. 栈、堆、方法区的交互关系2. 方法区的内部结构3. 运行时常量池4. 方法区的演进细节5. 方法区的垃圾回收 1. 栈、堆、方法区的交互关系 方法区的基本理解&#xff1a; 方法区&#xff08;Method Area&#xff09;与 Java 堆一样&#xff0c;是各个线程共享的内存区…

4.MySql安装配置(更新版)

MySql安装配置 无论计算机是否有安装其他mysql&#xff0c;都不要卸载。 只要确定大版本是8即可&#xff0c;8.0.33 8.0.34 差别不大即可。 MySql下载安装适合电脑配置属性有关&#xff0c;一次性安装成功当然是非常好的&#xff0c;因为卸载步骤是非常麻烦的 如果第一次安装…

医疗器械标准目录汇编2022版共178页(文中附下载链接!)

为便于更好地应用医疗器械标准&#xff0c;国家药监局医疗器械标准管理中心组织对现行1851项医疗器械国家和行业标准按技术领域&#xff0c;编排形成《医疗器械标准目录汇编&#xff08;2022版&#xff09;》 该目录汇编分为通用技术领域和专业技术领域两大类&#xff0c;通用…

NoSQL Redis

NoSQL Redis 1、数据库1.1关系型数据库1.2非关系型数据库1.3关系型和非关系型区别 2、非关系型数据库应用场景3、存储结构4、redis4.1redis概述4.2Redis 优点4.3Redis为什么这么快&#xff1f; 5、部署redis6、redis基础操作 1、数据库 1.1关系型数据库 关系型数据库是一个结…

互斥锁、条件变量、信号量以及适用场景

文章目录 互斥锁互斥锁实战过程中常用方法 条件变量条件变量实战过程中常用方法 信号量信号量的常用方法 生产者和消费者问题一个粗略版本的生产者消费者代码(如果只使用了互斥锁)一个改进版本的生产者消费者代码(使用了互斥锁和条件变量)一个最终版本的生产者消费者代码(使用了…

options.css 内容优化2 --chatPGT

问&#xff1a; options.css 内容优化,功能列表的li,设置成点击按钮的样式&#xff0c;需要有鼠标经过高亮&#xff0c;选中时按钮背景颜色和未选中时的背景色需要有肉眼可见的色差 gpt: 为了使左侧功能列表的每个 <li> 元素看起来像按钮&#xff0c;并且在鼠标经过时…

机械臂抓取的产业落地进展与思考

工业机械臂是一种能够模拟人类手臂动作的机械装置&#xff0c;具有高精度、高速度和高灵活性的特点。近年来&#xff0c;随着人工智能和机器人技术的快速发展&#xff0c;机械臂在工业生产、物流仓储、医疗护理等领域得到了广泛应用。机械臂抓取技术作为机械臂的核心功能之一&a…

广东省科学技术厅关于2023年度广东省科学技术奖提名工作的通知

粤科函区字〔2023〕1290号 各有关单位&#xff08;专家&#xff09;&#xff1a; 科技奖励制度是党和政府长期坚持的一项重要科技制度&#xff0c;为深入实施创新驱动发展战略&#xff0c;加快建设更高水平的科技创新强省和粤港澳大湾区国际科技创新中心&#xff0c;进一步体现…

tp5访问的时候必须加index.php,TP5配置隐藏入口index.php文件

PS&#xff1a;这里说的入口文件指的是public/index.php,配置文件就在这个目录下 可以去掉URL地址里面的入口文件index.php&#xff0c;但是需要额外配置WEB服务器的重写规则。 以Apache为例&#xff0c;需要在入口文件的同级添加.htaccess文件(官方默认自带了该文件)&#x…

基于Keil a51汇编 —— MPL 宏定义

MPL 宏 Ax51汇编程序支持的宏处理语言&#xff08;MPL&#xff09;是一种字符串替换工具&#xff0c;使您能够编写可修复的代码块&#xff08;宏&#xff09;并将其插入源文本中的一个或多个位置。 宏处理器查看源文件的方式与汇编程序不同。 对于汇编程序来说&#xff0c;源…

UniAD 论文学习

一、解决了什么问题&#xff1f; 当前的自动驾驶方案大致由感知&#xff08;检测、跟踪、建图&#xff09;、预测&#xff08;motion、occupancy&#xff09;和规划三个模块构成。 为了实现各种功能&#xff0c;智驾方案大致包括两种路线。一种是针对每个任务都部署一个模型&a…

Python Parser 因子计算性能简单测试

一直以来&#xff0c;Python 都在量化金融领域扮演着至关重要的角色。得益于 Python 强大的库和工具&#xff0c;用户在处理金融数据、进行数学建模和机器学习时变得更加便捷。但作为一种解释性语言&#xff0c;相对较慢的执行速度也限制了 Python 在一些需要即时响应的场景中的…

读取 yaml 文件

一、引入依赖 <dependency><groupId>org.yaml</groupId><artifactId>snakeyaml</artifactId><version>1.32</version> </dependency> 二、读取yaml内容工作代码 &#xff08;1&#xff09;上传yaml文件 读取yaml文件并校验…

知识图谱系列3:读论文-《中国鸟类领域知识图谱构建与应用研究》-面向知识图谱的智能服务研究(需求、管理、查询、推理)

5.1鸟类领域知识服务需求研究 本部分根据不同人群&#xff0c;对其需求进行了研究。 并总结需求类型如下。 知识型服务需求指用户学习鸟类相关知识&#xff0c;包括知识内容、知识学习等。知识内容 需求为构建鸟类领域知识库作为知识的来源&#xff1b;知识学习需求为用户通过…

gici-open示例数据运行(ground_truth坐标的转换)

1. 坐标系转换说明 涉及的两个坐标转换&#xff1a; nmea_pose_to_pose &#xff1a;激光IMU中心到数据集IMU中心&#xff0c;主要是杆臂误差&#xff0c;转换关系为&#xff1a; //坐标转换的主要步骤(若发现有错误的地方&#xff0c;请评论指出) //定义激光IMU和数据集IMU之…