Dichotomy search summary and best practice

(I) use scenarios Usually in the ordered numbers, find a number that meets certain conditions Multiple questions It needs to be traversed many times and has a large amount of data (II) basic process Determine the boundary (low, high) value To determine the boundary moving condition, write only one side moving (low=mid hig ...

Posted by terrabull on Mon, 09 Dec 2019 08:46:57 -0800

Thread learning note 2: worker threads in thread pool

This note is excerpted from: https://www.cnblogs.com/zhili/archive/2012/07/18/ThreadPool.html Record the learning process for future reference. I. thread pool Foundation First of all, it takes a lot of time to create and destroy threads. Second, too many threads also waste memory resources. Therefore, creating too many threads through Thread cl ...

Posted by dlkinsey85 on Mon, 09 Dec 2019 07:57:56 -0800

Quick sort demonstration - from small to large key operation "record subscript, use recursion"

Quick sorting analysis: for the operation of array subscript, it is necessary to pay attention to the initial value setting of conditional loop variable and the judgment of loop end condition, and pay attention to the multivariable control of conditional structure. Sometimes it's very convoluted and requires more proficiency, so mo ...

Posted by zevious on Sun, 08 Dec 2019 22:19:26 -0800

input(type='file ') upload multiple photos and display them to the background

The following content is the result of network excerpt and practice modification. If it is the same, please understand!!!!   1. First, the front-end page code: Where, < input type = "file" id = "file_input" name = "filepath" multiple = "multiple" / >, the multiple attribute needs to be set <styl ...

Posted by noise on Sun, 08 Dec 2019 21:25:56 -0800

Summary of learning about anti shake and throttle

debounce When users interact with web pages, they often request and send data to the server according to the status and data of the page, such as real-time verification according to the user's input data, pull-down request data, etc. if the user operates too frequently, the page status and data change too frequently, they will make multiple req ...

Posted by pnj on Sun, 08 Dec 2019 12:33:25 -0800

TopK Question: What is TopK Question?TopK is implemented using heap and fast exhaust

Directory 1. What is Top K Question 2. The actual application scenario of Top K 3. Code implementation of Top K problem and its efficiency comparison 1. Implement Top K by heap 2. Implement Top K with Quick Row 3. Efficiency comparison of TopK by heap or fast-pad   * Body 1. What is Top K problem? Given an unordered array of length N, output th ...

Posted by Azala on Sun, 08 Dec 2019 11:43:06 -0800

Lesson 3 of initial python

Reference source: Vitu.AI Today, let's look at the use of Boolean. Boolean types in Python are represented by two constants, True and False. x = True print(x) print(type(x)) Unlike the example above, which assigns True to x, we usually don't put True and False directly in the code, but get the Boolean value through some operational comparison, ...

Posted by greenCountry on Sun, 08 Dec 2019 07:59:15 -0800

MySql table partition (based on datetime)

timestamp type partition, please move = > MySql table partition (based on time timestamp)Environmental Science:MySQL 8.0.18 (unverified for 5.6 and 5.7)The field type of partition condition is datetimeThe complete sql operation table partition statement is as follows: -- 1.Delete table drop table t_test; -- ============================== ...

Posted by Brokenhope on Sun, 08 Dec 2019 03:47:37 -0800

If the php script execution process does not exit within 30 minutes, kill these php script processes

The online script content is as follows:[root@localhost ~]# cat /data/scripts/check_php.sh #!/bin/bash Date=`date "+%Y-%m-%d %H:%M:%S"` Num=$(ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_syc_img*|setcache*"|grep -v grep |wc -l) Pid=$(/bin/ps -ef|egrep "countjs_syc_site*|countjs_syc_plan*|countjs_syc.php|countjs_ ...

Posted by billf2007 on Sat, 07 Dec 2019 18:48:28 -0800

Function corrilization -- six pulse sword

Are you in? It should be. by the way, there's no six pulse sword here, or even it can't compete with the six pulse sword. But the title of this blog post is called this. It's not changed. What's more? Back to the main topic, the functions in javascript are curried, and many articles on the Internet are written in various ways, even with fancy s ...

Posted by Sulman on Sat, 07 Dec 2019 16:36:41 -0800