offer rotation array

Moving the first elements of an array to the end of an array is called array rotation. Input a rotation of a non decreasing sort array and output the smallest element of the rotated array. For example, if the array {3,4,5,1,2} is a rotation of {1,2,3,4,5}, the minimum value of the array is 1. NOTE: all elements given are greater than 0. If th ...

Posted by Zoofu on Thu, 09 Jul 2020 09:01:58 -0700

js image lazy loading

js image lazy loading Created by Marydon on 2018-04-14 08:15 1. Usage scenarios When a large number of images need to be loaded on the web page, if all the images are loaded at one time, the loading time of the web page will be too long; The web page itself has been very slow. If you need to quote ...

Posted by 182x on Tue, 30 Jun 2020 01:45:14 -0700

VBScript script language foundation

VBScript script language foundation 2.1 introduction of vbs script language 2.2 the first vbs scripting language - hello world Open Notepad program, fill in the edit window, save the file extension as. vbs dialog box: Input box inputbox("please input the length of the first edge", &quo ...

Posted by DJTim666 on Mon, 29 Jun 2020 19:26:57 -0700

Exception capture and regular expression usage in python

Exception capture 1. What is exception capture """ The program can continue to run if there is an exception in the process of program execution. Note: you don't need to use exception capture all the time. You should use it when you know that there may be an exception in a certain place and you don' ...

Posted by rsmarsha on Mon, 29 Jun 2020 18:35:21 -0700

Understanding of parallel pipeline

Ideas sharing Now there are two variables i,j. to calculate the result value of (i+j)*i/2, we can first find that each step of the calculation depends on the result of the previous step. For example, we have to add, then multiply, and then divide. It seems that we can't split it into parallel. This is ...

Posted by d00dle on Sun, 28 Jun 2020 21:46:56 -0700

python multi process explanation

python multitasking process 1, First demo 2, Queue 3, Process Pool 4, Case: file copying 5, Summary 1, First demo Process: after a program runs, the resource used by code + is called process, which is the basic unit of non allocated resources of the operating system. Multitasking completed by t ...

Posted by 2paulm on Sun, 28 Jun 2020 20:35:19 -0700

Python from a line to 30 lines of code within the fun of project recommendations! [continuous update]

catalog A line of code to realize the cardioid pattern Two lines of code to make special dynamic QR code Four lines of code generate exclusive word cloud: Draw polygonal lines in five lines of code: Ten lines of code to draw sunflower: Twenty lines of code to realize the game of Jingzi chess 2 ...

Posted by zoran on Sat, 27 Jun 2020 19:15:05 -0700

Playing with Stream in Java 8

Playing with Stream in Java 8 By litesky Link: http://www.jianshu.com/p/11c925cdba50 I believe you have heard about Java8 Stream, but you may not be able to use it or you are not familiar with it. This article will take you to use it from scratch, step by step, and lead you to the peak of Stream. Operator What are operators? Operator is a k ...

Posted by michibk on Sat, 27 Jun 2020 19:14:03 -0700

Design pattern principle

Design pattern principle 1. Overview One object should have the least knowledge of other objects The closer the relationship between class and class, the greater the coupling degree Demeter principle is also known as the least known principle, that is, the less a class knows about its own dependent c ...

Posted by evo4ever on Fri, 26 Jun 2020 21:22:54 -0700

[Learning Notes] FHQ-Treap

Balanced Tree and FHQ-Treap A balanced tree (i.e. a balanced binary search tree) is a series of metaphysical operations that keep the binary search tree (BST) in a more balanced state and prevent it from degenerating under certain data (when BST has monotonic insertion values, the tree is unbalanced and degenerates into \(\mathcal{O}(n)\) once ...

Posted by spidie on Fri, 26 Jun 2020 17:35:58 -0700