简单的quartz 可视化监听管理界面
spring-quartz。
导包、配置,不在此介绍。
简单的quartz管理界面,包括触发器的暂停、恢复、删除、修改(暂无),任务的运行、触发添加、创建,删除。
扩展内容:日志的管理,添加和创建触发器的操作(暂无实现)
本文原创,禁止转载。
扩展内容(暂不实现)
前端代码:
<%--
Created by IntelliJ IDEA.
User: ttttt
Date: 2017/5/31
Time: 15:43
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<title>Title</title>
<link rel="stylesheet" type="text/css" href="/bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="/js/jquery-2.1.1.min.js"/>
<script type="text/javascript" src="/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<h1>调度详情</h1>
<table id="table_report" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<!-- th class="text-center">序号</th-->
<th class="text-center">任务组名称</th>
<th class="text-center">定时任务名称</th>
<th class="text-center">触发器组名称</th>
<th class="text-center">触发器名称</th>
<%--<th class="text-center">任务类名</th>--%>
<th class="text-center">触发器描述</th>
<th class="text-center">时间表达式</th>
<th class="text-center">任务状态</th>
<th class="text-center">开始时间</th>
<th class="text-center">上次重启时间</th>
<th class="text-center">上次执行时间</th>
<%--<th class="text-center">下次运行时间</th>--%>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<!-- 开始循环 -->
<c:choose>
<c:when test="${not empty jobInfos && jobInfos.size()>0}">
<c:forEach items="${jobInfos}" var="var" varStatus="vs">
<tr>
<td class='text-center' style="width: auto;">${var.jobGroup}</td>
<td class='text-center' style="width: auto;">${var.jobName}</td>
<td class='text-center' style="width: auto;">${var.triggerGroupName}</td>
<td class='text-center' style="width: auto;">${var.triggerName}</td>
<%--<td class='text-center' style="width: auto;">${var.jobClass}</td>--%>
<td class='text-center' style="width: auto;">${var.description}</td>
<td class='text-center' style="width: auto;">${var.cronExpr}</td>
<td class='text-center' style="width: auto;">
<c:if test="${var.jobStatus == 'NONE'}">
<span class="label">未知</span>
</c:if>
<c:if test="${var.jobStatus == 'NORMAL'}">
<span class="label label-success arrowed">正常运行</span>
</c:if>
<c:if test="${var.jobStatus == 'PAUSED'}">
<span class="label label-warning">暂停状态</span>
</c:if>
<c:if test="${var.jobStatus == 'COMPLETE'}">
<span class="label label-important arrowed-in">完成状态</span>
</c:if>
<c:if test="${var.jobStatus == 'ERROR'}">
<span class="label label-info arrowed-in-right arrowed">错误状态</span>
</c:if>
<c:if test="${var.jobStatus == 'BLOCKED'}">
<span class="label label-danger">锁定状态</span>
</c:if>
</td>
<td class='text-center' style="width: auto;"><fmt:formatDate value="${var.startTime}"
pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td class='text-center' style="width: auto;"><fmt:formatDate value="${var.reStartTime}"
pattern="yyyy-MM-dd HH:mm:ss"/></td>
<td class='text-center' style="width: auto;"><fmt:formatDate value="${var.previousFireTime}"
pattern="yyyy-MM-dd HH:mm:ss"/></td>
<%--<td class='text-center' style="width: auto;"><fmt:formatDate value="${var.nextFireTime}"--%>
<%--pattern="yyyy-MM-dd HH:mm:ss"/></td>--%>
<td class='text-center' style="width: auto;">
<a class="btn btn-sm btn-warning" onclick="pauseJob('${var.triggerName}','${var.triggerGroupName}');">暂停</a>
<a class="btn btn-sm btn-success" onclick="resumeJob('${var.triggerName}','${var.triggerGroupName}');">恢复</a>
<a class="btn btn-sm btn-info" onclick="triggerJob('${var.jobName}','${var.jobGroup}');">修改</a>
<a class="btn btn-sm btn-danger" onclick="deleteJob('${var.triggerName}','${var.triggerGroupName}');">删除</a>
</td><!-- cron,jobName,jobGroupName,triggerName,triggerGroupName -->
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr class="main_info">
<td colspan="100" class="text-center">没有相关数据</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
<h1>任务详情</h1>
<table id="table_detail_report" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<!-- th class="text-center">序号</th-->
<th class="text-center">任务组名称</th>
<th class="text-center">任务名称</th>
<th class="text-center">任务类名</th>
<th class="text-center">任务描述</th>
<th class="text-center">持久性</th>
<th class="text-center">禁止并发</th>
<th class="text-center">数据更新</th>
<th class="text-center">恢复性</th>
<th class="text-center">关联调度器数量</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody>
<!-- 开始循环 -->
<c:choose>
<c:when test="${not empty jobDetailInfos && jobDetailInfos.size()>0}">
<c:forEach items="${jobDetailInfos}" var="var" varStatus="vs">
<tr>
<td class='text-center' style="width: auto;">${var.jobGroup}</td>
<td class='text-center' style="width: auto;">${var.jobName}</td>
<td class='text-center' style="width: auto;">${var.jobClass}</td>
<td class='text-center' style="width: auto;">${var.description}</td>
<td class='text-center' style="width: auto;">
<c:if test="${var.duration}">
是
</c:if>
<c:if test="${!var.duration}">
否
</c:if>
</td>
<td class='text-center' style="width: auto;">
<c:if test="${var.concurrentExectionDisallowed}">
是
</c:if>
<c:if test="${!var.concurrentExectionDisallowed}">
否
</c:if>
</td>
<td class='text-center' style="width: auto;">
<c:if test="${var.persistJobDataAfterExecution}">
是
</c:if>
<c:if test="${!var.persistJobDataAfterExecution}">
否
</c:if>
</td>
<td class='text-center' style="width: auto;">
<c:if test="${var.requestsRecovery}">
是
</c:if>
<c:if test="${!var.requestsRecovery}">
否
</c:if>
</td>
<td class='text-center' style="width: auto;">${var.triggerCount}</td>
<td class='text-center' style="width: auto;">
<a class="btn btn-sm btn-success"
onclick="triggerJob('${var.jobName}','${var.jobGroup}');">运行一次</a>
<a class="btn btn-sm btn-warning" href="/quartz/addJobTrigger?jobName=${var.jobName}&&jobGroup=${var.jobGroup}">添加调度</a>
<a class="btn btn-sm btn-info" href="/quartz/addJobTrigger?jobName=${var.jobName}&&jobGroup=${var.jobGroup}">创建调度</a>
<a class="btn btn-sm btn-danger" onclick="deleteJobDetail('${var.jobName}','${var.jobGroup}');">删除</a>
</td><!-- cron,jobName,jobGroupName,triggerName,triggerGroupName -->
</tr>
</c:forEach>
</c:when>
<c:otherwise>
<tr class="main_info">
<td colspan="100" class="text-center">没有相关数据</td>
</tr>
</c:otherwise>
</c:choose>
</tbody>
</table>
<h1>添加/修改 调度</h1>
<form class="form-horizontal" action="quartzAdd/add">
<div class="form-group">
<label for="jobName" class="col-sm-1 control-label">任务名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobName" disabled placeholder="任务名称" value="${jobDetailInfo.jobName}">
</div>
</div>
<div class="form-group">
<label for="jobGroupName" class="col-sm-1 control-label">任务组名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobGroupName" disabled placeholder="任务组名称" value="${jobDetailInfo.jobGroup}">
</div>
</div>
<div class="form-group">
<label for="jobClass" class="col-sm-1 control-label">任务类</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobClass" disabled placeholder="任务类" value="${jobDetailInfo.jobClass}">
</div>
</div>
<c:forEach items="${jobDetailInfo.jobDataMap}" var="var" varStatus="vs">
<div class="form-group">
<label for="jobData${vs.count}" class="col-sm-1 control-label">${var.key} (初始化)</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobData${vs.count}" disable placeholder="当前任务值:${var.value}">
</div>
</div>
</c:forEach>
<div class="form-group">
<label for="triggerName" class="col-sm-1 control-label">触发器名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="triggerName" placeholder="触发器名称">
</div>
</div>
<div class="form-group">
<label for="triggerGroupName" class="col-sm-1 control-label">触发器组名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="triggerGroupName" placeholder="触发器组名称">
</div>
</div>
<div class="form-group">
<label for="cron" class="col-sm-1 control-label">cron表达式</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="cron" placeholder="例如: 0 0/5 * 6L * 1,2 ?">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">是否立即执行</label>
<div class="col-sm-3">
<label class="radio-inline">
<input type="radio" name="radio" id="inlineRadio1" value="1"> 是
</label>
<label class="radio-inline">
<input type="radio" name="radio" id="inlineRadio2" value="0"> 否
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-1 col-sm-3">
<button type="submit" class="btn btn-default">添加调度</button>
</div>
</div>
</form>
<h1>创建调度</h1>
<form class="form-horizontal" action="quartzAdd/add">
<div class="form-group">
<label for="jobName1" class="col-sm-1 control-label">任务名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobName1" placeholder="任务名称">
</div>
</div>
<div class="form-group">
<label for="jobGroupName1" class="col-sm-1 control-label">任务组名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobGroupName1" placeholder="任务组名称">
</div>
</div>
<div class="form-group">
<label for="jobClass1" class="col-sm-1 control-label">任务类</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="jobClass1" disabled placeholder="任务类" value="${jobDetailInfo.jobClass}">
</div>
</div>
<div class="form-group">
<label for="triggerName1" class="col-sm-1 control-label">触发器名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="triggerName1" placeholder="触发器名称">
</div>
</div>
<div class="form-group">
<label for="triggerGroupName1" class="col-sm-1 control-label">触发器组名称</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="triggerGroupName1" placeholder="触发器组名称">
</div>
</div>
<div class="form-group">
<label for="cron1" class="col-sm-1 control-label">cron表达式</label>
<div class="col-sm-3">
<input type="text" class="form-control" id="cron1" placeholder="例如: 0 0/5 * 6L * 1,2 ?">
</div>
</div>
<div class="form-group">
<label class="col-sm-1 control-label">是否立即执行</label>
<div class="col-sm-3">
<label class="radio-inline">
<input type="radio" name="radio" id="inlineRadio11" value="1"> 是
</label>
<label class="radio-inline">
<input type="radio" name="radio" id="inlineRadio12" value="0"> 否
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-1 col-sm-3">
<button type="submit" class="btn btn-default">创建调度</button>
</div>
</div>
</form>
<br/>
<script>
function deleteJobDetail(jobName, jobGroup) {
if(confirm("是否删除该任务详情。")){
$.ajax({
type: "POST",
url: "/quartz/deleteJobDetail",
data: {"jobName": jobName, "jobGroup": jobGroup},
success: function (data) {
if(data){
location.reload();
}else{
alert("删除失败。");
}
},
fail: function () {
alert("操作失败。");
}
});
}
}
function triggerJob(jobName, jobGroup) {
if(confirm("是否立即运行一次。")){
$.ajax({
type: "POST",
url: "/quartz/triggerJob",
data: {"jobName": jobName, "jobGroup": jobGroup},
success: function (data) {
if(data){
location.reload();
}else{
alert("删除失败。");
}
},
fail: function () {
alert("操作失败。");
}
});
}
}
function deleteJob(triggerName, triggerGroup) {
if(confirm("是否删除该任务。")){
$.ajax({
type: "POST",
url: "/quartz/deleteJob",
data: {"triggerName": triggerName, "triggerGroup": triggerGroup},
success: function (data) {
if(data){
location.reload();
}else{
alert("删除失败。");
}
},
fail: function () {
alert("操作失败。");
}
});
}
}
function resumeJob(triggerName, triggerGroup) {
$.ajax({
type: "POST",
url: "/quartz/resumeJob",
data: {"triggerName": triggerName, "triggerGroup": triggerGroup},
success: function (data) {
if(data){
location.reload();
}else{
alert("恢复失败。");
}
},
fail: function () {
alert("操作失败。");
}
});
}
function pauseJob(triggerName, triggerGroup) {
$.ajax({
type: "POST",
url: "/quartz/pauseJob",
data: {"triggerName": triggerName, "triggerGroup": triggerGroup},
success: function (data) {
if(data){
location.reload();
}else{
alert("暂停失败。");
}
},
fail: function () {
alert("操作失败。");
}
});
}
</script>
</body>
</html>
Controllere代码:
package com.sky.controller; import com.sky.bean.JobDetailManage;
import com.sky.bean.JobEntity;
import com.sky.util.QuartzManager;
import com.sky.util.QuartzUtils;
import com.sun.istack.internal.NotNull;
import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;
import org.quartz.impl.matchers.GroupMatcher;
import org.springframework.scheduling.quartz.QuartzJobBean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView; import java.util.ArrayList;
import java.util.List;
import java.util.Set; /**
* @author sky
*/
@Controller
public class JobController { private Scheduler quartzScheduler; @RequestMapping("/quartz")
public ModelAndView quartz() {
ModelAndView mv = new ModelAndView();
mv.setViewName("quartz");
JobKey jobKey = JobKey.jobKey("hello4", "group1");
try {
mv.addObject("jobInfos", getSchedulerJobInfo());
mv.addObject("jobDetailInfos", getJobDetailInfos());
mv.addObject("jobDetailInfo", getJobDetailInfo(jobKey));
} catch (SchedulerException e) {
}
return mv;
} //暂停任务
@PostMapping("quartz/pauseJob")
@ResponseBody
public boolean pauseJob(@NotNull String triggerName, @NotNull String triggerGroup) {
TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
try {
quartzScheduler.pauseTrigger(triggerKey);
} catch (SchedulerException e) {
System.out.println(e.getMessage());
}
return true;
} //恢复任务
@PostMapping("quartz/resumeJob")
@ResponseBody
public boolean resumeJob(@NotNull String triggerName, @NotNull String triggerGroup) throws Exception {
TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
quartzScheduler.resumeTrigger(triggerKey);
return true;
} //删除任务
@PostMapping("quartz/deleteJob")
@ResponseBody
public boolean deleteJob(@NotNull String triggerName, @NotNull String triggerGroup) throws Exception {
JobKey jobKey = JobKey.jobKey(triggerName, triggerGroup);
TriggerKey triggerKey = TriggerKey.triggerKey(triggerName, triggerGroup);
quartzScheduler.pauseTrigger(triggerKey);
return quartzScheduler.unscheduleJob(triggerKey);
} //立即运行任务
@PostMapping("quartz/triggerJob")
@ResponseBody
public boolean triggerJob(@NotNull String jobName, @NotNull String jobGroup) throws Exception {
JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
quartzScheduler.triggerJob(jobKey);
return true;
} //删除任务详情
@PostMapping("quartz/deleteJobDetail")
@ResponseBody
public boolean deleteJobDetail(@NotNull String jobName, @NotNull String jobGroup) throws Exception {
JobKey jobKey = JobKey.jobKey(jobName, jobGroup);
List<Trigger> triggers = (List<Trigger>) quartzScheduler.getTriggersOfJob(jobKey);
if (triggers.size() > 0) {
return false;
}
return quartzScheduler.deleteJob(jobKey);
} // @SuppressWarnings("unchecked")
private List<JobEntity> getSchedulerJobInfo() throws SchedulerException {
SchedulerFactory schedulerFactory = new StdSchedulerFactory();
quartzScheduler = schedulerFactory.getScheduler(); List<JobEntity> jobInfos = new ArrayList<JobEntity>();
List<String> triggerGroupNames = quartzScheduler.getTriggerGroupNames();
for (String triggerGroupName : triggerGroupNames) {
Set<TriggerKey> triggerKeySet = quartzScheduler.getTriggerKeys(GroupMatcher.triggerGroupEquals(triggerGroupName));
for (TriggerKey triggerKey : triggerKeySet) {
Trigger t = quartzScheduler.getTrigger(triggerKey);
JobEntity jobInfo = new JobEntity();
if (t instanceof CronTrigger) {
CronTrigger trigger = (CronTrigger) t;
jobInfo.setCronExpr(trigger.getCronExpression());
} else if (t instanceof SimpleTrigger) {
SimpleTrigger trigger = (SimpleTrigger) t;
jobInfo.setCronExpr(trigger.getRepeatCount() + 1 + "-" + trigger.getTimesTriggered() + "(" + trigger.getRepeatInterval() + ")"); }
JobKey jobKey = t.getJobKey();
JobDetail jd = quartzScheduler.getJobDetail(jobKey);
jobInfo.setJobName(jobKey.getName());
jobInfo.setJobGroup(jobKey.getGroup());
jobInfo.setTriggerName(triggerKey.getName());
jobInfo.setTriggerGroupName(triggerKey.getGroup());
jobInfo.setNextFireTime(t.getNextFireTime());
jobInfo.setPreviousFireTime(t.getPreviousFireTime());
jobInfo.setStartTime(t.getStartTime());
jobInfo.setEndTime(t.getEndTime());
jobInfo.setJobClass(jd.getJobClass().getCanonicalName());
jobInfo.setDescription(t.getDescription()); Trigger.TriggerState triggerState = quartzScheduler.getTriggerState(t.getKey());
jobInfo.setJobStatus(triggerState.toString());// NONE无, NORMAL正常, PAUSED暂停, COMPLETE完全, ERROR错误, BLOCKED阻塞
JobDataMap map = quartzScheduler.getJobDetail(jobKey).getJobDataMap();
// jobInfo.setCount(Integer.parseInt((String) map.get("count")));
if (null != map) {
jobInfo.setJobDataMap(map);
} else {
jobInfo.setJobDataMap(new JobDataMap());
}
jobInfos.add(jobInfo);
}
}
return jobInfos;
} // @SuppressWarnings("unchecked")
private List<JobDetailManage> getJobDetailInfos() throws SchedulerException {
List<JobDetailManage> jobDetailInfos = new ArrayList<JobDetailManage>(); for (String groupName : quartzScheduler.getJobGroupNames()) {
for (JobKey jobKey : quartzScheduler.getJobKeys(GroupMatcher.jobGroupEquals(groupName))) {
jobDetailInfos.add(getJobDetailInfo(jobKey));
}
}
return jobDetailInfos;
} // @SuppressWarnings("unchecked")
private JobDetailManage getJobDetailInfo(JobKey jobKey) throws SchedulerException {
JobDetail jobDetail = quartzScheduler.getJobDetail(jobKey);
List<Trigger> triggers = (List<Trigger>) quartzScheduler.getTriggersOfJob(jobKey); if(jobDetail != null){
JobDetailManage jobDetailManage = new JobDetailManage();
jobDetailManage.setJobName(jobKey.getName());
jobDetailManage.setJobGroup(jobKey.getGroup());
jobDetailManage.setDescription(jobDetail.getDescription());
jobDetailManage.setDuration(jobDetail.isDurable());
jobDetailManage.setJobClass(jobDetail.getJobClass().getCanonicalName());
jobDetailManage.setJobDataMap(jobDetail.getJobDataMap());
jobDetailManage.setPersistJobDataAfterExecution(jobDetail.isPersistJobDataAfterExecution());
jobDetailManage.setConcurrentExectionDisallowed(jobDetail.isConcurrentExectionDisallowed());
jobDetailManage.setRequestsRecovery(jobDetail.requestsRecovery());
jobDetailManage.setTriggerCount(triggers.size()); return jobDetailManage;
}
return null;
}
}
JobDetailManage类:
package com.sky.bean; import org.quartz.JobDataMap; /**
* @author sky
*/
public class JobDetailManage {
private String jobName;
private String jobGroup;
private String description;
private Boolean duration;
private String jobClass;
private JobDataMap jobDataMap;
private Boolean concurrentExectionDisallowed;
private Boolean persistJobDataAfterExecution;
private Boolean requestsRecovery;
private Integer triggerCount; //get set
}
JobEntity类:
package com.sky.bean; import org.quartz.JobDataMap; import java.util.Date; /**
* 调度器信息
*
* @author sky
*/
public class JobEntity {
private int jobId;
private String jobType;
private String jobGroup;
private String jobName;
private String triggerName;
private String triggerGroupName;
private String cronExpr;
private String description;
private Date previousFireTime;
private Date nextFireTime;
private String jobStatus;
private Date startTime;
private Date endTime;
private Date reStartTime;
private String jobClass;
private int count;
private JobDataMap jobDataMap; //get set
}
简单的quartz 可视化监听管理界面的更多相关文章
- oracle配置监听图形界面不出来解决方法
ROOT用户下,执行 xhost + 然后再切换到oracle用户运行netca DISPLAY 在Linux/Unix类操作系统上, DISPLAY用来设置将图形显示到何处. 直接登陆图形界面或 ...
- 作业引擎quartz.net --- 监听链
针对多个作业:如何描述各个跑批任务之间的顺序,紧前.紧后关系,实现灵活调度.例如:A完成则B开始,B完成C开始. 对quartz.net 进行了查阅,能实现如上业务,如下图: 测试代码: using ...
- PLSQL连接Oracle64监听和服务的配置!
前言: 这里不会涉及到太多关于版本问题的解决,只是简单提一下基本的监听和服务配置问题的解决,让你可以快速的用PLSQL连接上你自己创建的Oracle数据库(这里示例数据库名为ORCL); 版本问题: ...
- Android中如何监听GPS开启和关闭
转自 chenming 原文 Android中如何监听GPS开启和关闭 摘要: 本文简单总结了如何监听GPS开关的小技巧 有时需要监听GPS的开关(这种需求并不多见).实现的思路是监听代表 GPS ...
- Linux下修改Oracle监听地址
如果你的服务器换了ip怎么办? 如果你的服务器换了名字怎么办? 以前的小伙伴怎么办? 以前的老客户怎么办? 没关系,简单教你修改监听地址,老朋友随便找! 想要修改监听地址首先要找到两个文件,确定两样东 ...
- OC - 18.监听iPhone的网络状态
使用系统的方法来监听网络状态 系统的方法是通过通知机制来实现网络状态的监听 实现网络状态监听的步骤 定义Reachability类型的成员变量来保存网络的状态 @property (nonatomic ...
- android 监听短信数据库,制作短信控制工具,控制别人的手机!!(一)
序言:本程序示例本着简洁易懂的目的,只做了简单的功能实现,需要用户启动应用,收到短信才有效果.作者将会在后面的(二)篇中加入服务后台运行.自动启动功能,实现一个真正的短信控制工具.本文的目的很简单,让 ...
- JS监听组合按键
有些时候,我们需要在网页上,增加一些快捷按键,方便用户使用一些常用的操作,比如:保存,撤销,复制.粘贴等等. 下面简单梳理一下思路: 我们所熟悉的按键有这么集中类型: 单独的按键操作,如:delete ...
- 原生javascript实现类似jquery on方法的行为监听
原生javascript有addEventListener和attachEvent方法来注册事件,但有时候我们需要判断某一行为甚至某一函数是否被执行了,并且能够获取前一行为的参数,这个时候就需要其他方 ...
随机推荐
- mycat详细
MyCAT的优势基于阿里开源的Cobar产品而研发,Cobar的稳定性.可靠性.优秀的架构和性能以及众多成熟的使用案例使得MYCAT一开始就拥有一个很好的起点,站在巨人的肩膀上,我们能看到更远.业界优 ...
- 2015,鬼王Xun和GGL比赛,带给我们无尽的欢乐
一如既往的风格,正文之前,先扯蛋~ 这篇文章好久就想写了,一直没有动笔,最近在忙于Android和iOS等技术研究,又忙于金融投资等方面的学习和写作.这个周末,把技术进度延缓了点,把很多闲杂的 ...
- 编写使用systemctl启动服务脚本
CentOS 7的服务systemctl脚本存放在:/usr/lib/systemd/,有系统(system)和用户(user)之分,像需要开机不登陆就能运行的程序,还是存在系统服务里吧,即:/usr ...
- BNUOJ 34990 Justice String
Justice String Time Limit: 2000ms Memory Limit: 65536KB 64-bit integer IO format: %lld Java cla ...
- POJ——T 3687 Labeling Balls
http://poj.org/problem?id=3687 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14842 ...
- 国庆 day 7 上午
思路:模拟,set记录一下. #include<set> #include<cstdio> #include<cstring> #include<iostre ...
- Unity 相机花式分屏
花式分屏,顾名思义,可以实现各种不规则几何边界的分屏,是无法直接通过调整相机视口能达到效果的(只能实现矩形的分屏),例如斜对角分屏,几何图形分屏: 假设我们有两个相机,需要上面的斜对角分屏画面,和镜子 ...
- USACO Section 1.3 : Calf Flac (calfflac)
题意:据说假设你给无限仅仅母牛和无限台巨型便携式电脑(有很大的键盘),那么母牛们会制造出世上最优秀的回文. 你的工作就是去寻找这些牛制造的奇观(最优秀的回文). 在寻找回文时不用理睬那些标点符号.空格 ...
- rest_framework-节流-总结完结篇
列表从后往前读 #1.在request中获取IP#2.访问记录 VISIT_RECORD = {} 放缓存 数据库 都可以 建议缓存import timeclass VisitThrottle(obj ...
- nil gogo
https://blog.csdn.net/zhonggaorong/article/details/50233421 https://github.com/KevinHM/FunctionalRea ...