easyexcel==省市区三级联动

省市区三级联动,不选前面的就没法选后面的

package com.example.demoeasyexcel.jilian2;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import com.alibaba.excel.write.handler.SheetWriteHandler;import java.util.List;
import java.util.Map;public class CascadeWriteHandler2 implements SheetWriteHandler {private List<String> provinceList; // 省份列表private Map<String, List<String>> cityMap; // 省份与城市的映射private Map<String, List<String>> districtMap; // 城市与区的映射public CascadeWriteHandler2(List<String> provinceList, Map<String, List<String>> cityMap, Map<String, List<String>> districtMap) {this.provinceList = provinceList;this.cityMap = cityMap;this.districtMap = districtMap;}@Overridepublic void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {// 此处代码在创建Sheet前,通常为空}@Overridepublic void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {Workbook workbook = writeWorkbookHolder.getWorkbook();Sheet sheet = writeSheetHolder.getSheet();// 创建一个隐藏的Sheet存放省市区数据Sheet hideSheet = workbook.createSheet("siteInfo");workbook.setSheetHidden(workbook.getSheetIndex(hideSheet), true);// 设置省份数据int rowNum = 0;Row provinceRow = hideSheet.createRow(rowNum++);provinceRow.createCell(0).setCellValue("省份列表");for (int i = 0; i < provinceList.size(); i++) {provinceRow.createCell(i + 1).setCellValue(provinceList.get(i));}// 设置城市数据for (String province : provinceList) {List<String> cities = cityMap.get(province);Row cityRow = hideSheet.createRow(rowNum++);cityRow.createCell(0).setCellValue(province);for (int i = 0; i < cities.size(); i++) {cityRow.createCell(i + 1).setCellValue(cities.get(i));}Name cityRangeName = workbook.createName();cityRangeName.setNameName(province);String cityRange = getRange(1, rowNum, cities.size());cityRangeName.setRefersToFormula("siteInfo!" + cityRange);}// 设置区数据for (String city : cityMap.values().stream().flatMap(List::stream).toArray(String[]::new)) {List<String> districts = districtMap.get(city);Row districtRow = hideSheet.createRow(rowNum++);districtRow.createCell(0).setCellValue(city);for (int i = 0; i < districts.size(); i++) {districtRow.createCell(i + 1).setCellValue(districts.get(i));}Name districtRangeName = workbook.createName();districtRangeName.setNameName(city);String districtRange = getRange(1, rowNum, districts.size());districtRangeName.setRefersToFormula("siteInfo!" + districtRange);}// 设置数据验证DataValidationHelper dvHelper = sheet.getDataValidationHelper();DataValidationConstraint provinceConstraint = dvHelper.createExplicitListConstraint(provinceList.toArray(new String[0]));CellRangeAddressList provinceRangeAddressList = new CellRangeAddressList(1, 999, 0, 0);setValidation(sheet, dvHelper, provinceConstraint, provinceRangeAddressList);// 城市数据验证for (int i = 2; i < 1000; i++) {DataValidationConstraint cityConstraint = dvHelper.createFormulaListConstraint("INDIRECT($A$" + i + ")");CellRangeAddressList cityRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 1, 1);setValidation(sheet, dvHelper, cityConstraint, cityRangeAddressList);}// 区数据验证for (int i = 2; i < 1000; i++) {DataValidationConstraint districtConstraint = dvHelper.createFormulaListConstraint("INDIRECT($B$" + i + ")");CellRangeAddressList districtRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 2, 2);setValidation(sheet, dvHelper, districtConstraint, districtRangeAddressList);}}private void setValidation(Sheet sheet, DataValidationHelper helper, DataValidationConstraint constraint, CellRangeAddressList addressList) {DataValidation validation = helper.createValidation(constraint, addressList);validation.setErrorStyle(DataValidation.ErrorStyle.STOP);validation.setShowErrorBox(true);validation.setSuppressDropDownArrow(true);sheet.addValidationData(validation);}public String getRange(int offset, int rowId, int colCount) {char start = (char) ('A' + offset);if (colCount <= 25) {char end = (char) (start + colCount - 1);return "$" + start + "$" + rowId + ":$" + end + "$" + rowId;} else {char endPrefix = 'A';char endSuffix = 'A';if ((colCount - 25) / 26 == 0 || colCount == 51) {// 26-51之间,包括边界(仅两次字母表计算)if ((colCount - 25) % 26 == 0) {// 边界值endSuffix = (char) ('A' + 25);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);}} else {// 51以上if ((colCount - 25) % 26 == 0) {endSuffix = (char) ('A' + 25);endPrefix = (char) (endPrefix + (colCount - 25) / 26 - 1);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);endPrefix = (char) (endPrefix + (colCount - 25) / 26);}}return "$" + start + "$" + rowId + ":$" + endPrefix + endSuffix + "$" + rowId;}}
}
package com.example.demoeasyexcel.jilian2;import com.alibaba.excel.EasyExcel;
import com.example.demoeasyexcel.jilian.CascadeVO;import java.io.File;
import java.util.*;public class Test22 {public static void main(String[] args) {List<CascadeVO> dataList = new ArrayList<>();/// 准备省市aqu测试数据List<String> provinceList = Arrays.asList("apro1", "apro2", "apro3");Map<String, List<String>> cityMap = new HashMap<>();cityMap.put("apro1", Arrays.asList("acity11", "acity12"));cityMap.put("apro2", Arrays.asList("acity21", "acity22"));cityMap.put("apro3", Arrays.asList("acity31", "acity32"));Map<String, List<String>> districtMap = new HashMap<>();districtMap.put("acity11", Arrays.asList("aqu111", "aqu112"));districtMap.put("acity12", Arrays.asList("aqu121", "aqu122"));districtMap.put("acity21", Arrays.asList("aqu211", "aq212"));districtMap.put("acity22", Arrays.asList("aqu221", "aqu222"));districtMap.put("acity31", Arrays.asList("aqu311", "aqu312"));districtMap.put("acity32", Arrays.asList("aqu321", "aqu322"));// 创建写入的SheetFile file = new File("D:\\data\\test.xlsx");EasyExcel.write(file, CascadeVO.class).sheet("sheet1").registerWriteHandler(new CascadeWriteHandler2(provinceList, cityMap, districtMap)).doWrite(dataList);}
}

再添加第四列,第四列的下拉不受到级联的影响

package com.example.demoeasyexcel.jilian3;import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import com.alibaba.excel.write.handler.SheetWriteHandler;import java.util.List;
import java.util.Map;public class CascadeWriteHandler3 implements SheetWriteHandler {private List<String> provinceList; // 省份列表private Map<String, List<String>> cityMap; // 省份与城市的映射private Map<String, List<String>> districtMap; // 城市与区的映射private String[] contactTypes = new String[]{"手机", "座机", "呼机"}; //public CascadeWriteHandler3(List<String> provinceList, Map<String, List<String>> cityMap, Map<String, List<String>> districtMap) {this.provinceList = provinceList;this.cityMap = cityMap;this.districtMap = districtMap;}@Overridepublic void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {// 此处代码在创建Sheet前,通常为空}@Overridepublic void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {Workbook workbook = writeWorkbookHolder.getWorkbook();Sheet sheet = writeSheetHolder.getSheet();// 创建一个隐藏的Sheet存放省市区数据Sheet hideSheet = workbook.createSheet("siteInfo");workbook.setSheetHidden(workbook.getSheetIndex(hideSheet), true);// 设置省份数据int rowNum = 0;Row provinceRow = hideSheet.createRow(rowNum++);provinceRow.createCell(0).setCellValue("省份列表");for (int i = 0; i < provinceList.size(); i++) {provinceRow.createCell(i + 1).setCellValue(provinceList.get(i));}// 设置城市数据for (String province : provinceList) {List<String> cities = cityMap.get(province);Row cityRow = hideSheet.createRow(rowNum++);cityRow.createCell(0).setCellValue(province);for (int i = 0; i < cities.size(); i++) {cityRow.createCell(i + 1).setCellValue(cities.get(i));}Name cityRangeName = workbook.createName();cityRangeName.setNameName(province);String cityRange = getRange(1, rowNum, cities.size());cityRangeName.setRefersToFormula("siteInfo!" + cityRange);}// 设置区数据for (String city : cityMap.values().stream().flatMap(List::stream).toArray(String[]::new)) {List<String> districts = districtMap.get(city);Row districtRow = hideSheet.createRow(rowNum++);districtRow.createCell(0).setCellValue(city);for (int i = 0; i < districts.size(); i++) {districtRow.createCell(i + 1).setCellValue(districts.get(i));}Name districtRangeName = workbook.createName();districtRangeName.setNameName(city);String districtRange = getRange(1, rowNum, districts.size());districtRangeName.setRefersToFormula("siteInfo!" + districtRange);}// 设置数据验证DataValidationHelper dvHelper = sheet.getDataValidationHelper();DataValidationConstraint provinceConstraint = dvHelper.createExplicitListConstraint(provinceList.toArray(new String[0]));CellRangeAddressList provinceRangeAddressList = new CellRangeAddressList(1, 999, 0, 0);setValidation(sheet, dvHelper, provinceConstraint, provinceRangeAddressList);// 城市数据验证for (int i = 2; i < 1000; i++) {DataValidationConstraint cityConstraint = dvHelper.createFormulaListConstraint("INDIRECT($A$" + i + ")");CellRangeAddressList cityRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 1, 1);setValidation(sheet, dvHelper, cityConstraint, cityRangeAddressList);}// 区数据验证for (int i = 2; i < 1000; i++) {DataValidationConstraint districtConstraint = dvHelper.createFormulaListConstraint("INDIRECT($B$" + i + ")");CellRangeAddressList districtRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 2, 2);setValidation(sheet, dvHelper, districtConstraint, districtRangeAddressList);}// 新增联系方式的数据验证DataValidationConstraint contactTypeConstraint = dvHelper.createExplicitListConstraint(contactTypes);CellRangeAddressList contactTypeRangeAddressList = new CellRangeAddressList(2, 999, 3, 3);setValidation(sheet, dvHelper, contactTypeConstraint, contactTypeRangeAddressList);}private void setValidation(Sheet sheet, DataValidationHelper helper, DataValidationConstraint constraint, CellRangeAddressList addressList) {DataValidation validation = helper.createValidation(constraint, addressList);validation.setErrorStyle(DataValidation.ErrorStyle.STOP);validation.setShowErrorBox(true);validation.setSuppressDropDownArrow(true);sheet.addValidationData(validation);}public String getRange(int offset, int rowId, int colCount) {char start = (char) ('A' + offset);if (colCount <= 25) {char end = (char) (start + colCount - 1);return "$" + start + "$" + rowId + ":$" + end + "$" + rowId;} else {char endPrefix = 'A';char endSuffix = 'A';if ((colCount - 25) / 26 == 0 || colCount == 51) {// 26-51之间,包括边界(仅两次字母表计算)if ((colCount - 25) % 26 == 0) {// 边界值endSuffix = (char) ('A' + 25);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);}} else {// 51以上if ((colCount - 25) % 26 == 0) {endSuffix = (char) ('A' + 25);endPrefix = (char) (endPrefix + (colCount - 25) / 26 - 1);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);endPrefix = (char) (endPrefix + (colCount - 25) / 26);}}return "$" + start + "$" + rowId + ":$" + endPrefix + endSuffix + "$" + rowId;}}
}

再添加个表头

package com.example.demoeasyexcel.jilian3;import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteWorkbookHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.CellRangeAddressList;
import com.alibaba.excel.write.handler.SheetWriteHandler;import java.util.List;
import java.util.Map;public class CascadeWriteHandler3 implements SheetWriteHandler {private List<String> provinceList; // 省份列表private Map<String, List<String>> cityMap; // 省份与城市的映射private Map<String, List<String>> districtMap; // 城市与区的映射private String[] contactTypes = new String[]{"手机", "座机", "呼机"}; //public CascadeWriteHandler3(List<String> provinceList, Map<String, List<String>> cityMap, Map<String, List<String>> districtMap) {this.provinceList = provinceList;this.cityMap = cityMap;this.districtMap = districtMap;}@Overridepublic void beforeSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {// 此处代码在创建Sheet前,通常为空}@Overridepublic void afterSheetCreate(WriteWorkbookHolder writeWorkbookHolder, WriteSheetHolder writeSheetHolder) {Workbook workbook = writeWorkbookHolder.getWorkbook();Sheet sheet = writeSheetHolder.getSheet();// 创建标题行并合并单元格Row titleRow = sheet.createRow(0); // 创建第一行作为标题行titleRow.setHeightInPoints(2 * sheet.getDefaultRowHeightInPoints()); // 设置行高为默认的两倍Cell titleCell = titleRow.createCell(0); // 在第一行第一个单元格中设置标题titleCell.setCellValue("人员信息\n完整的"); // 设置标题内容,并添加换行// 设置单元格样式为左对齐并自动换行CellStyle titleStyle = workbook.createCellStyle();titleStyle.setAlignment(HorizontalAlignment.LEFT); // 设置水平对齐为左对齐titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 设置垂直对齐为居中titleStyle.setWrapText(true); // 设置自动换行titleCell.setCellStyle(titleStyle); // 应用样式到单元格// 合并标题行的单元格sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, 3));// 设置列标题Row headerRow = sheet.createRow(1);headerRow.createCell(0).setCellValue("省");headerRow.createCell(1).setCellValue("市");headerRow.createCell(2).setCellValue("区");headerRow.createCell(3).setCellValue("联系方式");// 设置列宽以便显示标题sheet.setColumnWidth(0, 256 * 16); // 设置"省"的列宽sheet.setColumnWidth(1, 256 * 16); // 设置"市"的列宽sheet.setColumnWidth(2, 256 * 16); // 设置"区"的列宽sheet.setColumnWidth(3, 256 * 16); // 设置"联系方式"的列宽// 创建隐藏的Sheet存放省市区数据Sheet hideSheet = workbook.createSheet("siteInfo");workbook.setSheetHidden(workbook.getSheetIndex(hideSheet), true);// 省份列表处理逻辑int rowNum = 0;Row provinceRow = hideSheet.createRow(rowNum++);provinceRow.createCell(0).setCellValue("省份列表");for (int i = 0; i < provinceList.size(); i++) {provinceRow.createCell(i + 1).setCellValue(provinceList.get(i));}// 城市列表处理逻辑for (String province : provinceList) {List<String> cities = cityMap.get(province);Row cityRow = hideSheet.createRow(rowNum++);cityRow.createCell(0).setCellValue(province);for (int i = 0; i < cities.size(); i++) {cityRow.createCell(i + 1).setCellValue(cities.get(i));}Name cityRangeName = workbook.createName();cityRangeName.setNameName(province);String cityRange = getRange(1, rowNum, cities.size());cityRangeName.setRefersToFormula("siteInfo!" + cityRange);}// 区列表处理逻辑for (String city : cityMap.values().stream().flatMap(List::stream).toArray(String[]::new)) {List<String> districts = districtMap.get(city);Row districtRow = hideSheet.createRow(rowNum++);districtRow.createCell(0).setCellValue(city);for (int i = 0; i < districts.size(); i++) {districtRow.createCell(i + 1).setCellValue(districts.get(i));}Name districtRangeName = workbook.createName();districtRangeName.setNameName(city);String districtRange = getRange(1, rowNum, districts.size());districtRangeName.setRefersToFormula("siteInfo!" + districtRange);}// 省份数据验证DataValidationHelper dvHelper = sheet.getDataValidationHelper();DataValidationConstraint provinceConstraint = dvHelper.createExplicitListConstraint(provinceList.toArray(new String[0]));CellRangeAddressList provinceRangeAddressList = new CellRangeAddressList(2, 1000, 0, 0);setValidation(sheet, dvHelper, provinceConstraint, provinceRangeAddressList);// 城市数据验证for (int i = 3; i <= 1000; i++) {DataValidationConstraint cityConstraint = dvHelper.createFormulaListConstraint("INDIRECT($A$" + i + ")");CellRangeAddressList cityRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 1, 1);setValidation(sheet, dvHelper, cityConstraint, cityRangeAddressList);}// 区数据验证for (int i = 3; i <= 1000; i++) {DataValidationConstraint districtConstraint = dvHelper.createFormulaListConstraint("INDIRECT($B$" + i + ")");CellRangeAddressList districtRangeAddressList = new CellRangeAddressList(i - 1, i - 1, 2, 2);setValidation(sheet, dvHelper, districtConstraint, districtRangeAddressList);}// 联系方式数据验证DataValidationConstraint contactTypeConstraint = dvHelper.createExplicitListConstraint(new String[]{"手机", "座机", "呼机"});CellRangeAddressList contactTypeRangeAddressList = new CellRangeAddressList(2, 1000, 3, 3);setValidation(sheet, dvHelper, contactTypeConstraint, contactTypeRangeAddressList);}// 其他辅助方法和类成员不变private void setValidation(Sheet sheet, DataValidationHelper helper, DataValidationConstraint constraint, CellRangeAddressList addressList) {DataValidation validation = helper.createValidation(constraint, addressList);validation.setErrorStyle(DataValidation.ErrorStyle.STOP);validation.setShowErrorBox(true);validation.setSuppressDropDownArrow(true);sheet.addValidationData(validation);}public String getRange(int offset, int rowId, int colCount) {char start = (char) ('A' + offset);if (colCount <= 25) {char end = (char) (start + colCount - 1);return "$" + start + "$" + rowId + ":$" + end + "$" + rowId;} else {char endPrefix = 'A';char endSuffix = 'A';if ((colCount - 25) / 26 == 0 || colCount == 51) {// 26-51之间,包括边界(仅两次字母表计算)if ((colCount - 25) % 26 == 0) {// 边界值endSuffix = (char) ('A' + 25);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);}} else {// 51以上if ((colCount - 25) % 26 == 0) {endSuffix = (char) ('A' + 25);endPrefix = (char) (endPrefix + (colCount - 25) / 26 - 1);} else {endSuffix = (char) ('A' + (colCount - 25) % 26 - 1);endPrefix = (char) (endPrefix + (colCount - 25) / 26);}}return "$" + start + "$" + rowId + ":$" + endPrefix + endSuffix + "$" + rowId;}}
}
package com.example.demoeasyexcel.jilian3;import com.alibaba.excel.EasyExcel;
import com.example.demoeasyexcel.jilian.CascadeVO;
import com.example.demoeasyexcel.jilian2.CascadeWriteHandler2;import java.io.File;
import java.util.*;public class Test33 {public static void main(String[] args) {List<CascadeVO> dataList = new ArrayList<>();/// 准备省市aqu测试数据List<String> provinceList = Arrays.asList("apro1", "apro2", "apro3");Map<String, List<String>> cityMap = new HashMap<>();cityMap.put("apro1", Arrays.asList("acity11", "acity12"));cityMap.put("apro2", Arrays.asList("acity21", "acity22"));cityMap.put("apro3", Arrays.asList("acity31", "acity32"));Map<String, List<String>> districtMap = new HashMap<>();districtMap.put("acity11", Arrays.asList("aqu111", "aqu112"));districtMap.put("acity12", Arrays.asList("aqu121", "aqu122"));districtMap.put("acity21", Arrays.asList("aqu211", "aq212"));districtMap.put("acity22", Arrays.asList("aqu221", "aqu222"));districtMap.put("acity31", Arrays.asList("aqu311", "aqu312"));districtMap.put("acity32", Arrays.asList("aqu321", "aqu322"));// 创建写入的SheetFile file = new File("D:\\data\\test.xlsx");EasyExcel.write(file).sheet("sheet1").registerWriteHandler(new CascadeWriteHandler3(provinceList, cityMap, districtMap)).doWrite(dataList);}
}

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

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

相关文章

【Java 进阶篇】Java Web 开发之 JQuery 快速入门

嗨&#xff0c;各位小伙伴们&#xff01;欢迎来到 Java Web 开发的继续学习之旅。在前面的博客中&#xff0c;我们学习了 Servlet、JSP、Filter、Listener 等基础知识&#xff0c;今天我们将进入前端领域&#xff0c;学习一下如何使用 JQuery 来简化和优化我们的前端开发。 1.…

SpringBoot_01

Spring https://spring.io/ SpringBoot可以帮助我们非常快速的构建应用程序、简化开发、提高效率。 SpringBootWeb入门 需求&#xff1a;使用SpringBoot开发一个web应用&#xff0c;浏览器发起请求/hello后&#xff0c;给浏览器返回字符串"Hello World~~~"。 步骤…

学习pytorch15 优化器

优化器 官网如何构造一个优化器优化器的step方法coderunning log出现下面问题如何做反向优化&#xff1f; 官网 https://pytorch.org/docs/stable/optim.html 提问&#xff1a;优化器是什么 要优化什么 优化能干什么 优化是为了解决什么问题 优化模型参数 如何构造一个优化器…

企业计算机中了mkp勒索病毒怎么办,服务器中了勒索病毒如何处理

计算机技术的不断发展给企业的生产生活提供了极大便利&#xff0c;但也为企业带来了网络安全威胁。近期&#xff0c;云天数据恢复中心陆续接到很多企业的求助&#xff0c;企业的计算机服务器遭到了mkp勒索病毒攻击&#xff0c;导致企业的所有工作无法正常开展&#xff0c;给企业…

自动化测试测试框架封装改造

PO模式自动化测试用例 PO设计模式是自动化测试中最佳的设计模式&#xff0c;主要体现在对界面交互细节的封装&#xff0c;在实际测试中只关注业务流程就可以了。 相较于传统的设计&#xff0c;在新增测试用例后PO模式有如下优点&#xff1a; 1、易读性强 2、可扩展性好 3、…

Windows查看端口占用情况

Windows如何查看端口占用情况 方法1. cmd命令行执行netstat命令&#xff0c;查看端口占用情况 netstat -ano 以上命令输出太多信息&#xff0c;不方便查看&#xff0c;通过如下命令搜索具体端口占用情况&#xff0c;例如&#xff1a;8080端口 netstat -ano | findstr "…

Ubuntu LTS 坚持 10 年更新不动摇

Linux 内核开发者 Jonathan Corbet 此前在欧洲开源峰会上宣布&#xff0c;LTS 内核的支持时间将从六年缩短至两年&#xff0c;原因在于缺乏使用和缺乏支持。稳定版内核维护者 Greg Kroah-Hartman 也表示 “没人用 LTS 内核”。 近日&#xff0c;Ubuntu 开发商 Canonical 发表博…

VB.NET—Bug调试(参数话查询、附近语法错误)

目录 前言: BUG是什么&#xff01; 事情的经过: 过程: 错误一: 错误二: 总结: 前言: BUG是什么&#xff01; 在计算机科学中&#xff0c;BUG是指程序中的错误或缺陷&#xff0c;它通过是值代码中的错误、逻辑错误、语法错误、运行时错误等相关问题&#xff0c;这些问题…

基于51单片机RFID射频门禁刷卡系统设计

**单片机设计介绍&#xff0c; 基于51单片机RFID射频门禁刷卡系统设计 文章目录 一 概要二、功能设计设计思路 三、 软件设计原理图 五、 程序程序 六、 文章目录 一 概要 基于51单片机RFID射频门禁刷卡系统&#xff0c;是一种将单片机技术和射频标识技术应用于门禁控制系统的…

文心耀乌镇,“大模型之光”展现了什么?

“乌镇的小桥流水&#xff0c;能照见全球科技的风起云涌。” 多年以来&#xff0c;伴随着中国科技的腾飞&#xff0c;以及世界互联网大会乌镇峰会的连续成功举办&#xff0c;这句话已经成为全球科技产业的共识。乌镇是科技与互联网的风向标、晴雨表&#xff0c;也是无数新故事开…

Install Nginx in Linux

Nginx是一款轻量级的Web服务器、反向代理服务器&#xff0c;由于它的内存占用少&#xff0c;启动极快&#xff0c;高并发能力强&#xff0c;在互联网项目中广泛应用。 1.yum 安装 nginx [rootVM-8-7-centos nginx]# yum install -y nginx Loaded plugins: fastestmirror, lang…

36 Gateway网关 快速入门

3.Gateway服务网关 Spring Cloud Gateway 是 Spring Cloud 的一个全新项目&#xff0c;该项目是基于 Spring 5.0&#xff0c;Spring Boot 2.0 和 Project Reactor 等响应式编程和事件流技术开发的网关&#xff0c;它旨在为微服务架构提供一种简单有效的统一的 API 路由管理方式…

puzzle(1612)拼单词、wordlegame

目录 拼单词 wordlegame 拼单词 在线play 找出尽可能多的单词。 如果相邻的话&#xff08;在任何方向上&#xff09;&#xff0c;你可以拖拽鼠标从一个字母&#xff08;方格&#xff09;到另一个字母&#xff08;方格&#xff09;。在一个单词中&#xff0c;你不能多次使用…

Linux输入与输出设备的管理

计算机系统中CPU 并不直接和设备打交道&#xff0c;它们中间有一个叫作设备控制器&#xff08;Device Control Unit&#xff09;的组件&#xff0c;例如硬盘有磁盘控制器、USB 有 USB 控制器、显示器有视频控制器等。这些控制器就像代理商一样&#xff0c;它们知道如何应对硬盘…

Nacos入门到运行-超详细~windwos

&#x1f4da;目录 ⚙️简介:⚡️Nacos下载⌛解压到文件⚙️配置信息☘️修改 application.properties ⛵运行程序☘️安全问题☄️程序出现问题查看方式 ⛳Nacos开启鉴权⚡️跳过Token获取数据⚓接口请求&#xff1a; ✍️结束&#xff1a; ⚙️简介: Nacos:正如官网说的,一个…

机器学习——逻辑回归

目录 一、分类问题 监督学习的最主要类型 二分类 多分类 二、Sigmoid函数 三、逻辑回归求解 代价函数推导过程&#xff08;极大似然估计&#xff09;&#xff1a; 交叉熵损失函数 逻辑回归的代价函数 代价函数最小化——梯度下降&#xff1a; ​编辑 正则化 四、逻辑…

测试人员如何通过AI提高工作效率!

随着AI技术的兴起&#xff0c;像OpenAI推出的ChatGPT、Microsoft发布的Microsoft 365 Copilot、阿里的通义千问、百度的文心一言、华为的盘古大模型等。很多测试人员开始担心&#xff0c;岗位是否会被AI取代&#xff1f;其实取代你的不是AI&#xff0c;而是会使用AI的测试人&am…

xlua游戏热更新(C#访问lua)

xlua作为Unity资源热更新的重要解决方案api&#xff0c;在Tecent重多游戏中被采用&#xff0c;本文通过案例去讲解xlua代码结构层次。 /** Tencent is pleased to support the open source community by making xLua available.* Copyright (C) 2016 THL A29 Limited, a Tence…

Google Firebase PHP实现消息推送

获取key的方法&#xff1a; 登录谷歌开发者后台 https://console.firebase.google.com/?hlzh-cn function firebaseNotice($title,$body){$token_arr[token1,token2]; //用户的firebasetoken列表$notify_msg ["notification" > ["title" > $title…

【网络编程】网络层——IP协议

文章目录 基本概念路径选择主机和路由器 IP协议格式分片与组装网段划分IP地址的数量限制私网IP地址和公网IP地址深入认识局域网路由 基本概念 TCP作为传输层控制协议&#xff0c;其保证的是数据传输的可靠性和传输效率&#xff0c;但TCP提供的仅仅是数据传输的策略&#xff0c…