[Android development, geek time resource sharing
**android:divider="#f00" * * color of split line
android:dividerHeight = "2dp" the height of the splitter bar
**android:cacheColorHint="#0fff" * * when the background image is used in the list, there will be a problem in the drop-down or pull-up: the background image is missing
android:scrol ...
Posted by jackread on Mon, 03 Jan 2022 15:17:35 +0100
Spring Boot realizes read-write separation. No one else can't?
Step 1: configure multiple data sources
I won't introduce the basics of Spring Boot. I recommend this practical tutorial: github.com/javastacks/...
First, we configure two data sources in SpringBoot. The second data source is ro datasource:
spring:
datasource:
jdbc-url: jdbc:mysql://localhost/test
username: rw
password: rw_ ...
Posted by mustang on Mon, 03 Jan 2022 15:06:15 +0100
Java parallel program foundation, byte beating, Java interview cool classics
public static void main(String[] args) throws InterruptedException {
Thread t1 = new Thread(()->{
while (true) {
if (Thread.currentThread().isInterrupted()) {
System.out.println("Interrupt!");
break;
}
...
Posted by sylesia on Mon, 03 Jan 2022 08:36:51 +0100
Spring-MVC- core call process, MySQL million words essence summary
long startTime = System.currentTimeMillis();
Throwable failureCause = null;
doService(request, response);
}
> get into`doService`method
>
> Class: org.springframework.web.servlet.`DispatcherServlet`
```java
protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
logRequest(reques ...
Posted by serg91 on Sun, 02 Jan 2022 23:19:24 +0100
When using MySQL, please use JSON as your trump card
Relational structured storage has some disadvantages, because it needs to define all columns and their corresponding types in advance. However, in the process of business development, it may be necessary to expand the description function of a single column. At this time, if the JSON data type can be used well, the boundary between the storage ...
Posted by Jenling on Sun, 02 Jan 2022 21:27:21 +0100
Choose structure: if you love, please love deeply
Select structureHello, welcome back. I'm Peng Peng! HAKUNA MATATA!!!On the basis of data and operation, there is a new demand: process control. Generally, the code execution process will not be executed in the end. Many times, the appropriate direction will be selected according to the changes of data, and even the running results of the progra ...
Posted by foevah on Sun, 02 Jan 2022 19:41:46 +0100
Java 8 Lambda expressions and Stream operations
Syntax of Lambda expressions
Basic syntax:
(parameters) -> expression
or
(parameters) ->{ statements; }
Copy code
Method reference
There are three kinds of method references. Method references are represented by a pair of double colons::. Method references are another writing method of functional interfaces
Static method reference, ...
Posted by sangprabv on Sun, 02 Jan 2022 15:29:26 +0100
Ten JS tips you don't know
Summed up some commonly used JS tips to make your code more elegant!
1. Use const definition
Don't over declare variables in development, and try to use expressions and chain calls. Then, if you can use , const , don't use , let. After you write too much about this mode, you will find that you can hardly find several places to use &quo ...
Posted by Vasudhevan on Sun, 02 Jan 2022 11:49:36 +0100
Example of generalization error parameter adjustment of random forest application in machine learning sklearn classroom of vegetables
from sklearn.model_selection import train_test_split
#Divide 30% of the data as the test set
Xtrain, Xtest, Ytrain, Ytest = train_test_split(wine.data, wine.target, test_size=0.3)
clf = DecisionTreeClassifier(random_state=0) #Modeling: Decision Tree
rfc = RandomForestClassifier(random_state=0) #Modeling: random forest
clf = clf.fit( ...
Posted by fredted40x on Sun, 02 Jan 2022 04:26:43 +0100
How to integrate JWT in SpringBoot to realize login registration
JWT can be understood as an encrypted string, which consists of three parts: header, payload and signature
It is used by the header and payload encrypted by base64 The JWT string is formed by connecting the strings, then encrypting them with salt secret combination through the encryption method declared in the header, and then forming the JWT ...
Posted by NFClimber on Sat, 01 Jan 2022 23:22:02 +0100