- 博客(13)
- 资源 (2)
- 收藏
- 关注
转载 Understanding process.nextTick()
I have seen quite a few people being confused about process.nextTick(). Let's take a look at whatprocess.nextTick() does, and when to use it.As you might already know, every Node application runs
2015-01-29 16:25:55 621
原创 nodejs 调试技巧
1, 命令行调试run 执行脚本,在第一行暂停restart 重新执行脚本cont, c 继续执行,直到遇到下一个断点next, n 单步执行step, s 单步执行并进入函数out, o 从函数中步出setBreakpoint(), sb() 在当前行设置断点setBreakpoint(‘f()’), sb(...) 在函数f的第一行设置断点setBreakp
2015-01-29 10:31:39 892
原创 nodejs EventEmitter
Many objects in Node emit events: a net.Server emits an event each timea peer connects to it, afs.readStream emits an event when the file isopened. All objects which emit events are instances ofev
2015-01-28 15:31:24 1347
原创 nodejs 创建http server
1, http module require: var声明变量,require在引用module的时候,module名字用''引用。var http=require('http');2,http的几个方法:http.createServer([requestListener])#Returns a new web server object.The requestL
2015-01-28 14:37:18 3932
转载 多线程同步I/O和单线程异步I/O
多线程同步I/O和单线程异步I/O2014-08-24同步I/O与异步I/O线程在执行中如果遇到磁盘读写或网络通信(统称IO操作),通常要耗费较长的时间,这时OS会剥夺此线程的CPU控制权,使其暂停执行,同时将资源让给其他的工作线程,这种线程调度方式称为阻塞。当I/O操作完毕时,操作系统将这个线程的阻塞状态解除,恢复其对CPU的控制权,令其继续执行,这种I/O模式就是同步式I/O或阻塞
2015-01-27 18:28:41 4855
原创 同步式IO和异步式IO
什么是阻塞(block):线程在执行中如果遇到磁盘读写或网络通信(统称为io操作),通常要耗费较长的时间,这时操作系统会剥 .夺这个线程的CPU控制权,使其暂停执行,同时将资源让给其他的工作线程,这种线程调度方式称为阻塞。当IO操作完毕时,操作系统将这个线程的阻塞状态解除,恢复其对CPU的控制权,令其继续执行。这种IO模式就是通常的同步式IO或阻塞式IO。异步式IO或非阻塞式则针对所有
2015-01-27 18:20:51 735
转载 python list comprehension
http://www.secnetix.de/olli/Python/list_comprehensions.hawkhttp://www.secnetix.de/olli/Python/list_comprehensions.hawkPython: List ComprehensionsNote: Lines beginning with ">>>"and "..." i
2015-01-23 10:11:22 837
转载 linux socket server and client
In a previous example we learnt about the basics of socket programming in C. In this example we shall build a basic ECHO client and server. The server/client shown here use TCP sockets or SOCK_STREA
2015-01-22 13:44:20 832
转载 Python的map/filter/reduce常见用法例举
摘要:熟练掌握Python的map、filter、 reduce、 lambda以及list comprehension的用法,可以让你写出简洁的代码。1. map大多数的for循环可以用map来代替。map(func,seq)自动地将func施加到seq的每一个元素,并返回执行结果。例1 返回list array=[3,5,7,12,18]每个元素的立方组成的新list。用for
2015-01-22 13:43:11 616
转载 Yet Another Lambda Tutorial
转载:https://pythonconquerstheuniverse.wordpress.com/2011/08/29/lambda_tutorial/There are a lot of tutorials[1] for Python’slambda out there. One that I stumbled across recently and really found
2015-01-20 15:17:44 593
转载 20分钟学会AWK
转载自:http://ferd.ca/awk-in-20-minutes.htmlAwk in 20 MinutesWhat's AwkAwk is a tiny programming language and a command line tool. It'sparticularly appropriate for log parsing on servers, mos
2015-01-20 14:27:41 2489
原创 git am failed:cannot open <dir>/*.patch: No such file
git am ~/xxx/xxx/xxx/*.patch这个命令在脚本中执行的时候,出现了:/usr/lib/git-core/git-am: 209: /usr/lib/git-core/git-am: cannot open ~/projects-develop/bosch-patch-scripts/bosch-patch-final2/u-boot/*.patch: No such
2015-01-12 15:26:27 1628
转载 What is fast-forward in git
转载自:https://sandofsky.com/images/fast_forward.pdf
2015-01-12 09:33:13 728
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人