Python Basics - functions

A function, also known as a method, is a piece of code used to implement a specific functionFunction to improve code reusabilityFunction must be called to executeThe variables defined in the function are local variables. Local variables can only be used in the function and cannot be used outside the functionA function does only one thing import ...

Posted by Riparian on Wed, 20 Nov 2019 07:27:11 -0800

WebApi data validation - model state validation returns all error information, and returns common result classes uniformly,

I. public return class (defined according to the needs of the project, consistent with the normal request data return result class) Note: please expand the generic return class yourself. This article is only an example and only lists one non generic return class. EnumAppCode is an enumeration of error codes. Please define it yourself. usin ...

Posted by tron00 on Wed, 20 Nov 2019 07:03:14 -0800

The use of Pyyaml module in Python

I. what is YAML YAML is a special language for writing configuration files, which is far more convenient than JSON format. The design goal of YAML is to facilitate human reading and writing. YAML is a lighter file format than XML and JSON, and it's simpler and more powerful. It can express structure through indentation. Does it sound like a ...

Posted by agnalleo on Wed, 20 Nov 2019 04:46:16 -0800

Applets encapsulate HTTP requests (for getting started)

Development steps First, we need to create a tool library function to store variables that may change, such as domain name and appkey const config = { api_base_url: 'http://bl.***.pro/v1/', appkey: '' } export { config } Next is the play, which uses a class to encapsulate the public HTTP request method and define the public ...

Posted by mamavi on Tue, 19 Nov 2019 08:05:37 -0800

Master vscode debugging skills

Debugging front-end js Prepare a Front End Project index.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> </ ...

Posted by kruahsohr on Mon, 18 Nov 2019 11:47:12 -0800

Spring Cloud Alibaba Sidecar multilingual microservices heterogeneous

Introduction to Spring Cloud Alibaba Sidecar Since spring cloud Alibaba version 2.1.1, the spring cloud Alibaba sidecar module has been added as a proxy service to indirectly let other languages use spring cloud Alibaba and other related components. Through the route mapping with the gateway, the service can be obtained, and then the Ribbon can ...

Posted by ngubie on Mon, 18 Nov 2019 11:22:19 -0800

Python data interpretation of the most popular bread in Jingdong

Preface   What's the best brand of bread to sell? What is the most popular taste? I believe that every friend who likes bread will care about these problems. By crawling the bread data of Jingdong, on the one hand, this paper answers all kinds of questions about bread before, on the other hand, it brings you a complete data r ...

Posted by mechamecha on Mon, 18 Nov 2019 11:01:58 -0800

JavaScript manipulating JSON objects

JSON(JavaScript Object Notation) is a lightweight data exchange format, which is completely independent of the language text format. It is an ideal data exchange format. At the same time, JSON is a native JavaScript format, which means that you don't need any special API or toolkit to process JSON data in JavaScript. 1. Declare ...

Posted by NiallThistle on Mon, 18 Nov 2019 10:50:23 -0800

Filter in spring cloud Zuul

1. Import dependency information. Since Zuul depends on feign and hystrix, you need to import the corresponding package <!--Add to Eureka Client dependency--> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId> ...

Posted by davidjam on Mon, 18 Nov 2019 09:35:34 -0800

Reverse a certain autumn aviation algorithm

@TOC Reverse a certain autumn aviation algorithm According to packet capturing analysis, each page request of an autumn app will first send a request to / ECMember/secretKey/getSecret, most likely to obtain the key. The request and response are both base64 encoded ciphertext. Capture analysis Decompile Here we open it with jebAs you can see fr ...

Posted by luca200 on Mon, 18 Nov 2019 08:52:03 -0800