Java Mail中文乱码


Nginx: 简单负载均衡

工作之前的时候,做任何web项目,我都会选择用PHP,简洁,快速,有时候很赞同PHP是世界上最好的语言,但是有些时候还是不如Java来的利索。可惜的是Java“不支持”热部署(至少在生产环境下不建议热部署), 导致每次部署都会有一段服务下线的时间(更糟糕的是用户的session也会随之丢失,最最糟糕的时候,每次部署,有时候还不得不重启一下Tomcat)。

My Windows Tools

I am a software developer, and during my daily work time I use a DELL laptop with Win7. Since I have used windows for a long time, and used and am using a lot of awesome tools, below is the list of tools I recommend.

LeetCode answers in Java

I have put all my answers of LeetCode questions here: LeetCode(Java). Hope this will be helpful for anyone who is fighting with interviews.

freetwitterkeywords: a fun project

This project is started by my friend Aki, who has a lot of experience of big data and is the most awesome I have seen so far. (A secret: His mother is very good at cooking!) Our goal is:1Better keyword targeting suggestions than Twitter's tool

Jackson: deserialize nested object

I am implementing a RESTful server inside my company. The workflow is very straight-forward: request and response. However, nothing is easy, the RESTful service is based on an existed project, which handles database operations, and the entities inside that project is pretty complex(a lot of interfaces and abstract classes).

Remote tomcat deployment with Gradle

Recently, I am playing Gradle, which is a similar tool as Maven. What I usual do is to depoly webiste into Tomcat. Refer this Deploy Website into Tomcat 7 with Maven. Here is my note to deploy website with Gradle.

Fix: Tomcat7 restart too slow in Ubuntu 14.04

I have two servers in DigitalOcean, and both of them are Ubutun with tomcat 7. Recently, I found that if I want to restart tomcat, it will cost me more than 5 minutes(No errors during this). And the worest is(almots half an hour):1INFO: Server startup in 1497026 ms

Java: Test a file is image or not

There are many ways to check whether a file is image. For example, check the file extension(jpg, png, gif …). But this is not so safe, in a web environment, user may rename XXX.exe, to XXX.jpg, then s/he can succeed to upload it. In this case, it can induce security problem.

Note: why SVN is so slow to connect to server

It happens from one month ago after I changed my windows domain password(Damn windows forced me to do that). Then every time when I want to commit to server, I need to input my password(SVN won’t save it for me), what’s more, SVN always needs more than 3 minutes to connect with server at background.