Simple data verification using JavaScript
Using JS to complete simple data verification
requirement analysis
Use JS to complete the simple data verification of the registration page. It is not allowed to leave the user name or password blank
technical analysis
from form property -- onsubmit must have a return value. If it is true, the submit is successful. If it is false, it cannot be ...
Posted by guayaquil on Tue, 05 May 2020 18:15:24 +0200
spring cloud learning note 4 (request merge processing)
The dependency in microservice architecture is realized by remote call, and the most common problem in remote call is communication consumption and connection number occupation. In the case of high concurrency, due to the increase of communication times, the total communication time consumption will become less ideal. At the same time, due to t ...
Posted by wescrock on Tue, 05 May 2020 11:13:49 +0200
Full introduction to Java array (2)
Example analysis
1. Pass in a value in the function and find the corresponding array corner
public class Rewriter {
public static int fun(int num) {
int[] a =new int[] {1,2,3,4,5};
for (int i = 0; i < a.length; i++) {
if (a[i] == num) {
return i;
}
...
Posted by cs.punk on Tue, 05 May 2020 04:00:28 +0200
golang validates the data format of struct field
Suppose we have the following structure:
type User struct {
Id int
Name string
Bio string
Email string
}
We need to verify the validity of the fields in the structure:
· the value of Id is in a range.
· the length of Name is in the range of none.
· Email format is correct.
We might writ ...
Posted by brent123456 on Mon, 04 May 2020 08:10:43 +0200
RadioButton display multi line implementation in RadioGroup (very simple)
RadioGroup display multiline implementation steps
Radio buttons wrapped in radio group are characterized by radio selection and mutual exclusion, which are often used in projects.
If RadioButton implements multi line display, it will lose its original feature.
On the Internet, most of them are customized to deal wi ...
Posted by TheBrandon on Mon, 04 May 2020 03:04:34 +0200
YModem protocol learning
YModem transmission mode: YModem, YModem-1K, YModem-g.
In YModem-1k, the standard 128 byte transmission is replaced by 124 byte information fast transmission, and CRC teaching and research is used to ensure the accuracy of data transmission.
YModem-g cancels the CRC check code of the data, and after sending a data block information, ...
Posted by markjia on Sun, 03 May 2020 16:44:28 +0200
Hdu-6070 divide rati line tree + fractional programming
Title:
Give you an array, find an interval to minimize the ratio of the number of different numbers in the interval to the length of the interval.
Solution:
This is a classic score planning problem. Considering the dichotomy answer K, our goal is to find an interval to make Val / len < = k, Val is the number of d ...
Posted by mjm7867 on Sun, 03 May 2020 12:42:18 +0200
Chapter 10 alds1 ﹣ 9 ﹣ B: maximum heap
Knowledge points
Maximum heap: for all nodes i, the key value is less than or equal to the key value of the parent node
Question link
ALDS1_9_B: Maximum Heap
Question content
For sequence A, the maximum heap is realized by using the property of the maximum heap
thinking
For A sequence A containing n el ...
Posted by Misery_Kitty on Sun, 03 May 2020 04:28:52 +0200
Common application algorithms of Java basic 5-array
Common algorithms
1. Bubble sorting:
Principle: compare two adjacent elements and exchange the elements with large values to the right end
Example:
public static void bubbleSort(int[] a) {
int n = a.length;
//In total n-1 Comparison of wheels
for (int i = 1; i < n; i++) {
for (int j = 0; j < n - i; j++) {
...
Posted by Cogen2 on Sun, 03 May 2020 01:33:51 +0200
Luogu P3383 [template] linear sieve prime number (Miller_Rabin)
Title Description
For example, given a range n, you need to deal with the question of whether a certain number M is a prime number (each number is in the range 1-N)
I / O format
Input format:
The first row contains two positive integers, N and M, which represent the range and number of queries respectively.
Next, each row of row M conta ...
Posted by majocmatt on Sat, 02 May 2020 06:41:25 +0200