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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
/* Client side, works in Chrome 55 and Firefox 52 without transpilation */ | |
//https://blogs.msdn.microsoft.com/typescript/2016/11/08/typescript-2-1-rc-better-inference-async-functions-and-more/ | |
async function fetchURLs() { | |
try { | |
// Promise.all() lets us coalesce multiple promises into a single super-promise | |
var data = await Promise.all([ | |
/* Alternatively store each in an array */ | |
// var [x, y, z] = await Promise.all([ | |
// parse results as json; fetch data response has several reader methods available: | |
//.arrayBuffer() |
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
app.post('/upload', function (req, res) { | |
console.log("Context path1=" + __dirname); | |
var busboy = new Busboy({ headers: req.headers }); | |
busboy.on('file', function(fieldname, file, filename, encoding, mimetype) { | |
console.log("Context path=" + __dirname); | |
var saveTo = path.join(__dirname +"/uploads" ,filename); | |
console.log("inside upload get request111111::: "+filename); | |
console.log('Uploading: ' + saveTo); | |
file.pipe(fs.createWriteStream(saveTo)); |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" type="text/css" media="all" href="index.css"> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> | |
<link rel="stylesheet" href="popupS.css"> | |
<script src="popupS.js"></script> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> |
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 express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
var Busboy = require('busboy'); | |
//require('./chatflow.js').DataTable; | |
var chatFlow=require('./chatflow.js'); | |
const fs = require('fs'); | |
const request = require('request'); | |
const url = require('url'); | |
const https = require('https'); |
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 express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
//require('./chatflow.js').DataTable; | |
var chatFlow=require('./chatflow.js'); | |
const fs = require('fs'); | |
const request = require('request'); | |
const url = require('url'); | |
const https = require('https'); |
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
function getNextMsgId(intent) { | |
console.log("Inside getNextMsgId method " + prevMsg ); | |
for (var c in chatFlow.DataTableArray) { | |
console.log("1: "+String(chatFlow.DataTableArray[0][1])+" 2: "+String(prevMsg)); | |
if (String(prevMsg) in String(chatFlow.DataTableArray.indexOf([0][1]) !== 1)) { | |
console.log("Inside For In Loop " + prevMsg ); | |
console.log("Inside For In Loop" + chatFlow.DataTableArray.indexOf([0][1])); | |
console.log("Inside For In Loop" + chatFlow.DataTableArray[2]); | |
chatFlow.DataTableArray[0][4]=msg; |
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
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<link rel="stylesheet" type="text/css" media="all" href="index.css"> | |
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> | |
</head> |
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 express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
require('./chatflow.js').DataTable; | |
var path = require("path"); | |
const fs = require('fs'); | |
const request = require('request'); |
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 DataTable = { | |
source: [], | |
setEntry: function(i,j,e) { | |
var o ; | |
if( !!! ( o = this.source[i] ) ) o = this.source[i] = [] ; | |
o[j] = e ; | |
return this ; | |
}, | |
getEntry: function(i,j) { | |
var o, e = null ; |
NewerOlder