• ## The python implementation turns the even number in the list into its square

Time：2021-10-13

I’ll stop talking nonsense. Let’s look at the code directly~ ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #Write a program to turn the even number in the list into his square def word_len(s):   # s = [i ** 2 for i in s if i % 2 […]

• ## The problem of auto balancing when the nodes of echart graph are deleted

Time：2021-10-3

Project scenario: Project scenario: a node X and Y in the echarts diagram are fixed,To center the same column, which stipulates:The current column has an odd number of elements, and the new nodes are put down. When there are even numbers of nodes, the new nodes are put up。 Problem Description: If you delete an […]

• ## Game SG

Time：2021-9-21

Three classical game problems Bash game: there is only a pile of N stones. A and B take turns to take 1 ~ m stones each time. Finally, the winner will win Wizov game: there are two piles of stones, a and B take turns. You can take any one (at least one) from a […]

• ## Go brush questions every week for the fourth week

Time：2021-9-16

Start the leetcode series of dynamic programming. Self supplement related to theoretical knowledge points, old rules, or start with simple topics. Leetcode70 This is an entry-level topic. Find the total number of methods for N steps. When you reach the last step n, there are only two situations, one is from n-1 (one step) and […]

• ## Clever use of Python for in

Time：2021-8-31

import random Ou = “even”Ji = “odd”a = range(1,11) x = 0 while x < 10: list = random.sample(a,10) print(list) if list % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list % 2 != 0: print(ji, end=”,”) else: print(ou, end=”,”) if list […]

• ## Golang exercise, reversing slices

Time：2021-8-17

package main import ( “fmt” ) func main() { var s1 []int = []int{1,2,3,4,5,6} var s2 []int = []int{1,2} rotate(s1) rotate(s2) fmt.Println(s1) fmt.Println(s2) } func rotate(s []int){ left,rigth := 0,0 If len (s)% 2 = = 0{// judge whether the length is odd or even, and determine the center of rotation according to this left […]

• ## [Special Topics in number theory] finding prime pairs, a / B + C / D

Time：2021-8-16

Finding prime pairs Goldbach guesses that everyone knows something. We don’t want to prove this conclusion now, but want to take out an even number arbitrarily from the number set that can be expressed in the program language to find two prime numbers so that the sum is equal to the even numberIf this fact […]

• ## How to calculate pi with C language π（ Three methods)

Time：2021-7-2

Topic 1: Calculation by Formula 1 π It is required to accumulate until the last term is less than 10 ^ (- 6). Program code: #include #include #include int main(){ float s=1; float pi=0; float i=1.0; float n=1.0; while(fabs(i)>=1e-6){ pi+=i; n=n+2; //The design here is very clever. The sign is different every time s=-s; i=s/n; […]

• ## Sharding JDBC is used to separate database and table, and read and write are separated

Time：2021-4-11

Sub database and sub table Why do we have to divide the database and table? The amount of data in the database is uncontrollable. With the development of time and business, there are more and more data in the table. If you curd the database table again, it will cause performance problems. In order to […]

• ## In a word, it’s a recurrence

Time：2021-3-22

Modification record: 2021.2.6 The format of the problem is unified 2021.2.3 At the end of the article, we add the recursive review link of big brother Ah, what is recursion? Namely: fromKnownreachunknown。Using observation to find the previous known data, we can get the conclusionRecurrence formulaAnd then the recursive formula is used to solve the problem. […]

• ## C practical exercise topic 3

Time：2021-2-20

Title:An integer, after adding 100, is a complete square number, and then 168 is a complete square number. What is the number? Program analysis: Suppose the number is X. 1. Then: x + 100 = N2, x + 100 + 168 = m2 2. Calculation equation: M2 – N2 = (M + n) (M – […]

• ## Using translate (- 50%, – 50%) causes text blur

Time：2021-1-3

When writing a toast component, the text on the component will become blurred. It is found that the toast uses thetransform: translate(-50%, -50%); ↑It’s the same ↑What it looks like after using translate In the process of reproduction, it is found that there is no blurring problem in Firefox, but there will be blurring problems […]