• Leetcode-010-regular expression matching


    Regular Expression Matching Title Description: give you a string s and a character rule P. please implement a regular expression matching that supports’. ‘and’ * ‘. ‘.’ matches any single character‘*’ matches zero or more preceding elementsThe so-called matching is to cover the whole string s, not part of the string. See leetcode’s official website […]

  • A tool class that compares whether floats are equal


    Compare floats for equality Why not directly compare = = but write a method to compare? Because floating-point numbers are stored in the calculator in binary mode, there will be a problem of precision loss. For example:Floating point number16777216The binary of is0-10010111-00000000000000000000000Floating point number16777217The binary of is0-10010111-00000000000000000000000So the two are equal Specific reasons can refer […]

  • str_ Replace and preg_ Performance comparison of replace


    Environment: centos7, php7.2.6 Only compare the same function. Using the novel mother_ West_ Wind’s_ Children.txt, 155kb in size, all in English.       Using STR_ Replace function to replace string, time consuming: 0.017s 0.014s 0.018s 0.020s 0.017s The average use time was 0.0172 s   Using preg_ Replace function to replace string, time consuming: […]

  • This is HTTP’s three handshakes and four waves


    Taking the state confirmation scene of common conversations in life as the starting point, this paper interprets three handshakes and four waves of HTTP easily. HTTP three handshakes 1. The client sends a status confirmation query to the server (the first handshake); 2. The server confirms the status and asks the client for the status […]

  • The DFS solution of leetcode 123, 188 stock trading problem template


    The common point of these two problems is that there is a limit on the number of transactions, that is to say, there are two states changing: I (the current date is the index of the array) and K. Here, the state of DFS is found, that is, the parameter of DFS function:function dfs (i,k){} […]

  • Leetcode 309, 714 stock problem, including fees and frozen period, DFS template solution


    The common point of these two questions is that the status has only date (only date)iThe change of array index will lead to the change of resulti 。 Do this kind of problem, as long as you can write the DFS solution, and then optimize on the basis of it, you will pass the test. […]

  • RefineDet


    Refinedet can be regarded as the combination of SSD, RPN and FPN algorithms. Its main idea is: fast RCNN and other two stage algorithms regress the box twice, so the precision is high, but the speed is slow; Yolo and other one stage algorithms regress the box only once, which is fast, but the precision […]

  • String of algorithm — longest common prefix


    1. Longest common prefix difficultysimple Write a function to find the longest common prefix in a string array.If there is no public prefix, return an empty prefix””。 Example 1:Input: [flower “,” flow “,” flight “]Output: “FL” Example 2:Input: [dog “,” racecar “,” car “]Output:Explanation: input does not have a public prefix. The idea at the […]

  • Kafka replica synchronization (II)


    In the previous section, we talked about ISR, how to judge the synchronization between segment follower replica and leader replica, and related concepts (HW, Leo). Today, we will take a look at the detailed synchronization process between follower replica and leader replica, but the synchronization process mentioned in this section has disadvantages. In the new […]

  • Prototype and love hate of proto


    Original: https://blog.crimx.com/2017/0 After the last “six barriers of JavaScript this”, I found that story making was a little addictive, and the memory effect was also good. Ha ha, continue to nag todayprototypeAnd__proto__Love and hate. First, understand the essential difference between the two,prototypeIt is unique to function and is set artificially;__proto__All objects are inherited. Then let’s […]

  • Oracle view the real usage of table space


    –View real usage of tablespaces set linesize 500 pagesize 500 col tablespace_name format a25 col TP_REAL_GB format a15 col TP_REAL_FREE_GB format a20 select all_tp.TP_NAME “TABLESPACE_NAME”, to_char(trunc(all_tp.TP_ALL_SIZE_KB / 1024 / 1024, 2), ‘FM9999990.0099’) “TP_REAL_GB”, to_char(trunc(free_tp.TP_FREE_SIZE_KB / 1024 / 1024, 2), ‘FM9999990.0099’) “TP_REAL_FREE_GB”, (to_char(trunc(all_tp.TP_ALL_SIZE_KB / 1024 / 1024, 2), ‘FM9999990.0099’) – to_char(trunc(free_tp.TP_FREE_SIZE_KB / 1024 / 1024, 2), […]