Extended application of Object method for ES6 knowledge point arrangement

In ES6, some extensions and optimizations have been made for the object-oriented methods. The following is a brief summary of the commonly used methods is method to judge whether two objects are equal console.log(Object.is({},{}), {} === {}); // false, false console.log(Object.is(NaN,NaN), NaN === NaN); // true, false c ...

Posted by Chris.P on Sun, 05 Apr 2020 04:31:33 +0200

Deep analysis of Hikic.js lazy loading

This article focuses on the lazy loading method in Hikic.js and how to implement it First, we create a new html file and write the basic structure: <!DOCTYPE> <html> <head> <title>about Hikic.js Depth analysis of lazy loading</title> <meta charset="UTF-8"> </head> <body& ...

Posted by Lustre on Sun, 05 Apr 2020 01:37:58 +0200

Background data request in node.js mock, axios

<! -- Axios handles the cross domain background configuration 1. Install cnpm install -- save dev Axios 2.Introduce axios To project or component(Current component use only) --> // Using axios requests Axios.get("/getuser") .then(res => { //succss console.log(res.data.result); }) .catch(error => { //error ...

Posted by petrb on Sat, 04 Apr 2020 11:58:38 +0200

Source code analysis of Django rest framework (3) -- throttling

Add throttling Custom throttling method Limit access to 3 times within 60s (1) Create a new throttle.py under the API folder. The code is as follows: # utils/throttle.py from rest_framework.throttling import BaseThrottle import time VISIT_RECORD = {} #Save access records class VisitThrottle(BaseThrottle): '''60s Can only ...

Posted by synical21 on Sat, 04 Apr 2020 10:06:33 +0200

Leave confirmation customization in react Route 4

In some applications, the product requirements are as follows: for example, when the user jumps to the route, the user needs to be prompted that the data of the current page has not been saved, and the user needs to be prompted to leave for confirmation. The general effect is as follows: image.png Previous router router pract ...

Posted by dnast on Sat, 04 Apr 2020 06:30:56 +0200

Python learning notes (10) Python collection (2)

Common methods of collection add() adds an element to the collection. If the element already exists in the collection, the method will fail 1 >>> help(set.add) 2 Help on method_descriptor: 3 4 add(...) 5 Add an element to a set. #Add an element to the collection 6 7 This has no effect if the element is already prese ...

Posted by insub2 on Fri, 03 Apr 2020 21:07:50 +0200

SAX parsing XML case Demo(2)

I. Introduction Create a new class XmlParseHandler.java, which needs to inherit DefaultHandler or implement ContentHandler interface. Here we inherit DefaultHandler (implement ContentHandler interface), which is the core of SAX parsing. We need to rewrite the following methods we care about. startDocument(): called at the beginning of docume ...

Posted by Crusader on Fri, 03 Apr 2020 09:06:33 +0200

Solutions to conflicts when Android Scrollview nesting ViewPager + Fragment

Start with the final rendering (the image is not very clear): The top ad uses ConvenientBanner, which has little to do with this article. Only show the effect. In fact, we use NestedScrollView to achieve the above effect. There are several problems when nesting viewpagers with NestedScrollView: 1. Fragment s in vi ...

Posted by Bikkebakke on Fri, 03 Apr 2020 00:03:51 +0200

Simple implementation of listener in java web

Today, I relearned the basic listener technology of java web, and used sessionListener to simply count the number of people online (one bug is that when the web page is closed, the session will not be closed and still exists, unless the server is closed). The code is as follows (the front-end web page code will not be displayed): LoginServlet.j ...

Posted by lukegw on Thu, 02 Apr 2020 16:08:24 +0200

Development of React Native -- component Text

Preface Text component is a basic component in React. It is similar to TextView component on Android. It is used to display text. Besides basic display layout, this control can be nested, styled, and event handling functions can be added. Basic Usage Attribute method Here I just give some more commonly used attribute method ...

Posted by Mesden on Thu, 02 Apr 2020 14:06:38 +0200