Yan Blog

读书需要思考。呜呼,尽信书不如无书

Understanding Https

As web applications today are using http to do the communication between the client and server, the security for the communication become more and more important. Https is a scheme that a new SSL l...

Record a Best Solution

Recently, when I played on LeetCode.com, there is a solution for a question is really beautiful. In this post, I want to present this solution. The question is: The solution is: public int si...

Using Java to parse XML document

I will introduce how to use a simple Java program to parse a XML document. A given XML document test.xml: <?xml version="1.0" encoding="UTF-8"?> <note> <to>Tove</to> &...

Simple Tutorial of Go html parser

Parsing html document is one of very useful feature for web crawler when you only need crawl a specific element content on the web page. In go 1.4.0, a html parser in golang.org/x/net/html. In this...

Delete A Git Repository History

Sometimes, you have to delete some of the history of your repository in your github. Some reason like, you have some confidential detail negligently submitted into your public repository (e.g. pers...

Package Control not showing

Yesterday, when I am using my sublime and trying to install a new package, I experience an terrible issue. That is my package control is not showing in the list when I press ctrl + shift + p. I tri...

Singleton Pattern Learning

Singleton pattern is to have only one instance for a class. One of the most important reason to use singleton pattern is to save memory. For example, in a system there should be only one window man...

Factory Pattern Learning

Encapsulation is one of the most useful features in an OO program language such as Java and C++. We can encapsulate platform dependencies such as window system, operating system, database, etc. Sin...

Welcome to My Blog!

Hi, my friend. My name is Yan Dai, from China. Currently, I’m living in New Zealand. My current job is Java Developer at Syl Semantics. Syl is a company providing services about information managem...