timeline

java实现冒泡排序

…衆ロ難τιáo~ 提交于 2020-07-28 08:06:06
冒泡排序: 算法重复走访要排序的数列,一次比较两个元素,如果它们顺序错误就交换它们的位置,这样最大的数就到了最后,重复操作即可得到有序数列。 冒泡排序算法运行: 1. 比较相邻的元素。如果第一个比第二个大,就交换他们两个。 2. 对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对。在这一点,最后的元素应该会是最大的数。 3. 针对所有的元素重复以上的步骤,除了最后一个。 4. 持续每次对越来越少的元素重复上面的步骤,直到没有任何一对数字需要比较。 代码实现: public static void main(String[] args) { int[] values = { 3, 1, 6, 2, 9, 0, 7, 4, 5, 8 }; bubbleSort(values); System.out.println(Arrays.toString(values)); } public static void bubbleSort(int[] values) { int temp; for (int i = 0; i < values.length; i++) { for (int j = 0; j < values.length - 1 - i; j++) { //减i原因:内层循环,每循环完一趟就在数组末产生一个最大数,即最大数就不用比较了。 if (values[j] >

腾讯前端团队是如何做web性能监控的?

*爱你&永不变心* 提交于 2020-07-27 10:17:28
也许你有听过一个问题,你这款 web 应用性能怎么样呀?你会回答什么呢?是否会优于海量 web 应用市场呢?本文就来整理下如何进行 web 性能监控?包括我们需要监控的指标、监控的分类、performance 分析以及如何监控。 但是,如何进行 web 性能监控本身是一个很大的话题,文中只会侧重一部分进行研究,某些内容不是很全面。 前言:为什么需要监控? web 的性能一定程度上影响了用户留存率,Google DoubleClick 研究表明:如果一个移动端页面加载时长超过 3 秒,用户就会放弃而离开。BBC 发现网页加载时长每增加 1 秒,用户就会流失 10%。 我们希望通过监控来知道 web 应用性能的现状和趋势,找到 web 应用的瓶颈?某次发布后的性能情况怎么样?是否发布后对性能有影响?感知到业务出错的概率?业务的稳定性怎么样? 监控什么? 首先我们需要知道应该监控些什么呢?有哪些具体的指标? google 开发者提出了一种 RAIL 模型来衡量应用性能,即: Response 、 Animation 、 Idle 、 Load ,分别代表着 web 应用生命周期的四个不同方面。并指出最好的性能指标是:100ms 内响应用户输入;动画或者滚动需在 10ms 内产生下一帧;最大化空闲时间;页面加载时长不超过 5 秒。 我们可转化为三个方面来看:响应速度、页面稳定性

Look for traces of APT attacks through the ZoomEye history api

让人想犯罪 __ 提交于 2020-07-26 12:39:52
Author: Heige(a.k.a Superhei) of KnownSec 404 Team Date: May 25,2020 Chinese version: https://paper.seebug.org/1219/ We had released ZoomEye’s historical data API query interface in ZoomEye 2020 that had launched in January this year: https://medium.com/@80vul/zoomeye-2020-has-started-8414d6aaf38 . Next, I will introduce some examples of using ZoomEye History API to capture the traces of APT team attacks. Instructions for using the historical query API interface: https://www.zoomeye.org/doc#history-ip-search ,Of course we have also updated our ZoomEye SDK support history api: https://github

Java工具类——日期相关的类

我们两清 提交于 2020-07-25 18:24:34
前言 在日常的开发工作当中,我们经常需要用到日期相关的类(包括日期类已经处理日期的类),所以,我就专门整理了一篇关于日期相关的类,希望可以帮助到大家。 正文 一、日期类介绍 在 Java 里面,操作日期的类主要有以下几个类: 工具类 所属包 继承关系 实现接口 Date类 java.util包,需要导包 默认继承Object Serializable, Cloneable, Comparable SimpleDateFormat类 java.text包,需要导包 继承DateFormat Serializable, Cloneable Calendar类 java.util包,需要导包 默认继承Object Serializable, Cloneable, Comparable 二、Date类 这是最基础的一个日期类,其中Date类重名的有4个相关的类,这四个类所属的包都不相同,这里我们讲的是位于java.util包下的 Date 类。 1、构造方法 Date 类有6个构造方法,其中后面5个带有 @Deprecated 注解的都已经废弃了(不推荐用),主要用的是前面2个构造方法。 public Date() public Date(long date) @Deprecated public Date(String s) @Deprecated public Date(int

How to raise a click event for a vis.js Timeline (to get the result of a click when the clickToUse option is set to True)?

别来无恙 提交于 2020-06-17 12:40:35
问题 I have multiple timelines in a project that uses vis.js , generated by a PHP code. There is an option for timelines, called clickToUse , if which is set to True , it causes the specific timeline to get selected when the user clicks on the timeline, causing a shadowed outline appearing around it. I'm using an additional div header with title and various information regarding to the timeline below it. I would like to have the timeline selected from code (causing to have the shadowed outline)

SAP OData服务性能测量的几种工具和手段

大憨熊 提交于 2020-05-08 12:25:06
The OData service url being tested is: /sap/opu/odata/sap/CRM_ODATA/TaskCollection?$filter=isMyTask eq true&$expand=DocumentNotes,DocumentNextUserStatuses,DocumentHistories,DocumentApplicationLogs,Attachments Approach1 – gateway client Log on your gateway ( frontend ) server, use tcode /IWFND/GW_CLIENT, paste the url and execute. Then you will get execution time in unit Millisecond. Approach2 – Chrome development tool Open Chrome development tool via F12, paste the COMPLETE url with host name and port number and execute. The time will be displayed in column “Time”. Hover the mouse to column

postgresql , etcd , patroni 做failover

那年仲夏 提交于 2020-05-08 05:16:41
os: centos 7.4 etcd:3.2 主从IP信息 192.168.56.101 node1 master 192.168.56.102 node2 slave 192.168.56.103 node3 slave yum下载、安装 # yum install etcd # yum list installed |grep -i etcd etcd.x86_64 3.2.18-1.el7 @extras 建议使用yum来安装,简单,直接。 etcd 配置 使用 wget 方式 和 yum 方式,会在一些文件路径有有所差异。 以 wget 方式的所有文件都在 /usr/etcd-v3.2.18 下 下面是以yum方式为例配置, # cp /etc/etcd/etcd.conf /etc/etcd/etcd.conf.bak # vi /etc/etcd/etcd.conf # cat etcd.conf #[Member] #ETCD_CORS="" ETCD_DATA_DIR="/var/lib/etcd/node1.etcd" #ETCD_WAL_DIR="" ETCD_LISTEN_PEER_URLS="http://192.168.56.101:2380" ETCD_LISTEN_CLIENT_URLS="http://192.168.56.101:2379

第05讲:Flink SQL & Table 编程和案例

*爱你&永不变心* 提交于 2020-05-06 00:17:17
我们在第 02 课时中使用 Flink Table & SQL 的 API 实现了最简单的 WordCount 程序。在这一课时中,将分别从 Flink Table & SQL 的背景和编程模型、常见的 API、算子和内置函数等对 Flink Table & SQL 做一个详细的讲解和概括,最后模拟了一个实际业务场景使用 Flink Table & SQL 开发。 Flink Table & SQL 概述 背景 我们在前面的课时中讲过 Flink 的分层模型,Flink 自身提供了不同级别的抽象来支持我们开发流式或者批量处理程序,下图描述了 Flink 支持的 4 种不同级别的抽象。 Table API 和 SQL 处于最顶端,是 Flink 提供的高级 API 操作。Flink SQL 是 Flink 实时计算为简化计算模型,降低用户使用实时计算门槛而设计的一套符合标准 SQL 语义的开发语言。 我们在第 04 课时中提到过,Flink 在编程模型上提供了 DataStream 和 DataSet 两套 API,并没有做到事实上的批流统一,因为用户和开发者还是开发了两套代码。正是因为 Flink Table & SQL 的加入,可以说 Flink 在某种程度上做到了事实上的批流一体。 原理 你之前可能都了解过 Hive,在离线计算场景下 Hive 几乎扛起了离线数据处理的半壁江山

YARN常用参数

我只是一个虾纸丫 提交于 2020-05-05 15:43:59
name value description yarn.nodemanager.resource.memory-mb -1 Amount of physical memory, in MB, that can be allocated for containers. If set to -1 and yarn.nodemanager.resource.detect-hardware-capabilities is true, it is automatically calculated(in case of Windows and Linux). In other cases, the default is 8192MB. yarn.scheduler.maximum-allocation-mb 8192 The maximum allocation for every container request at the RM, in MBs. Memory requests higher than this will throw a InvalidResourceRequestException. yarn.scheduler.maximum-allocation-vcores 4 The maximum allocation for every container request

repmgr+pg12集群,挂掉的主机如何手动加入集群

一笑奈何 提交于 2020-05-04 13:44:02
接上回,备机在检测到主机挂掉后,备机通过standby promote成功升级为主机继续提供服务 此时集群状态如下: 接下来需要恢复原主机为备机加入集群继续提供服务 1、主机执行node rejoin,将节点重新加入集群: ./repmgr node rejoin -h192.168.101.7 -Upostgres - dpostgres [postgres@localhost bin]$ ./repmgr node rejoin -h192. 168.101 . 7 -Upostgres - dpostgres ERROR: this node cannot attach to rejoin target node 2 DETAIL: rejoin target server ' s timeline 2 forked off current database system timeline 1 before current recovery point 0/8000028 HINT: use --force-rewind to execute pg_rewind 报错日志可以看出,此时的节点和现在的主节点日志发生了分歧,需要调用--force-rewind重做备机,执行如下命令即可 ./repmgr node rejoin -h192. 168.101 . 7