vue writes a component

I have been working on the front end for several years. As more and more projects are being done, I need to make some wheels for my own use. vue has been used for more than a year, which can be used initially. Now I want to encapsulate a cascade pop-up window by myself. Before, most of the components written in vue were used: parameter names ar ...

Posted on Thu, 17 Oct 2019 00:15:54 -0400 by sam2004

Canvas drawing a pixel wind electronic clock

The idea is to draw a number of small squares on Canvas. The first step is to realize the method of drawing small squares. First, draw a 10x10 square with a side length of 5, which can be easily completed by using two for loops. 1 for (let i = 0; i < 10; i++) { 2 for (let j = 0; j < 10; j++) { 3 context.fillRect(5 * i, 5 ...

Posted on Wed, 16 Oct 2019 21:51:01 -0400 by Tracekill

Summer training - Quick Sorting - beyond light years

Quick sort 1. i++,j --; what's the difference between putting it in the if statement and putting it outside? void qsort(long m,long n){ long i=m,j=n; long mid=a[(i+j)/2]; do{ while(a[i]>mid) i++; while(a[j]<mid) j--; if(i<=j){ long temp=a[i]; ...

Posted on Wed, 16 Oct 2019 18:17:31 -0400 by arundathi

React installation steps

Install global webpack first cnpm i webpack@3.8.1 -g //Or when a specific project has a specified version of webpack, which version can be installed npm i webpack@3.8.1 -g Install the web pack that development depends on cnpm i webpack@3.8.1 -D npm i webpack@3.8.1 -D Install async if not used in the p ...

Posted on Wed, 16 Oct 2019 13:16:21 -0400 by daniel_lee_hill

30 seconds of code - Array learning

Original address: https://github.com/30-seconds... permutations Generates an array of all permutations of array elements, including duplicates. For an array with length of 2, the result is returned directly; for an array with length less than 2, the original array is returned directly. For other length arrays, first use Array.prototype.reduce() ...

Posted on Wed, 16 Oct 2019 09:09:16 -0400 by nelsons

leetcode446. Arithmetic Slices II - Subsequence

Subject requirements A sequence of numbers is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same. For example, these are arithmetic sequences: 1, 3, 5, 7, 9 7, 7, 7, 7 3, -1, -5, -9 The following sequence is not arithmetic. 1, 1, 2, 5, 7 A zero-indexed array A ...

Posted on Tue, 15 Oct 2019 09:05:44 -0400 by CyberGarage

Reading Notes in JavaScript Regular Expressions Minibook

Regular basis Common abbreviations Character set Specific meaning Memory mode \d Represents [0-9]. Represents a number. Its English is digit. \D Represents [^ 0-9]. Represents any character other than a number. \w Represents [0-9a-zA-Z_]. Represents numbers, upper and lower case letters, and underscores. w is short for word, also know ...

Posted on Tue, 15 Oct 2019 01:00:37 -0400 by suicide-boy

Condition-analysis of learning concurrent programming in java

ConditionObject Condition in ReentrantLock is actually the creation of ConditionObject objects for AQS. The main member variables are Node type first Waiter and last Waiter. As the head and tail nodes, they are one-way linked lists. When await is called, join the queue, signal, join the AQS blocking queue. await method Move the node to the Cond ...

Posted on Mon, 14 Oct 2019 13:21:40 -0400 by susrisha

Where did RocketMQ start to consume when a new consumer group first started?

1. throwing out problems When a new consumer group subscribes to an existing Topic topic, which message does the consumer group begin to consume from that Topic? First, when you look through the API of DefaultMQPushConsumer, the setConsume FromWhere API comes into view. Literally, it is the key to solve this problem to set up where consumers be ...

Posted on Mon, 14 Oct 2019 09:54:36 -0400 by rayk

LeetCode 202: Happy Number

Title: Write an algorithm to determine whether a number is a "happy number". A "happy number" is defined as: for a positive integer, each time the number is replaced by the square of the number at each location, and then the process is repeated until the number becomes 1, or it may be infinite loop but always less than 1. If ...

Posted on Mon, 14 Oct 2019 06:33:03 -0400 by cortez