Some useful java codes for my work