The fifth day of learning python

4.30 self summary First review 1. View data type #Position of value 10 print(di(10)) #Style of value 10 print(type(10)) 2. Some supplements on variables a=1 b=1 c=1 #a,b,c three kinds of position judgment print(a is b is c) print(id(a)=id(b)=id(c)) a = 10 a is 10 ture #Because 10 is the data in the fixed small integer pool, when python is star ...

Posted on Tue, 19 Nov 2019 14:50:18 -0500 by easethan

Selection and sorting of basic sorting

Algorithm evaluation: Time complexity: square order. Spatial complexity: constant order. Stability: unstable. Applicable data specification modulus: small scale. Relationship between algorithm complexity and data size: Brief description of algorithm principle (for example): A total of n students r ...

Posted on Tue, 19 Nov 2019 14:06:58 -0500 by lordgreg

Selection structure (no.2)

Selection structure (no.2) switch Statements Format: switch (variable / expression){ case literal 1: statement block 1; break; case literal 2: statement block 2; break; ... case literal value n: statement block n; break; default: statement block n+1; } matters needing attention: Value of expression: byte, int, short, cha ...

Posted on Fri, 15 Nov 2019 14:48:20 -0500 by davieboy

Using Baidu ai to realize text and picture audit

Before the platform content release audit, we built a set of prohibited thesaurus by ourselves. In the code, we use thesaurus to judge the content published by users. Now we can use Baidu ai api to complete this function. Let's talk about how to do it First, open Baidu ai development platform to register an account: Register account and enter ...

Posted on Fri, 15 Nov 2019 13:08:27 -0500 by dbakker

Spring5 source code analysis - container refresh - invokeBeanFactoryPostProcessors() method

Last article: Spring 5 source code analysis - container refresh - prepareBeanFactory() method  The main functions of this method are as follows: 1. Instantiate the ConfigurationClassPostProcessor, call the ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry method to complete the parsing of the configuration class, and perform ...

Posted on Tue, 12 Nov 2019 23:59:13 -0500 by tlchung

Source code analysis of spring learning -- refresh of AbstractApplicationContext

Source code analysis of spring learning -- register and scan of annotationconfiguapplicationcontext In, we talked about how to register bean definition in annotation form. After registration, we have bean definition information, of course, initialization container. refresh public void refresh() throws BeansException, IllegalStateException { ...

Posted on Tue, 12 Nov 2019 22:23:57 -0500 by nightowl

Algorithm greedy knapsack problem

For knapsack problem (this is knapsack problem, not 0 / 1 knapsack problem), there are three strategies for greed: 1. Select the most valuable items to put in. 2. Select the one with the least weight from the items. 3. Select the items with large ratio of value to weight. The first one and the second one can not guarantee t ...

Posted on Tue, 12 Nov 2019 14:19:34 -0500 by iimrii

XII. Spring IOC container initialization

IOC container initialization of Spring Preface In the previous section, we analyzed BeanFactory, the lowest IOC container, and then simply analyzed ApplicationContext, a high-level form container. In ApplicationContext, we know a core method, refresh, which is the IOC container initialization process. In the previous section, we did not directl ...

Posted on Tue, 12 Nov 2019 14:01:59 -0500 by manmanman

Pure js - General carousel, card carousel, stacked carousel

Record the process of making the plug-in of the carousel Design sketch General carousel chart Card carousel Stacked carousel General carousel chart Functions: *Can control whether to rotate automatically *Left and right arrows switch from previous to next, throttling treatment *Put the mouse on the arrow, the picture stops rotating automa ...

Posted on Tue, 12 Nov 2019 06:17:57 -0500 by justinjkiss

Getting started with Python 3 concurrent programming

I. Python thread module 1. Thread introduction A standard thread consists of thread ID, current instruction pointer (PC), register set and stack. Thread is an entity in the process, which is the basic unit independently scheduled and dispatched by the system. The thread itself does not have system resources, and shares all the resources of the ...

Posted on Mon, 11 Nov 2019 08:18:09 -0500 by danwatt