自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(4445)
  • 收藏
  • 关注

转载 helm部署Filebeat + ELK

helm部署Filebeat + ELK系统架构图:1)多个Filebeat在各个Node进行日志采集,然后上传至Logstash2)多个Logstash节点并行(负载均衡,不作为集群),对日志记录进行过滤处理,然后上传至Elasticsearch集群3)多个Elasticsearch构成集群服务,提供日志的索引和存储能力4)Kibana负责对Elast...

2019-09-30 21:39:00 1102

转载 Git回滚代码

回滚命令:1.回退到上个版本$ git reset --hard HEAD^2.回退到前2次提交之前,以此类推,回退到n次提交之前 $ git reset --hard HEAD~23.退到/进到 指定commit的sha码 $ git reset --hard commit_id然后强推到远程:$ git push origi...

2019-09-30 19:54:00 527

转载 前端常用缓存技术之Cookie和localStorage和sessionStorage和ApplicationCache

1、CookieJavaScript是运行在客户端的脚本,因此一般是不能够设置Session的,因为Session是运行在服务器端的。而cookie是运行在客户端的,所以可以用JS来设置cookie。cookie的结构:简单地说,cookie是以键值对的形式保存的,即key=value的格式。各个cookie之间一般是以“;”分隔。cookie是浏览器提供的一种机制,它将do...

2019-09-27 13:18:00 773

转载 【leetcode】1201. Ugly Number III

题目如下:Write a program to find then-th ugly number.Ugly numbers arepositive integerswhich are divisible byaorborc.Example 1:Input: n = 3, a = 2, b = 3, c = 5Output: 4Explan...

2019-09-25 10:36:00 532

转载 【leetcode】1202. Smallest String With Swaps

题目如下:You are given a strings, and an array of pairs of indices in the stringpairswherepairs[i] =[a, b]indicates 2 indices(0-indexed) of the string.You canswap the characters at any p...

2019-09-25 10:25:00 460

转载 【leetcode】1200. Minimum Absolute Difference

题目如下:Given anarrayofdistinctintegersarr, find all pairs of elements with the minimum absolute difference of any two elements.Return a list of pairs in ascending order(with respect...

2019-09-25 10:16:00 170

转载 【leetcode】147. Insertion Sort List

题目如下:Sort a linked list using insertion sort.A graphical example of insertion sort. The partial sorted list (black) initially contains only the first element in the list.With each iteration...

2019-09-25 10:14:00 89

转载 jieba源码解析(二):jieba.cut

前一章介绍了jieba分词之前关于前缀词典的构建,本章介绍jieba的主体:jieba.cut。jieba分词有三种模式:全模式、精确模式、搜索引擎模式。全模式和精确模式通过jieba.cut实现,搜索引擎模式对应cut_for_search,且三者均可以通过参数HMM决定是否使用新词识别功能。官方例子:# encoding=utf-8import jiebaseg_list ...

2019-09-22 15:17:00 6242

转载 Prometheus Operator 监控Kubernetes

Prometheus Operator 监控Kubernetes1.Prometheus的基本架构​ Prometheus是一个开源的完整监控解决方案,涵盖数据采集、查询、告警、展示整个监控流程,下图是Prometheus的架构图:官方文档:https://prometheus.io/docs/introduction/overview/2.组件说明P...

2019-09-22 11:13:00 280

转载 基于licode搭建webrtc服务器

0. 前言licode官网文档安装教程十分简单, 但是实际搭建过程是很艰辛的. 官方文档没有提示说会遇到什么样的问题, 实际过程中可能遇到各种各样的问题, 在解决的时候费时费力, 我就总结一下自己在安装搭建过程中遇到的问题.注: 最大的问题就是网络问题, 整个安装过程是边下载资源边安装的, 资源基本都是国外的, 因为墙的缘故, 可能会遇到想不到的错误.1. 环境系统...

2019-09-21 11:27:00 342

转载 【windows&flask】flask通过service自动运行

最近在学习在windows平台用flask框架提供Restful API服务,需要使得flask的windows应用能够开机自动运行,并且后台运行,所以通过service来实现。首先尝试的是在自己派生的serivice类的中直接调用create_app(debug=True).run(host='0.0.0.0', port=5000) 的方式启动flask。参考代码:...

2019-09-20 11:08:00 972

转载 【leetcode】1105. Filling Bookcase Shelves

题目如下:We have a sequence ofbooks: thei-th book has thicknessbooks[i][0]and heightbooks[i][1].We want to place these booksin orderonto bookcase shelves that have total widthshelf_widt...

2019-09-20 05:53:00 157

转载 How To Install OpenSSL on Windows

转自https://tecadmin.net/install-openssl-on-windows/OpenSSL is a full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is licensed under an Ap...

2019-09-19 19:34:00 184

转载 【leetcode】1191. K-Concatenation Maximum Sum

题目如下:Given an integer arrayarrand an integerk, modify the array by repeating itktimes.For example, ifarr= [1, 2]andk = 3then the modified array will be[1, 2, 1, 2, 1, 2].Return...

2019-09-17 10:32:00 134

转载 【leetcode】1190. Reverse Substrings Between Each Pair of Parentheses

题目如下:Given a stringsthat consists of lower case English letters and brackets.Reverse the stringsin eachpair of matching parentheses, startingfrom the innermost one.Your result shoul...

2019-09-17 10:21:00 180

转载 【leetcode】1189. Maximum Number of Balloons

题目如下:Given a stringtext, you want to use the characters oftextto form as many instances of the word"balloon"as possible.You can use each character intextat most once. Return the maxi...

2019-09-17 10:17:00 214

转载 Collector的使用

一、Collector的引入      1)Collector的聚合作用前面已经使用过,将list.stream后的一系列操作之后再返回list。2)Collector的引入,通过需求:将绿色的Apple放在一个list,黄色的Apple放在一个list代码例子: 1 package com.cy.java8; 2 3 import java.util.*;...

2019-09-16 23:19:00 773

转载 docker复制文件到宿主机

从主机复制到容器sudo docker cp host_path containerID:container_path从容器复制到主机sudo docker cp containerID:container_path host_path  转载于:https://www.cnblogs.com/Dev0ps/p/11527522.html...

2019-09-16 15:26:00 166

转载 【leetcode】638. Shopping Offers

题目如下:In LeetCode Store, there are some kinds of items to sell. Each item has a price.However, there are some special offers, and a special offer consists of one or more different kinds of i...

2019-09-16 10:41:00 96

转载 【leetcode】1125. Smallest Sufficient Team

题目如下:In a project, you have a list of required skillsreq_skills,and a list ofpeople. The i-th personpeople[i]contains a list of skills that person has.Consider asufficient team: a se...

2019-09-16 10:33:00 131

转载 Optional的使用

一、空指针问题与Optional的引入      需求:根据人获取他买的车保险名字。Person:1 package com.cy.java8;2 3 import lombok.Data;4 5 @Data6 public class Person {7 8 private Car car;9 }View CodeCa...

2019-09-15 13:06:00 111

转载 【leetcode】1172. Dinner Plate Stacks

题目如下:You have an infinite number of stacks arranged in a row and numbered (left to right) from 0, each of the stacks has the samemaximumcapacity.Implement theDinnerPlatesclass:Dinne...

2019-09-14 21:43:00 143

转载 【C++】C++中的异常解析

异常是程序在执行期间产生的问题。C++ 异常是指在程序运行时发生的特殊情况,比如尝试除以零的操作。异常提供了一种转移程序控制权的方式。C++ 异常处理涉及到三个关键字:try、catch、throw。throw: 当问题出现时,程序会抛出一个异常。这是通过使用 throw 关键字来完成的。catch: 在您想要处理问题的地方,通过异常处理程序捕获异常。catch 关键字用于捕...

2019-09-14 10:58:00 95

转载 Kubernetes pod 状态

CrashLoopBackOff: 容器退出,kubelet正在将它重启InvalidImageName: 无法解析镜像名称ImageInspectError: 无法校验镜像ErrImageNeverPull: 策略禁止拉取镜像ImagePullBackOff: 正在重试拉取RegistryUnavailable: 连接不到镜像中心ErrImagePull: ...

2019-09-14 10:27:00 669

转载 NumericStream && Stream综合练习

一、NumericStream    我们可以将一个Stream转化为对应的数字Stream,如mapToInt、mapToLong转化为IntStream、LongStream等(NumericStream又可以通过boxed、mapToObj方法转化回去),这样做的好处是可以节省比较多的内存开销,数据量大的话是比较明显的,因为int 4个字节的数字比Integer类型的小很多。所...

2019-09-14 09:42:00 111

转载 Stream之filter、distinct、skip、map、flatMap、match、find、reduce

一、Stream之filter、distinct、skip: 1 package com.cy.java8; 2 3 import java.util.Arrays; 4 import java.util.List; 5 import java.util.stream.Collectors; 6 7 public class StreamFilter ...

2019-09-13 21:31:00 263

转载 原型对象和原型链解析

????摘要本文主要深入介绍了[[prototype]]和prototype这两个属性,顺着这个思路讲解了原型链的形成过程。从一个题目开始从一个很迷惑的经典题目开始。 Object instanceof Function //true Function instanceof Object //true[[prototype]]和prototype首先,我们要了解,这里...

2019-09-13 10:52:00 78

转载 【leetcode】1179. Reformat Department Table

题目如下:SQL SchemaTable:Department+---------------+---------+| Column Name | Type |+---------------+---------+| id | int || revenue | int || mont...

2019-09-12 13:33:00 459

转载 【leetcode】1186. Maximum Subarray Sum with One Deletion

题目如下:Given an array of integers, return the maximum sum for anon-emptysubarray (contiguous elements) with at most one element deletion.In other words, you want to choose a subarray and opt...

2019-09-12 13:29:00 173

转载 【leetcode】1185. Day of the Week

题目如下:Given a date, return the corresponding day of the week for that date.The input is given as three integers representing theday,monthandyearrespectively.Return the answer as one o...

2019-09-12 13:12:00 130

转载 【leetcode】1184. Distance Between Bus Stops

题目如下:A bushasnstops numbered from0ton - 1that forma circle. We know the distance between all pairs of neighboring stops wheredistance[i]is the distance between the stops numberian...

2019-09-12 13:10:00 97

转载 jieba源码解析(一):分词之前

简介总的来说,jieba分词主要是基于统计词典,构造一个前缀词典;然后利用前缀词典对输入句子进行切分,得到所有的切分可能,根据切分位置,构造一个有向无环图;通过动态规划算法,计算得到最大概率路径,也就得到了最终的切分形式。初始化jieba采用了延迟加载机制,在import后,不会立刻加载词典文件,在利用jieba.cut或jieba.lcut分词的时候才加载本地词典。如果有必要可以...

2019-09-11 17:55:00 276

转载 Kubernetes master无法加入etcd 集群解决方法

背景:一台master磁盘爆了导致k8s服务故障,重启之后死活kubelet起不来,于是老哥就想把它给reset掉重新join,接着出现如下报错提示是说etcd集群健康检查未通过:error execution phase check-etcd: error syncing endpoints with etc: dial tcp 172.31.182.152:2379: con...

2019-09-11 15:09:00 3316

转载 创建Stream

1.创建Stream        create Stream from Collections;create Stream from values;create Stream from Arrays;craeate Stream from files;craeate Stream from functions代码举例: 1 package com.cy....

2019-09-10 22:21:00 591

转载 emqx配置ssl

1、生产自签证书mkdir /etc/emqttd/certs/ && cd /etc/emqttd/certs/openssl genrsa -out ca-key.pem 2048openssl req -x509 -new -nodes -key ca-key.pem -days 10000 -out ca.pem -subj "/CN=kube-c...

2019-09-09 12:47:00 2581

转载 Stream介绍

一、Stream介绍  现在有这样的需求:有个菜单list,菜单里面非常多的食物列表,只选取小于400卡路里的并且按照卡路里排序,然后只想知道对应的食物名字。代码:package com.cy.java8;public class Dish { private final String name; private final boole...

2019-09-08 18:33:00 279

转载 lambda表达式使用解析

1、Predicate/Consumer/Function/Supplier介绍Predicate boolean test(T t);Consumer accpet(T t);Function<T, R> R apply(T t);Supplier<T> T get();以Predicate为例,引申出很多类似的Predicate,如...

2019-09-08 15:39:00 74

转载 lambda表达式

一、简单介绍lambda表达式    lambda接口满足的条件:接口有且只有一个方法,default方法、static方法除外,@FunctionalInterface会告诉编译器编译的时候判断方法到底是不是一个function的接口,标注了@FunctionalInterface的接口,如果下面方法不满足,会报错。java中很多的以前的方法都加了@FunctionalInte...

2019-09-08 12:42:00 71

转载 【leetcode】1178. Number of Valid Words for Each Puzzle

题目如下:With respect to a givenpuzzlestring, awordisvalidif both the following conditions are satisfied:wordcontains the first letter ofpuzzle.For each letter inword, that lette...

2019-09-06 16:10:00 179

转载 【leetcode】1177. Can Make Palindrome from Substring

题目如下:Given a strings, we make queries on substrings ofs.For each queryqueries[i] = [left, right, k], we mayrearrangethe substrings[left], ..., s[right], and then chooseup tokof the...

2019-09-06 15:59:00 357

空空如也

空空如也

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

TA关注的人

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