java: itext8.05 create pdf
只能调用windows 已安装的字体,这样可以在系统中先预装字体,5.0 可以调用自配文件夹的字体文件。CSharp donetItext8.0 可以调用。
/*** encoding: utf-8* 版权所有 2024 ©涂聚文有限公司 言語成了邀功盡責的功臣,還需要行爲每日來值班嗎* 许可信息查看: https://github.com/itext/itext-publications-examples-java/blob/develop/src/main/java/com/itextpdf/samples/sandbox/fonts/FreeSansBold.java* 描述:https://mvnrepository.com/artifact/com.itextpdf/kernel* # Author : geovindu,Geovin Du 涂聚文.* # IDE : IntelliJ IDEA 2023.1 Java 17* # Datetime : 2024 - 2024/11/20 - 20:13* # User : geovindu* # Product : IntelliJ IDEA* # Project : EssentialAlgorithms itext8.05* # File : SimpleItext.java* # explain : 学习 类**/package BLL;//import java.awt.*;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import com.itextpdf.io.font.PdfEncodings;
import com.itextpdf.io.font.TrueTypeFont;
import com.itextpdf.kernel.geom.PageSize;
import com.itextpdf.kernel.colors.Color;
import com.itextpdf.kernel.colors.*;
import com.itextpdf.kernel.colors.gradients.*;
import com.itextpdf.kernel.font.PdfFont;
import com.itextpdf.kernel.font.PdfFontFactory;
import com.itextpdf.kernel.font.*;
import com.itextpdf.kernel.pdf.*;
import com.itextpdf.kernel.pdf.canvas.draw.*;
import com.itextpdf.io.image.ImageData;
import com.itextpdf.io.image.ImageDataFactory;
import com.itextpdf.io.font.FontProgramFactory;
import com.itextpdf.layout.element.*;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.borders.Border;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Image;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.element.Table;
import com.itextpdf.layout.properties.TextAlignment;
import com.itextpdf.layout.properties.UnitValue;
import com.itextpdf.layout.properties.VerticalAlignment;
import com.itextpdf.layout.properties.HorizontalAlignment;
import com.itextpdf.layout.element.Text;
import com.itextpdf.layout.borders.*;
import com.itextpdf.layout.borders.SolidBorder;
import com.itextpdf.io.util.StreamUtil;
import java.io.IOException;
import java.util.List;
import java.util.ArrayList;import java.io.File;
import java.util.HashSet;
import java.util.Set;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.nio.file.Paths;import Model.Orders;public class SimpleItext {private static String USER_PASSWORD = "geovindu";private static String OWNER_PASSWORD = "geovindu";public static final String FONTDIR = "font/";public void test(){try {String fontFile2 = "font/MHeiHK-Light.TTF";String path = "C:/WINDOWS/Fonts/simhei.ttf";//windows里的字体资源路径String getfont="";// Creating a PdfWriter objectString dest = "coloredBorders.pdf";//PdfFont pfont=null;PdfWriter writer = new PdfWriter(dest);// Creating a PdfDocument objectPdfDocument pdfDoc = new PdfDocument(writer);// Creating a Document objectDocument doc = new Document(pdfDoc);PdfFontFactory.registerDirectory(FONTDIR);byte[] bytes;FileInputStream myflie = new FileInputStream(fontFile2);//var is = getClass().getResourceAsStream(fontFile2);bytes = StreamUtil.inputStreamToArray(myflie);//byte[] tem = new byte[myflie.available()];//创建一个长度为myflie长的竹筒//myflie.read(tem);//var pfont = FontProgramFactory.createFont(bytes);//PdfFont pfont = PdfFontFactory.createFont(bytes, PdfEncodings.UTF8);/*Set<String> fonts = new HashSet<String>(FontProgramFactory.getRegisteredFonts());for (String fontname : fonts) {System.out.print(fontname);getfont=fontname;pfont = PdfFontFactory.createRegisteredFont(getfont, PdfEncodings.IDENTITY_H);doc.add(new Paragraph(String.format("Postscript name for %s: %s", getfont,pfont.getFontProgram().getFontNames().getFontName())));}*///PdfFont f2 = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H");PdfFont pfont = PdfFontFactory.createFont(path, PdfEncodings.IDENTITY_H);//PdfFontFactory.EmbeddingStrategy.FORCE_EMBEDDED// Creating a tablefloat[] pointColumnWidths = {200F, 200F};Table table = new Table(pointColumnWidths);// Adding row 1 to the tableCell c1 = new Cell();// Adding the contents of the cellc1.add(new Paragraph("Name").setFont(pfont));// Setting the back ground color of the cellc1.setBackgroundColor(ColorConstants.DARK_GRAY);// Instantiating the Border classBorder b1 = new DashedBorder(ColorConstants.RED, 3);// Setting the border of the cellc1.setBorder(b1);// Setting the text alignmentc1.setTextAlignment(TextAlignment.CENTER);// Adding the cell to the tabletable.addCell(c1);Cell c2 = new Cell();c2.add(new Paragraph("涂聚文").setFont(pfont));c1.setBorder(new SolidBorder(ColorConstants.RED, 3));c2.setTextAlignment(TextAlignment.CENTER);table.addCell(c2);// Adding row 2 to the tableCell c3 = new Cell();c3.add(new Paragraph("Id").setFont(pfont));c3.setBorder(new DottedBorder(ColorConstants.DARK_GRAY, 3));c3.setTextAlignment(TextAlignment.CENTER);table.addCell(c3);Cell c4 = new Cell();c4.add(new Paragraph("001").setFont(pfont));c4.setBorder(new DoubleBorder(ColorConstants.DARK_GRAY, 3));c4.setTextAlignment(TextAlignment.CENTER);table.addCell(c4);// Adding row 3 to the tableCell c5 = new Cell();c5.add(new Paragraph("Designation").setFont(pfont));c5.setBorder(new RoundDotsBorder(ColorConstants.RED, 3));c5.setTextAlignment(TextAlignment.CENTER);table.addCell(c5);Cell c6 = new Cell();c6.add(new Paragraph("Programmer").setFont(pfont));c6.setBorder(new RoundDotsBorder(ColorConstants.RED, 3));c6.setTextAlignment(TextAlignment.CENTER);table.addCell(c6);// Adding Table to documentdoc.add(table);// Closing the documentdoc.close();System.out.println("Borders added successfully..");}catch(IOException oex){oex.printStackTrace();}catch (Exception ex){ex.printStackTrace();}}public void Createpdf(){try{String dem="itextExample.pdf";PdfWriter writer =new PdfWriter(dem);//设置打开文档必码// writer.setEncryption(USER_PASSWORD.getBytes(),//OWNER_PASSWORD.getBytes(), PdfWriter.ALLOW_PRINTING,//PdfWriter.ENCRYPTION_AES_128);String fontFile2 = "font\\MHeiHK-Light.TTF"; // 这个报错: Type of font is not recognizedString path = "C:/WINDOWS/Fonts/simhei.ttf";//windows里的字体资源路径//PdfFont f2 = PdfFontFactory.createFont("STSong-Light", "UniGB-UCS2-H");PdfFont pfont = PdfFontFactory.createFont(path, PdfEncodings.IDENTITY_H);//PdfFontFactory.EmbeddingStrategy.FORCE_EMBEDDED//PdfFont pfont = PdfFontFactory.createRegisteredFont(path, PdfEncodings.IDENTITY_H);PdfDocument pdfDoc = new PdfDocument(writer);Document document = new Document(pdfDoc);//document.setFont(pfont);//document.open();document.add(new Paragraph("Some content here").setFont(pfont).setFontColor(ColorConstants.RED));//Set attributes here//document.("Geovin Du 涂聚文");// document.addCreationDate();//document.addCreator("dusystem.com");//document.addTitle("Set Attribute Example");//document.addSubject("An example to show how attributes can be added to pdf files.");Table table = new Table(3,true); // 3 columns.//table.setHeight(100); //Width 100%//table.setHeight(10f); //Space before table//table.setSpacingAfter(10f); //Space after table//Set Column widths//float[] columnWidths = {1f, 1f, 1f};//table.setHeight(columnWidths);Cell cell1 = new Cell().add(new Paragraph("深圳市").setFont(pfont));cell1.setBorder(new SolidBorder(ColorConstants.BLACK, 1));cell1.setPaddingLeft(10);cell1.setHorizontalAlignment(HorizontalAlignment.CENTER);cell1.setVerticalAlignment(VerticalAlignment.MIDDLE);Cell cell2 = new Cell().add(new Paragraph("南山區").setFont(pfont).setFontColor(ColorConstants.GREEN));cell2.setBorder(new SolidBorder(ColorConstants.BLACK, 1));cell2.setPaddingLeft(10);cell2.setHorizontalAlignment(HorizontalAlignment.LEFT);cell2.setVerticalAlignment(VerticalAlignment.MIDDLE);//.setVerticalAlignment(VerticalAlignment.MIDDLE)Cell cell3 = new Cell().add(new Paragraph("科技園").setFont(pfont));cell3.setBackgroundColor(ColorConstants.RED);cell3.setPaddingLeft(10);cell3.setHorizontalAlignment(HorizontalAlignment.CENTER);cell3.setVerticalAlignment(VerticalAlignment.MIDDLE);table.addCell(cell1);table.addCell(cell2);table.addCell(cell3);// table.complete();document.add(table);List<Orders> orders = new ArrayList<>();Orders order = new Orders();order.setProductId(1); ;order.setProduct("中國電器");order.setQty(50);order.setPrice(52.0);orders.add(order);order = new Orders();order.setProductId(2);order.setProduct ("日本電器");order.setQty(150);order.setPrice(252.0);orders.add(order);//2Table tableData = new Table(5, true);tableData.setBorder(new SolidBorder(ColorConstants.BLACK, 1));tableData.setFont(pfont);Cell headerProductId = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("ID"));Cell headerProduct = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("產品名稱"));Cell headerProductPrice = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("價格"));Cell headerProductQty = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("數量"));Cell headerTotal = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph("合計"));tableData.addCell(headerProductId);tableData.addCell(headerProduct);tableData.addCell(headerProductPrice);tableData.addCell(headerProductQty);tableData.addCell(headerTotal);double grandTotalVal = 0;for(Orders c:orders){Cell productid = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getProductId())));Cell product = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(c.getProduct()));Cell price = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getPrice())));Cell qty = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(c.getQty())));var value = c.getPrice() * c.getQty();Cell total = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(String.valueOf(value)));grandTotalVal += value;tableData.addCell(productid);tableData.addCell(product);tableData.addCell(price);tableData.addCell(qty);tableData.addCell(total);}Cell grandTotalHeader = new Cell(1, 4).setTextAlignment(TextAlignment.RIGHT).add(new Paragraph("合計: ")).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));Cell grandTotal = new Cell(1, 1).setTextAlignment(TextAlignment.LEFT).add(new Paragraph(" " + String.valueOf(grandTotalVal))).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));grandTotal.setBorderBottom(new SolidBorder(ColorConstants.BLACK, 1));tableData.addCell(grandTotalHeader);tableData.addCell(grandTotal);//tableData.complete();document.add(tableData);Table tablebottom = new Table(4,true);//tablebottom.setBorder(new SolidBorder(ColorConstants.BLACK, 3));tablebottom.setHorizontalAlignment(HorizontalAlignment.CENTER);tablebottom.addCell(new Cell().add(new Paragraph("產品ID").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("名稱").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("書量").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));tablebottom.addCell(new Cell().add(new Paragraph("價格").setFont(pfont)).setBorderTop(new SolidBorder(ColorConstants.BLACK, 3)));//table.setHeaderRows(1);//Cell[] cells = table.getCell(2,3);//for (int j=0;j<cells.length;j++){//cells[j].setBackgroundColor(ColorConstants.BLACK);//}for (Orders s:orders){Cell cel1= new Cell().add(new Paragraph(String.valueOf(s.getProductId()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel1.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel1);Cell cel2=new Cell().add(new Paragraph(s.getProduct()).setFont(pfont)).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel2.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel2);Cell cel3=new Cell().add(new Paragraph(String.valueOf(s.getQty()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel3.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel3);Cell cel4=new Cell().add(new Paragraph(String.valueOf(s.getPrice()))).setBorder(new SolidBorder(ColorConstants.BLACK, 3));cel4.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel4);}Cell cel1= new Cell().add(new Paragraph("3").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)));cel1.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel1);Cell cel2=new Cell().add(new Paragraph("涂聚文").setFont(pfont).setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel2.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel2);Cell cel3=new Cell().add(new Paragraph("333").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel3.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel3);Cell cel4=new Cell().add(new Paragraph("3333").setBorderBottom(new SolidBorder(ColorConstants.BLACK, 3)).setBorderLeft(new SolidBorder(ColorConstants.BLACK, 3)));cel4.setTextAlignment(TextAlignment.CENTER);tablebottom.addCell(cel4);document.add(tablebottom);ImageData imageData = ImageDataFactory.create("geovindu.jpg");Image image1 = new Image(imageData);//Fixed Positioning//image1.setAbsolutePosition(205f, 150f);//Scale to new height and new width of imageimage1.scaleAbsolute(100, 100);//Add to documentdocument.add(image1);document.close();writer.close();} catch (Exception e){e.printStackTrace();}}}
调用:
//SimpleItext itextpdf=new SimpleItext();//itextpdf.test();itextpdf.Createpdf();
相关文章:

java: itext8.05 create pdf
只能调用windows 已安装的字体,这样可以在系统中先预装字体,5.0 可以调用自配文件夹的字体文件。CSharp donetItext8.0 可以调用。 /*** encoding: utf-8* 版权所有 2024 ©涂聚文有限公司 言語成了邀功盡責的功臣,還需要行爲每日來值班…...

如何用通义灵码快速绘制流程图?
使用通义灵码快速绘制流程图?新功能体验 不想读前人“骨灰级”代码,不想当“牛马”程序员,想像看图片一样快速读复杂代码和架构? 通义灵码已经支持代码逻辑可视化,可以把你的每段代码画成流程图。像个脑图工具一样帮你…...

vue 预览pdf 【@sunsetglow/vue-pdf-viewer】开箱即用,无需开发
sunsetglow/vue-pdf-viewer 开箱即用的pdf插件sunsetglow/vue-pdf-viewer, vue3 版本 无需多余开发,操作简单,支持大文件 pdf 滚动加载,缩放,左侧导航,下载,页码,打印,文本复制&…...

Java NIO 核心知识总结
在学习 NIO 之前,需要先了解一下计算机 I/O 模型的基础理论知识。还不了解的话,可以参考我写的这篇文章:Java IO 模型详解。 一、NIO 简介 在传统的 Java I/O 模型(BIO)中,I/O 操作是以阻塞的方式进行的。…...

疑难Tips:NextCloud域名访问登录时卡住,显示违反内容安全策略
[ 知识是人生的灯塔,只有不断学习,才能照亮前行的道路 ] 1使用域名访问Nextcloud用户登录时卡住,显示违反内容安全策略 我使用官方Docker镜像来部署NextCloud 28.0.5,并通过Openresty反向代理Nextcloud,但是在安装后无法稳定工作,每次登录后,页面会卡死在登录界面,无法…...

C 语言学习-06【指针】
1、目标单元与简介存取 直接访问和间接访问 #include <stdio.h>int main(void) {int a 3, *p;p &a;printf("a %d, *p %d\n", a, *p);*p 10;printf("a %d, *p %d\n", a, *p);printf("Enter a: ");scanf("%d", &a)…...

如何快速将Excel数据导入到SQL Server数据库
工作中,我们经常需要将Excel数据导入到数据库,但是对于数据库小白来说,这可能并非易事;对于数据库专家来说,这又可能非常繁琐。 这篇文章将介绍如何帮助您快速的将Excel数据导入到sql server数据库。 准备工作 这里&…...

【人工智能】Python在机器学习与人工智能中的应用
Python因其简洁易用、丰富的库支持以及强大的社区,被广泛应用于机器学习与人工智能(AI)领域。本教程通过实用的代码示例和讲解,带你从零开始掌握Python在机器学习与人工智能中的基本用法。 1. 机器学习与AI的Python生态系统 Pyth…...

使用八爪鱼爬虫抓取汽车网站数据,分析舆情数据
我是做汽车行业的,可以用八爪鱼爬虫抓取汽车之家和微博上的汽车文章内容,分析各种电动汽车口碑数据。 之前,我写过很多Python网络爬虫的案例,使用requests、selenium等技术采集数据,这次尝试去采集小米SU7在微博、汽车…...

什么是事务?事务有哪些特性?
在数据库管理中,事务是一个核心概念,它确保了数据操作的完整性和一致性。本文将探讨事务的定义及其四大特性。 一、事务的定义 事务是数据库操作的最小工作单元,是作为单个逻辑工作单元执行的一系列操作。这些操作作为一个整体一起向系统提…...

玩转合宙Luat教程 基础篇④——程序基础(库、线程、定时器和订阅/发布)
文章目录 一、前言二、库三、线程四、定时器五、订阅/发布5.1 回调函数5.2 堵塞等待一、前言 教程目录大纲请查阅:玩转合宙Luat教程——导读 写一写Lua程序基础的东西。 包括如何调用库,如何创建线程、如何创建定时器,如何使用订阅/发布事件。 二、库 程序从main.lua开始通…...

24.<Spring博客系统①(数据库+公共代码+持久层+显示博客列表+博客详情)>
项目整体预览 登录页面 主页 查看全文 编辑 写博客 PS:Service.impl(现在流行写法) 推荐写法。后续完成项目。会尝试这样写。 接口可以有多个实现。每个实现都可以不同。 这也算一种设计模式。叫做(策略模式)。 我们…...

webp 网页如何录屏?
工作中正好研究到了一点:记录下这里: 先看下效果: 具体实现代码:  <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><meta name"viewport&qu…...

丹摩征文活动|实现Llama3.1大模型的本地部署
文章目录 1.前言2.丹摩的配置3.Llama3.1的本地配置4. 最终界面 丹摩 1.前言 Llama3.1是Meta 公司发布的最新开源大型语言模型,相较于之前的版本,它在规模和功能上实现了显著提升,尤其是最大的 4050亿参数版本,成为开源社区中非常…...

Spring Boot 2 和 Spring Boot 3 中使用 Spring Security 的区别
文章目录 Spring Boot 2 和 Spring Boot 3 中使用 Spring Security 的区别1. Jakarta EE 迁移2. Spring Security 配置方式的变化3. PasswordEncoder 加密方式的变化4. permitAll() 和 authenticated() 的变化5. 更强的默认安全设置6. Java 17 支持与语法提升7. PreAuthorize、…...

【数据结构与算法】 LeetCode:回溯
文章目录 回溯算法组合组合总和(Hot 100)组合总和 II电话号码的字母组合(Hot 100)括号生成(Hot 100)分割回文串(Hot 100)复原IP地址子集(Hot 100)全排列&…...

SpringBoot线程池的使用
SpringBoot线程池的使用 在现代Web应用开发中,特别是在使用Spring Boot框架时,合理使用线程池可以显著提高应用的性能和响应速度。线程池不仅能够减少线程创建和销毁的开销,还能有效地控制并发任务的数量,避免因线程过多而导致的…...

Neural Magic 发布 LLM Compressor:提升大模型推理效率的新工具
每周跟踪AI热点新闻动向和震撼发展 想要探索生成式人工智能的前沿进展吗?订阅我们的简报,深入解析最新的技术突破、实际应用案例和未来的趋势。与全球数同行一同,从行业内部的深度分析和实用指南中受益。不要错过这个机会,成为AI领…...

HttpServletRequest req和前端的关系,req.getParameter详细解释,req.getParameter和前端的关系
HttpServletRequest 对象在后端和前端之间起到了桥梁的作用,它包含了来自客户端的所有请求信息。通过 HttpServletRequest 对象,后端可以获取前端发送的请求参数、请求头、请求方法等信息,并根据这些信息进行相应的处理。以下是对 HttpServle…...

React-useEffect的使用
useEffect react提供的一个常用hook,用于在函数组件中执行副作用操作,比如数据获取、订阅或手动更改DOM。 基本用法: 接受2个参数: 一个包含命令式代码的函数(副作用函数)。一个依赖项数组,用…...

MySQL数据库与Informix:能否创建同名表?
MySQL数据库与Informix:能否创建同名表? 一、MySQL数据库中的同名表创建1. 使用CREATE TABLE ... SELECT语句2. 使用CREATE TABLE LIKE语句3. 复制表结构并选择性复制数据4. 使用同义词(Synonym)二、Informix数据库中的同名表创建1. 使用不同所有者2. 使用不同模式3. 复制表…...

爬虫实战:采集知乎XXX话题数据
目录 反爬虫的本意和其带来的挑战目标实战开发准备代码开发发现问题1. 发现问题[01]2. 发现问题[02] 解决问题1. 解决问题[01]2. 解决问题[02] 最终结果 结语 反爬虫的本意和其带来的挑战 在这个数字化时代社交媒体已经成为人们表达观点的重要渠道,对企业来说&…...

大数据新视界 -- Hive 数据桶原理:均匀分布数据的智慧(上)(9/ 30)
💖💖💖亲爱的朋友们,热烈欢迎你们来到 青云交的博客!能与你们在此邂逅,我满心欢喜,深感无比荣幸。在这个瞬息万变的时代,我们每个人都在苦苦追寻一处能让心灵安然栖息的港湾。而 我的…...

【小白学机器学习33】 大数定律python的 pandas.Dataframe 和 pandas.Series基础内容
目录 0 总结 0.1pd.Dataframe有一个比较麻烦琐碎的地方,就是引号 和括号 0.2 pd.Dataframe关于括号的原则 0.3 分清楚几个数据类型和对应的方法的范围 0.4 几个数据结构的构造关系 list → np.array(list) → pd.Series(np.array)/pd.Dataframe 1 python 里…...

【shodan】(五)网段利用
shodan基础(五) 声明:该笔记为up主 泷羽的课程笔记,本节链接指路。 警告:本教程仅作学习用途,若有用于非法行为的,概不负责。 nsa ip address range www.nsa.gov需科学上网 搜索网段 shodan s…...

LeetCode739. 每日温度(2024冬季每日一题 15)
给定一个整数数组 temperatures ,表示每天的温度,返回一个数组 answer ,其中 answer[i] 是指对于第 i 天,下一个更高温度出现在几天后。如果气温在这之后都不会升高,请在该位置用 0 来代替。 示例 1: 输入: temperatu…...

Node.js的http模块:创建HTTP服务器、客户端示例
新书速览|Vue.jsNode.js全栈开发实战-CSDN博客 《Vue.jsNode.js全栈开发实战(第2版)(Web前端技术丛书)》(王金柱)【摘要 书评 试读】- 京东图书 (jd.com) 要使用http模块,只需要在文件中通过require(http)引入即可。…...

加菲工具 - 好用免费的在线工具集合
加菲工具 https://orcc.online AI 工具 加菲工具 集合了目前主流的,免费可用的ai工具 文档处理 加菲工具 pdf转word、office与pdf互转等等工具都有链接 图片图标 加菲工具 统计了好用免费的在线工具 编码解码 加菲工具 base64编码解码、url编码解码、md5计算…...

.NET9 - 新功能体验(二)
书接上回,我们继续来聊聊.NET9和C#13带来的新变化。 01、新的泛型约束 allows ref struct 这是在 C# 13 中,引入的一项新的泛型约束功能,允许对泛型类型参数应用 ref struct 约束。 可能这样说不够直观,简单来说就是Span、ReadO…...

map和redis关系
Map 和 Redis 都是用于存储和管理数据的工具,但它们在用途、实现和应用场景上有所不同。下面详细解释 Map 和 Redis 之间的关系和区别。 1. Map 数据结构 定义 Map 是一种数据结构,用于存储键值对(key-value pairs)。每个键都是…...