Attribute summary of beautifusop utility method

I. object There are four important objects in Beautifulsoup: Tag, tag, can get tag text, attribute Beautifulsop, inherited from Tag, so it can basically use Tag's methods NavigableString, text string Comment, comment 2. Create a beautifulsop object 2.1 create by string from bs4 import BeautifulSoup html = """ <html><head><tit ...

Posted on Tue, 26 Nov 2019 06:54:13 -0500 by 2levelsabove

Java learning note 10 - Concurrent container class

Implementation of reasoning HashMap Data to store Data structure involved: array, linked list, stack, tree, queue Inserting and finding arrays Sequential search: insert in sequence when inserting, and compare by polling scan when searching. Binary search: sort when inserting; divide n elements into roughly equal parts to reduce complexity. ...

Posted on Tue, 26 Nov 2019 00:11:32 -0500 by tecdesign

Java learning note 8-lock related

The concept of lock in Java Spin lock: in order not to give up the CPU execution time, CAS mechanism is used to update the data until success. Pessimistic lock: assume that there will be concurrent conflicts, synchronize all related operations on data, and lock from the beginning of reading data. Optimistic lock: assuming there is no conflict, ...

Posted on Tue, 26 Nov 2019 00:04:57 -0500 by lampquest

Java learning note 7 - atomic operation of thread safety

Before we talk about atomic operation, we will talk about the following concepts: race condition, critical region, shared resource and immutable object. Competitive condition and critical region Multiple threads access the same resources. When writing to these resources, the execution order is required. Critical area: the internal area of incr ...

Posted on Tue, 26 Nov 2019 00:04:42 -0500 by Alith7

Java build Redis connection pool tool class

Redis is an open-source log and key value database written in ANSI C language, complying with BSD protocol, supporting network, memory based and persistent, and provides API s in multiple languages. During the encoding process, there may be a large amount of computation or fetching, which exceeds the timeout set by the HTTP protocol. This needs ...

Posted on Mon, 25 Nov 2019 14:00:58 -0500 by CKPD

How to deal with Empty Mono

stay Reactor Sometimes we need to do some specific business logic for empty mono < T > in programming. Here's a non reactor Code: public void oldCheck(Token token) { if (token == null) { // business logic return; } if (token.isExpired) { // business logic return; } // business logic return; } If you were to cha ...

Posted on Mon, 25 Nov 2019 13:33:37 -0500 by EsOne

springboot uses RestTemplate+httpclient connection pool to send http messages

brief introduction RestTemplate is a template object that spring supports to request http rest service, which is a bit like JDBC template in nature Spring is the core class used to synchronize the client side, which simplifies the communication with HTTP services and satisfies the RestFul principle. The program code can provide it with a UR ...

Posted on Mon, 25 Nov 2019 12:44:58 -0500 by jdnet

springboot uses RestTemplate+okhttp connection pool to send http messages

1, introduction OkHttp is an efficient HTTP client, which allows all requests with the same host address to share the same socket connection; connection pool reduces request delay; transparent GZIP compression reduces the size of response data; caches response content to avoid some completely repeated requests When there is a problem in the n ...

Posted on Mon, 25 Nov 2019 10:22:37 -0500 by adelinewss

springboot learning: springboot quickly integrates Mybatis components

MyBatis @[toc] brief introduction Advantage The biggest advantage is that SQL statements are flexible, suitable for tuning scenarios and complex business scenarios Inferiority The biggest disadvantage is the migration between different databases Introducing the mybatis component Add to pom.xml <dependency> <groupId>mysql</gr ...

Posted on Mon, 25 Nov 2019 06:15:27 -0500 by DigitalDesign

ES6 foundation - extension of ES6

String extension, regular extension, numerical extension, function extension, object extension, array extension. Development environment preparation: Editor (VS Code, Atom, Sublime) or IDE (Webstorm) Browser's latest Chrome String extension: Template string, some new methods, new unicode representation and traversal methods: Some new string met ...

Posted on Mon, 25 Nov 2019 04:54:50 -0500 by antileon