poi 发表于 2019-04-04 更新于 2024-03-24 分类于 blog 本文字数: 116 阅读时长 ≈ 1 分钟 坑123456789101112131415161718// 这里定义的row的长度,超过这个长度导出异常Workbook workbook = new SXSSFWorkbook(500);import org.apache.poi.ss.usermodel.Sheet;Sheet sheet = workbook.createSheet(sheetName);// SXSSFWorkbook的SXSSFSheet没有实现合并单元格// 此处为poi源码@NotImplemented@Overridepublic void shiftRows(int startRow, int endRow, int n){ throw new RuntimeException("NotImplemented");}// 现改为XSSFWorkbook workbook = new XSSFWorkbook();XSSFSheet sheet = workbook.getSheetAt(0); 样式定义123456789101112// 边框CellStyle defStyle = workbook.createCellStyle();defStyle.setBorderTop(BorderStyle.THIN);defStyle.setBorderLeft(BorderStyle.THIN);defStyle.setBorderBottom(BorderStyle.THIN);defStyle.setBorderRight(BorderStyle.THIN);// 顶端对齐CellStyle topStyle = workbook.createCellStyle();// clone默认样式topStyle.cloneStyleFrom(defStyle);// 设置新的样式topStyle.setVerticalAlignment(VerticalAlignment.TOP);
hexo 发表于 2019-04-01 更新于 2024-03-24 分类于 blog 本文字数: 179 阅读时长 ≈ 1 分钟 hexo blog init添加搜索组件12345$ npm install hexo-cli -g$ hexo init blog$ cd blog$ git clone https://github.com/theme-next/hexo-theme-next themes/next$ npm install hexo-generator-searchdb --save 创建页面12345$ hexo g -w$ hexo server$ hexo new page categories$ hexo new page tags$ hexo new page about hexo配置1234567search: path: search.xml field: post format: html limit: 10000# 图片资源post_asset_folder: true 主题配置12345678910local_search: enable: trueback2top: enable: true # Back to top in sidebar. sidebar: true # Scroll percent label in b2t button. scrollpercent: truescheme: Gemini 图片资源1hexo new page 12{% asset_img hexo.svg hexo %}![hexo](hexo/hexo.jpg) deploy12345678910111213Example: deploy: type: sftp host: <host> port: [port] # Default is 21 user: <user> pass: <pass> # leave blank for paswordless connections privateKey: [path/to/privateKey] # Optional passphrase: [passphrase] # Optional agent: [path/to/agent/socket] # Optional, defaults to $SSH_AUTH_SOCK remotePath: [remotePath] # Default is `/` forceUpload: [boolean] # default is false concurrency: [number] # Max number of SFTP tasks processed concurrently. Default to 100.