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> | |
#include<list> | |
using namespace std; | |
class Graph | |
{ | |
int V; | |
list<int> *adj; | |
public: | |
Graph(int V) |
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
// output | |
hello | |
world |
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
setTimeout(function() { | |
console.log("world"); | |
}, 2000) | |
console.log("hello"); |
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
// extract a core module like this | |
var http = require('http); | |
// extract a user defined module like this | |
var something = require('./folder1/folder2/folder3/something.js'); |
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
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { | |
var F = function () {}; | |
F.prototype = o; | |
return new F(); | |
}; | |
var otherPerson = Object.create(person); |
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
// take order for table 1 and move on... | |
orderNonBlocking(['Coke', 'Iced Tea'], function(drinks){ | |
return serveOrder(drinks); | |
}); | |
// take order for table 2 and move on... | |
orderNonBlocking(['Beer', 'Whiskey'], function(drinks){ | |
return serveOrder(drinks); | |
}); |
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
// take order for table 1 and wait... | |
var order1 = orderBlocking(['Coke', 'Iced Tea']); | |
// once order is ready, take order back to table. | |
serveOrder(order1); | |
// once order is delivered, move on to another table. | |
// take order for table 2 and wait... | |
var order2 = orderBlocking(['Coke', 'Water']); |
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
if (typeof Object.create !== 'function') { | |
Object.create = function (o) { | |
var F = function () {}; | |
F.prototype = o; | |
return new F(); | |
}; | |
var otherPerson = Object.create(person); |
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
// output | |
hello | |
world |
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
setTimeout(function() { | |
console.log("world"); | |
}, 2000) | |
console.log("hello"); |
NewerOlder