Tag:negative

  • Increase decrease sequence

    Time:2022-4-20

    Increase decrease sequence The ultimate goal is to make the whole sequence equal There is only one operation to make\([l,r]\)Interval all\(+1\) Since the whole sequence is equal, theDifferenceSequence should be 0 Operation can be transformed into\(a[l]+=1,a[r+1]-=1\) The minimum number of operations is required Through the original sequence, we first find an original difference sequence, and […]

  • The balance tree is not easy to hit? Try trie dictionary tree!

    Time:2022-4-2

    WOC, what if the examination room (interview) forgets to hit the balance tree? Trie saved your life Text only published inBlog Garden, this article is pirated without permission in other places. Algorithm import As we all know, the balance tree is difficult to hit (except for the big guys) and is always adjusted wrong. If […]

  • I used data analysis to uncover the last fig leaf of the Chinese men’s basketball team

    Time:2022-2-23

    The United States only ranked seventh, which really verified Kobe Bryant’s sentence: “the United States, don’t think you’re stable.”. As like as two peas, the service fault made me think of the 10 days ago that Zhou Qi’s service was wrong. (sighs) Then I remembered the scene of the Chinese men’s basketball team‘s life and […]

  • C serial 25 – modulus, type conversion, increment and decrement, expression

    Time:2022-2-17

    1、 Special points of modular operation If negative numbers are included, how will the computer calculate them If the divisor is negative, the remainder is negative; If the divisor is positive, the remainder is positive give an example: 11%5=1 ; 11%(-5)=1 ; -11%5=-1 ; -11%(-5)=-1 In any case, it can be transformed into a% B […]

  • Tell redis-02 to your girlfriend

    Time:2022-2-12

    1、 Spring boot integrates redis 1. Introduce dependencyThe corresponding dependencies are introduced according to the version of springboot. The version adopted in this paper is 2.4.5 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> <!– If this dependency is not introduced, redis will report an error when the project starts the connection. The error message is as follows — […]

  • It’s too strong. Xiaobai can also become a dark horse by integrating the basic essence of Java that big manufacturers and cattle have learned

    Time:2022-2-6

    Today’s sharing begins. Please give us more advice~ We have already talked about annotation, identifier, data type and type conversion. Today we will continue to explain the remaining basic knowledge points of Java, including type conversion, variables, constants, operators and so on. Don’t say much, the text begins! Type conversion Because Java is a strongly […]

  • JS random scrambling array

    Time:2022-1-22

    How to realize the random disorder of JS object array? Solution: arr.sort(()=>Math.random() – 0.5) The comparison function has two parameters, and its return value determines the relative position of the two values. When it is positive, the first value changes to the second value, and then it is negative or 0 without changing the position.

  • How can spring boot quickly configure multiple redis data sources

    Time:2021-12-5

    brief introduction The main application scenario of redis multiple data sources is that multiple data sources need to be usedredisServer or use multipleredisLibrary, this paper usesfastdepRely on the integration framework for rapid integrationRedisMultiple data sources and integrationlettuceThe connection pool only needs to be created after the dependency is introducedyamlConfigure the connection information of multiple data […]

  • Multidimensional array sorting

    Time:2021-11-20

    Sample array $arr = [ [‘key1’=> 940, ‘key2’=>’blah’], [‘key1’=>23, ‘key2’=>’this’], [‘key1’=>894, ‘key2’=>’that’] ]; Custom sort function Receive two parameters The return value indicates which parameter should be first If a negative number or false is returned, the first one comes first (note positive and reverse order) If a positive number or true is returned, the […]

  • [JavaScript] string common methods

    Time:2021-11-19

    Some common methods of string recording toUpperCase()Convert characters to uppercase format toLowerCase()Convert to lowercase trim()Remove blank,trimLeftLeft,trimRightright charAt(num)Get single character 1. Intercept string slice(start,end)Return the intercepted part, start subscript, negative number starts from the tail, and end subscript substring(start,stop)Start subscript, stop optional, must be a non negative integer substr(start,length)Start start subscript, length optional length,Important: ECMAScript does […]

  • On the common methods of horizontal and vertical centering of elements in CSS

    Time:2021-11-1

    (1) The first method: use absolute positioning + outer margin (set position as absolute positioning, set left and top as 50% of the parent element respectively, and set the upper outer margin and left outer margin as half of their own height and width, and negative values) position:absolute; left:50%; top:50%; margin-top:-height/2px; margin-left:-width/2px; (2) The second […]

  • Differences between MySQL: int (10) and int unsigned

    Time:2021-11-1

    Let’s first understand what both mean int(10) Set the byte length of int type to 10. The default value range size of int type is:-2147483648 and 2147483647。 unsigned Set int type cannot be negative. Create a MySQL table for demonstration Create test in demo int (10) CREATE TABLE `test-in` ( `id` int(10) NOT NULL AUTO_INCREMENT, […]