- 博客(21)
- 收藏
- 关注
原创 单例模式五种Java实现方式
本文在CS-Notes的单例模式基础上添加了部分个人理解,方便自己复习。安利CS-Notes,涵盖所有计算机基础课程的知识点总结笔记。单例一个类只有一个实例五种Java实现方式懒汉模式 - 线程不安全最基础的一种方式,判断单例有没有创建,没有创建就去new一个public class Singleton{ private static Singleton instance;...
2020-04-12 17:29:38 230
原创 Elasticsearch Java API之计数(HighLevelClient)
最近项目需要做一些修改,把之前访问MySQL进行查询改为Es查询,Es查询的优点这边就不赘述了。因为之前是借助PageHelper实现的分页,PageHepler需要结果集的总数,SQL实现的话直接SELECT COUNT(1) FROM TABLE WHERE CONDITION;即可,Es也可以通过sourceBuilder.from(0).size(10000)这样设置一个足够大的siz...
2020-03-23 19:41:11 4317 3
原创 layui数据表格某个字段不显示问题
表格是用layui数据表格的方法渲染方式渲染的大概这个样子var table = layui.table; //执行渲染table.render({ elem: '#demo' //指定原始表格元素选择器(推荐id选择器) ,height: 315 //容器高度 ,cols: [{}] //设置表头 //,…… //更多参数参考右侧目录:基本参数选项});co...
2019-07-15 18:47:13 6642 2
原创 leetcode_96. Unique Binary Search Trees/leetcode_95. Unique Binary Search Trees II
先看96题Givenn, how many structurally uniqueBST's(binary search trees) that store values 1 ...n?Example:Input: 3Output: 5Explanation:Given n = 3, there are a total of 5 unique BST's: 1 ...
2019-07-10 15:26:56 184
原创 leetcode_91. Decode Ways
A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given anon-emptystring containing only digits, determine t...
2019-07-09 16:31:27 126
原创 leetcode_81. Search in Rotated Sorted Array II
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e.,[0,0,1,2,2,5,6]might become[2,5,6,0,0,1,2]).You are given a target value to search. If found ...
2019-07-08 17:06:43 134
原创 leetcode_80. Remove Duplicates from Sorted Array II
Given a sorted arraynums, remove the duplicatesin-placesuch that duplicates appeared at mosttwiceand return the new length.Do not allocate extra space for another array, you must do this bymod...
2019-07-08 15:48:44 106
原创 leetcode_78. Subsets
Given a set ofdistinctintegers,nums, return all possible subsets (the power set).Note:The solution set must not contain duplicate subsets.Example:Input: nums = [1,2,3]Output:[ [3], [1...
2019-07-08 10:52:35 118
原创 leetcode_77. Combinations
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.Example:Input:n = 4, k = 2Output:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]一看就是一道时间复杂度...
2019-07-05 16:53:17 121
原创 leecode_73. Set Matrix Zeroes
Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do itin-place.Example 1:Input: [ [1,1,1], [1,0,1], [1,1,1]]Output: [ [1,0,1], [0,0,0], [1,0,1]]E...
2019-07-05 15:17:36 106
原创 leecode_63. Unique Paths II
这个问题类似leetcode_62. Unique Paths,可以参考一下A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in t...
2019-07-05 10:35:11 108
原创 leetcode_62. Unique Paths四种解法
有什么问题或建议欢迎留言交流~A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is tryin...
2019-07-05 09:25:38 559
原创 leetcode_61. Rotate List
Given a linkedlist, rotate the list to the right bykplaces, wherekis non-negative.Example 1:Input: 1->2->3->4->5->NULL, k = 2Output: 4->5->1->2->3->NULLExplan...
2019-07-04 16:53:45 104
原创 leetcode_60. Permutation Sequence
The set[1,2,3,...,n]contains a total ofn! unique permutations.By listing and labeling all of the permutations in order, we get the following sequence forn= 3:"123" "132" "213" "231" "312"...
2019-07-04 15:47:47 131
原创 leetcode_55. Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine if yo...
2019-07-02 18:47:30 112
原创 leetcode_54. Spiral Matrix
Given a matrix ofmxnelements (mrows,ncolumns), return all elements of the matrix in spiral order.Example 1:Input:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]Output: [1,2,3,6,9,8,7,4,5]...
2019-07-02 17:42:41 95
原创 leetcode_Rotate Image
题目要求:You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Note:You have to rotate the imagein-place, which means you have to modify the input 2D m...
2019-07-02 10:25:51 113
原创 JDK1.8 LinkedList源码解析
继ArrayList之后,记录一下阅读LinkedList源码的笔记。还是有一些不太懂的地方,在代码中有标注,欢迎各位不吝赐教,感谢!package java.util;import java.util.function.Consumer;public class LinkedList<E> extends AbstractSequentialLis...
2019-06-20 16:35:38 245
原创 JDK1.8 ArrayList源码解析
好记性不如烂笔头,记录一下阅读收获,有什么错误或者问题希望大家可以留言,一起学习一起进步package java.util;import java.util.function.Consumer;import java.util.function.Predicate;import java.util.function.UnaryOperator;import sun.misc.Sha...
2019-06-17 10:12:01 154
原创 thymeleaf动态渲染select
<option th:selected="${res.selected eq option.id}" th:each="option : ${res.data}"th:value="${option.id}" th:text="${option.value}"></option>json数据:{ "selected":
2019-03-06 16:14:10 4172
原创 Spring Boot学习笔记--自定义参数
学习http://tengj.top/2017/02/28/springboot2/笔记配置文件解析自定义参数创建Spring boot项目后,在src/main/resources下的application.properties中可以自定义属性。形如:key=value,在需要调用的地方使用@Value("${key}")即可把value赋值给任意变量。形如:group.ke...
2018-10-19 10:58:52 187
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人