Error handling in Restful API
brief introduction
With the rise of mobile development and front-end development, more and more Web back-end applications tend to implement Restful APIs.The Restful API is a simple, easy-to-use front-end and back-end separation scheme that simply handles client requests and returns the results without r ...
Added by Guldstrand on Thu, 01 Aug 2019 04:32:04 +0300
Paging's application in Recycler View, this article is enough.
Preface
AAC is a very good set of framework components. If you haven't understood it yet, I recommend you to read my previous series of articles:
Android Architecture Components Part1:Room
Android Architecture Components Part2:LiveData
Android Architecture Components Part3:Lifecycle
Android Architecture Components Part4:ViewModel
After a year' ...
Added by schlag on Wed, 31 Jul 2019 17:48:21 +0300
Multithread Synchronization
1. Synchronized code block
grammar
Synchronized (lock){
// Code segments requiring access to critical resources
}
_Lock must be an object_
1) When the program goes to the code segment, it uses the lock to lock the critical resources. At this time, other threads can not execute the code in the co ...
Added by matt1019 on Wed, 31 Jul 2019 15:52:46 +0300
Network Flow (Miscellaneous Records)
Simply speaking, network flow is an algorithm for judging the maximum flow from S to T in the graph. It's not difficult. Look at it well. Here are a few blogs to recommend: (Code Reference No. 2)
Look at this first: https://blog.csdn.net/mmy1996/article/details/71056041
The most detailed description: ht ...
Added by jswash on Wed, 31 Jul 2019 04:37:14 +0300
- Function-function II
01. - Function - Return Value
(1). Find the sum of any number
You can specify the return value of a function by returning
def fn(*nums):
# Define a variable to hold the result
result = 0
# Traversing through tuples and accumulating elements in tuples
for n in nums:
result ...
Added by Snorkel on Tue, 30 Jul 2019 12:24:17 +0300
poj3662 Telephone Lines Binary Answer + Shortest Path
Links: Lougu Valley
POJ
Title Description
Farmer John wants to set up a telephone line at his farm. Unfortunately, the phone company is uncooperative, so he needs to pay for some of the cables required to connect his farm to the phone system.
There are N (1 ≤ N ≤ 1,000) forlorn telephone poles conveniently numbered 1..N that ar ...
Added by TCovert on Sun, 28 Jul 2019 21:47:22 +0300
The Basis and Exercises of KMP Algorithms
Catalog
Explanation of Algorithms
NEXT Array Explanation
Template
Example
A:HDU-1711 Number Sequence
B:HDU-1686 Oulipo
C:HDU-2087 cut strips
D:HDU-3746 Cyclic Nacklace
E:HDU-1358 Period
F:POJ-2406 Power Strings
G:POJ-2752 Seek the Name, Seek the Fame
H:POJ-3080 Blue Jeans
Explanation ...
Added by CavemanUK on Sat, 27 Jul 2019 15:36:36 +0300
9. async, future, packaged_task, promise
std::async, std::future creates background tasks and returns values.
The thread is expected to return a value.
std::async is a function template that starts an asynchronous task and returns a std::future object
Asynchronous task: automatically create a thread and start executing the corresponding thread entry function, returning a std::futur ...
Added by dar-k on Thu, 25 Jul 2019 10:46:32 +0300
Migration from golang flag to cmdr
Be based on cmdr v1.0.3From golang flag to cmdr
With a new command line interpreter framework, the most painful thing is to write data structures or streaming definitions. Let's first look back. cmdr The two most typical command-line interface definitions supported by most other three-party enhanced command-line interpreters will be studied l ...
Added by Hepp on Tue, 23 Jul 2019 17:09:30 +0300
[I/O multiplexing] poll system call
Article Directory
[1] Preface
[2] poll system call function prototype
[3] Program example
[4] Advantages and disadvantages of poll
[1] Preface
poll is essentially the same as select, it copies the user's incoming array into the kernel space, then queries each fd for the corresponding device stat ...
Added by Alk3m1st on Sat, 20 Jul 2019 04:08:53 +0300