Generate a QR code with text at the bottom of the image inserted in the center

package com.scamel.mom.common.util; import cn.hutool.core.io.resource.ClassPathResource; import com.alibaba.nacos.common.utils.StringUtils; import com.google.zxing.BarcodeFormat; import com.google.zxing.EncodeHintType; import com.google.zxing.MultiFormatWriter; import com.google.zxing.WriterException; import com.google.zxing.common.BitMatrix; import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel; import sun.font.FontDesignMetrics; import javax.imageio.ImageIO; import java.awt.*; import java.awt.font.FontRenderContext; import java.awt.font.LineMetrics; import java.awt.geom.AffineTransform; import java.awt.geom.RoundRectangle2D; import java.awt.image.AffineTransformOp; import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import java.util.HashMap; import java.util.Map; /** * QR code, barcode generation tool */ public class CodeUtils […]

kprobe inserts a pile at a function offset

For symbols, it is easy to find, just look up the kernel symbol table, but if you want to know the offset of a statement in a function relative to the starting address of the function, you still need a certain method. Requirement: How to get the corresponding offset if you want to insert the […]

Word file insert signature or seal picture (original code)

/* * Test report signature * Signature call method * * fileid file id * userid user id * typeid placeholder * gid primary key * code file server encoding * */ @RequestMapping(“insertimages”) public <string> String insertimages(String Fileid, String Userid, String Typeid, String gid, String code) throws Exception { FileInfo fileinfo = (FileInfo) baseDao. get(Fileid, […]

How to insert hundreds of thousands of data in Java (it only takes 13 seconds to insert 300,000 data into MySQL)

This article mainly describes the cases and results of large data volume data insertion through MyBatis, JDBC, etc. 300,000 pieces of data are inserted into the database for verification Entity class, mapper and configuration file definition User entity mapper interface mapper.xml file jdbc.properties sqlMapConfig.xml Stud directly regardless of batches Insert one by one in a […]

Insertion sort – direct insertion sort and Hill sort

Direct insertion sort The idea of direct insertion sorting is: Insert the records to be sorted into an ordered sequence that has been sorted one by one according to the size of their key code values, until all the records are inserted. , get a new ordered sequence . We can first look at the […]

Insert operation of balanced binary tree (AVL tree)

1. Chain storage of AVL tree typedef int ElementType; typedef struct AVLNode *Position; typedef Position AVLTree; struct AVLNode{ ElementType Data;//node data AVLTree Left;//Point to the left subtree AVLTree Right;//point to the right subtree int Height;//tree height }; 2. Rotate left monorotation AVLTree SingleLeftRotation(AVLTree A) { //A must have a left child node B //return the […]