Exceptional Halt




Thoughts on Flask, Python and Node.js

Recently I’ve been working on a software design competition held in my university. This year’s theme has something to do with GPS/LBS application, which requires candidates to use designated toolkits provided by the sponsor. Since the toolkits is not mature, my team decided to focus on the other option: anything as long as it’s attractive because it’s not mandatory to conform to the theme.

Anyway, we decided to write an app which enables people to draw their interactive models. Since I have experience in former CMS work, I am in charge of server this time. In CMS, I used Node.js and Express for all of the development so I’d like to try something new, like Python, in this project.

Above is the prelude of my thoughts. Initially I set up a virtual environment using pyenv and pyenv-virutualenv. Compared to Node.js ’s NPM, Python’s PIP is not that user-friendly.




  • 任务分配
  • 进度追踪
  • 错误修正


  • 信息冗余(同一个消息和不同人说),
  • 无法定位(因为相关信息都是在对话中),
  • 误解(通过语言/文件解释一个接口必然不精确)


为什么array.sort(function(a, b){return a-b})是从小到大排序


  • If compareFunction(a, b) is less than 0, sort a to a lower index than b, i.e. a comes first.

  • If compareFunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements. Note: the ECMAscript standard does not guarantee this behaviour, and thus not all browsers (e.g. Mozilla versions dating back to at least 2003) respect this.

  • If compareFunction(a, b) is greater than 0, sort b to a lower index than a.

  • compareFunction(a, b) must always return the same value when given a specific pair of elements a and b as its two arguments. If inconsistent results are returned then the sort order is undefined

简而言之,如果比较函数 function(a, b)结果是小于0的,那么第一个参数a就一定是在第二个参数b的前面。如果结果是大于0的,那么第二个参数b就在第一个参数a的前面。





npm run protractor


Error: Could not find chromedriver