Object oriented advanced extend,instanceof keyword and method rewriting
Three characteristics of object-oriented: inheritance, encapsulation and polymorphism
inherit
Inheritance makes it easier to implement class extensions. For example, if we define a human, then we only need to extend the human to define the Boy class. The code reuse is realized, and don't need to rein ...
Posted by devarishi on Thu, 30 Jan 2020 06:15:35 -0800
while loop of python learning notes
python learning notes (8) while loop
1. while cycle
In the previous blog, we have learned about the for loop. Here we introduce another loop, while.
The syntax of while is very simple. According to its English definition "when...", as long as the following conditional statements of while are ...
Posted by SheepWoolie on Thu, 30 Jan 2020 03:29:17 -0800
Start and call of Spring Boot
[eye]
1. A way to start Spring BootService startup class
package com.npc.rest;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ImportResource;
/**
* Frozen
* 2020-1-29
*/
/**
* Previously, users used three annotations to ...
Posted by blakey on Wed, 29 Jan 2020 07:39:19 -0800
Difference between Synchronized and Static Synchronized
By analyzing these two usages, we can understand the concept of lock in java. One is instance lock (lock on an instance object, if the class is a single instance, then the lock also has the concept of global lock). The other is global lock (the lock is for a class, no matter how many objects are instance, then the thread shares the lock). The i ...
Posted by Syphon on Tue, 28 Jan 2020 06:59:34 -0800
JavaScript syntax: error handling mechanism
1. Error Instance Object
When JavaScript parses or runs, the engine throws an error object whenever an error occurs.JavaScript natively provides the Error constructor, and all errors thrown are examples of this constructor.
var err = new Error('Error');
console.log(err.message); // "Error"
...
Posted by seavolvox on Mon, 27 Jan 2020 21:58:28 -0800
How to use locally installed packages in node modules?
How to use the local version of the module in node.js. For example, in my application, I installed coffee script:
npm install coffee-script
This will install it in. / node \ u modules, while the coffee command is in. / node \ u modules /. Bin / coffee. Can I run this command when I am in the project's home folder? I guess I'm looking for ...
Posted by nerya on Mon, 27 Jan 2020 02:23:08 -0800
[Django] Django RestFramework framework
Install RestFramework
$ pip install djangorestframework
# settings.py
INSTALLED_APPS = (
...
'rest_framework',
)
Create Serializer class
from rest_framework import serializers
from .models import Book, Author, Publisher
class AuthorSerializer(serializers.Serializer):
id = serializers.IntegerFie ...
Posted by CodeJunkie88 on Sun, 26 Jan 2020 06:50:58 -0800
Python crawler: crawling Bilibili video (. m4s)
This article is for reference only:Bili Bili video capture
The video capture of station b is still relatively difficult. Compared with the video capture of other websites, it is also relatively difficult because of my curiosity and fear of death. I intend to analyze and analyze the video of station b. t ...
Posted by prcollin on Sun, 26 Jan 2020 03:43:16 -0800
Basic course of matplotlib
The original idea of doing this tutorial is: Although plt.plot(x,y) is a simple and convenient way, there are many detailed requirements for drawing tutorials involving academic paper, which need to further fine tune the pictures, and at this time, it needs to constantly Baidu Baidu, not to mention writ ...
Posted by fred2k7 on Sun, 26 Jan 2020 00:03:57 -0800
Countdown display and control
This may happen during the development of foreground functions:
For a list of multiple order commodities, click view details, which contains the countdown of the corresponding commodity activity time. If you click view instead of refreshing the entire page, you need to close the countdown when you view the details and return t ...
Posted by LordShryku on Fri, 24 Jan 2020 07:49:20 -0800