Skip to content

Instantly share code, notes, and snippets.

View j3N0's full-sized avatar
🌴
On vacation

Hao Wen j3N0

🌴
On vacation
View GitHub Profile
@j3N0
j3N0 / gist:abdf62d2275700c09d7d9291926a18f3
Created July 9, 2019 12:36
mysql通过sql文件导入数据时出现乱码的解决办法
mysql -u root -p password < path_to_import_file –default-character-set = utf8
@j3N0
j3N0 / SplitList.java
Created July 9, 2019 05:20
Stream() 切分List
private static final Integer MAX_NUMBER = 3;
public static void main(String[] args) {
List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7);
int limit = countStep(list.size());
//方法一:使用流遍历操作
List<List<Integer>> mglist = new ArrayList<>();
Stream.iterate(0, n -> n + 1)
.limit(limit)
.forEach(i -> mglist.add(list
.stream()