query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Whether paragraph is empty or composed only of whitespace. | function isEmptyParagraph(node) {
return node.type === 'paragraph' && node.children.every(isEmptyText)
} | [
"function isEmptyParagraph(node) {\n return (!node ||\n (node.type.name === 'paragraph' && !node.textContent && !node.childCount));\n}",
"function isEmptyDocument(node) {\n var nodeChild = node.content.firstChild;\n if (node.childCount !== 1 || !nodeChild) {\n return false;\n }\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that create the option for the select (genres) | function createGenresSelect(container, genres) {
for (var i = 0; i < genres.length; i++) {
var option = $(".template option").clone();
option.val(genres[i]["id"]).text(genres[i]["name"])
container.append(option);
}
} | [
"function buildSelect(heroes) {\n var select = document.createElement(\"select\");\n heroes.forEach(h => {\n select.innerHTML += \"<option value='\" + h.link + \"' data-name='\" + h.name + \"'>\" + h.name + \"</option>\";\n })\n return select;\n }",
"function displayGenre... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse the action info within the given payload | parseSlackActionInfo () {
const payload = this.request.body.payload;
let actionPayload;
let actionOrCallbackId =
payload.actions &&
payload.actions[0] &&
payload.actions[0].action_id;
if (!actionOrCallbackId) {
actionOrCallbackId = payload.view && payload.view.private_metadata;
}
if (!actionOrC... | [
"action(type, payload) {\n var action;\n if (payload) {\n action = _.extend({}, payload, {actionType: type});\n } else {\n action = {actionType: type};\n }\n debug('Action: ' + type, action);\n this.dispatch(action);\n }",
"function parseAction(userInput) {\n let inputWordsArray = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function specifically populates the year dropboxes based on the first_year_with_data value in operations_constants table | function populate_year_dropboxes(dropbox_id) {
//
var options_str = '';
var date = new Date();
var curr_year = date.getFullYear();
var first_year = CONSTANTS.FIRST_YEAR_WITH_DATA;
var dropbox = document.getElementById(dropbox_id);
var opt = null;
var opt_attr = {};
for (var y = curr_... | [
"function setYearList() {\n\tvar res = \"<select id = 'selected_year' onchange = 'setYear();' >\";\n\tfor (i = 1950; i <= 2097; i++) {\n\t\tif (YEAR == i) {\n\t\t\tres += \"<option selected = 'selected' value =\" + i +\">\" + i +\"</option>\";\n\t\t}else {\n\t\t\tres += \"<option value =\" + i +\">\" + i +\"</op... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Speichert die Sprache im localStorage | function tphSpeicherSprache(tphSprache) {
console.log(tphSprache);
// deutsch, englisch, plattdeutsch
var tphStorage = tphLadeLocalStorage();
tphStorage.setItem('tphSprache', tphSprache);
} | [
"function tphSpeicherSchriftgroesse(tphSchriftgroesse) {\r\n console.log(tphSchriftgroesse);\r\n // normal, mittel, gross \r\n var tphStorage = tphLadeLocalStorage();\r\n tphStorage.setItem('tphSchriftgroesse', tphSchriftgroesse);\r\n}",
"function saveStorage() {\r\n //acessando a variavel global... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
General Utilities return new object just like paramsObj except that all values are trim()'d. | function trimValues(paramsObj) {
const trimmedPairs = Object.entries(paramsObj).
map(([k, v]) => [k, v.toString().trim()]);
return Object.fromEntries(trimmedPairs);
} | [
"function removeEmptyParameters(params) {\r\n for (var p in params) {\r\n if (!params[p] || params[p] == 'undefined') {\r\n delete params[p];\r\n }\r\n }\r\n return params;\r\n}",
"sanitizeParams(params) {\n Object.keys(params).forEach(\n key => params[key] === undefined ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit `node` with the given `fn` | function visit(node, fn) {
return node.nodes ? mapVisit(node.nodes, fn) : fn(node);
} | [
"function AddFunctionNodes(node){\n if(her.length > 0){\n nodesFunctions.push(node);\n }\n }",
"visitStandard_function(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"static dfs(currentNode,fn,params)\n {\n if(!currentNode)return;\n fn(currentNode,params);\n this.dfs(cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when the mouse is pressed, a toggle keeps track of what the dominant color needs to be changed to also, a new monster with a number of tendrils is born under the pointer | function mousePressed() {
toggle++;
toggle = toggle % 3;
for (var i = 0; i < tendrilsPerMonster; i++) {
tendrils.push(new Tendril());
}
} | [
"function mousePressed() {\n shocked = true;\n}",
"function mouseReleased(){\n\n shocked = false;\n\n}",
"function yellowClick() {\n\tyellowLight();\n\tuserPlay.push(3);\n\tuserMovement();\t\n}",
"function mouseClicked() {\n var size = random(10, 40);\n drawMondrianblue(mouseX, mouseY, size);\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper function which returns the direct child of ancestor which is an ancestor of elem, or null if elem is not a descendant of ancestor. | function findAncestorChild(ancestor, elem) {
while (elem && elem.parentElement !== ancestor) {
elem = elem.parentElement;
}
return elem;
} | [
"closest( child, ancestor ) {\n while ( child ) {\n if ( child === ancestor ) { return child; }\n child = child.parentNode;\n }\n\n return false;\n }",
"function closest_ancestor_of_class(elt, a_class){\n if (elt == null) { return null }\n else if(elt.classList && elt.classList.contains(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
we remove the toaster after | _onToasterHide () {
this.setState({
toaster: null
})
} | [
"function removeHomeWarnings() {\n $(\"#edit-existing-tour\").popover('dispose');\n $(\"#edit-existing-stop\").popover('dispose');\n $(\"#edit-existing-media\").popover('dispose');\n}",
"function onTarefaConcluirClick() {\n $(this).parent('.tarefa-item')\n .off('click')\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
future functionality grab the message price from the database via API call and then setting it in the store. | SET_MESSAGE_PRICE(state, price){
state.messagePrice = price;
} | [
"async price_update() {}",
"get price() {\n return this._price\n }",
"function getOfferPrice() {\n return localStorage.getItem('Price');\n }",
"async fetchCoinPrice() {\n await fetch(\"https://api.coingecko.com/api/v3/simple/price?ids=\" + this.getCoinID() + \"&vs_currencies=usd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Example: role == "Werewolf", this.serverData.roleConfig[role] == 2 Iterate over number of roles | for (var numRole = 0; numRole < this.serverData.roleConfig[role]; numRole++) {
if (UUIDList.length == 0) {
console.log("All players have roles, stopping now!");
//this.printAllUUIDS();
return;
}
... | [
"function manageRoles(cmd){\n try{\n\t//console.log(cmd.message.channel instanceof Discord.DMChannel);\n\t//if (cmd.message.channel instanceof Discord.DMChannel) { sendMessage(cmd, \"This command currently only works in guild chats\"); return \"failure\"; }\n\tconst openRoles = roleNames.openRoles, voidRoles = rol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempts to require a given file. Returns undefined if 'require' is not available. Helps to use the calling js file in both node.js and browser environments. In a node.js environment the passed dependency will be loaded through the require mechanism. In a browser environment this function will return undefined and the ... | function tryRequire(file) {
return typeof require !== 'undefined' ? require(file) : undefined;
} | [
"require(path) {\n assert(path, 'missing path');\n assert(typeof path === 'string', 'path must be a string');\n return Module._load(path, this, /* isMain */ false);\n }",
"function dependOn(dependency, callback) {\n var path = dependencies[dependency];\n if (/:\\/\\//.exec(path) !== null) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Takes wind speed, direction in degrees and units and returns a string ex. (8.5, 270, "metric") returns "W 8.5 km/h" | function formatWind(speed, degrees, units) {
var wd = degrees;
if ((wd >= 0 && wd <= 11.25) || (wd > 348.75 && wd <= 360)) {
wd = "N";
}
else if (wd > 11.25 && wd <= 33.75){
wd = "NNE";
}
else if (wd > 33.75 && wd <= 56.25){
wd = "NE";
}
else if (wd > 56.25 && wd <= 78.75){
wd =... | [
"convertWindSpeed(windInMph) {\r\n\t\treturn this.windUnits === \"metric\" ? windInMph * 2.23694 : windInMph;\r\n\t}",
"function format_speed(speed) {\n return Number(speed).toFixed(2) + ' Mbps';\n}",
"get cursorWGS() {\n try {\n return Units.stringify(Units.IN, this.cursor, Units.L... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Module to read data from HTML Input box and store in LineStorage object | function Input()
{
// Create a new LineStorage object
this.lineStorage = new LineStorage();
this.parse = function()
{
// Get input from HTML text input box
var input = document.input.inputBox.value;
// Parse input by newline delimiter "\n" and store each line in array
... | [
"function parseInput(){\n\n if(segments.value){ \n clearSelections();\n clearRowAndColSelections();\n \n var segmArr = segments.value.split(\" \");\n parseInputArray(segmArr);\n\n }else{\n formSelPart();\n }\n}",
"function renderInput(){\n var renderObj... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Copies the first object to the second | function copyObject(first, second) {
clearObject(second);
for(var k in first) {
second[k] = first[k];
}
} | [
"function merge_objeto(objFirst,objSecond)\r\n{\r\n\r\n\treturn $.extend({}, objFirst,objSecond);\t\t\r\n}",
"function change(x) {\n var object2 = Object.assign({}, x);//copying the object to new object2\n // Object.freeze(x);\n //object2 = x;\n \n object2.name = \"Manu\"//Change value of new Object... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set key:value that will be sent as tags data with the event. Can also be used to unset a tag, by passing `undefined`. | function setTag(key, value) {
callOnHub('setTag', key, value);
} | [
"handleUIStateChange(key, value){\n\t this.props.setPGTtabUIState({\n\t\t[key]: {$set: value}\n\t });\n\t}",
"onFieldTagsKeyDown(event) {\n let me = this;\n\n if (event.key === 'Enter') {\n Neo.main.DomAccess.getAttributes({\n id : event.target.id,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the attached `DebugNode` instance for an element in the DOM. | function getDebugNode(element) {
var debugNode = null;
var lContext = loadLContextFromNode(element);
var lView = lContext.lView;
var nodeIndex = lContext.nodeIndex;
if (nodeIndex !== -1) {
var valueInLView = lView[nodeIndex];
// this means that value in the lView is a component with ... | [
"static attach(element) {\n return new DomBuilder(element);\n }",
"get element() {\n return this.dom;\n }",
"get element() {\n if (Screen.cache_.element === undefined) {\n Screen.cache_.element = document.getElementById(\"screen\");\n }\n return Screen.cache_.element;\n }",
"log() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================= VaadinUpload component section | function VaadinUpload(params) {
this.component = $('<vaadin-upload>', {
});
} | [
"handleUpload() {\n if (!this.bShowUploadSection) {\n this.bShowUploadSection = true;\n this.sLabelUpload = 'Collapse Upload Section';\n this.uIconName = 'utility:down';\n }\n else {\n this.bShowUploadSection = false;\n this.sLabelUpload = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
write the number value to the response object | function sendGeneratedNumber(res) {
res.write("data: " + `New number is ${num++}\n\n`)
// call the function every second
setTimeout(() => {
sendGeneratedNumber(res)
}, 1000);
} | [
"handleNumberOutput() {\n this._value = this.handlePrecision(this._value);\n this.updateValue();\n }",
"writeValue(buffer, value) {\n assert.isBuffer(buffer);\n assert.instanceOf(value, [ArrayBuffer, Uint8Array]);\n buffer\n .addAll(flexInt.makeValueBuffer(value.by... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the modal's HTML | buildModal() {
if(this.style === 'card') {
this.createCardStructure();
} else {
if(!this.content.innerHTML) {
this.content.innerHTML = this.body;
}
}
if(this.closable) {
/** @param {HTMLElement} */
this.closeBut... | [
"function build_car_modal_content(){\r\n\r\n\t\tvar popup_html = '';\r\n\r\n\t\tpopup_html += '<div class=\"table-responsive\"> ';\r\n\t\t\tpopup_html += '<table class=\"table\" id=\"passenger-confirm-table\">';\r\n\t\t\t\tpopup_html += '<thead>';\r\n\t\t\t\t\tpopup_html += '<tr>';\r\n\t\t\t\t\t\tpopup_html += '<th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper functions Returns the index of an order in the array, given its id; returns undefined if id is not found. | function getOrderIdxById(id) {
if (isNaN(id)) {
throw NaN;
} else {
id = Number(id);
}
var idx = undefined;
for (var i = 0; i < orders.length; i++) {
if (orders[i].id === id) {
idx = i;
}
}
return idx;
} | [
"getIndex(id, data){\n for(let i=0; i<data.length; i++){\n if(id === data[i].id){\n return i;\n }\n }\n console.log(\"No match found\");\n return 0;\n }",
"indexOfId(id) {\n var Model = this.constructor.classes().model;\n var index = 0;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Update choices slide score by 'this' element | function updateChoicesSlideScore_() {
updateChoicesSlideView_(this.closest('.slide-choices__option-wrapper'));
} | [
"function updateChoicesSlideView_(slide) {\n\n slide.maxScore = getMaxScore(slide.wrapper.getElementsByClassName('slide-choices__option-wrapper'));\n\n for( var i = 0; i < slide.answers.length; i++ ) {\n\n var answer = slide.answers[i],\n answerHeight = slide.answers[0].wrapp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show a toast using current snackbar config. If message is empty, no toast is displayed allowing to optout when needed. Default MatSnackBarConfig has no duration, meaning it stays visible forever. If that's the case, an action button is added to allow the enduser to dismiss the toast. | showToast(message) {
if (message) {
this.snackBar.open(message, this.matSnackBarConfig.duration ? null : "OK");
}
} | [
"function showToastMessage() {\n const toast = localStorage.getItem('showToast');\n if (localStorage.length <= 0) return;\n if (data.shouldShowToast === false) return;\n\n switch (toast) {\n case 'profile-info':\n new Toast('Updated profile info');\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a array of glossary terms (strings), returns an object that tells what page the term is from in the story data | function MapTermsToPages(terms) {
var mapped = {};
//loop pages of story data and look for terms - start form 1 to ignore title page
for (var page = 0; page < storyData.length; page++) {
//check if this page has a glossary
if(storyData[page].hasOwnProperty('glossary'))
{
... | [
"async function parseGlossary (data) {\n\tlet glossary = {}\n\tfor (let entry of data) {\n\t\tlet title = entry.title.toLowerCase()\n\t\tlet titleEnd = title.search(re)\n\t\tif (titleEnd !== -1) {\n\t\t\ttitle = title.substring(0, titleEnd)\n\t\t}\n\n\t\tlet url = '/t/' + entry.postKey\n\n\t\tlet meaningStart = ent... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init purchase form validation | function initValidation() {
var errorClass = 'errore';
var successClass = 'success';
var regEmail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
var regPhone = /^[0-9]+$/;
jQuery('form#purchaseForm').each(function(){
var form = jQuery(this);
var successFlag = true;
var inputsAll = form... | [
"function validation(){\r\n \r\n if (validateItem() && validateQty()) {\r\n return true; \r\n }\r\n \r\n return false;\r\n \r\n }",
"function custPreFormValidation(preChatlableObject, user){\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a RSocket error code, returns a humanreadable explanation of that code, following the names used in the protocol specification. | function getErrorCodeExplanation(
code
) {
const explanation = ERROR_EXPLANATIONS[code];
if (explanation != null) {
return explanation;
} else if (code <= 0x00300) {
return 'RESERVED (PROTOCOL)';
} else {
return 'RESERVED (APPLICATION)';
}
} | [
"function bluesnapGetErrorText(errorCode) {\n switch (errorCode) {\n case '001':\n return Drupal.t('Please enter a valid card number.');\n\n case '002':\n return Drupal.t('Please enter a valid CVV/CVC number.');\n\n case '003':\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show/Hide Embed Code and Link | function showembed(){
document.getElementById('hideembed').style.visibility="hidden";
document.getElementById('hideembed').style.display="none";
document.getElementById('showembed').style.display="block";
document.getElementById('showembed').style.visibility="visible";
document.g... | [
"function generateEmbedCode()\n{\n var thisURL = Meteor.absoluteUrl() + \"/models/\" + model._id;\n embedCode = \"<iframe width=\\\"500\\\" height=\\\"250\\\" src=\\\"\" + thisURL + \"\\\" frameborder=\\\"0\\\"></iframe>\";\n throwNotification(embedCode);\n return embedCode;\n}",
"function audioConten... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
reportStatus send message to status pipeline | function reportStatus(theReason) {
print("thereason is " + theReason);
var reason = {
"reason" : theReason
}
cocoon.sendPage("wagger-status-pipeline", reason);
}//reportStatus | [
"function sendStatusUpdate(status, substatus, callback) {\n var patch = {\n firmware: {\n fwUpdateStatus: status,\n fwUpdateSubstatus: substatus\n }\n };\n deviceTwin.properties.reported.update(patch, function(err) {\n callback(err);\n });\n}",
"function sendStatus(status) {\r\n friends.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
given a state place, returns a possible random destination | function randomRobot(state) {
return {direction: randomPick(roadGraph[state.place])};
} | [
"selectRandomPlace(placeIDs) {\r\n const length = placeIDs.length;\r\n if (length === 0) {\r\n return -1;\r\n }\r\n const index = Math.floor((Math.random() * length));\r\n return index;\r\n }",
"function get_random_state() {\n // Since the only valid initial sta... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
"Clones" the given function by wrapping it into a passthrough function. Doesn't preserve arity ('.length') and argument names. | function cloneFunction(func) {
return function (...args) {
return func.call(this, ...args);
};
} | [
"function inplaceShallowCloneArrays(functionArguments, contentWindow) {\n let { Object, Array, ArrayBuffer } = contentWindow;\n\n functionArguments.forEach((arg, index, store) => {\n if (arg instanceof Array) {\n store[index] = arg.slice();\n }\n if (arg instanceof Object && arg.buffer instanceof Ar... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
readonly attribute DOMString methodName; | get methodName() {
return this[_methodName];
} | [
"getMethodName()\n {\n return this._methodName\n }",
"function attrFunction() {\n\t var x = value.apply(this, arguments);\n\t if (x == null) this.removeAttribute(name);\n\t else this.setAttribute(name, x);\n\t }",
"static getMethodInfoByName(method_name){\n\t\treturn null;\n\t}",
"attri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bind hashchange event when browser do not support history api | function hashHistoryListener(callback) {
util.lang.addEventListener(window, 'hashchange', function (e) {
callback();
});
} | [
"function onHashChange() {\n debug('onHashChange, location=', window.location);\n\n startNavigationFromCurrentLocation().then(\n () => executeNavigationStep('beforeLeave')\n ).then(\n () => executeNavigationStep('beforeEnter').catch(catchStepError)\n ).then(\n setFutureState\n ).then(\n switchPanel... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[Editor cusomization Story 3.19] change the fontsize of the editor. Parameters: The selected input from the 'font' dropdownlist. Returns: none. Author: Mimi | function changeFont(){
var new_font = $('#font').val();
editor.setFontSize(parseInt(new_font));
} | [
"function decreaseFont(){\r\n\tbody = document.getElementById('fontChange');\r\n\tstyle = window.getComputedStyle(body, null).getPropertyValue('font-size');\r\n\tsettSize = parseFloat(style);\r\n\tbody.style.fontSize = (setSize -3) + 'px'; //decreases the current font size of the page by 3px \r\n}",
"function inc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
purpose : Private method to search the port for a given port name parameter : port port name return output : index | _searchForPort(port)
{
// If it exists, the index is returned; else it returns -1.
let result = -1; // assume it's never found
if (port !== "")
{
if (portList.length >= 1) // ensures that theres at least 1 item in array
{
result = po... | [
"getProcessIndex(name, port) {\n return this.serviceData[name].port.indexOf(port);\n }",
"function findGeneral(port, cb) {\n check(port)\n .then(function (res) {\n if (res === false)\n return cb(null, port);\n\n find(port + 1, cb);\n })\n .catch(function (err) {\n cb (err)\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
There are two ways to find removable storages: // The first way uses the Removable Devices KnownFolder to get a snapshot of the currently // connected devices as StorageFolders. This is demonstrated in scenario 1. // The second way uses Windows.Devices.Enumeration and is demonstrated in scenario 2(). // Windows.Devices... | function scenario1_listStorages() {
var scenarioOutput = document.getElementById("scenarioOutput");
scenarioOutput.innerHTML = "";
// Find all storage devices using the known folder
Windows.Storage.KnownFolders.removableDevices.getFoldersAsync()
.done(
functi... | [
"function retrievePaths(){\n\tif (typeof(Storage) !== \"undefined\"){\n\t\tvar paths = JSON.parse(localStorage.getItem(APP_PREFIX))\n\t\tfor (var i = 0; i<paths.length; i++){\n\t\t\tvar current = new Path(paths[i]);\n\t\t\tpathList.push(current);\n\t\t\tpathNames.push(current.title);\n\t\t}\n\t}else{\n\t\tconsole.l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GetChannelRecordIndex returns the channel's position in the ChSignalHigh array (example: [1,36,95,120,""]) Returns: the index in the array | function GetChannelRecordIndex(channel, ChSignalHigh) {
for (var i=0; i<ChSignalHigh.length; i++) {
if (channel==ChSignalHigh[i][1]) {
return i
}
}
return null
} | [
"function getFrequencyToIndex(freq) {\n\t// Get the Nyquist frequency, 1/2 of the smapling rate.\n\tvar nyquistFrequency = audioContext.sampleRate / 2;\n\t// Map the frequency to the correct bucket.\n\tvar index = Math.round(freq / nyquistFrequency * analyser.frequencyBinCount);\n\n\t// Return the correspoding buck... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate tags for each star | function generateStarCnt(ship, shipTag)
{
let starTag = '<i class="relative fas fa-star text-yellow-300 stroke-2 -mr-2 text-md"><i class="absolute text-yellow-900 left-0 far fa-star"></i></i>';
for (let i = 0; i < ship.stars.value; i++)
{
let cash = $(starTag);
// this first margin left ... | [
"generateStars(rating)\n\t{\n\t\tlet i\n\t\tlet output = []\n\t\trating = Math.round(rating * 2) / 2\n\t\tfor (i = rating; i >= 1; i--){\n\t\t\toutput.push(\"<i class='fa fa-star' aria-hidden='true'></i> \")\n\t\t}\n\t\tif (i === .5){\n\t\t\toutput.push(\"<i class='fa fa-star-half-o' aria-hidden='true'></i>&nb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
init krpano viewer with data | function initKrpano () {
krpanoViewer.init({
el: document.querySelector('#vrmaker-krpano'),
panoramas
})
// krpano viewer config
var config = {
autoRotateSettings: {
active: true,
revert: false,
rotateDuration: 200000,
restartTime: 20000
},
gyroSettings: {
acti... | [
"function initMediaViewer() {\n rotateDeg = 0\n panzoom = Panzoom(panzoomElem, {});\n}",
"function create_3dView() {\n var scene = new WebScene({\n portalItem: {\n id: \"159d275b250b4db1978a728bd20fa2ec\"\n }\n });\n\n var view = new SceneView({\n m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function: getIpProtoByServCatPubUrl This function is used to parse the publicURL/internalURL got from keystone catalog, And returns protocol (http/https), IP and port of the service publicURL/internalURL can be any of below formats: and xxx.xxx.xxx.xxx:xxxx/v2.0 and | function getIpProtoByServCatPubUrl (pubUrl)
{
var ipAddr = null;
var port = null;
var reqProto = global.PROTOCOL_HTTP;
var ipAddrStr = pubUrl, portStr = null;
var ipIdx = -1, portIdx = -1;
ipIdx = pubUrl.indexOf(global.HTTPS_URL);
if (ipIdx >= 0) {
reqProto = global.PROTOCOL_HTTPS;
... | [
"vaidateProtocol(host){\n let protocols = ['https://', 'http://'];\n if (protocols.map(protocol => host.includes(protocol)).includes(true)) return host\n throw new Error('Host String must include http:// or https://')\n }",
"function getPort () {\n if (process.env.PORT) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects if control has validator for given control name and validator name. | isValidatorRegistered(name, validatorName) {
return (this.registeredValidatorsMap[name] &&
this.registeredValidatorsMap[name].some(errorKey => errorKey === validatorName));
} | [
"hasControlErrors(name) {\r\n const control = this.get(name);\r\n return !!(control && control.errors);\r\n }",
"function isInputDependentValidation () {\n // remove all watchers first if there are any\n unWatchDependencyItems();\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParserexplicitConstructorInvocation. | exitExplicitConstructorInvocation(ctx) {
} | [
"exitConstructorDeclarator(ctx) {\n\t}",
"exitConstructorBody(ctx) {\n\t}",
"enterExplicitConstructorInvocation(ctx) {\n\t}",
"exitPrimaryConstructor(ctx) {\n\t}",
"exitConstructorDelegationCall(ctx) {\n\t}",
"visitConstructor_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"enterConstruc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Safely assert whether the given value is an ArrayBuffer. In some execution environments ArrayBuffer is not defined. | function isArrayBuffer(value) {
return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;
} | [
"function isBuffer (obj) {\n return isExonumObject(obj) && (rawValue(obj) instanceof Uint8Array)\n}",
"function checkUint8Array(b) {\n if (!(b instanceof Uint8Array)) {\n throw new TypeError('b must be a Uint8Array');\n }\n}",
"function ISARRAY(value) {\n return Object.prototype.toString.call(val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update the avatars of the follow list. | function updateFollowsAvatars(payload) {
var result = {}
payload.avatars.forEach((a) => {
result[a.username] = a.avatar
})
return {type: 'followsAvatars', followsAvatars: result}
} | [
"function updateFollowers() {\n const alreadyFollowersArray = models.users\n .findById(followingId)\n .then((resultUser) => {\n return resultUser.get({\n plain: true\n }).followers;\n });\n\n return alreadyFollow... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Neues Board mit Zufallsarray | function neuesBoard(array) {
let zufall = random(1, 3);
if (zufall == 1) createBoard(firstArray);
else if (zufall == 2) createBoard(secondArray);
else createBoard(thirdArray);
} | [
"initBoard() {\n for (let i = 0; i < this.width*this.height; i++) {\n this._board.push(0);\n }\n }",
"setBoard(height,width,start) {\nlet color = 'w';\nlet piece;\nif(start===true){\npiece= {king};\n}\nelse {\npiece= null;\n}\n\tfor(let i=0;i<height;i++){\n\tlet row =[];\n\t\tfor(let j=0;j<width;j++){... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a random jitter value, or 0 if jitter is disabled. | function randomJitter () {
if (!d3.select("#checkbox-jitter").node().checked) {
return 0;
}
var jitterRange = JITTER_PERCENT * finishTime;
return Math.random() * jitterRange - jitterRange / 2;
} | [
"static expRand() {\n return -Math.log(Math.random());\n }",
"function getRandomNum() {\n let time = new Date();\n return time.getMilliseconds();\n}",
"function randomNumberGenerator(){\r\nreturn Math.floor(Mayh.random()*1000);\r\n\r\n}",
"function random_int() /* () -> ndet int */ {\n return Math... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
bill think this is for dancers who are out the path find rountines all start with findset(i,.) in an attempt to find p,n,o to work with for dancer i if p is found, the dancer is marked as a nonend (dancer[].e = false) and processing continues but if p can't be found i.e. p returned at 1 then the routine quits and calls... | function atend(i, mw, t2) {
// mw 0 men, 1 women, 2 both, 10 1 men, 11 1 women, 12 1s, 20 2 men, 21 2 women, 22 2s
// "x" lady on the left to progress
// "a" face across the rejoin the dance
// "s" star left formation to rejoin the dance
// "t" star right formation to rejoin the dance
// "d" dia... | [
"async autoPlay() {\n // list of places yet to visit\n // I'm faking up the initial one to get things started\n // later ones will be targets as returned by getTargets\n\n /** @type {Exit[]} */\n const exitsToVisit = [\n {\n x: this.player.isoX,\n y: this.player.isoY,\n next... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function for counting number of files in images/memes folder. | function readDir() {
fs.readdir( 'public/images/memes', (error, files) => {
return files.length;
});
} | [
"function countImages() {\r\n // console.log('Init images count');\r\n var $galleryTiles = $('.gallery-tile');\r\n var imagesLength = $galleryTiles.length;\r\n var $currentImg = $('#imagelightbox');\r\n var currentImageNumber = 1;\r\n for (var i = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checking if snake ate a bait or not | checkEat() {
let x = convert(this.snake[0].style.left);
let y = convert(this.snake[0].style.top);
let check = false;
if (x === this.bait.x && y === this.bait.y) check = true;
return check;
} | [
"function snake_action(a_world) {\n var head = a_world.snake.body.car;\n if (Core.point_eq(head, a_world.apple)) {\n return EAT_APPLE;\n }\n if (S.in_snake(head, a_world.snake) || !Core.in_rect(head, a_world.bounds)) {\n return DIE;\n }\n return NOTHING;\n}",
"function isSnakeEyes(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Tests that ConstraintCheckercheckForeignKeysForDelete() throws an error if referring keys do exist, for constraints that are DEFERRABLE. | function testCheckForeignKeysForDelete_Deferrable() {
asyncTestCase.waitForAsync('testCheckForeignKeysForDelete_Deferrable');
addSampleDataForForeignKeyChecks().then(function(rows) {
var parentTable2 = env.schema.table('tableG');
var parentRow2 = rows[1];
assertNotThrows(function() {
checker.che... | [
"function testCheckForeignKeysForDelete_Deferrable() {\n checkForeignKeysForDelete(\n lf.ConstraintTiming.DEFERRABLE,\n 'testCheckForeignKeysForDelete_Deferrable');\n}",
"function testCheckForeignKeysForUpdate_Deferrable() {\n asyncTestCase.waitForAsync('testCheckForeignKeysForUpdate_Deferrable');\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Callback function to show user the employeeless modal | function _showEmployeelessModal() {
$employeelessModal = $("#employeelessModal");
$employeelessModal.css("margin-top", Math.max(0, ($(window).height() - $employeelessModal.height()) / 2));
$employeelessModal.modal('show');
} | [
"function displayEmployeeModal(index) {\n let employee = employees[index];\n let firstName = capitalize(employee.name.first);\n let lastName = capitalize(employee.name.last);\n let address = formatAddress(employee);\n let dob = formatDateOfBirth(employee.dob);\n let modalContent = '<div class=\"modal-content\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find training series using a filter if you want to find a single training series assigned to the user, you should use two keys: trainingSeries_ID and teamMember_ID. if you want to find all of the team member's assigned training series, only one key is needed: teamMember_ID | function findTrainingSeriesBy(filter) {
return db("RelationalTable").where(filter);
} | [
"function getTrainingSeriesAssignments(teamMemberId) {\n return db(\"TeamMember\")\n .join(\n \"RelationalTable\",\n \"TeamMember.teamMemberID\",\n \"RelationalTable.teamMember_ID\"\n )\n .join(\n \"TrainingSeries\",\n \"TrainingSeries.trainingSeriesID\",\n \"RelationalTable.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
normalize the config into a simple list of hex instances | static _flattenBag(bag) {
const items = [];
for (var item of config) {
// expand config specification of hexes in hexBag
// e.g. [new Forest(), [3, () => new Mountain()]]
if (Array.isArray(item)) {
var array = item;
var amount = array[0... | [
"static _flattenConfig(config) {\n const items = [];\n for (var item of config) {\n // expand config specification of hexes in hexBag\n // e.g. [new Forest(), [3, () => new Mountain()]]\n if (Array.isArray(item)) {\n var array = item;\n va... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if the polygon reference is valid and passes the filter restrictions. | isValidPolyRef(ref, filter) {
try {
let tileAndPoly = this.m_nav.getTileAndPolyByRef(ref);
// If cannot pass filter, assume flags has changed and boundary is invalid.
if (filter.passFilter(ref, tileAndPoly[0], tileAndPoly[1]))
return true;
} catch (e) {
// If cannot get polygon, assume it does not e... | [
"function validate(polygon) {\n polygon = polygon && polygon.positions || polygon;\n\n if (!Array.isArray(polygon) && !ArrayBuffer.isView(polygon)) {\n throw new Error('invalid polygon');\n }\n}",
"static checkConvex(appState) {\n if(!this.checkPolygonCross(appState.gridCorners)){\n //http... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create a new area. | function createArea(axios$$1, area) {
return restAuthPost(axios$$1, 'areas', area);
} | [
"function createAreaType(axios$$1, areaType) {\n return restAuthPost(axios$$1, 'areatypes/', areaType);\n }",
"async addArea() {\n const area = this.ctx.request.body;\n const id = this.ctx.params.areaId;\n area.id = id;\n\n // area id doesn't exist\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Event listener for reset button (mouseclick and keypress: enter) | function resetButton(){
reset.addEventListener("click", function(){
location.reload();
});
reset.addEventListener("keydown", function(key){
if (key.keyCode === 13){
key.preventDefault();
location.reload();
}
... | [
"function setupResetButton(){\n resetButton.addEventListener(\"click\", function(){\n reset();\n });\n}",
"function enableResetButton() {\n\t gameStartCheck = 2;\n\t}",
"function enableResetButton() {\n resetButton.disabled = false;\n}",
"function reset(){\r\n document.getElementById(\"count-increme... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Throws an error when the URI is... uncouth. Otherwise, return it untouched. | function ensureSafeURI(uri) {
if (uri.match(/[\u0000\s>]/)) {
throw new Error('Refusing to add prefix with suspicious URI.');
}
return uri;
} | [
"uriParse(value) {\n return vscode.Uri.parse(value);\n }",
"error() {\n const isAbsolute = this.options.fail.indexOf('://') > -1;\n const url = isAbsolute ? this.options.fail : this.options.url + this.options.fail;\n\n this.request(url);\n }",
"parse(_stUrl) {\n Url.parse(_stUrl, true);\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions related to the service indicators / This function loads the whole set of triples and generate an array of elements each element has ?prop ?proplabel ?geo ?geolabel ?val | function loadIndicatorsObservations(forASingleCounty) {
var bindings = queryIndicatorResults.results.bindings;
var localIndicators = [];
var localProps = [];
var localRegions = [];
var len = 0;
for (var i=0; i<bindings.length; i++) {
// in each row we have ?prop ?proplabel ?geo ?geolabel ?val
var... | [
"function getTrainingDataTrulia(urlsToHit) {\n return new Promise(async (resolve, reject) => {\n // the object that will contain all the inputs and outputs from trulia\n let trainingData = {\n x: [],\n y: []\n }\n setInterval(async function getPropertyData() {\n // keep running if we hav... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Funcion para mostrar los datos de la cuenta bancaria mediante un for que ira recorriendo los elementos del String. Laura: Paul te has liado | function mostrarCuenta() {
//Primero convertimos el array en un String para poder usar los metodos
var cuenta = digitosCuenta.toString();
//Creamos una variable mensaje, para guardar el mensaje correcto para cada caso
var mensaje;
for (var i = 0; i < longitud; i++) {
if (i === 0) {
... | [
"function afficher(entrees) {\n //let i = 3;\n // let phrase = \"Ma maison est belle\";\n let tableau = [1, 2, 3, 4, 5];\n for (let i = 0; i <= 10; i++) \n \n// console.log(i + '=' + tableau.charAt(4));\nconsole.log(i + '=' + tableau[i]);\n}",
"function showHobbies() {\n const hobbies = db.get('hobbies').val... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the album cover's URL of the current playing song. | getAlbumCover() {
//If the token is expired, don't send a request.
if (this.expires < new Date().getTime()) return;
//If there's errors/the player is inactive, don't send a request.
if (this.stoppedRequests.dueTo204 || this.stoppedRequests.dueTo400) return;
//If the album ID is not saved, don't send a reque... | [
"getSrc(){\n\t\tif( this.props.activeTrack ) {\n\t\t\treturn this.props.activeTrack.url;\n\t\t}\n\t}",
"function getCurrentCover() {\n\n var endpoint = \"mobile/v1/user/cover\";\n var token = eresData.getData(\"x-auth-sb\");\n\n var config = {\n headers: {\n 'x-auth-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Apply sbox0 to each byte in w. | function subw(w) {
return ((SBOX0[(w >>> 24) & 0xff]) << 24) |
((SBOX0[(w >>> 16) & 0xff]) << 16) |
((SBOX0[(w >>> 8) & 0xff]) << 8) |
(SBOX0[w & 0xff]);
} | [
"function makeZero() {\n\t\tvar m = arguments[0];\n\t\tvar rows = m.length;\n\t\tvar cols = m[0].length;\n\t\tfor(var r = 0; r < rows; r++) {\n\t\t\tfor(var c = 0; c < cols; c++) {\n\t\t\t\tm[r][c] = 0;\n\t\t\t}\n\t\t}\n\t}",
"loadZero()\n\t{\n\t\tvar TcI,TcJ;\n\t\tfor (TcI = 0; TcI < 4; TcI++)\n\t\t{\n\t\t\tfor ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the closest point from a point `p` on a segment `p1` to `p2`. | function closestPointOnSegment(p, p1, p2) {
return _sqClosestPointOnSegment(p, p1, p2);
} // Douglas-Peucker simplification, see http://en.wikipedia.org/wiki/Douglas-Peucker_algorithm | [
"function closestDistance2D( line1, line2 ) { \n var a0 = [ line1.startX, line1.startY, 0 ],\n a1 = [ line1.endX, line1.endY, 0 ],\n b0 = [ line2.startX, line2.startY, 0 ],\n b1 = [ line2.endX, line2.endY, 0 ]; \n \n var result = closestDistanceBetweenLines(a0, a1, b0, b1, true);\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
' Name : validateInputFieldOfResetArea ' Return type : None ' Input Parameter(s) : None ' Purpose : Validate the password and reenter password fields. ' History Header : Version Date Developer Name ' Added By : 1.0 14th March,2013 Karuna Mishra ' | function validateInputFieldOfResetArea() {
var element1 = $('#new_pwd').val();
var element2 = $('#re_new_pwd').val();
if (element1 == '') {
$('#re_new_pwd').removeClass("error_red_border");
showErrorMessageofFieldValidation(messages['login.alert.newPwd'], 'new_pwd', 'wrong_resetpwd');
... | [
"function setup_changepass(){\n \t$(\"#alpha_background\").show();\n \t$(\"#btn_changepass_cancel\").click(function(){\n \t\t$(\"#alpha_background\").hide();\n \t\t$(\"#editprofile_popup\").hide();\n \t});\n \t$(\"#btn_changepass_ok\").click(function(){\n \t\t$(\"#changepass_form\").valid();\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return the dir names. | getDirNames(dir, opts) {
return (new fs.Dir(this.dst, dir)).getDirNames(opts);
} | [
"getEntryNames(dir = \".\") {\n return (new fs.Dir(this.dst, dir)).getEntryNames();\n }",
"function listDir(dir) {\n return fs.readdirSync(dir)\n .filter(function(file) {\n return file.indexOf('.')!=0;\n });\n}",
"visitDirectory_name(ctx) {\n\t return this.visitChildren(ctx);\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Draws 2D keyboard UI (current letter and left and right arrows) | function draw2Dkeyboard()
{
imageMode(CORNER);
image(keyboard, width/2 - 2.0*PPCM, height/2 - 1.0*PPCM, 4.0*PPCM, 3.0*PPCM);
textFont("Arial", 0.35*PPCM);
textStyle(BOLD);
fill(0);
noStroke();
text("S" , width/2 - 1.32*PPCM, height/2 + 0.63*PPCM);
textFont("Arial", 0.25*PPCM);
textStyle(NORMAL);
... | [
"function displayControls(){\n noStroke();\n fill(fgColor);\n text(\"left player: WASD. right player: Arrow keys.\", width/2, height-15);\n}",
"function draw_help() {\n ctx.font = 'bold 1em sans-serif';\n ctx.globalAlpha = 0.5;\n ctx.fillText('esc to exit', canvas.width/dpi - 13, 20);\n ctx.fillText('up/do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Queries the currently active panel and turns it into a tab. | function activePanelIntoTab() {
chrome.windows.getAll(null, function(windows) {
windows.forEach(function(vindov) {
if (isPanel(vindov) && vindov.focused) {
panelIntoTab(vindov.id);
return;
}
});
});
} | [
"function activeTabIntoPanel() {\n chrome.tabs.query({\n active: true,\n currentWindow: true\n }, function(tabs) {\n tabIntoPanel(tabs[0]);\n });\n}",
"setCurrentTab(tabName) {\n this.currentTab = tabName;\n\n MapLayers.nuts3.renderLayer();\n }",
"function pa_tabs_start(id_panel, id_con... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
endregion region createParticipantFromPerson this is the Conversation::createParticipant method | function createParticipantFromPersonOrUri(person) {
var dfd = new Task();
dfd.promise.then(); // this task cannot be cancelled
var href = Property({
get: function () { return href() || dfd.promise; }
... | [
"function createParticipant(options) {\n extend(options, {\n ucwa: ucwa,\n isTabActive: isTabActive.asReadOnly(),\n contactManager: contactManager\n });\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ITS NOT WORKING!!!!!!!!!! updating an existing parent fcmToken | async updateParentFCMToken(parent_id, parentToken){
if (!parent_id) throw "NO ID";
if (!parentToken) throw "NO TOKEN";
const parsedId = ObjectId(parent_id);
const found_parent = await this.get(parsedId)
const found_id = found_parent._id
const usersCollection = await users();
const updat... | [
"function saveMessagingDeviceToken() {\n firebase.messaging().getToken().then(function(currentToken) {\n if (currentToken) {\n // Saving the Device Token to the datastore.\n firebase.firestore().collection('fcmTokens').doc(currentToken)\n .set({uid: firebase.auth().currentUser.uid});\n } e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
calculates the overall steering force based on the currently active steering behaviors. | Calculate() {
//reset the force
this.m_vSteeringForce.Zero();
//this will hold the value of each individual steering force
this.m_vSteeringForce = this.SumForces();
//make sure the force doesn't exceed the vehicles maximum allowable
this.m_vSteeringForce.Truncate( this.... | [
"solve() {\n let edgeLength, edge;\n let dx, dy, fx, fy, springForce, distance;\n const edges = this.body.edges;\n const factor = 0.5;\n\n const edgeIndices = this.physicsBody.physicsEdgeIndices;\n const nodeIndices = this.physicsBody.physicsNodeIndices;\n const forces = this.physicsBody.forces... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pushes an item via push_ to the bottom right of a tree. | function push(item, a)
{
var pushed = push_(item, a);
if (pushed !== null)
{
return pushed;
}
var newTree = create(item, a.height);
return siblise(a, newTree);
} | [
"TreePush(str_id=null)\n {\n let win = this.getCurrentWindow();\n this.Indent();\n win.DC.TreeDepth++;\n this.PushID(str_id ? str_id : \"#TreePush\");\n }",
"push(val) {\n this._stack.push(val);\n }",
"enQueue(item) {\n // move all items from stack1 to stack2, which reve... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add damage and play sound when hitting walls | function wallDmg(){
playerHP -= 1;
if(playerHP < 0){
if(!explodeSound.isPlaying()){
explodeSound.play();
}
} else {
if(!crashSound.isPlaying()){
crashSound.play();
}
}
} | [
"function groundShot() {\n playSound(\"audioCannonShot\");\n }",
"function bombShot() {\n playSound(\"audioBombShot\");\n }",
"function bombExplode() {\n playSound(\"audioBombExplosion\");\n }",
"function mixedShot() {\n playSound(\"audioMixedShot\");\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Grab the most recent lab results within a set threshold date | getMostRecentLabResults(results, sinceDate) {
let mostRecentLabResultsLookupTable = {};
// Convert the sinceDate to a moment.js date
let sinceDateMoment = new moment(sinceDate, "D MMM YYYY");
// Create mostRecentLabResultsLookupTable with unique lab results that fall after threshold da... | [
"getLabResultsChronologicalOrder(sinceDate) {\n let results = this.getTests();\n results.sort(this._observationsTimeSorter);\n\n let mostRecentLabResults = results;\n if (sinceDate && !Lang.isNull(sinceDate)) {\n mostRecentLabResults = this.getMostRecentLabResults(results, sin... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks if content is existing | function checkContents() {
var content = document.getElementById("content");
if (typeof(content) !== 'undefined' && content !== null) {
return checkContent = true;
}
else {
return checkContent = false;
}
} | [
"function singleChildContentTagExists(element)\n{\n // Define a list of alloed tags for the inner content tag. There should be one and only one of these tags as element child\n var allowedContentTags = [\"blockquote\", \"dd\", \"div\", \"form\", \"center\", \"table\", \"span\", \"input\", \"textarea\", \"select\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return a Point4d with the diagonal entries of the matrix | diagonal() { return this.getSteppedPoint(0, 5); } | [
"static identity(){\n return new matrix4([[1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]);\n }",
"function project4to3(p) {\n var v = viewpoint4D.v,\n pv = p.minus(v),\n lambda = -1 * v.dotproduct(v) / v.dotproduct(pv),\n pp = pv.scalproduct(lambda).plus(v),\n p1 = pp.dotproduct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calls all of the callbacks registered for this promise. | callAllCallbacks() {
this.callbackSets.forEach((set) => {
this.callCallbackSet(set);
});
} | [
"function callAllServiceFunctions() {\n\t\tgetAllDataSpeakers();\n\t\tgetAllDataSponsors();\n\t\tgetAllDataSessions();\n\t\tgetAllDataExhibitors();\n\t}",
"fire(name, ...args) {\n if (this._cb.hasOwnProperty(name)) {\n this._cb[name](...args);\n }\n }",
"clearCallbacks() {\n this._callbackMap... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Container for Rackspace | createContainerRackspace(options, callback) {
let opt = {
name: options.containerName
};
this.client.createContainer(opt, callback);
} | [
"createContainerOpenstack(options, callback) {\n let opt = {\n name: options.containerName\n };\n\n if (options.containerCdn) {\n opt.metadata = {\n type: 'public'\n }\n }\n\n this.client.createContainer(opt, callback);\n }",
"a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
change page ajax request | function changePageAction(page)
{
//ajax show list request
$('pageIndex').value = page;
var url = UrlConfig.BaseUrl + '/ajax/search/keywordrank';
new Ajax.Request(url, {
parameters : {
pageIndex : $F('pageIndex'),
pageSize : CONST_DEFAULT_PAGE_SIZE
},
... | [
"function MainPageAjaxUpdate(page, sort_input, process_name) {\n //alert(\"Input : \" + page);\n //alert(\"Input : \" + sort_input);\n //alert(\"Input : \" + process_name);\n $.ajax({\n type: \"POST\",\n url: '/Home/MainPageAjaxUpdate',\n data: { \"page\": page, \"sort_input\": sort... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate what day it is based on "someDate" + "offsetInDays") eg if someDate is Oct 1, what's the date for 4 days ago (offsetInDays = 4)? | function calculateDay(someDate, offsetInDays) {
var offsetInMillis = offsetInDays * ONE_DAY;
return new Date(someDate.getTime() + offsetInMillis);
} | [
"function getDay(offset) {\n var d = new Date();\n return new Date(d.setDate(d.getDate() + offset)).setHours(0,0,0,0);\n}",
"function _working_days_ago(d,working_day_ago, optional_hour_shift) {\n \"use strict\";\n var r = working_day_ago % 5;\n var w = Math.round( (working_day_ago-r) / 5 );\n var a = w*7+r;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DELETE PAST VACATION DAYS | function deletePastVacationDays(){
var l = U.profiles.length;
//console.log("We have " + l + " profiles to check.");
for(i=0;i<l;i++){
//Attend to vacationDays in each profile
var v = U.profiles[i].vacationDays.length;
//console.log("====>The profile " + U.profiles[i].profileName + " has " + v + " vacation day... | [
"function deleteVacationDay(theElement){\n\tconsole.log(\"Deleting this vacationDay: \");\n\tconsole.log(theElement.parentNode);\n\t\n\t$(\"#saveStatusMessage\")[0].innerHTML = \"Saving...\";\n\t$(\"#saveStatusMessage\").show();\n\t\n\t//Handle the removal of the vacation day from the User object\n\tvar theVacation... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given the toast manager state, finds the toast that matches the id and return it's position and index | function findToast(toasts, id) {
var position = getToastPosition(toasts, id);
var index = position ? toasts[position].findIndex(toast => toast.id == id) : -1;
return {
position,
index
};
} | [
"function getValidIndex () {\n return $toasts.get().findIndex(toast => toast.key === toastId)\n }",
"posById(id){\n let slot = this._index[id];\n return slot ? slot[1] : -1\n }",
"modifyToast(index)\n {\n this.setState({toasts:this.state.toasts.slice(0,index+1)});\n }",
"function get... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates and returns the status div content | #statusContent() {
var driverID = this.serverKey + '_driver';
var stateID = this.serverKey + '_state';
var experimentID = this.serverKey + '_experiment';
var numCompletedID = this.serverKey + '_numCompleted';
var numQueuedID = this.serverKey + '_numQueued';
var dateTimeID... | [
"function followStatus(status) {\n\tlet temp = document.createElement(\"DIV\");\n\ttemp.className = \"follow-status\";\n\ttemp.innerHTML = status;\n\treturn temp;\n}",
"function createStatus() {\r\n return $('<span/>', { class: 'status', text: 'available' });\r\n}",
"function constructStatus(ref, div) {\n\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Decreases the aircrafts altitude | decreaseAircraftAltitude() {
const altitude_diff = this.altitude - this.target.altitude;
let descentRate = this.model.rate.descent * PERFORMANCE.TYPICAL_DESCENT_FACTOR;
if (this.mcp.shouldExpediteAltitudeChange || this.isEstablishedOnCourse()) {
descentRate = this.model.rate.descent... | [
"increaseAircraftAltitude() {\n const altitude_diff = this.altitude - this.target.altitude;\n let climbRate = this.getClimbRate() * PERFORMANCE.TYPICAL_CLIMB_FACTOR;\n\n if (this.mcp.shouldExpediteAltitudeChange || this.isTakeoff()) {\n climbRate = this.model.rate.climb;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Drop a flower in a new location (common to mouse and touch) | onDragDrop() {
this.onDragEnd();
// If we dropped a flower at a new position, report that we made a move
// and generate new flowers
if (!Map(this._originalTargetCell).equals(Map(this._currentCell))) {
this.board.resolveMoveAt(this._currentCell);
}
} | [
"function mouseDrop(e) {\n\n if(dropValid(mousePiece)) {\n\n alignPiece(mousePiece);\n\n removeEvent(document, \"mousemove\", mouseMove, false);\n removeEvent(document, \"mouseup\", mouseDrop, false);\n mousePiece.style.cursor = \"pointer\";\n solveCheck()\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
START Start the https service. Accept requests from localhost only, for security. | function start()
{
if(!checkSite()) return;
types = defineTypes();
banned = [];
banUpperCase("./public/", "");
var service = https.createServer(options, authenticate);
/*
service.listen(PORT, () => {
console.log("Our app is running on port "+PORT);
});
*/
service.listen(PORT);
var address = "https:/... | [
"function start() {\n test();\n var httpService = http.createServer(serve);\n httpService.listen(ports[0], '0.0.0.0');\n\n var options = {\n key: key,\n cert: cert\n };\n var httpsService = https.createServer(options, serve);\n httpsService.listen(ports[1], '0.0.0.0');\n\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Flush current connected peers' URLs into DB. Note that you should only provide peers with desired `nodeType`s. | async writeCurPeerUrls(peerUrls) {
let data = JSON.stringify(peerUrls);
return this.db.put(genKey('cur_peer_urls'), data);
} | [
"_updatePeers() {\n var peers = this.peers;\n peers.clear();\n mergeMaps(peers, this.ocluster, this.ncluster);\n this.configAry = Array.from(peers);\n peers.delete(this.peerId);\n }",
"sendToAllConnectedPeers(data) {\n for (let peer_id in this.peers) {\n if (this.peers[peer_id] && this.pee... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: inspectSelection DESCRIPTION: Refreshes the contents of the text fields based on the attributes of the current selection. ARGUMENTS: none RETURNS: nothing | function inspectSelection() {
var dom = dw.getDocumentDOM();
var theObj = dom.getSelectedNode(); //new TagEdit(dom.getSelectedNode().outerHTML);
// Call initializeUI() here; it's how the global variables get
// initialized. The onLoad event on the body tag is never triggered
// in inspectors.
initializeUI();
in... | [
"_updateSelection() {\n\t\t// If there is no selection - remove DOM and fake selections.\n\t\tif ( this.selection.rangeCount === 0 ) {\n\t\t\tthis._removeDomSelection();\n\t\t\tthis._removeFakeSelection();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRoot = this.domConverter.mapViewToDom( this.selection.editableElement ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
helper function that takes a row and returns a insight object | function insightFromRow (row) {
return {
id: row.iid,
title: row.title,
url: row.url,
author: row.author,
creator_id: row.creator_id,
type: row.type,
date: row.date,
active: row.active,
tags: row.tid ? [tagFromRow(row)] : []
};
} | [
"getRow(row, returnAsObject = false) {\n if (returnAsObject) {\n return this.cells[row].map(obj => obj);\n } else {\n return this.cells[row].map(obj => obj.value);\n }\n }",
"function objectizeRowData(_row) {\r\n\tiobj = new Object();\r\n\tiobj.id = _row.getValue(_row.getAllColumns()[0].getNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push product to drafts, publish if the flags say so, then store result on FS, then return promise which resolves with the business service results object. When we read the details of the WSRR data set the business service results object. If an error happens during the push store a bad result and return promise which re... | function _pushProductToDraftsPublishStoreResult(bsBsrURI, bsrURI, bsResults, modeFlags, apiCli, apicdevportal) {
logger.entry("_pushProductToDraftsPublishStoreResult", bsBsrURI, bsrURI, bsResults, modeFlags, apiCli, apicdevportal);
var wsrrData = null;
var productDetails = null;
// result which we update a... | [
"function _pushProductToDrafts(bsBsrURI, bsrURI, productDetails, apiCli) {\r\n\tlogger.entry(\"_pushProductToDrafts\", bsBsrURI, bsrURI, productDetails, apiCli);\r\n\t\r\n\tlogger.info(logger.Globalize.formatMessage(\"flowPushingProductToDrafts\", productDetails.productName, productDetails.productVersion));\r\n\t\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======== BUILD DOC ======== | function buildDoc(cb) {
spawn.sync("jsdoc", ["-r", "-c", "./.jsdoc.json", "-d", "./docs", "./src"]);
cb();
} | [
"function buildDocs( docDirName, project )\n{\n //var root={ items : [] };\n\n //readDocs( root, path.join( docDirName.toString() ).toString() );\n\n var docDir=path.join( docDirName.toString() ).toString();\n var indexPath=path.join( dir, docDir, \"index\" );\n\n var indexJSON=fs.readFileSync( index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an indentation strategy that, by default, indents continued lines one unit more than the node's base indentation. You can provide `except` to prevent indentation of lines that match a pattern (for example `/^else\b/` in `if`/`else` constructs), and you can change the amount of units used with the `units` option... | function continuedIndent({ except, units = 1 } = {}) {
return (context) => {
let matchExcept = except && except.test(context.textAfter)
return context.baseIndent + (matchExcept ? 0 : units * context.unit)
}
} | [
"function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter);\n return context.baseIndent + (matchExcept ? 0 : units * context.unit);\n };\n }",
"function syntaxIndentation(cx, ast, pos) {\n return in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function clears the page and appends the final page | function renderFinalPage(){
clearPage();
$(".noBorder").append(finalPage());
} | [
"function clearHomepage() {\n //TODO Change the homepage from empty context to user defined\n data.getPage(space.homepage.id, function (response) {\n let oldPage = JSON.parse(response);\n\n let updatePage = {\n version: {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Author: [M.C] Name: _getDashboard Description: Launch get full dashboards service Params: idDashboard Return: No one | function _getDashboard(idDashboard) {
CDHelper.showHideLoading(true);
DashboardsServices.getDashboard(idDashboard, _getDashboardSucceed, _getDashboardFailed);
} | [
"getDashboardData () {\n this.showLoading()\n this.getDashboardInfo({\n success: this.handleSuccessDashboardInfo,\n fail: this.handleFailureDashboardInfo,\n key: this.backdoorKey\n })\n }",
"function openDashboard() {\n\t$(LOADING_ALERT).modal(SHOW);\n\t$.ajax({\n\t\turl: \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is called after Rollup finishes writing the files on the file system. It takes care of stopping the bundle execution, if it's already running, and starting it again. | writeBundle() {
this._stopExecution();
this._startExecution();
} | [
"writeBundle() {\n // Validate that there's no instance already running.\n if (!this._instance) {\n // Get the server basic options.\n const { https: httpsSettings, port } = this._options;\n // Create the server instance.\n this._instance = httpsSettings ?\n createHTTPSServer(httpsS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
x loop through our linkedlist to find current.next.value = value x if found value, then create a new node for our newVal x point our new node/newVal to current.next point our value to new node/newVal edgecase | insertAfter(value, newVal) {
let current = this.head;
while(current) {
if (current.value === value) {
let node = new Node(newVal);
node.next = current.next;
current.next = node;
return;
}
current = current.next;
}
} | [
"addToBack(value) {\n var newNode = new SLLNode(value);\n\n if (this.head == null) {\n this.head = newNode;\n return;\n }\n\n var runner = this.head;\n\n while (runner.next != null) {\n // console.log(runner.value)\n runner = runner.next... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Generate the expected fetch body. | function generateExpectedFetchBody(app, logtype, navigator, params) {
const data = generateParamData(params);
const client = generateExpectedClient(navigator);
return {
app,
client,
data,
type: logtype
};
} | [
"function fetchWithResponseType() {\n fetch('https://api.github.com/users', {mode: 'cors'})\n .then(function(response) {\n return response.text();\n })\n .then(function(text) {\n console.log('Request successful', text);\n })\n .catch(function(error) {\n console.log('Request failed',... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private function: Takes in a date string, and see if the value of meeting start date text box matches the input text string | function checkForDate(matchDate, testMsg, nextStepCallback) {
// Make sure that we are in Jun 8th
// Check the UIA element
return Q.fcall(function () {
return uia.root().findFirst(function (el) { return ((el.name === "Meeting start date") && (el.className === "RichEdit20WPT"))... | [
"function ValidateAppointment()\n{\n AptDate = document.getElementById(\"IdDate\").value;\n today = new Date().toISOString().slice(0, 10);\n \n // reject past date\n if (AptDate < today) {\n document.getElementById(\"error\").innerHTML = \"Cannot create past appointments!\";\n document.getElementById(\"I... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converting Decimal to Binary / Binary to Decimal runConvertDecimalBinary(); | function runConvertDecimalBinary() {
let doc_5 = document.getElementById('id_5');
let input_5 = document.getElementById('input_5');
let valueInput_5 = input_5.value;
//console.log(valueInput_5);
function dec2bin(val) {
doc_5.innerHTML += val + ' = ' + (val >>> 0).toString(2) + '<br>';
}... | [
"decimaltobinary(n) {\n\n\n bin = '';\n while (n > 0) {\n bin = (n % 2) + bin;\n n = Math.floor(n / 2)\n\n }\n var output = parseInt(bin)\n console.log(output)\n return bin\n }",
"function convertBin()\n{\n isBinIP(input) ? true : error(`badInp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Notifies any siblings that may potentially receive the item. | _notifyReceivingSiblings() {
const draggedItems = this._sortStrategy
.getActiveItemsSnapshot()
.filter(item => item.isDragging());
this._siblings.forEach(sibling => sibling._startReceiving(this, draggedItems));
} | [
"itemsChanged() {\n this._processItems();\n }",
"function itemClick(event) {\n\n\n $(this).find(\"input[type=checkbox]\").click();\n\n updateCompletedBtn();\n updateCheckCount();\n\n // Don't bubble up the event to the enclosing <li> element ?? Ask Willis\n event.stopPropagation();\n}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
draw current status with a mask (number under mask will not be drawn) | draw_with_mask(mask)
{
for (let i = 0; i < 4; i++)
for (let j = 0; j < 4; j++)
if (mask[i][j] === 0 || this.numbers[i][j] === 0)
{
let grid = new FilletRectangle(width / 2 - height / 2 + j * (gap + grid_size) + gap, i * (gap + grid_size) + gap,... | [
"function drawStatusLED()\n {\n // Check faulted state\n var faultCount = Object.keys(fault_detector.getCurrentFaults()).length;\n if (faultCount > 0)\n {\n // Set LED to green\n image = document.getElementById('status_led');\n image.src = 'static/images/red_light.png';\n }\n else\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Now to use my GMail API Here I am using nodemailer a npm module to send email 1. Done with google cloud console and got CLIENT_ID and CLIENT SECRET from it 2. In scopes blank paste and in OAuth credentials paste the CLIENT_ID and CLIENT_SECRET (from the google cloud console) and click authorize 3. you will be redirecte... | function sendEmail(usermail){
const accessToken = oAuth2Client.getAccessToken();
// to generate accessTokens every time
// create reusable transporter object
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
type: 'OAuth2',
user: u... | [
"function send_email(your_email,your_password,to_email, subject, content)\n{\n\n\t// Set up the connection to the administrator's email account\n\tvar transporter = nodemailer.createTransport({\n\t service: 'gmail',\n\t auth: {\n\t\tuser: your_email,\n\t\tpass: your_password\n\t }\n\t});\n\n\t// Customize the em... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |