Overview of Java Collections

An overview of Java collections (above) Preface First of all, why do I write such a blog (I always like to write why).Because by the end of the year recently, I was preparing for an interview, so I was making a technical summary of all aspects.Java collections are a very important part of Java, and they have spent a lot of time learning before ...

Posted by Graxeon on Fri, 10 Jan 2020 02:40:18 +0100

ArrayList collection source

Based on JDK 1.7 Inheritance and implementation methods public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable { Let's look at the main methods add(E) to add elements /** * Appends the specified element to the end of this list. * * @param e e ...

Posted by dr-dre67 on Mon, 06 Jan 2020 16:12:42 +0100

Python basics ONLINE problem sets data types

3.1 synthesize tuples (1,2,3) and sets {"four",5,6} into a list 1 tuple,set,list = (1,2,3),{"four",5,6},[] 2 for i in tuple: 3 list.append(i) 4 for j in set: 5 list.append(j) 6 print(list) 3.2 set more than 5 elements to 0 and less than 5 elements to 1 in list [3,7,0,5,1,8] 1 list2 = [3,7,0,5,1,8] 2 print(list2) 3 for i ...

Posted by ktsirig on Sun, 05 Jan 2020 06:05:20 +0100

The chunk and slice of Array

1, lodash version: 4.16.1 2, Function. 1,chunk 1) Meaning: unpack an array into multiple size arrays, and then make multiple arrays into a new array. 2) example. const _ = require('lodash'); console.log(_.chunk([1, 2, 3, 4, 5, 6], 4)); // Output: [[1, 2, 3, 4], [5, 6]] console.log(_.chunk([1, 2, 3, 4, 5, 6], 2)); // Outp ...

Posted by sandip123 on Sun, 05 Jan 2020 02:56:53 +0100

MYSQL composite partition

Composite partition is the partition of each partition in the partition table. The sub partition can use either HASH partition or KEY partition. This is also known as a subarea. Tip: mysql can only use HASH/KEY partition for sub partition, which is also different from ORACLE. The following issues need to be noted for composit ...

Posted by chasiv on Sat, 04 Jan 2020 02:53:26 +0100

[LeetCode] 417. Pacific Atlantic Water Flow

417. Pacific Atlantic Water Flow Title Description Given an m x n matrix of non-negative integers representing the height of each unit cell in a continent, the "Pacific ocean" touches the left and top edges of the matrix and the "Atlantic ocean" touches the right and bottom edges. Water can only flow in four directions (up ...

Posted by saqibb on Sat, 04 Jan 2020 01:45:35 +0100

leetcode 210. Curriculum II topological sorting + Chain forward star

Now you have a total of N courses to choose, which are 0 to n-1. Some prerequisite courses are required before taking some courses. For example, to learn lesson 0, you need to complete lesson 1 first. We use a match to represent them: [0,1] Given the total number of courses and their prerequisites, return to the order ...

Posted by chinto09 on Fri, 03 Jan 2020 21:58:23 +0100

MySQL [2] single table query (exercise 1)

Log in, view and use Mysql-uroot-p password SHOW DATABASES; -- view all databases USE DB1; -- use one of the databases Departmental table CREATE TABLE DEPT( DEPTNO INT PRIMARY KEY, DNAME VARCHAR(14), -- Department name LOC VARCHAR(13)-- Department address ) ; INSERT INTO DEPT VALUES (10,'ACCOUNTING','NEW YOR ...

Posted by StormS on Fri, 03 Jan 2020 07:02:30 +0100

Overloaded c ා operator

Overloaded C ා operator You can redefine or overload the operators built in C ා. Therefore, programmers can also use operators of user-defined types. Overloaded operators are functions with special names defined by the keyword operator followed by the symbol of the operator. Like other functions, overloaded operators have return types and par ...

Posted by Fender963 on Thu, 02 Jan 2020 23:07:38 +0100

Deep understanding of Threadlocal

Preface Concurrency is an unavoidable topic in Java development.Modern processors are multi-core, and multi-threaded programming is essential for better drying machine performance, so thread security is a required course for every Java Engineer. There are two general ways to address thread security issues: Synchronization: Use the Synchronized ...

Posted by twinzen on Thu, 02 Jan 2020 06:25:07 +0100