New features of Java 8
Java 9 is coming, so we have to sort out Java 8.
Official documents: http://docs.oracle.com/javase/specs/jls/se8/html/index.html
I. Default and static methods of interfaces
The method body can also be written in the interface. The class that implements the interface no longer enforces the implementation of the method, but only needs to add defa ...
Posted by Large on Sat, 22 Jun 2019 23:15:13 +0200
Comparable vs. Compparator
1. Prototype of two interfaces
In Java, Comparable and Comparator interfaces are used for comparison. So what's the difference between the two interfaces in actual use? Now let's analyze it with examples.
Let's first look at the prototype of the two interfaces in JDK.
package java.lang;
import java.util.*;
public interface Comparable< ...
Posted by dotancohen on Sat, 22 Jun 2019 00:51:46 +0200
Python-based built-in functions and recursion
I. Built-in Functions
Following is a brief introduction of several:
1. Absolute value of ABS ()
2.all() Returns True if all elements of iterable are true (or if iterable is empty).
3.any() returns True if any element of iterable is true. If iterable is empty, return False
4.callable() If the object parameter is tunable, return True or False
5. ...
Posted by d401tq on Thu, 20 Jun 2019 23:00:05 +0200
Talk about several ways to traverse Map in java
There are many ways to traverse a map in java, from the earliest Iterator to the foreach supported by Java 5 to Java 8 Lambda. Let's look at the specific usage and advantages and disadvantages of each.
Initialize a map first
public class TestMap {
public static Map<Integer, Integer> map = new HashMap<Integer, Integer>();
}
keySet ...
Posted by spdwrench on Wed, 19 Jun 2019 19:10:15 +0200
Thread Safety and Thread Insecurity
What is thread safety?
The more official explanations are as follows:
When multiple threads access a class, no matter how the runtime environment is scheduled or how these threads are executed alternately, and there is no need for any additional synchronization or collaboration in the main code, this class can show the correct behavior, so it ...
Posted by immunity on Thu, 13 Jun 2019 00:20:48 +0200
Data Mining Using sklearn
Steps of Data Mining
Data mining usually includes data acquisition, data analysis, feature engineering, training model, model evaluation and other steps.
sklearn workflow
Sklearns mainly work in dotted frames (sklearn s can also extract text features)
Sklearns'main methods fit, fit_transform, transform
Transform method is mainly used ...
Posted by Jibberish on Wed, 12 Jun 2019 23:34:11 +0200
FP-growth algorithm for discovering frequent itemsets (2) - discovering frequent itemsets
The last part introduced How to Construct FP Tree Each path of FP tree satisfies minimum support. What we need to do is to find more relationships on one path.
Extraction of conditional pattern bases
Start with a single frequent element item in the FP tree header pointer table. For each element item, the corresponding conditional pattern base i ...
Posted by stretchy on Sun, 26 May 2019 21:40:52 +0200
Three Ways to Create Threads in Java and Thread Control
I. Processes and Threads
1. What is a process?
The process is a running program, and has some independent functions. The process is an independent unit for resource allocation and scheduling of the system.
2. Three Characteristics of Process
(1) Independence. Process is an independent entity in the system. It can have its own independent resour ...
Posted by sbarros on Sun, 26 May 2019 21:22:44 +0200
C#Asynchronous Programming 1 APM Mode Asynchronous Programming Development
C#has more than 10 years of history. From the update progress of Microsoft version 1 of 2 years alone, it is extremely vigorous. Asynchronous programming in C#has also undergone several versions of evolution. From today on, a series of blogs have been written to record the development of asynchronous programming in C#Advertisement for a friend ...
Posted by JeremyTiki on Sun, 26 May 2019 19:15:08 +0200
Talk about UVW Code (1)
The blog Garden is a very good place to learn knowledge. I believe there are many people like me who have been in the blog Garden for 3 years. They do not know how many codes they have copied or how many blogs they have read, but they have never written a single blog.It's a crime.
This time I'm going to write a few articles about the reading an ...
Posted by monotoko on Fri, 24 May 2019 18:53:44 +0200