自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(78)
  • 资源 (1)
  • 收藏
  • 关注

原创 HIVE GROUPING SETS,GROUPING__ID,CUBE,ROLLUP

概述GROUPING SETS,GROUPING__ID,CUBE,ROLLUP这几个分析函数通常用于OLAP中,不能累加,而且需要根据不同维度上钻和下钻的指标统计,比如,分小时、天、月的UV数。GROUPING SETS和GROUPING__ID说明在一个GROUP BY查询中,根据不同的维度组合进行聚合,等价于将不同维度的GROUP BY结果集进行UNION ALLGROUPING__ID,表示结果属于哪一个分组集合。查询语句: 1 2 3.

2021-04-09 18:03:38 143

原创 presto和hive时间格式转换

presto和hive时间格式转换1、北京时间格式tounix时间格式 数据格式: 2017-11-17 08:28:13 2017-11-17 08:28:10 2017-11-17 08:27:51.343 2017-11-17 08:27:48.021 presto单个标准时间转化(10位unix): select to_unixtime(cast ('2017-08-30 10:36:15' as times...

2021-04-02 15:35:36 995

原创 一台Linux服务器可以负载多少个连接?

首先我们来看如何标识一个TCP连接?系统是通过一个四元组来识别,(src_ip,src_port,dst_ip,dst_port)即源IP、源端口、目标IP、目标端口。比如我们有一台服务192.168.0.1,开启端口80.那么所有的客户端都会连接到这台服务的80端口上面。有一种误解,就是我们常说一台机器有65536个端口,那么承载的连接数就是65536个,这个说法是极其错误的,这就混淆了源端口和访问目标端口。我们做压测的时候,利用压测客户端,这个客户端的连接数是受到端口数的限制,但是服务器上面的连...

2020-07-24 20:44:55 305

原创 lombok几个注解的使用@Data@AllArgsConstructor@NoArgsConstructor@Builder

lombok是一款在java开发中简洁化代码十分有用的插件工具,这篇博客对较为常用的几种注解进行记录,分享学习心得。 使用lombok注解,目的和作用就在于不用再去写经常反复去写的(如Getter,Setter,Constructor等)一些代码了。 首先,用到的几个注解: @Data使用这个注解,就不用再去手写Getter,Setter,equals,canEqual,hasCode,toString等方法了,注解后在编译时会自动加进去。 @AllArgsC...

2020-07-17 19:32:17 281

原创 Redis面试题 2020

1、什么是 Redis?Redis 是完全开源免费的,遵守 BSD 协议,是一个高性能的 key-value 数据库。Redis 与其他 key - value 缓存产品有以下三个特点:Redis 支持数据的持久化,可以将内存中的数据保存在磁盘中,重启的时候可以再次加载进行使用。Redis 不仅仅支持简单的 key-value 类型的数据,同时还提供 list,set,zset,hash 等数据结构的存储。Redis 支持数据的备份,即 master-slave 模式的数据备份。Re

2020-07-17 12:56:34 256

原创 curl命令操作elasticsearch

一、_cat查看具体命令 curl localhost:9200/_cat1.集群健康状态/_cat/health2.资源信息/_cat/allocation3.查看文档总数/_cat/count4.查看具体索引的文档总数/_cat/count/{index}5.查看fielddata占用内存情况(查询时es会把fielddata信息load进内存)/_cat/fielddata6.针对某一字段进行查看/_cat/fieldda...

2020-07-16 17:02:36 568

原创 hive启动hiveserver2连接JDBC报错:root is not allowed to impersonate root (完美解决方案)

在服务端启动: hive --service hiveserver2 & 客户端:beeline 回车 !connect jdbc:hive2://ip:10000 回车 输入用户名 回车 输入密码 回车于是乎报错:注意:很多博客给出的答案是在hadoop的core-sit.xml下添加如下字段(客户端、服务端、数据库中的hadoop都需要...

2020-04-27 13:22:50 1663 8

原创 shuffle流程整理

1. 从map函数输出到reduce函数接受输入数据,这个过程称之为shuffle.2. map函数的输出,存储环形缓冲区(默认大小100M,阈值80M) 环形缓冲区:其实是一个字节数组kvbuffer. 有一个sequator标记,kv原始数据从左向右填充(顺时针), kvmeta是对kvbuffer的一个封装,封装成了int数组,用于存储kv原始数据的对应的元数据valsta...

2020-04-27 09:45:26 408

原创 1132 Cut Integer (20 分)

Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...

2019-02-18 09:51:22 257

原创 1133 Splitting A Linked List (25 分)

Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those grea...

2019-02-17 20:06:28 144

原创 1134 Vertex Cover (25 分)

A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if e...

2019-02-14 17:31:01 174

原创 1136 A Delayed Palindrome (20 分)

Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0≤a​i​​<10 for all i and a​k​​>0. Then N is palindromic if and only if a​i​​=a​k−i​​ for...

2019-02-13 14:19:52 129

原创 1137 Final Grading (25 分)

For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain no less than 200 points from...

2019-02-11 20:35:27 146

原创 1138 Postorder Traversal (25 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first number of the postorder traversal se...

2019-02-09 19:28:42 101

原创 1139 First Contact (30 分)

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly i...

2019-02-07 20:54:05 256

原创 1143 Lowest Common Ancestor (30 分)

The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively defined as a binary tree which has ...

2019-01-17 17:34:50 490

原创 1142 Maximal Clique (25 分)

A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...

2019-01-17 16:26:13 151

原创 1141 PAT Ranking of Institutions (25 分)

After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.Input Specification:Each input file conta...

2019-01-17 14:53:46 199

原创 1140 Look-and-say Sequence (20 分)

Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...where D is in [0, 9] except 1. The (n+1)st number is a kind of description of the nth n...

2019-01-17 10:53:02 123

原创 1147 Heaps (30 分)

In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...

2019-01-16 17:00:04 258

原创 1146 Topological Order (25 分)

This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supposed to write a program to test...

2019-01-16 15:46:37 106

原创 1145 Hashing - Average Search Time (25 分)

The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer keys from the table and output the average sea...

2019-01-16 11:04:06 255

原创 1144 The Missing Number (20 分)

Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. For each case, the first line giv...

2019-01-16 09:47:21 237

原创 1149 Dangerous Goods Packaging (25 分)

When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trouble. For example, oxidizing agent (氧化剂)...

2019-01-15 19:28:27 309

原创 1148 Werewolf - Simple Version (20 分)

Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Player #2 is a werewolf."; player #2 said...

2019-01-15 16:17:17 504 1

原创 1150 Travelling Salesman Problem (25 分)

The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city and retu...

2019-01-15 11:52:15 300

原创 1151 LCA in a Binary Tree (30 分)

The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you are supposed to find their LCA.In...

2019-01-14 17:07:22 162

原创 1155 Heap Paths (30 分)

In computer science, a heap is a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater than or equal to (i...

2019-01-13 20:09:59 250

原创 1154 Vertex Coloring (25 分)

A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at most kcolors is called a (proper) k-...

2019-01-13 16:11:59 135

原创 C++ sort排序函数用法

用法1、sort函数可以三个参数也可以两个参数,头文件为#include < algorithm>和using namespace std; 2、它使用的排序方法是类似于快排的方法,时间复杂度为n*log2(n)3、sort函数有三个参数:(第三个参数可不写)(1)第一个是要排序的数组的起始地址。(2)第二个是结束的地址(最后一位要排序的地址)(3)第三个参数是...

2019-01-13 15:29:05 904

转载 map和unordered_map的差别

map和unordered_map的差别 需要引入的头文件不同map: #include < map >unordered_map: #include < unordered_map >内部实现机理不同map: map内部实现了一个红黑树(红黑树是非严格平衡二叉搜索树,而AVL是严格平衡二叉搜索树),红黑树具有自动排序的功能,因此map内部的所有元素都是有序的...

2019-01-13 11:17:52 91

原创 1095 解码PAT准考证 (25 分)1153 Decode Registration Card of PAT (25 分)

PAT 准考证号由 4 部分组成:第 1 位是级别,即 T 代表顶级;A 代表甲级;B 代表乙级; 第 2~4 位是考场编号,范围从 101 到 999; 第 5~10 位是考试日期,格式为年、月、日顺次各占 2 位; 最后 11~13 位是考生编号,范围从 000 到 999。现给定一系列考生的准考证号和他们的成绩,请你按照要求输出各种统计信息。输入格式:输入首先在一行中给出...

2019-01-13 11:08:02 296

原创 1094 谷歌的招聘 (20 分)1152 Google Recruitment (20 分)

2004 年 7 月,谷歌在硅谷的 101 号公路边竖立了一块巨大的广告牌(如下图)用于招聘。内容超级简单,就是一个以 .com 结尾的网址,而前面的网址是一个 10 位素数,这个素数是自然常数 e 中最早出现的 10 位连续数字。能找出这个素数的人,就可以通过访问谷歌的这个网站进入招聘流程的下一步。自然常数 e 是一个著名的超越数,前面若干位写出来是这样的:e = 2.718281828...

2019-01-12 20:24:10 226

原创 1093 字符串A+B (20 分)

给定两个字符串 A 和 B,本题要求你输出 A+B,即两个字符串的并集。要求先输出 A,再输出 B,但重复的字符必须被剔除。输入格式:输入在两行中分别给出 A 和 B,均为长度不超过 10​6​​的、由可见 ASCII 字符 (即码值为32~126)和空格组成的、由回车标识结束的非空字符串。输出格式:在一行中输出题面要求的 A 和 B 的和。输入样例:This is a ...

2019-01-12 20:11:01 508

原创 1092 最好吃的月饼 (20 分)

月饼是久负盛名的中国传统糕点之一,自唐朝以来,已经发展出几百品种。若想评比出一种“最好吃”的月饼,那势必在吃货界引发一场腥风血雨…… 在这里我们用数字说话,给出全国各地各种月饼的销量,要求你从中找出销量冠军,认定为最好吃的月饼。输入格式:输入首先给出两个正整数 N(≤1000)和 M(≤100),分别为月饼的种类数(于是默认月饼种类从 1 到 N 编号)和参与统计的城市数量。接...

2019-01-12 19:33:14 520

原创 1091 N-自守数 (15 分)

如果某个数 K 的平方乘以 N 以后,结果的末尾几位数等于 K,那么就称这个数为“N-自守数”。例如 3×92​2​​=25392,而 25392 的末尾两位正好是 92,所以 92 是一个 3-自守数。本题就请你编写程序判断一个给定的数字是否关于某个 N 是 N-自守数。输入格式:输入在第一行中给出正整数 M(≤20),随后一行给出 M 个待检测的、不超过 1000 的正整数。输...

2019-01-12 18:48:37 385

原创 1088 三人行 (20 分)

作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KB 子曰:“三人行,必有我师焉。择其善者而从之,其不善者而改之。”本题给定甲、乙、丙三个人的能力值关系为:甲的能力值确定是 2 位正整数;把甲的能力值的 2 个数字调换位置就是乙的能力值;甲乙两人能力差是丙的能力值的 X 倍;乙的能力值是丙的 Y 倍。请你指出...

2019-01-12 17:19:15 105

原创 1087 有多少不同的值 (20 分)

作者: CHEN, Yue单位: 浙江大学时间限制: 150 ms内存限制: 64 MB代码长度限制: 16 KB 当自然数 n 依次取 1、2、3、……、N 时,算式 ⌊n/2⌋+⌊n/3⌋+⌊n/5⌋ 有多少个不同的值?(注:⌊x⌋ 为取整函数,表示不超过 x 的最大自然数,即 x 的整数部分。)输入格式:输入给出一个正整数 N(2≤N≤10​4​​)。输出...

2019-01-12 16:15:41 657

原创 1086 就不告诉你 (15 分)

作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KB做作业的时候,邻座的小盆友问你:“五乘以七等于多少?”你应该不失礼貌地围笑着告诉他:“五十三。”本题就要求你,对任何一对给定的正整数,倒着输出它们的乘积。输入格式:输入在第一行给出两个不超过 1000 的正整数 A 和 B,其间以空格分隔。输出格式:...

2019-01-12 15:38:29 2367 2

原创 简单的代码生成程序

简单的代码生成程序Time Limit: 1000MSMemory Limit: 65536KB SubmitStatistic Problem Description通过三地址代码序列生成计算机的目标代码,在生成算法中,对寄存器的使用顺序为:寄存器中存有 > 空寄存器 > 内存中存有 > 以后不再使用 > 最远距离使用Input单组输入,给定输出的

2017-12-07 10:51:28 1803 1

LibrarySeats.rar

基于SSM框架的图书馆作为预约管理系统,为了更清晰、直观地描述本系统各功能的具体操作,将其根据性能划分为系统管理、师生信息、阅览室、登录、信用积分、选座管理、通知公告、交流管理、数据统计、我的推荐等十大模块。

2020-05-14

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除