Python 3 uses asyncio module asyncio to realize concurrency of coroutines
Python 3 solves many problems of Python 2, such as GIL (Global Interpreter Lock), and introduces many powerful libraries as native libraries. Among them, asyncio libraries are a bright spot, which can be said to be the libraries Python 3 must understand.
Understand the asyncio library: https://www.c ...
Posted by daloss on Tue, 08 Oct 2019 02:38:44 +0200
Summer Training Diary - 8.6 (Codforce)
D. Suitable Replacement
Topic: In the S string? Convert to lowercase letters, so that string S has the largest number of disjoint strings of string T, (letters in S can be exchanged in order)
Solution: Greed
#include<bits/stdc++.h>
#define mp make_pair
using namespace std;
typedef long long ll;
t ...
Posted by Colton.Wagner on Mon, 07 Oct 2019 18:10:27 +0200
Cookie and Session of Django
Cookie
Get Cookie
request.COOKIES['key']
request.get_signed_cookie('key', default=RAISE_ERROR, salt='', max_age=None)
The parameters of get_signed_cookie method:
default: default value
Salt: Encrypted salt
max_age: Background control expiration time
Set Cookie
rep = HttpResponse(...)
rep = render(request, ...)
rep.set_cookie(key,value,...) ...
Posted by johanlundin88 on Mon, 07 Oct 2019 12:53:36 +0200
Design pattern JavaScript implementation
The book Design Patterns, co-published by GoF, provides many solutions to common problems in object-oriented software design. These models have been around for quite a long time and have proved very useful in many cases.
Monomer mode
There is only one instance of a particular class. This means that the second time you create a new object with t ...
Posted by ddragas on Sun, 06 Oct 2019 16:10:42 +0200
Transaction Message Source Interpretation of RocketMQ - Client
Background
Ali's RicketMQ has been castrated in previous versions and re-added in the new version to solve the problem that small companies are unable to make reliable messaging middleware products. At the same time, RocketMQ also refers to the Kafka implementation, and its performance is very good.
Version 2
<dependency>
<groupId& ...
Posted by Jenling on Sat, 05 Oct 2019 03:56:16 +0200
[Android] Initialize every page with JsBridge and WebView
Now there's a requirement: initialize the toolbar in the android interface based on the json passed from the page.
So use JsBridge
Implementation'com.github.lzyzsd: jsbridge: 1.0.4'//js and android interaction framework
Import the JsBridge project, add a webview to the layout, and then come to th ...
Posted by JMair on Sat, 05 Oct 2019 01:54:45 +0200
python Notebook Programming Style Competition
Links to the original text: https://my.oschina.net/kooksee/blog/542430
python Notebook Programming Style Competition
Although my python age is not very high, I would like to share ...
Posted by rich86 on Fri, 04 Oct 2019 18:57:44 +0200
[JavaScript] js Basic Syntax - 2 (Arrays, Functions, Global Variables)
Article directory
1. js array
2. Functions of JS
3. Global and local variables of JS
1. js array
1.Definition:
(1)var arr = [1,2,3]; var arr = [1,"4",true];
(2)Using built-in objects Array
var arr1 = new Array(5);//Define an array with an array length of 5
arr1[0] = "1";
(3)Using built-in obje ...
Posted by k3Bobos on Fri, 04 Oct 2019 13:33:14 +0200
Talk about dubbo's Connection Ordered Dispatcher
order
This article mainly studies dubbo's Connection Ordered Dispatcher.
ConnectionOrderedDispatcher
dubbo-2.7.3/dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/transport/dispatcher/connection/ConnectionOrderedDispatcher.java
public class ConnectionOrderedDispatcher implements Dispatcher {
public static final Stri ...
Posted by petrosa on Fri, 04 Oct 2019 05:57:59 +0200
Python 3 Foundation Package-Numpy's Attributes and Interfaces
1. Exploring attributes
Before doing data analysis, we need to understand our data, then how to view the attributes of the data, the operation is as follows:
a=np.arange(8)
print(a) # Print array
print(a.ndim) # Rank 1
print(a.size) # Eight elements in the whole array
print(a.shape) ...
Posted by brianb on Fri, 04 Oct 2019 04:52:27 +0200