Python generates a pair of RSA keys and saves the public and private keys as .pem files respectively. Use the public key in the generated RSA key pair to encrypt the data, and then use the private key to decrypt. Convert RSA’s public key exponent (E) and modulus (N) to .pem format

You can use the cryptography library to generate a pair of RSA keys and save the public and private keys as .pem files respectively. Here is a sample code: from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import serialization from cryptography.hazmat.primitives.asymmetric import rsa # Generate RSA key pair private_key = rsa.generate_private_key( public_exponent=65537, key_size=2048, backend=default_backend() ) # Get […]

IsolarAB exports arxml to Matlab/Simulink to generate the model and configure the memory partition

This article uses a simple example to illustrate how to import the SWC arxml designed by Isolar into simulink to generate a model, and specify that the code generated by simulink has memory partition information. The SWC created in this article is called ECAS_Sensor_SWC. Its main function is to process sensor signals and pass them […]

java uses geotools to export shp files

The SHP format is a vector data format used to store geographic information system (GIS) data. SHP files consist of a series of ordered files. The shp files we export include .shp, .shx, .dbf, .prj and .fix files. .shp (shape) file: stores vector map data and records the spatial location information of each feature. .shx […]

Onnx export swin transformer

1. Configure the swin transformer environment according to the repo. https://github.com/microsoft/Swin-Transformer 2. Create the file export.py in the repo directory. run `python export.py –eval –cfg configs/swin/swin_based_patch4_window7_224.yaml –resume ../weights/swin_tiny_patch4_window7_224.pth –data-path data/ –lock_rank 0` # ———————————————– ———- #SwinTransformer # Copyright (c) 2021 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ze […]

OpenMMlab exports the yolov3 model and uses onnxruntime and tensorrt for inference

Export onnx file Use script directly import torch from mmdet.apis import init_detector, inference_detector config_file = ‘./configs/yolo/yolov3_mobilenetv2_8xb24-ms-416-300e_coco.py’ checkpoint_file = ‘yolov3_mobilenetv2_mstrain-416_300e_coco_20210718_010823-f68a07b3.pth’ model = init_detector(config_file, checkpoint_file, device=’cpu’) # or device=’cuda:0′ torch.onnx.export(model, (torch.zeros(1, 3, 416, 416),), “yolov3.onnx”, opset_version=11) The exported onnx structure is as follows: The output is the output of three different levels of detection heads. If you […]

2. Import and export of docker images

Directory Overview docker common commands download Export Import image Finish Overview Docker common commands The commands used in this chapter are summarized here, with use cases following. Command Function docker images Show images docker rmi $(docker images -q) Delete all images on the system docker rmi -f Force deletion of multiple images: docker rmi -f […]

Detailed process of pure front-end export to Excel (including export by column + table with style + table merge + table nested table + two sheets in Chinese and English)

1. Foreword The vue project is a pure front-end export to Excel. The data structure array contains arrays to export Excel according to the required columns. Using the xlsx-populate plug-in, the exported Excel file: with borders, first column merging, nested tables, and Chinese generation respectively. and english two worksheets. The effect of exporting the table […]

Export using easyExcel in springBoot

pom dependency <dependency> <groupId>com.alibaba</groupId> <artifactId>easyexcel</artifactId> <version>3.3.2</version> </dependency> Controller layer //The method return value is void when exported @PostMapping(“/exportQAData”) public void exportQAData(String startDate, String endDate, HttpServletResponse response) {<!– –> qADataManageService.exportQAData(response, startDate,endDate); } Service layer @Component @Slf4j public class QADataManageService implements FileExportService<QADataManageVo> {<!– –> /** * Declare and obtain dao layer instance */ @Autowired private QADataManageDao qADataManageDao; […]