摘要: References: [1]. http://www.javaworld.com/article/2074481/java-concurrency/java-101--understanding-java-threads--part-4 thread-groups--volatility--and 阅读全文
posted @ 2016-06-06 23:37 小张的练习室 阅读(255) 评论(0) 推荐(0)
摘要: References: [1]. http://python.jobbole.com/81129/ 本文将讨论Python中下划线(_)字符的使用方法。我们将会看到,正如Python中的很多事情,下划线的不同用法大多数(并非所有)只是常用惯例而已。 单下划线(_) 通常情况下,会在以下3种场景中使用 阅读全文
posted @ 2016-02-01 23:32 小张的练习室 阅读(212) 评论(0) 推荐(0)
摘要: 1. Enum Class 2. Use Enum Class 阅读全文
posted @ 2016-01-06 19:43 小张的练习室 阅读(165) 评论(0) 推荐(0)
摘要: If a file has content like which are all key-value pairs, we could use properties.load() to parse it. The reason to use Thread.currentThread().getCont 阅读全文
posted @ 2015-10-12 21:52 小张的练习室 阅读(168) 评论(0) 推荐(0)
摘要: In a Maven project, we may often struggle to get a certain file (e.g. json file or sql file). Here is how to place the resource file and use it in the 阅读全文
posted @ 2015-10-08 21:25 小张的练习室 阅读(233) 评论(0) 推荐(0)
摘要: Main reference[1]http://winterbe.com/posts/2014/07/31/java8-stream-tutorial-examples1. How Streams WorkA stream represents a sequence of elements and ... 阅读全文
posted @ 2015-07-17 22:39 小张的练习室 阅读(279) 评论(0) 推荐(0)
摘要: Main reference:[1] http://winterbe.com/posts/2014/03/16/java-8-tutorial/[2]https://plus.google.com/107771575694787223844/posts1. Add default methods f... 阅读全文
posted @ 2015-07-17 21:33 小张的练习室 阅读(238) 评论(0) 推荐(1)
摘要: 设置全局的timer需要在web.xml中添加servlet, 并设置load-on-startup 为 1, 然后在servlet的init()中开启timer, 具体代码如下:1. web.xml backup locationService.backup.Backup 12. Backup.j... 阅读全文
posted @ 2015-04-14 17:54 小张的练习室 阅读(236) 评论(0) 推荐(0)
摘要: 1. To handle 404 not found yourself, just add this code to your web.xml 404 /pageNotFound.jsp 2. To handle wrong action not mapped in Str... 阅读全文
posted @ 2015-04-14 17:46 小张的练习室 阅读(210) 评论(0) 推荐(0)
摘要: 1. Beansa. Version Beanpackage locationService.beans;import java.sql.Timestamp;import java.util.ArrayList;import java.util.List;import javax.persisten... 阅读全文
posted @ 2015-03-10 22:15 小张的练习室 阅读(378) 评论(0) 推荐(0)