- 博客(92)
- 收藏
- 关注
原创 中华石杉ES入门篇
中华石杉ES入门篇功能1)分布式的搜索引擎和数据分析引擎搜索:百度,网站的站内搜索,IT系统的检索 数据分析:电商网站,最近7天牙膏这种商品销量排名前10的商家有哪些;新闻网站,最近1个月访问量排名前3的新闻版块是哪些 分布式,搜索,数据分析2)全文检索,结构化检索,数据分析全文检索:我想搜索商品名称包含牙膏的商品,select * from products where product_name like "%牙膏%" 结构化检索:我想搜索商品分类为日化用品的商品都有哪些,select
2020-07-18 08:35:45
1286
原创 JAVA8实战 函数式编程
JAVA8实战 函数编程部分函数式编程JAVA8支持函数作为一等公民,用类::函数名或 Lambda 表达式进行函数传递,jvm会自动传递给最合适的方法。这样的好处是代码更加简洁,容易读。e.g 假设你有一个Apple类,它有一个getColor方法,还有一个变量inventory保存着一个Apples的列表。你可能想要选出所有的绿苹果,并返回一个列表。java8之前代码 public static List<Apple> filterGreenApples(List&l
2020-05-16 19:42:11
942
原创 高性能MYSQL 第一章
高性能MYSQL 第一章MySQL逻辑架构作用这里贴个极客时间《mysql45讲》图并发控制主要通过锁来时间并发,常用的锁有。读写锁读锁:读锁是共享的,或者说是相互不阻塞的。多个客户在同一时刻可以同时读取同一个资源,而互不干扰。写锁:写锁则是排他的,也就是说一个写锁会阻塞其他的写锁和读锁,这是出于安全策略的考虑,只有这样,才能确保在给定的时间里,只有一个用户能执...
2020-02-09 20:59:17
371
原创 springboot @value 解决静态属性无法注入问题
工作中遇到的场景:采用的微服务框架,之前es和hbase 的空间名和表名等配置写在JAVA Conatant类中,为了调试方便要改放到config服务下。各属性都是 static final,所以面临@Value静态注入问题。操作步骤创建一个类,+注解component,被spring托管声明静态属性和get,set方法。注意set方法不是satic,get方法和属性有static关键字...
2020-01-15 15:20:52
1280
1
原创 eclipse ctrl+鼠标左键 无法进入方法
上周 笔记本屏幕被摔坏了,修好后eclispe ctrl+左键就进不去方法了。解决方法依次点击window》prefrences之后按下图小框依次点击,进入hyperlinking窗口。 把框中的那几个Java Editor取消在选择,【点击】ok按钮 ,就可以点进去方法了。ps:因为工作需要,从idea转eclipse 真心有点痛苦...
2019-09-01 21:13:09
1753
原创 第六章 使用命令
命令有以下四种形式:type 显示命令的类型 格式:type commandwhich 显示可执行指令的位置 格式:which command注意:指令类型只能是可执行指令help 查看shell内部帮助文档 格式: help command--help 可执行指令查看选项和所支持的语法说明 格式 command --help .注意:不是所有的指令都支持 。 ...
2018-12-28 19:11:05
231
原创 第五章(cd /cp/ mv/ ls/ file/ less/ ln指令和Linux目录结构/通配符)笔记
通配符mkdir 创建目录 格式 mkdir directory...cd 与windows的cd指令类似,改变所在目录 e.g cd .. cp 复制文件 格式:cp item1 item2 把1复制到2 cp item ... director...
2018-12-28 17:02:48
362
转载 转 逗号表达式
c语言提供一种特殊的运算符,逗号运算符,优先级别最低,它将两式联接起来,如:(3+5,6+8)称为逗号表达式,其求解过程先表达式1,后表达式2,整个表达式值是表达式2的值,如:(3+5,6+8)的值是14,(a=3*5,a*4)的值是60,原因在于赋值运算优先级高于逗号表达式。逗号表达式的要领:1.从左到右逐个计算;2.逗号表达式作为一个整体,它的值为最后一个表达式的值;3. 逗...
2018-12-18 16:08:43
252
原创 MySQL必知必会 笔记
DISTINCT 选出不同的值,仅仅不重复它之前列SELECT DISTINCT conversation_id FROM message navicat执行选中语句的快捷键CTRL SHIFT + R LIMIT 指定检索的开始行和行数 e.g 检索product 的5-10的pro_nameSELECT pro_name from product LIMIT 5,...
2018-10-12 16:23:33
251
原创 hdu1239
题目链接传送门题意:需要找到两个数(不妨设为p,q)满足以下条件: p,q均为质数;p*q<=m; a/b <=p/q <=1;(p、q的比例约束),求最接近m的p,q.思路:所以在2-10000内枚举就好了#include <iostream>#include<cstdio>#include<cstring>#include<cm...
2018-03-24 15:23:53
261
原创 hdu1238
题目链接传送门题意:一共有t组数据每组都n串字符串,求这n串字符串的最长公共子字符串长度,注意可以是公共子字符串是其反串。思路:数据较小,t在10以内,n在100以内,直接暴力搜索一遍 ac了虽然我觉得会超时。。。注意strstr函数的最差复杂度是O(n2);代码#include <iostream>#include<cstdio>#include<cstring...
2018-03-23 22:03:01
722
原创 poj3278简单BFS
题目链接:点击打开链接题意;给你一个n,k.有三种操作,1.n->n-1 2.n->n+1 3.n->2n 花费一个时间,问你从n->k要多少时间思路:BFS一次到k就可以了#include #include#include#includeusing namespace std;const int maxn=1e5+10;int a[maxn],n,k;in
2017-09-06 22:33:05
455
原创 poj2251BFS
题目链接:点击打开链接题意:给你三个数L,R,C,有一个L层的二维数组,给你一个起始点S,和一个终点E,求从S到E要走多少步,可以上下+四方向走,(i,j,k)可以走到(i+1,j,k),(i-1,j,k),(i,j+1,k),(i,j,k+1)等六个方向。思路:六个方向的BFS一遍就可以了。#include #include#include#includeusing na
2017-09-06 21:47:39
238
原创 poj1321DFS
题目链接:点击打开链接思路:按行枚举所有情况就可以了,代码有注解#include #include#includeusing namespace std;const int maxn=9;int col[maxn],tol,m,n,k; char op[maxn][maxn];void DFS(int cur){ if(m==k) { t
2017-09-06 20:58:16
352
2
原创 scu1778求多边形交面积
题目链接:点击打开链接直接用模板就好了。。。感觉我做计算几何靠模板为生的。。。。#include #include #include #include #include #include #define PI acos(-1)using namespace std;const int maxn = 300;const double eps = 1e-8;int dcmp
2017-08-31 00:24:44
375
原创 hdu1411求四面体体积
题目链接:点击打开链接用公式就ok了#include #include#include using namespace std;double V(double a,double b,double c,double l,double n,double m)//求四面体体积(输入的是棱长){ return sqrt(4*a*a*b*b*c*c-a*a*(b*b+c*c-m*m
2017-08-30 23:29:30
455
原创 poj1348求凸包周长
题目链接:点击打开链接题意:给你n个顶点(代表城堡),要绕城堡外面建一个围墙,围住所有点,并且墙与所有点的距离至少为l,求这个墙最小的长度 。思路:其实就是一个以l为半径的圆的circle+凸包周长。#include #include #include #include #include #include #define PI acos(-1)using name
2017-08-30 23:11:22
341
原创 hdu1115求凸包重心
题目链接:点击打开链接用模板就好了#include #include #include #include #include #include using namespace std;const int maxn=1e6+10;struct Point//点 向量{ double x,y; Point(double x=0,double y=0):x(x),
2017-08-30 16:54:02
467
转载 求两个多边形的交面积(模板)
别人的博客:http://blog.csdn.net/betwater/article/details/52423079/* * 多边形的交,多边形的边一定是要按逆时针方向给出 * 还要判断是凸包还是凹包,调用相应的函数 * 面积并,只要和面积减去交即可 */ #include using namespace std; const int maxn = //
2017-08-30 15:38:34
3002
转载 csu1812求两多边形的交面积
题目链接:点击打开链接直接用模板就可以了,拿的别人的模板,,,,/* * 多边形的交,多边形的边一定是要按逆时针方向给出 * 还要判断是凸包还是凹包,调用相应的函数 * 面积并,只要和面积减去交即可 */#include #include #include #include #include #include using namespace std;const in
2017-08-30 15:36:51
485
1
转载 判断多边形的核是否存在 poj3130&&poj3335
poj3130点击打开链接poj3335点击打开链接拿的别人的模板poj3335#include#include#include#include#include#include#define inf 0x7fffffff#define exp 1e-10#define PI 3.141592654using namespace std;const int max
2017-08-30 14:58:29
374
原创 hdu1086判读线段相交
题目链接点击打开链接题意:给你n条线段,求这些线段有几个交点,用模板就好了,哈哈#include #include #include #include #include #include using namespace std;const int maxn=1e2+10;struct Point//点 向量{ double x,y; Point(doubl
2017-08-30 10:55:46
275
原创 hdu1756判断点是否在多边形内部
题目链接:点击打开链接#include #include #include using namespace std;const int maxn=1e3;const double eps=1e-8;struct Point//点 向量{ double x,y; Point(double x=0,double y=0):x(x),y(y) {}};typedef
2017-08-30 00:12:10
383
原创 计算几何点,直线,线段模板
#include #include #include #include #include #include using namespace std;typedef Point Vector;//向量使用点作为表示方法 结构相同 为了代码清晰定义宏加以区别const double eps = 1e-8;int dcmp(double x) //三态函数 处理与double零
2017-08-29 23:51:01
378
原创 Uva11178计算几何
题目链接:点击打开链接题意:做三角形ABC内角的三等分线,交与DEF点求这三点的坐标D点是向量BC向逆时针旋转B/3弧度和向量CB顺时针旋转C/3的交点,其他也是也一样,用向量旋转和直线相交的模板就可以做出来了#include #include#includeusing namespace std;const double eps = 1e-8;struct Poin
2017-08-29 22:41:57
313
原创 poj2312优先队列BFS
题目链接:点击打开链接题意:给你一个m行n列的矩阵。Y代表起点,T代表终点。B、E可以走,S、R不可以走,B的时间花费为2,E为1.求Y到T的最短时间。思路:用优先队列BFS一遍就可以了#include #include#include#include#include#include#includeusing namespace std;co
2017-08-29 00:00:18
394
原创 csdn1780 优先队列BFS
题目链接:点击打开链接第一次是求正常的BFS第二次是每次要转弯的BFS求第二个只要记住每个点最多是由相邻的个点走过来的就要好了,用vis2标记四个方向,每个方向最多走一次#include #include#include#include#include#include#includeusing namespace std;const int maxn=500+1
2017-08-28 23:24:33
358
原创 hdu1243求最长公共字串的权值
题目链接:点击打开链接求最长公共子串的长度模板char s1[maxn],s2[maxn];int dp[maxn][maxn];//求串s1和串s2的公共子序列int lcs(char *s1,char *s2){ int len1 = strlen(s1); int len2 = strlen(s2); for(int i = 0; i <= len1;
2017-08-25 00:00:54
372
转载 hdu1024求n个数分成k段的最大子序列和
题目链接点击打开链接给你n个数,求分成m个子序列的最大和先贴别人的代码,我看不懂,之后再理解理解/*状态dp[i][j]有前j个数,组成i组的和的最大值。决策:第j个数,是在第包含在第i组里面,还是自己独立成组。方程 dp[i][j]=Max(dp[i][j-1]+a[j] , max( dp[i-1][k] ) + a[j] ) 0<k<j空间复杂度,m未知,n<=10000
2017-08-24 22:58:26
1337
原创 csu1335区间更新,求单点
题目链接:点击打开链接#include #include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=1e5+10;int n,cunt,k;int sum[maxn<<2],col[maxn<<2];void Pushup
2017-08-24 15:35:42
332
原创 csu1328模拟
题目链接:点击打开链接#include #include#include#include#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1using namespace std;const int maxn=1e3+10;char s[maxn],sub[maxn];int p[maxn],len;int Max,pos,cun
2017-08-24 00:18:09
258
原创 hdu1232 并查集
题目链接:点击打开链接#include#include#include#include#include#includeusing namespace std;const int maxn=1e3+10;int pre[maxn],t[maxn];int Find(int x){ int r=x; while(r!=pre[r]) r=pre[
2017-08-22 21:21:07
228
原创 csu1113模拟,STL
题目链接:点击打开链接求增加减少改变的字典词#include #include #include#include #include#include#includeusing namespace std;string old,newdic;string midkey,midvalue;char prim[3]= {'+','-','*'};struct node{
2017-08-21 23:07:01
303
原创 hdu1423 Lics
题目链接:点击打开链接模板题#include #include #include using namespace std;const int maxn=1e3+10;int n,m,a[maxn],b[maxn],dp[maxn][maxn];//a数组的长度n,b数组的长度为m,都是从1开始int LICS(){ int MAX,i,j; memset(dp
2017-08-21 22:46:33
340
原创 csu1120 Lics(模板)
题目链接:点击打开链接求最长递增公共子序列长度#include #include #include using namespace std;const int maxn=1e3+10;int n,m,a[maxn],b[maxn],dp[maxn][maxn];//a数组的长度n,b数组的长度为m,都是从1开始int LICS(){ int MAX,i,j;
2017-08-21 22:31:23
272
原创 hdu2544 最短路,dijstra(模板)
题目链接:点击打开链接#include #include#includeusing namespace std;const int INF=0x3f3f3f3f;int dis[110],vis[110],v[110][110];void Dijkstra(int n){ int i,j,pos; for(i=1; i<=n; i++) {
2017-08-21 12:01:10
272
原创 poj1789最小生成树
题目链接:点击打开链接题意:给你n个字符串,dis(i,j)表示串对应位置不相同的个数,求最小生成树的最dis和,输出倒数#include #include#includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=2e3+10;int sum,ral[maxn][maxn];char s[maxn]
2017-08-21 10:57:35
266
原创 poj1251 prim算法
题目链接:点击打开链接#include #includeusing namespace std;const int INF=0x3f3f3f3f;const int maxn=1e2+10;int sum,ral[maxn][maxn];void Prim(int start,int n){ int a[maxn],lowval[maxn],pos,i,j;//a[]是标
2017-08-21 00:40:48
370
原创 poj1258 prim算法(模板)
题目链接点击打开链接#include using namespace std;const int INF=0x3f3f3f3f;const int maxn=1e2+10;int sum,ral[maxn][maxn];void Prim(int start,int n){ int a[maxn],lowval[maxn],pos,i,j;//a[]是标记数组 a[
2017-08-21 00:11:33
273
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人