摘要: 大型网站系统架构 dubbo+ssh+nginx负载均衡/动静分离+数据库主从+缓存+分布式存储+队列 1、缓存--利用缓存改善网站性能a.缓存包含本地缓存和分布式缓存;本地缓存如OSCache,分布式缓存如Memcached、Redis。 b.本地缓存和分布式缓存的特点本地缓存的特点是速度快,但是 阅读全文
posted @ 2016-12-30 16:55 yweihainan 阅读(177) 评论(0) 推荐(0) 编辑
摘要: 1 public static int getIntervalDays(Date date, Date otherDate) { 2 long time = Math.abs(new LocalDate(date).toDate().getTime() - new LocalDate(otherDate).toDate().getTime()); 3 return (int) t... 阅读全文
posted @ 2016-12-30 16:52 yweihainan 阅读(203) 评论(0) 推荐(0) 编辑
摘要: 1 public static List getWorkDates(int year, int month) { 2 List dates = new ArrayList(); 3 Calendar cal = Calendar.getInstance(); 4 cal.set(Calendar.YEAR, year); 5 ... 阅读全文
posted @ 2016-12-30 16:46 yweihainan 阅读(1541) 评论(0) 推荐(0) 编辑
摘要: 在写代码初期,最关注的是如何用代码实现需求,如果是仅仅实现业务需求的话,即使是刚上手的程序员,只要解题能力还OK,基本上都是可以写出代码来的。所以我自己一直认为数学成绩是程序员的一个非常重要的要求,数学好的人通常解题和逻辑思维能力是还不错的。 上面的这个基本的写代码的过程中,写的更好的同学的体现会在 阅读全文
posted @ 2016-12-30 16:32 yweihainan 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 什么是ApplicationContext? 它是spring的核心,Context我们通常解释为上下文环境,但是理解成容器会更好些。 ApplicationContext则是应用的容器。 Spring把Bean(object)放在容器中,需要用就通过get方法取出来。 ApplicationEve 阅读全文
posted @ 2016-12-30 16:23 yweihainan 阅读(5805) 评论(0) 推荐(0) 编辑
摘要: 1 package com.jt.mongo.demo.modules.init; 2 3 import org.slf4j.Logger; 4 import org.slf4j.LoggerFactory; 5 import org.springframework.context.ApplicationListener; 6 import org.springframework.... 阅读全文
posted @ 2016-12-30 16:17 yweihainan 阅读(1392) 评论(0) 推荐(0) 编辑
摘要: 1 package com.jt.boot.utils; 2 3 import com.google.common.base.Objects; 4 5 import java.net.NetworkInterface; 6 import java.nio.ByteBuffer; 7 import java.util.Date; 8 import java.ut... 阅读全文
posted @ 2016-12-30 15:06 yweihainan 阅读(4607) 评论(0) 推荐(0) 编辑