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
public class ExecutionTimeMeasurementExample { | |
public static void main(String[] args) throws InterruptedException { | |
long startTime = System.currentTimeMillis(); | |
sleepFunction(1000); | |
sleepFunction(1000); | |
long endTime = System.currentTimeMillis(); | |
System.out.println("Program took " + (endTime - startTime) + " ms to complete"); | |
} | |
private static void sleepFunction(int milliSecondsToSleep) throws InterruptedException { |
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 sleepFunction = function(milliSecondsToSleep) { | |
let startTime = new Date().getTime(); | |
setTimeout(function() { | |
console.log("Dummy CallBack"); | |
}, milliSecondsToSleep); | |
let endTime = new Date().getTime(); | |
console.log("My job done in " + (endTime - startTime) + " ms"); | |
} | |
let startTime = new Date().getTime(); |
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 sleepFunction = function(milliSecondsToSleep) { | |
let startTime = new Date().getTime(); | |
setTimeout(function() { | |
let endTime = new Date().getTime(); | |
console.log("My job done in " + (endTime - startTime) + " ms"); | |
}, milliSecondsToSleep); | |
} | |
let startTime = new Date().getTime(); | |
sleepFunction(1000); |
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 sleepFunction = function(milliSecondsToSleep, timerLabel) { | |
console.time(timerLabel); | |
setTimeout(function() { | |
console.timeEnd(timerLabel); | |
}, milliSecondsToSleep); | |
} | |
console.time("Program"); | |
sleepFunction(1000, "FunctionCall1"); | |
sleepFunction(1000, "FunctionCall2"); |
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 kafka = require('kafka-node'); | |
exports.initiateKafkaConsumerGroup = function (groupName, topicName) { | |
var options = { | |
// connect directly to kafka broker (instantiates a KafkaClient) | |
kafkaHost: '127.0.0.1:9092', | |
groupId: groupName, | |
autoCommit: true, | |
autoCommitIntervalMs: 5000, | |
sessionTimeout: 15000, |
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 kafka = require('kafka-node'); | |
var producer = null; | |
var readyFlag = false; | |
var BaseModel = function () { | |
}; | |
BaseModel.prototype.produceJob = function (topic, pload, isBatchProducer, callback) { | |
module.exports.getProducer(topic, pload, isBatchProducer); |
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
//We can use fs.readdir or fs.readdirSync methods | |
const fs = require('fs'); | |
const testFolder = __dirname + '/files/'; | |
//Asynchronous way | |
fs.readdir(testFolder, (err, files) => { | |
files.forEach(file => { | |
console.log(file); | |
}); | |
}) |
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
<html> | |
<head> | |
<title>MNIST</title> | |
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/[email protected]"> </script> | |
<script type="text/javascript"> | |
// Variables for referencing the canvas and 2dcanvas context | |
var canvas, ctx; | |
// Variables to keep track of the mouse position and left-button status |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> | |
<script> | |
function onLoad() { | |
var url = 'jsonData.json'; | |
$.getJSON(url, function (json) { | |
var table = $('<table>'); |
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
[ | |
{ | |
"ID": 1, | |
"Name": "Tankala Ashok", | |
"IDNumber": "1234" | |
}, | |
{ | |
"ID": 2, | |
"Name": "Himabindu", | |
"IDNumber": "2345" |
OlderNewer