This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Rx = require('rx'); | |
(function(exports) { | |
function shiftLeft(list, value) { | |
var result = list.slice(1); | |
result.push(value); | |
return result; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Rx = require('rx'); | |
function RefCountObservable(source) { | |
this._source = source; | |
} | |
RefCountObservable.prototype = Object.create(Rx.Observable.prototype); | |
RefCountObservable.prototype._refCount = 0; | |
RefCountObservable.prototype._subject = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename uint_t> | |
uint_t | |
PointKDTreeImplImpl<uint_t>::partitionAroundMedian( | |
uint_t idxBegin, | |
uint_t idxEnd, | |
KDTreeAxis axis) | |
{ | |
uint_t halfSize = (idxEnd - idxBegin) / 2; | |
uint_t idxMedian = idxBegin + halfSize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using IPv4 unspecified address 0.0.0.0 | |
Using IPv6 unspecified address :: | |
Interface lo0 has address ::1 | |
Interface lo0 has address 127.0.0.1 | |
Interface lo0 has address fe80::1%lo0 | |
Interface en0 has address 192.168.1.7 | |
Starting too many servers on port 4567... | |
Listening on 0.0.0.0 port 4567 | |
Listening on :: port 4567 | |
Listening on ::1 port 4567 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var server = net.createServer(); | |
server.listen(4000, function() { | |
console.log('Listening on port 4000!'); | |
}); | |
server.on('error', function(error) { | |
console.error('Help!', error); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var os = require('os'); | |
function getLocalHosts() { | |
var hosts = ['0.0.0.0', '::']; | |
var interfaces = os.networkInterfaces(); | |
Object.keys(interfaces).forEach(function(interfaceName) { | |
var interface = interfaces[interfaceName]; | |
interface.forEach(function(info) { | |
var address = info.address; | |
// append the interface name onto link-local IPv6 addresses |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ '0.0.0.0', | |
'::', | |
'::1', | |
'127.0.0.1', | |
'fe80::1%lo0', | |
'192.168.1.7' ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net'); | |
var os = require('os'); | |
function getLocalHosts() { | |
var hosts = ['0.0.0.0', '::']; | |
var interfaces = os.networkInterfaces(); | |
Object.keys(interfaces).forEach(function(interfaceName) { | |
var interface = interfaces[interfaceName]; | |
interface.forEach(function(info) { | |
var address = info.address; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#define ENUM_CLASS(Name, ...) \ | |
struct Name { \ | |
static int sCounter; \ | |
int mValue; \ | |
Name() : mValue(++Name::sCounter) {} \ | |
operator int() { return mValue; } \ | |
static Name __VA_ARGS__; \ | |
}; \ |
OlderNewer