Data analysis learning notes (6) -- random walk

This example completes simple mathematical statistics work by simulating some random numbers as an experience of later data analysis Random walk: randomly generate 1 or - 1 random number to imitate a person's advance or retreat In this environment, some statistical work is carried out Random walk Do some preparations for the home ...

Posted by canabatz on Thu, 02 Apr 2020 07:17:50 -0700

CountDownTimer source code analysis

Countdown function, for example: send SMS verification code countdown. 1 public class CountDownTimerActivity extends Activity { 2 3 private Button mSend; 4 private SendCountMessage mCountMessage; 5 6 @Override 7 protected void onCreate(Bundle savedInstanceState) { 8 super.onCreate(savedInstanceState); 9 ...

Posted by mattyj10 on Thu, 02 Apr 2020 06:11:51 -0700

Wannanly challenge 13 D. Apple's birthday conclusion, greedy

Give the ratio t (0.5 - > 1) and the initial number of cakes n(1000), then give the size of N cakes (integer, 1e6) Now you can cut a cake into two pieces of any size The target state is that the size of the smallest cake is not less than t times the size of the largest cake. How many knives do you need to cut at least? Da ...

Posted by NINTHTJ on Thu, 02 Apr 2020 05:31:08 -0700

RxJava2 operator (1)

RxJava is a library of asynchronous, event based programs that use observable sequences on the Java VM. In short, it's the asynchronous operation tool library. It can be used to keep the code simple when it comes to complex asynchronous functions. RxJava uses the Observer mode. The observable and the Observer implement the sub ...

Posted by webosb on Wed, 01 Apr 2020 19:03:51 -0700

Analysis of Redis source code -- implementation of SDS

Implementation of SDS SDS is a simple dynamic string. It is one of the basic data structures of Redis and has a wide range of uses Overview of basic functions function function Complexity sdsnewlen Create SDS from given string O(N) sdslen Return string length O(1) sdsdup Copy an SDS O(N) sdsfree ...

Posted by Fantast on Wed, 01 Apr 2020 16:19:05 -0700

LeetCode series 15. 3Sum (JavaScript)

Q: Title Link: 3Sum First look at the requirements:   Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain duplicate triplets. For example, given array S = [-1, 0, 1, 2, - ...

Posted by r.smitherton on Wed, 01 Apr 2020 15:25:07 -0700

5.3Python function (3): indefinite length position parameter & indefinite length keyword parameter

@Variable length position parameter Use the location parameter defined by * arg_name to represent any multiple location parameters; In Python standard library, * args is used to name indefinite length position parameter. Of course, we can customize this name; The type of indefinite length position parameter is tuple; In the ...

Posted by Destramic on Wed, 01 Apr 2020 12:59:59 -0700

C + + Learning note 14 -- operator overloading in C + +

The concept of operator overloading Overloading in C + + can extend the function of operators Operators are overloaded in the form of functions Nature: extending the function of operators with special functions Define special functions through the operator keyword * * overload operators Syntax: // Sign is a predefine ...

Posted by Toboe on Wed, 01 Apr 2020 11:28:18 -0700

Oracle 12C creates indexes for partial partitions of partitioned tables

Sometimes we need to create indexes for some partitions. Oracle 11g provides this function. You can create local and global indexes on partial partitions. Global partial index: only those partitions that need to be indexed will be indexed, and other partitions will not be created. Local index: if index is turned on fo ...

Posted by jacko on Wed, 01 Apr 2020 09:45:30 -0700

js motion buffer motion

1. When calculating the speed, you must remember to round, because pixels are the smallest unit that the computer can receive, so if it is 299.9px, the computer will think it is 299px, and the computer will not round you. 2. Buffer movement: gradually slow down, and finally stop. The farther away, the faster. That is, speed is ...

Posted by abnfire on Wed, 01 Apr 2020 06:01:22 -0700