This file contains hidden or 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 path = require('path'); | |
var filename = path.basename(path.normalize(__filename)) | |
// Install deps: | |
// $> npm install log4js | |
// $> npm install node-lumberjack | |
// | |
// Run as: | |
// $> time node stress.js > /dev/null |
This file contains hidden or 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
/* | |
* Output on my machine (i686 32-bit): | |
* | |
* qsort: 3.08 sec | |
* Bottom up Merge Sort: 1.98 sec | |
* Top down Merge Sort: 2.43 sec | |
* std::sort: 2.22 sec | |
* | |
*/ |
This file contains hidden or 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
/* Compiling: Create a file named list_sort.c in the src/ folder and | |
* run: | |
* | |
* gcc list_sort.c lcthw/list.o lcthw/list_algos.o -I . -O2 | |
* | |
* Time: 14.025s | |
* | |
*/ | |
#include "lcthw/list.h" | |
#include "lcthw/list_algos.h" |
This file contains hidden or 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 dns = require('dns'); | |
console.log('Calling resolveSrv(localhost)'); | |
dns.lookup('localhost', function() { | |
console.log('Callback for resolve(localhost)'); | |
}); | |
console.log('After calling resolveSrv(localhost)'); | |
console.log('Calling resolveSrv(127.0.0.1)'); | |
dns.lookup('127.0.0.0', function() { |
This file contains hidden or 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
const js = require('../jsonselect.js'); | |
var obj = { | |
books: [ | |
{ name: "A Rough Ride", author: "Unknown" }, | |
{ name: "A Smooth Ride", author: "Known" }, | |
{ name: "Javascript", author: "Crockford" }, | |
{ name: "Node.js", author: "Dahl" }, | |
{ name: "C++", author: "Stroustrup" } | |
], |
This file contains hidden or 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
/* | |
* Copyright (c) 2011 Dhruv Matani | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is | |
* furnished to do so, subject to the following conditions: | |
* |
NewerOlder