- 博客(10)
- 收藏
- 关注
原创 记一个诡异的ES查询失败
下面的查询条件只有第一个查不出来: 1. 出发城市:北京,沙县 2. 出发城市:北京 3. 出发城市:北京,上海 4. 出发城市:北京,沙县 & 到达城市:上海ES数据库中不存在depCity为沙县的文档查询语句1 出发城市:北京,沙县 { "from" : 0, "size" : 20, "query" : { "bool" : { "must" : {
2016-09-21 00:47:58
2240
原创 "Calendars" and "DateFormats" should not be static
“Calendars” and “DateFormats” should not be static 级别:bug, multi-threading Not all classes in the standard Java library were written to be thread-safe. Using them in a multi-threaded manner is h
2016-09-01 00:13:27
1521
原创 BigDecimal(double)
“BigDecimal(double)” should not be used 级别:bug Because of floating point imprecision, you’re unlikely to get the value you expect from the BigDecimal(double) constructor.From the JavaDocs: Th
2016-08-30 00:54:14
1821
原创 @Deprecated & @Override
1. @Deprecated” code should not be used 级别:cwe, obsolete, owasp-a9, security Once deprecated, classes, and interfaces, and their members should be avoided, rather than used, inherited or extende
2016-08-28 17:09:43
2492
原创 不要使用equals方法对AtomicXXX进行是否相等的判断
1. “.equals()” should not be used to test the values of “Atomic” classes 级别:bug AtomicInteger, and AtomicLong extend Number, but they’re distinct from Integer and Long and should be handled diff
2016-08-26 00:42:50
4819
原创 堆排序(算法导论实现)
#include #include using namespace std;int heap_size;int left(int i){ return 2 * i + 1;}int right(int i){ return 2 * i + 2;}void exchange(vector& v, int k, int largest){ int temp = v[k];
2015-07-22 20:57:05
576
原创 二叉树的前序、中序、后续遍历,递归、非递归实现
前序遍历递归:#include #include using namespace std;struct TreeNode { int val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(NULL) {}};void pre_order_recursive(TreeN
2015-07-22 15:47:06
596
原创 归并排序C++
#include using namespace std;/* *把数组从中间分为2部分,分别将两部分排好序后,调用merge将2个有序序列合并成1个有序序列 * */void merge(int* arr, int start, int mid, int end){int* p = new int[1000];int* q = new int[1000];for(int i = start; i
2015-07-19 22:31:57
477
原创 快速排序&易错点
#include using namespace std;int partition(int* arr, int p, int q){ int pivot = arr[p]; while (p < q) // while中统一使用p < q 而不是p <= q { while(pivot <= arr[q] && p < q) q--; arr[p] = arr[q];
2015-07-19 21:55:35
737
原创 读《Finding and evaluating community structure in networks》Newman&Girvan
待编辑
2013-09-21 09:30:08
5274
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人