Custom control -- composite control

First look at the renderings The practicability of this control is not considered here, mainly to learn the method of composition control. 1. The first thing to do is to create a layout file testtest.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/an ...

Posted by somo on Sat, 02 May 2020 22:21:12 -0700

Java Implementation of AES ECP PKCS5Padding Encryption and Decryption Tool Class

Java implements an AES/ECB/PKCS5Padding encryption and decryption algorithm tool class Encryption algorithm: AES Mode: ECB Complement method: PKCS5Padding <!-- more --> 1. Tool Classes import lombok.Getter; import lombok.Setter; import lombok.extern.slf4j.Slf4j; import org.springframework.util.Base64Utils; import javax.crypto.Cipher; i ...

Posted by sundawg on Sat, 02 May 2020 22:16:45 -0700

Multiline radio group

demand Implementation method If it is single row or single column, use RadioGroup+RadioButton directly But often the plan can't catch up with the change. The graph given by ui is this kind of multi line single choice One of the ways to think about it is gridview Here we use RecyclerView to encapsulate Finish all the processing, so t ...

Posted by rockroka on Sat, 02 May 2020 19:11:34 -0700

56. (android Development) file read / write operations OpenFileOutput and OpenFileInput

In addition to saving key value data, content can also be saved directly in the form of files in android. Data format can be at will, are in the form of strings in the file. Take the longest txt text file you can see as an example. To read and write files, you need to open them. There are two methods: OpenFileOutput and OpenFileInput The storag ...

Posted by apenster on Sat, 02 May 2020 19:08:17 -0700

Sesame HTTP: the pit of scikit learn Bayesian text classification

Basic steps: 1. Training material classification: I refer to the official directory structure: Put the corresponding text, a txt file and a corresponding article in each directory: as follows   It should be noted that the proportion of all materials should be kept at the same proportion (adjusted according to the training results, the ...

Posted by KevinCB on Sat, 02 May 2020 13:36:22 -0700

Bulk merge PDF files with Python (bookmarking)

On the Internet, I found several softwares that combine pdf, which are not very easy to use. Generally, they don't have the function of bookmarking. I went to find the script of python merging pdf, and found that there was no function of bookmarking. So I wrote a small tool by myself, using PyPDF2, the code is as follows: #!/usr/bin/env py ...

Posted by gwolff2005 on Sat, 02 May 2020 00:12:31 -0700

Struts 2 notes -- File Download

Struts 2 provides the stream result type, which is specifically used to support the file download function. The following four properties are required to configure the result of stream type. contentType: Specifies the file type of the downloaded file inputName: Specifies the entry input stream of the downloaded file contentDispositio ...

Posted by greeneel on Fri, 01 May 2020 21:03:00 -0700

New features of C × 9: code generator, compile time reflection

Preface Today, the official blog of. NET announced the release of the first preview version of C 񖓿 9 source generators, a feature that users have been shouting for nearly 5 years, and finally released today. brief introduction Source Generators, as the name implies, allows developers to get and view user code during code compilation and generat ...

Posted by businessman332211 on Fri, 01 May 2020 14:48:51 -0700

js base64 and canvas base64

1, js base64 Get the uploaded file myfile, create a fileRead file object, and use the readAsDataURL method to encode the read file into a Data URL. After the file is loaded successfully, e.target.result is the base64 encoding corresponding to the file image. The image can be displayed by assigning the src of img directly. <body> & ...

Posted by hardius on Fri, 01 May 2020 14:42:21 -0700

Python string encryption

①base64 Base64 is a method of representing arbitrary binary data in 64 characters. When using Notepad to open exe, jpg, pdf files, we will see a lot of garbled code, because binary files contain many characters that cannot be displayed and printed, so if you want text processing software like Notepad to be able to process binary data, you ne ...

Posted by nasty_psycho on Fri, 01 May 2020 07:38:27 -0700