Use this header file to conditionally invoke eio_custom() or uv_queue_work(), depending on the node version that the module is being compiled for.
See the usage.cc file for a partial example.
Comments, forks, and improvements are welcome!
| /* | |
| author: jbenet | |
| os x, compile with: gcc -o testo test.c | |
| linux, compile with: gcc -o testo test.c -lrt | |
| */ | |
| #include <time.h> | |
| #include <sys/time.h> | |
| #include <stdio.h> |
| node_modules/ |
| // For each of the following code fragments: | |
| // a. what does the code do? | |
| // b. what did the author intend for it to do? | |
| // c. how would you fix it? | |
| // NOTE: all code samples work exactly the same in all browsers | |
| // 1. object literals | |
| var data = [ { high: 100, low: 81 }, { high: 93, low: 73 }, { high: 60, low: 32 } ]; | |
| function getAverages(data) { | |
| var avgs = []; |
| Buffer.prototype.pprint = function() { | |
| var line = ""; | |
| if(this.length > 0) { | |
| for(var i=0; i<this.length; i++) { | |
| if(i%8==0) { | |
| sys.print(" "); | |
| } | |
| if(i%16==0) { | |
| sys.print(line); | |
| line = ""; |
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the branch/status of the current git repository | |
| # * the branch of the current subversion repository | |
| # * the return value of the previous command | |
| # | |
| # USAGE: |