建2块 linux lvm 格式的 分区 fdisk /dev/vdb Welcome to fdisk (util-linux 2.23.2). Changes will remain in memory only, until you decide to write them. Be caref ...
分类:
系统相关 时间:
2020-01-13 22:06:57
阅读次数:
130
kafka的bin目录下有很多脚本,其中kafka-console-producer.sh是生产者脚本、kafka-console-consumer.sh是消费者脚本,下面用这两个脚本进行模拟发送消息和接收消息。在前面的3篇中已经介绍了kafka的配置。按照步骤启动zookeeper和kafka。 ...
分类:
其他好文 时间:
2020-01-12 22:18:30
阅读次数:
129
CAP理论概述 CAP理论概述 1998 年来自柏克莱加州大学的计算机科学家 埃里克.布鲁尔(Eric Brewer) 提出分布式系统的三个基本指标:Consistency(一致性)、Availability(可用性) 、Partition tolerance(分区容错),简称:CAP。 1998 ...
分类:
其他好文 时间:
2020-01-10 17:12:53
阅读次数:
125
会选择使用源码安装MySQL,想必对MySQL及其他的安装方式已经有了一定的了解,这里就不对周边信息进行过多赘述了,直接开始吧。 编译MySQL比较消耗内存,如果机器内存较小,可能会在编译期间出现内存不足的异常。若没有设置swap分区的可以设置swap分区来解决,否则只能扩容内存了: [root@t ...
分类:
数据库 时间:
2020-01-10 12:37:06
阅读次数:
132
该算法以快排为基础 int random_select(int A[], int p, int r, int i) { if (p == r) return A[p]; int q = random_partition(A, p, r); int k = q - p + 1; if (i == k) ...
分类:
编程语言 时间:
2020-01-10 01:20:33
阅读次数:
121
1、List集合分批操作的工具: List<Integer> list = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 0); // 使用guava对list进行分割 List<List<Integer>> supList1 = Lists.partition( ...
分类:
其他好文 时间:
2020-01-08 23:05:22
阅读次数:
93
将数组A[p...p]划分成两个子数组A[p...q-1]和A[q+1,r],使得A[p...q-1]的每一个元素都小于等于A[q],A[q]也小于等于A[q+1,r]中的每个元素。 实现快速排序 void quick_sort(int A[], int p, int r) { int q; if ...
分类:
编程语言 时间:
2020-01-07 11:44:39
阅读次数:
99
max()、min()、avg()、sum()、count() SQL> select deptno,ename,sal, sum(sal) over(partition by deptno order by deptno) sum_sal, round(avg(sal) over(partitio ...
分类:
数据库 时间:
2020-01-05 10:04:30
阅读次数:
92
单路 1 # include <iostream> 2 # include <ctime> 3 # include <algorithm> 4 # include "InsertionSort.h" 5 6 //对arr[l...r]部分进行partition操作 7 // 返回p,使arr[l.. ...
分类:
编程语言 时间:
2020-01-04 16:44:09
阅读次数:
110
在剑指offer第2版"面试题39:数组中出现次数超过一半的数字"的题解中,有这么一句话: "我们有成熟的时间复杂度为O(n)的算法得到数组中任意第k大的数字", 我觉得这句话有点不妥,至少让我产生过误解。 go代码如下: func partition(nums []int, l, r int) i ...
分类:
编程语言 时间:
2020-01-04 14:36:08
阅读次数:
91