Feel different CRUD with expression tree
Intro
Recently, there is an idea that if you want to do something similar to ORM without writing sql statements, you can parse the expression tree, generate the sql statements to be executed, and finally execute the sql statements to return the corresponding results.
Train of thought analysis
The common sql statements basically have a certain m ...
Posted by rsmarsha on Fri, 06 Dec 2019 15:08:38 -0800
Python development [Part 3]: branch loop
1. if condition statement
Syntax:
if conditions:
Code block - true execution
else: optional
Code block condition is false execution
Example:
n = int(input('Please enter a number:'))
if n > 0:
print('%s Greater than 0' % n)
else:
print('%s Less than 0' % n)
The if statement supports nesting:
if conditions:
if ...
Posted by scald on Fri, 06 Dec 2019 14:18:16 -0800
02Gin Source Interpretation
brief introduction
HttpRouter implementation
data structure
Add Route
addRoute
insertChild
get data
summary
brief introduction
Gin source interpretation, based on v1.5.0 Edition.
HttpRouter implementation
Adding routes is mainly done by addRoute:
func (engine *Engine) addRoute(method, path string, handlers HandlersChain) {
assert1(pa ...
Posted by mabwi on Fri, 06 Dec 2019 14:08:46 -0800
Design mode: responsibility chain mode
The objects that can handle the same kind of requests form a chain, and the submitted requests are passed along the chain. The objects in the chain judge whether they can handle the request one by one
If it can, it will be processed; otherwise, it will be passed to the next object.
For example: the company's administrative approval process, the ...
Posted by kostasls on Fri, 06 Dec 2019 07:06:37 -0800
Python loop and judgment
1.for cycle The for statement can be used to traverse all elements, such as outputting the characters in the string one by one, outputting the elements in the list one by one, the elements in the tuple, the elements in the collection (pay attention to the order of the elements in the assignment), the keys in the dictionary1-1.range cycle:
1 fo ...
Posted by Zyxist on Fri, 06 Dec 2019 02:43:00 -0800
What lock-free technologies exist in Java to solve concurrency problems?How to use it?
In addition to using synchronized, Lock locking, there are many tool classes in Java that can solve concurrency problems without locking
1. Atomic Tools
In JDK 1.8, the classes under the java.util.concurrent.atomic package are all atomic classes, which are based on the implementation of sun.misc.Unsafe.
To solve concurrency problems, the ...
Posted by cyanblue on Fri, 06 Dec 2019 02:18:00 -0800
Order table of C + data structure and algorithm
1. definition
The sequential storage of a linear table is called a sequential table. Elements are adjacent to each other in logical relationship and memory address; random access is supported, and each element in the table can be accessed through subscripts.
2. Structure definition
#define MaxSize 50
typedef struct {
int data[MaxSize];
int len ...
Posted by eyespark on Fri, 06 Dec 2019 00:30:32 -0800
#leetcode: the way to brush questions
A list is given. Each k nodes are flipped and the flipped list is returned.k is a positive integer whose value is less than or equal to the length of the list. If the total number of nodes is not an integral multiple of k, the remaining nodes will remain in the original order.
Example:Given this list: 1 - > 2 - > 3 - > 4 - > 5When ...
Posted by Spekta on Thu, 05 Dec 2019 14:03:57 -0800
AI => Tensorflow2.0 syntax - use of the keras'api
Preface
Most of the keras interfaces implement the call method.The parent class call calls ().Therefore, almost all the model / network layers mentioned below can be called directly as functions after being defined.eg:
Model object (parameter)
Network layer object (parameter)
We can also implement inheritance templates
Import
from tensorflow i ...
Posted by SycoSyco on Thu, 05 Dec 2019 13:05:35 -0800
Optimize package size - PNG section
background
Compared with JPEG image, PNG image is a lossless image storage format, and there is an additional transparency channel, so in general, PNG image is larger than JPEG image, and PNG image is often the big head of APK image resources, so optimizing the size of PNG image is more rewarding for reducing the volume of packet.
wiki about P ...
Posted by mwmobley on Thu, 05 Dec 2019 12:08:02 -0800