A Little Bit About Doctype

As we can imply from the name doctype, it’t the type of the document that’s going to be treated by the User Agents, it appears above the <html> tag.

There was a time I was creating a new HTML file for IE and when I run the page something unexpected happened, the divs I had originally placed correctlly were in a goddamned mess. What caused this is IE was set to ‘quirks mode’ automatically, after I selected ‘IE 8 document mode’(no joking) everything were back on the way again. So what made IE choose the ‘quirks mode’ for me even I had forced IE to treat it using ‘IE 8’, is I forgot to add the doctype at the beginning of the document.

KMP is not that complex

Generate Fibonacci Number in 4 Ways

Recently when I searched “Dynamic Programming(DP for short)” on YouTube I found a super inspired video about the core thinking of DP and it takes some of the most classical examples as Fibonacci and shortest path and so on.

Node.js的http处理多个url

众所周知,Node.js是单线程、非阻塞的JavaScript运行环境,其中的一个原理是在内部执行“事件轮询”(Event loop)来查询正在处理的状态。但是,由于每一个事件的属性不同,所需要处理的时间也不同,因此当所有事件完成是并且调用回调函数的顺序是不同的,所以系统带有一定的随机性。

Ruby `self` 用法 1

我们在Ruby的类中定义一个方法,有的方法是作为接口需要被暴露出来,我们叫做实例方法(instance method),然而有的方法则是类的内部方法,叫做(class method)。