Skip to content

Instantly share code, notes, and snippets.

View dlutwuwei's full-sized avatar

wei.wu dlutwuwei

  • bytedance
  • beijing
View GitHub Profile
@dlutwuwei
dlutwuwei / route.param.md
Created May 24, 2014 08:53
app.route, app.param - express4.2api讲解

app.routeapp.param是express4.2新增的两个api,这里做一些说明:

app.route

express的官方文档时这样解释的:

>Returns an instance of a single route which can then be used to handle HTTP verbs with optional middleware. Using app.route() is a recommended approach to avoiding duplicate route naming and thus typo errors.

@dlutwuwei
dlutwuwei / chord代码解析.md
Created May 22, 2014 13:51
chord代码解析

使用peersim已经有一段时间了,但是对如何能够编制高效程序,使用peersim提供的接口还有很多不足,今天开始学习官网上提供的协议模拟包,希望能够学习到peersim高手的一些技巧。

CreateNw:对chord协议进行初始化,构造chord环的后继表,初始化finger表; ChordProtocol:处理FinalMessage和LookupMessage,维持chord网络拓扑结构; TrafficGenerator:随机产生查询消息,制造网络流量; MessageObserver:观察chord网络的消息量和查询成功率等;

以上是主要的五个需要配置的类,其他类主要是一些辅助类: ChordMessage:是一个接口,由FinalMessage和LookupMessage实现; Parameters:封装两个id,PID协议ID,TID传输层ID(事件驱动特用);

@dlutwuwei
dlutwuwei / github.md
Created May 21, 2014 06:24
git使用概述

title: git使用概述(初学者必看) date: 2014-05-21 13:00:50 categories: git tags: [git, hexo, gitcafe, github]

昨天为了把hexo博客放到gitcafe上,由于hexo d命令配置仓库不起作为,hexo g生成项目时很多更新判断是有问题,造成一些配置项无法生效,好的办法是把.deploy和pulic文件夹都删除,重新走一遍,但是本着学习的精神,还是好好地研究了一番git。

对于快速上手git,推荐看廖雪峰大牛的git教程, 写得很易懂,但是有些使用场景也没覆盖到,全面的教程在这里,免费的书哦,但是内容太多,看起来太累。

###一、概念理解

@dlutwuwei
dlutwuwei / hexo.md
Created May 20, 2014 10:30
hexo速度优化

title: hexo速度优化(light主题) date: 2014-05-20 9:00:50 categories: hexo tags: [hexo, 优化, jquery,googleapis]

hexo是利用github.io实现的一个博客系统,它在本地生成静态页面上传到github,为广大码农提供了一个免费的博客托管,网上很多教程,只教大家配置各种插件,发现打开网页还要载入大半天,甚至报一大堆脚本错误,虽然不影响使用,但是让人看着很难受。

![enter image description here][1]

@dlutwuwei
dlutwuwei / express.md
Created May 20, 2014 01:30
express4.2源码解析

title: express4.2源码解析 date: 2014-05-18 15:00:50 categories: express tags: [nodejs, node, js, express]

express是nodejs平台上一个非常流行的框架,4.2.0是最新的版本,相比3.x版本优化了代码和api,去除了connect模块,自己实现了一个router组件,实现http请求的顺序流程处理,去除了很多绑定的中间件,使代码更清晰。

##1.使用express 如何使用express在官网有很好的讲解,只用experssjs实例app的几个函数,就可以构建构建web程序。