日记整理---->2016-11-21
2016-11-21简单的总结一下学到的知识点。作为一个目标而存在的东西,总是那么美丽而优雅。
一、PE中事务的编写
getTransactionTemplate().execute(new TransactionCallback() {
public Object doInTransaction(TransactionStatus arg0) {
getSqlMap().update("mt.updateSystemLimit",context.getDataMap());// 更新个人限额表
getSqlMap().update("mt.updateSystemLimitEnt",context.getDataMap());// 更新企业限额表
if(!"".equals(MinGuaranteeLimit)&&MinGuaranteeLimit!=null&&!"".equals(EarlyWarningLimit)&&EarlyWarningLimit!=null){
getSqlMap().update("mt.updateSystemLimitEnt",map2);// 更新企业垫资限额和保底限额
}
return null;
}
}
二、日志的控制级别
error>warn>info>debug。
在spring中,若要打印框架内部的日志。需要将jcl的日志框架改成slf能够识别的日志规范。在spring中使用logback,需要以下的jar包。
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback-version}</version>
</dependency> <dependency>
<groupId>org.logback-extensions</groupId>
<artifactId>logback-ext-spring</artifactId>
<version>${logback-spring-version}</version>
</dependency> <!-- 添加这个,可以打印spring内部的日志 -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.21</version>
</dependency>
三、Vue中的v-bind:value和v-model
首先v-model只是一种语法糖,以下两种写法是等价的。
<input v-model="something">
<input v-bind:value="something" v-on:input="something = $event.target.value">
以下是一个例子,便于理解:value和v-model的区别。html部分的代码:
<div id="app">
<input :value="username" @input="updateUsername"><br>
<input v-model="username"><br>
<div>{{username}}</div>
</div>
- js的代码如下:
var password = "huhx";
new Vue({
el: "#app",
data: {
username: password,
},
methods: {
updateUsername: function(e) {
password = "name is huhx";
}
}
});
运行的效果如下:password的改变并不影响this.username,也就是输入框的内容。
aaarticlea/gif;base64,R0lGODlh0wBKAEQAACH5BAAUAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAA0wBKAKT///+pqakAAAD/13ev//8nAE/XdydPr/8AT6+vTwB31////6/X////r08nAAAAAE8nd9c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AkSQnBBCDwJ9EidQxBY5AQNHcMQ8LxrFaYxIGhS33pUQkpOLxyQtOq0vs8Hst6NQrX/m8ts279yJ9bYAnaEZSAH6EVkOLTo2OXZCRLhEAIfkEAQoAAAAsYgACAAcAEQCiAP8AAAAApsj/////hWMsepzTAAAAAAAAAxcoCir05RFAq7046827/0MYhENgAmaQAAAh+QQBFAAAACwoAAYABQAQAKMA/wAAAAD/13ev//8nAE////8MAAD//6/X//931/9PACcAJ3eTTwAAAAAAAAAAAAAEH7AAEICkdtbFQkCHklQCMVSGR5rrCZQu3M4ZdlU3EAEAIfkEARQAAAAsKwAGAAUAEACjAP8AAAAA/9d3r///JwBP////DAAA//+v1///d9f/TwAnACd3k08AAAAAAAAAAAAABB+wABCApHbWxUJAh5JUAjFUhkea6wmULtzOGXZVNxABACH5BAEUAAAALC0ABgAFABAAowD/AAAAAK/Xd6///ycAT////9f//08AJwAMAHfX/3fXrwAAAAAAAAAAAAAAAAAAAAQeEBQQgKR2VoBCMMqRVAIxbBRpqidQti8rZ9i1aUAEACH5BAEKAAAALDAABgAFABAAowD/AAAAAP/Xd6///ycAT////wwAAP//r9f//3fX/08AJwAnd5NPAAAAAAAAAAAAAAQfsAAQgKR21sVCQIeSVAIxVIZHmusJlC7czhl2VTcQAQAh+QQBCgAAACwzAAYABQAQAKMA/wAAAAD/13ev//8nAE////8MAAD//6/X//931/9PACcAJ3eTTwAAAAAAAAAAAAAEH7AAEICkdtbFQkCHklQCMVSGR5rrCZQu3M4ZdlU3EAEAIfkEAQoAAAAsYQADAAgAFAChAP8AAAAA////epzTAiPEbggr6/xcW6HS8MLM2+kIfJHIgaTXUWnYCZO7YSYYZlaFFQAh+QQBFAAAACxEAAcAJAAmAKEA/wD///8AAAAAAAACR4SPqQvh/ZicKNB7Ld5L8294ICeOWGlSaCqtbPeecTar9eTejZ44ls8LCofEYlGABCAFRKbReTQqpdAm9frERrPcrXCpTPIKACH5BAEUAAAALAYAAgCbAC4AowD/AHmb0v///6mpqa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2S6vm23v8JRTgcIw8hgOQIBzc7P0NHS09TV1tfNCdjb3N3bAszJ4lcB4AHj6FPl4X8C6Xvr5+3vePGE7vR09vP5cft++Pq1+bcnoMA0BPEYPFgm4Z2FDME4pAMxopeJcSpaJGfu3saGHT35ffyCEY7GkepCAkRJUmVBlhddKoS5pSTNXzZv6ornrafPn0CDCr3mDpzRo0iTKl3KtKnTp1CjSp1K1V0EACH5BAEUAAAALDIABgAGABAAowD/AAAAAP/Xd////6///ycAT///rycAANf//3fX/3e1d08AJ69PAAAAAAAAAAAAAAQiEAwAAp31UitZCAhgLAknFISlHJ+Juil1xsAM31ombbkVAQAh+QQBFAAAACw2AAYABQAQAKMA/wAAAAD/13ev//8nAE////8MAAD//6/X//931/9PACcAJ3eTTwAAAAAAAAAAAAAEH7AAEICkdtbFQkCHklQCMVSGR5rrCZQu3M4ZdlU3EAEAIfkEAQoAAAAsOQAGACIAGACjAP8AAAAA/////9d3r///JwBP//+vDAAA1///ACd3TwAnd9f/k08AAAAAAAAAAAAABFFQABCmvThrK+n+IDdVYZklTBAgZjsZykK65lAQMx0eaq5/NtwPIygCioKg79cT9JTDEDQKvC2plik207luu1sNOEwum8/otHq9QQaQ5h5FFQEAIfkEAQoAAAAsTgAOAA0AHQCiAP8AAAAA////qampe53UAAAAAAAAAAAAAzkIutLQYkkVp61W4ky59gzYiRtXZoQIDCoWvMAbjNL8TTb0OIoN+h4gR5ghWow4FbKmbIqWshhskgAAIfkEAQoAAAAsTQAbAAgAEgChAP8A////AAAAAAAAAiBEbggbCwJXdKI5aW+9mL9MgR23keLnlRqoHJmgRRBcAAAh+QQBFAAAACwGAAIAmwAuAKMA/wB5m9L///+pqamlx/6kxv0AAADT4/5kluiSor1Pr/8AJ3cAAAAAAAAAAAAAAAAE/xCISau9OOvNu/9gKEpDaZ5oqq5s675wLM/0NAB4ru987//AoHBILBqLA9txyWw6n9BgUnCLWnGCq3Z7nFa5zix4TNZ5y0wxeq09s4uLtxzqngfV9jyxru/h+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4nJp7nD2Wn3KVqKQ2qa+qIE0ur6CutBJEJba3uLm6u7y9vr+wscLExUAAA7AA==" alt="" />
如果在updateUsername方法中,加上this.username = e.target.value;那么第一个输入框的修改,会影响所有的内容显示。这也就是上述所说的v-model类似
- 如果加上以下的内容:
computed: {
username: function() {
return password + ", name";
}
},
运行的效果如下:修改两个输入框的内容,不改变this.username,而且this.username内容始终为:huhx, name。这说明了在渲染数据的时候,先是data里面的username,然后调用computed里面的username的get方法。
aaarticlea/gif;base64,R0lGODlhJgFOAFUAACH5BAAKAAAAIf8LTkVUU0NBUEUyLjADAQAAACwAAAAAJgFOAKX///+pqakAAAD/13ev//8nAE9Pr/93JwD//9d31////68nAAAAT6//r09PAAAAJ3cAACfX//8AAE8nd9fXdycnACevTwBPACevr09PAE9Pd3dPT093dydPd9d3r3fXd08nd68nd3cAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAG/0CAcEgsGo/IpHLJbDqf0Kh0Sq1ar9isdsvter/g8DdALpvP6LR6zW673/C4fC6u2+2Bu35/z/P/gFF+gYSFgoaIiYOJjI0Ai46RYpCSlXuUlplYmJqdXZyeoU55AwUES6WnoqtJoKyvRaSmqLOwto+3uUayqkmpuq+uwKKyGAICBgC/qaXGyAAUEAnKCxNIpRzH1gANxwIMAAgHGgvfA+XgAAoOAhK9w63wuqQL4A3uy6bn9u4AFuAWth05Z+0egXXJGkgT9yDCuoYDKiQQl4xCQ3nxMNoiJVGZvlnMOv4St+HiNZG1hCi4MPFAMorhXP5aOU3jLpuweHkkkI8nyP9a3ZL5+nnq3LGFLmO+lFnuaE2cQ4RBjaSTGdGe6i54SGmkZ8RpNGGKlcl1alSzxHbuRAgNH1Fx1ixGuEbUoD+kS/PC/IVWKlpFan9ROBYig8+ipixcXAdQoJCe4o6BcDk2rzp20v7i0qzJb5Q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QcAHgAZAKQA/wD4+ftCQ00YGCTIycwLCxhLTFeys7jw8PMsLDj09Pfh4ePW1tgoKDTl5efo6OozMz/OztLCwslhYmwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFnGAQAGRpnmgqjmnrkqP4zicr0zQL3Lir779erRY8DQivIg81ECBbRWBrAHBCVcsStfocYotbLioKA5usJp1tZT53d+UYGRAuoeFs6XSMzsuyWikIVitlekwtD3clf3stCwJjhSlhCCQCmJhCgQAKBQdVoJsmVJ4ECQALqKNaCAVIBhIABqKsAq8kBA0ADKusKAYMABC/KQ4NExEkIQAh+QQBFAAAACwUAQ0ADAATAKAA/wD///8CKEyAqXa6YFxqUTZ458rQVcRhmleF2GGe6TkyDBh96CvTM0zdkpi6SAEAIfkEAAoAqwAsPAAbAAEAEACgAAAAAAAAAgSEjwkFADsA" alt="" />
四、关于pe加载文件的部分笔稿
XmlBeanDefinitionReader 这个不一样,这里开始了重写。
XmlBeanDefinitionReader
ApplicationConfigParser这个是解析的类 EntityResolver entityResolver = (EntityResolver)constructor0.newInstance(new Object[] { "pe-config.dtd", "/com/csii/pe/config/"})
tag-definitions.xml定义了pe的核心。
loadTagDefinitions Class parserClass0 = Class.forName("com.csii.pe.config.ApplicationConfigParser");
setParserClass(parserClass0);
Class class0 = Class.forName("com.csii.pe.config.DtdResolver");
Constructor constructor0 = class0.getConstructor(new Class[] {
java.lang.String.class, java.lang.String.class
});
EntityResolver entityResolver = (EntityResolver)constructor0.newInstance(new Object[] {
"pe-config.dtd", "/com/csii/pe/config/"
});
setEntityResolver(entityResolver);
logger.info("using entity resolver:" + entityResolver);
}
五、对于js中装包的理解
首先js的代码如下:
function funTest() {
var outerParam = "huhx";
innner("123456");
function innner(str) {
console.log("hello world " + outerParam + ", " + str);
}
return function() {
innner("linux");
outerParam = "chenhui";
console.log(outerParam);
}
}
- funTest():
hello world huhx, 123456
- funTest()():
hello world huhx, 123456
hello world huhx, linux
chenhui
- var test = new funTest(); test();
hello world huhx, 123456
hello world huhx, linux
chenhui
六、伪元素的基本使用
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
span:before {
content: "I love you, "
}
span:after {
content: "I hate you.";
color: red;
}
</style>
</head>
<body>
<p><span id="test">周长风</span></p>
<script type="text/javascript">
var ele = document.getElementById("test").innerText; // 周长风
alert(ele);
</script>
</body>
</html>
页面显示效果:
七、toString和String强制转换的区别
Object obj = null;
System.out.println(obj.toString()); // 抛出空指针异常:java.lang.NullPointerException
System.out.println((String)obj); // null
八、 抢火车票程序思路
1、访问12306网站,查询余票。通过console可以得到请求的url以及请求数据。 2、在项目中通过okhttp发送请求,可以得到返回的数据。 3、转换成json对象,对数据进行解析处理。 4、得到你想要的信息,根据要求判断是否发送邮件通知。 5、开启一个定时任务,不断的轮询火车票的状态,重复上述的操作。
一、访问12306网站:在console里面得到url为:参数2017-01-17是出发日,SHH是出发地上海,WHN是目的地武汉,ADULT是单选框选中的普通。
https://kyfw.12306.cn/otn/leftTicket/queryA?leftTicketDTO.train_date=2017-01-17&leftTicketDTO.from_station=SHH&leftTicketDTO.to_station=WHN&purpose_codes=ADULT
对url进行组装:
final String path = url + "queryA?leftTicketDTO.train_date=" + time + "&leftTicketDTO.from_station=" + from + "&leftTicketDTO.to_station=" + to + "&purpose_codes=" + purpose;
返回的数据在12306上显示大概如下:
二、通过okhttp发送的get请求,得到返回的数据:
Runnable runnable = new Runnable() {
@SuppressWarnings("deprecation")
@Override
public void run() {
OkHttpClient.Builder builder = new OkHttpClient.Builder();
List<InputStream> inputStreams = new ArrayList<>();
inputStreams.add(new ByteArrayInputStream(CER_12306.getBytes()));
SSLSocketFactory sslSocketFactory = getSocketFactory(inputStreams);
builder.sslSocketFactory(sslSocketFactory);
OkHttpClient client = builder.build();
Request request = new Request.Builder().url(path).build();
try {
Response response = client.newCall(request).execute();
ResponseBody body = response.body();
String string = body.string(); // 请求返回的数据
// 对返回的数据进行分析处理
getInfoFromResponse(string);
System.out.println("string " + string);
body.close();
} catch (IOException e) {
e.printStackTrace();
}
}
};
三、对返回的数据做解析处理。
private static void getInfoFromResponse(String string) {
boolean isEmailSend = true;
JSONObject jsonObject = JSONObject.parseObject(string);
String httpStatus = jsonObject.getString("httpstatus");
StringBuilder builder = new StringBuilder();
if (StringUtils.isEmpty(httpStatus) || !httpStatus.equals("200")) {
return;
}
@SuppressWarnings("unchecked")
List<Map<String, Map<String, String>>> dataObject = (List<Map<String, Map<String, String>>>) jsonObject.get("data");
System.out.println(dataObject.size());
builder.append(getInfoMessage(dataObject, isEmailSend));
if (isEmailSend) {
SendMailUtils.sendMail(emailTo, "<span>" + builder.toString() + "</span>");
}
}
四、针对解析处理的结果,看是否要发送邮件通知。
public static void sendMail(String to, String message) {
Properties props = new Properties();
props.put("mail.smtp.host", "smtp.qq.com");
props.put("mail.smtp.port", 465); // 这个需要
props.put("mail.smtp.auth", "true");
props.put("mail.from", EMAIL_SEND_FROM);
props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
Session session = Session.getInstance(props, auth);
MimeMessage msg = new MimeMessage(session);
Address address;
try {
address = new InternetAddress(EMAIL_SEND_FROM);
msg.setFrom(address);
msg.setRecipients(Message.RecipientType.TO, to);
msg.setSubject("胡红翔");
msg.setSentDate(new Date());
String html = "<html><body>" + message + "</body></html>";
msg.setText(html, "utf-8", "html");
Transport.send(msg);
} catch (Exception e) {
e.printStackTrace();
}
}
五、开启定时任务
// 定时任务
ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
service.scheduleAtFixedRate(runnable, 0, watiTime, TimeUnit.MINUTES);
六、接收的邮件通知如下:不够人性化,但是数据都有,后续处理好说。
七、过程中遇到的问题
1、使用okhttp发送https请求时,会涉及到证书的知识。这方面不是很了解 2、线程中关于是否发送邮箱的变量isEmailSend有些不好把握,关于线程方面有待提高。
八、过程中学到的知识:
1、okhttp发送https请求,了解了一些关于证书的知识 2、定时任务的另外一种写法。
友情链接
日记整理---->2016-11-21的更多相关文章
- 2017/11/21 Leetcode 日记
2017/11/21 Leetcode 日记 496. Next Greater Element I You are given two arrays (without duplicates) num ...
- 【读书笔记】2016.11.19 北航 《GDG 谷歌开发者大会》整理
2016.11.19 周六,我们在 北航参加了<GDG 谷歌开发者大会>,在web专场,聆听了谷歌公司的与会专家的技术分享. 中午免费的午餐,下午精美的下午茶,还有精湛的技术,都是我们队谷 ...
- U3D笔记11:47 2016/11/30-15:15 2016/12/19
11:47 2016/11/30Before you can load a level you have to add it to the list of levels used in the gam ...
- 【转载】webstorm11(注册,激活,破解,码,一起支持正版,最新可用)(2016.11.16更新)
很多人都发现 http://idea.lanyus.com/ 不能激活了 很多帖子说的 http://15.idea.lanyus.com/ 之类都用不了了 最近封的厉害仅作测试 选择 License ...
- 微信iphone7、 ios10播放视频解决方案 2016.11.10
2016.11.10日更新以下方法 微信最新出同层播放规范 即使是官方的也无法解决所有android手机的问题. 另外iphone 5 .5s 某些手机始终会弹出播放,请继续采用 “以下是老的解决办法 ...
- FFMpeg ver 20160219-git-98a0053 滤镜中英文对照 2016.02.21 by 1CM
FFMpeg ver 20160219-git-98a0053 滤镜中英文对照 2016.02.21 by 1CM T.. = Timeline support 支持时间轴 .S. = Slice t ...
- ”耐撕“团队 2016.3.21 站立会议3 2 1 GO!
”耐撕“团队 2016.3.21 站立会议 时间:2016.3.21 ① 17:20-17:45 ②17:55-18:10 总计40分钟 成员: Z 郑蕊 * 组长 (博客:http://www ...
- 打印出1,11,21,31,41。。。。。。的shell脚本
打印出1,11,21,31,41......的shell脚本 方法一:#!/bin/bash ;i<;i=i+));do echo $i #cat -n /etc/services | sed ...
- 最新的 cocoapods 安装与使用(2016.11)
cocoapods简介: cocoapods 是iOS的类库管理工具,可以让开发者很方便集成各种第三方库,而不用去网站上一个个下载,再一个个文件夹的拖进项目中,还得添加相关的系统依赖库.只需要安装好c ...
- China Intelligent Office Summit(2018.11.21)
时间:2018.11.21地点:中关村软件园国际会议中心
随机推荐
- (实用)Eclipse中使用命令行(运行外部程序)
备忘 http://www.oschina.net/question/28_46291 另外,在eclipse的console菜单中可以选择“new console view”(新控制台视图),这样就 ...
- C#常用数据类型间的转换
数据类型有很多种,数据类型间的转换也是有很多的方法,如果不细心整理的话等到用的时候再查就会显得很浪费时间,所以决心整理出这篇博文.主要是讲解常用数据类型之间的转换方法以及常见数据类型所占字节数. 字节 ...
- kafka基本概念
介绍 Kafka是一个分布式的.可分区的.可复制的消息系统.它提供了普通消息系统的功能,但具有自己独特的设计. 这个独特的设计是什么样的呢? 首先让我们看几个基本的消息系统术语:Kafka将消息以to ...
- Scripting.FileSystemObject对象的详细技巧指南
Scripting.FileSystemObject对象的详细技巧指南 FileSystemObject对象提供对计算机文件系统的访问: powered by 25175.net 在代码内操作文本文件 ...
- (Dos)/BAT命令入门与高级技巧详解(转)
目录 第一章 批处理基础 第一节 常用批处理内部命令简介 1.REM 和 :: 2.ECHO 和 @ 3.PAUSE 4.ERRORLEVEL 5.TITLE 6.COLOR 7.mode 配置系统设 ...
- winform下通过webclient使用非流方式上传(post)数据和文件
这两天因为工作的需要,需要做一个winform上传数据到服务器端的程序.当时第一个想法是通过webservice的方式来实现,后来觉得麻 烦,想偷懒就没有用这样的方式,http的post方式变成了第一 ...
- Rob Whitfield:银行已准备好避免下一场金融危机的爆发
2014夏季达沃斯论坛于9月10日至12日在天津举行.来自全球90多个国家和地区的1600多位精英将就“推动创新 创造价值”这一主题展开激烈讨论.中国电子银行网全程直击,第一时间为您带来达沃斯最前方的 ...
- opencv获取IP摄像头(IP-camera)实时视频流
之前这篇文章讲了如何通过网络摄像头(web camera)获取实时视频流,但是这种方法的缺陷就是摄像头和主机必须连在一起,那这种在室外部署的时候就会非常麻烦并且不安全,所以后来找了下用海康威视或者大华 ...
- symfony window下的安装 安装时候出现的问题以及解决方案
1. cmd进入DOS , cd 到 php.exe 的目录下 2. php -r "readfile('http://symfony.com/installer');&q ...
- go类型系统
https://blog.csdn.net/hittata/article/details/50915496 https://blog.csdn.net/hittata/article/details ...