很多公司都大量使用了python,其中有一些开发规范,code guidline, 通用组件,基础框架是可以共用的。
每个公司都自己搞一套, 太浪费人力,我想开一帖和大家讨论一下这些python基础设施的搭建。
原则是我们尽量不重新发明轮子,但开源组件这么多,也要有个挑选的过程和组合使用的过程,在这里讨论一下。
另一方面,有些开源组件虽然强大,但我们不能完全的驾驭它,或只使用其中很少的一部分,我们就可以考虑用python实现一个简单的轮子,可控性更强,最好不要超过300行代码。
// returns a list of all elements under the cursor | |
// | |
function elementsFromPoint(x,y) { | |
var elements = [], previousPointerEvents = [], current, i, d; | |
if(typeof document.elementsFromPoint === "function") | |
return document.elementsFromPoint(x,y); | |
if(typeof document.msElementsFromPoint === "function") | |
return document.msElementsFromPoint(x,y); | |
I was a bit skeptical about a new data format call tnetstring. It claims to be both human and machine readable. They claim that a parser is easier to built for a tnetstring and therefore is better. In fact, while the implementation of the parser may be easier, human readability suffers with negligible speed gains.
I assert that if human readability is harmed in favor of speed, then you would be much better off using a binary solution such as Protobufs.
Time is in milliseconds: