query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
transforms a key value pair into a string
function keyValToStr(key, val, delimiter = "\n") { return [key, val].join(delimiter); }
[ "function toStr(key) {\n return '' + key;\n}", "function keyValToStr(key, val, delimiter) {\n if (delimiter === void 0) { delimiter = \"\\n\"; }\n return [key, val].join(delimiter);\n }", "function keyValue(key, value) {\n return '\"' + key + '\":\"' + escape(value) + '\",\\n'\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Takes the operator and value and does math with the current total. Checks the for the type of operator and does math accordingly. If the user tries to divide by zero, then it gives an error and returns to askForOperation function. If the values are valid then it comletes the calculation and loops back to the operator f...
function doMath (operator, value){ if (operator == "+") { total += value; } else if (operator == "-") { total -= value; } else if (operator == "*"){ total = total * value; } else if (operator == "/" && value == 0) { console.log("Cannot divide by 0, pl...
[ "function askForOperation (){\n\n rl.question(\"Enter operation (+-*/, q to quit) : \", (answer) => {\n \n if (answer == \"q\") {\n console.log(\"Final value : \" + total);\n\n rl.close;\n\n process.exit();\n }\n else if (answer != \"+\" && answer != \...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Port object PUBLIC Constructor A port is a yellow circle allocated at a side of its network element owner. The position of the each port is calculated automatically, what menas that this object has any method prepared to do such things. To calculate the correct position of the port, to avoid the overlapping of ports an...
function Port(name) { this.name = name; this.ne = null; this.connection = null; this.id = null; this.x = 0; this.y = 0; this.side = null; this.color = "Yellow"; this.setId = setPortId; this.setNetworkElement = setPortNetworkElement; this.setConnection = setPortConnection; this.setColor = setPort...
[ "function Connection(port1, port2) {\n\t\tif (port1.ne.id > port2.ne.id) {\n\t\t\tthis.originPort = port2;\n\t\t\tthis.destinationPort = port1;\n\t\t} else {\n\t\t\tthis.originPort = port1;\n\t\t\tthis.destinationPort = port2;\n\t\t}\n\t\tthis.originPort.setConnection(this);\n\t\tthis.destinationPort.setConnection(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `GreenFleetProvisioningOptionProperty`
function CfnDeploymentGroup_GreenFleetProvisioningOptionPropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected ...
[ "function validateProperties(props) {\n let validProps = getProperties();\n for (let i in props) {\n if (!validProps.includes(props[i])) {\n return false;\n }\n }\n return true;\n}", "function hasEveryProp() {\n var nodeProps = arguments.length > 0 && arguments[0] !== undefin...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creating function to change opacity of the heatmap
function changeOpacity() { heatmap.set("opacity", heatmap.get("opacity") ? null : 0.2); }
[ "function changeOpacity() {\n heatmap.set('opacity', heatmap.get('opacity') ? null : 0.2);\n}", "changeOpacity() {\n this.heatmap.set('opacity', this.heatmap.get('opacity') ? null : 0.2);\n }", "function changeOpacity(bool) {\n const step = .2, min = 0, max = 1;\n let current = heatmap.get('opacity');\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Extracts animation data from the given CAS XML DOM, and returns a new CASAnimation instance for it, which may have an empty framesequence if the input is invalid.
static fromCASDOM(casdoc) { var ELEMENT_TYPE, NF, NS, anim, casel, doCheckSigns, f, fel, fhi, flo, framesSegment, frmels, glossStr, i, j, k, len, len1, len2, s, sd, signdesc, signdescs, ssel, ssels; //---------- ELEMENT_TYPE = 1; anim = new CASAnimation(); if (casdoc) { casel = casdoc.documentElement(); // Get the XML ...
[ "static fromFrames(frames) {\nvar anim;\n//----------\nanim = new CASAnimation();\nanim.setFromFrames(frames);\nreturn anim;\n}", "function buildAnimation()\n\t{\n\t\t// Assemble an array of all the transformations in the entire animation.\n\t\tlet transformationSet =\n\t\t\tgetLyricsTransformations()\n\t\t\t.con...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add emoji as marker on the map
function placeMarker(latLng, map) { console.log(emoji_to_use); var marker = new google.maps.Marker({ position: latLng, map: map, icon: emoji_to_use }); // a debug message to make sure this line works console.log("Placing marker here"); emoji_array.push(marker);...
[ "function place_marker(l) {\n var emoji = document.getElementById('icon_use').value;\n var marker = new google.maps.Marker({\n position: l,\n map: map,\n icon: emoji\n });\n\n // Log to the console latitude, longitude, and emoji of every marker as a separate entry\n console.log(l.lat()...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Converts `GeolocationPosition` to JavaScript object.
function geolocationPositionToJSON(position) { const { coords, timestamp } = position; return { coords: { latitude: coords.latitude, longitude: coords.longitude, altitude: coords.altitude, accuracy: coords.accuracy, altitudeAccuracy: coords.alt...
[ "function convertPosition(position) {\n\tvar latitude = position.coords.latitude;\n var longitude = position.coords.longitude;\n\n var pos= {\n lat: latitude,\n lng: longitude\n }\n\n return pos;\n}", "function detectPosition(position) {\n return { x: position.lat, y: position.lng };\n}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Validates an icd10 code to be one of the valid values
function validateICD10(value, field) { if (value === field.unknown) return [] return value !== undefined && field.valid_values.split(',').indexOf(value) !== -1 ? [] : ['Unknown ICD10 code'] }
[ "function is_valid_input(code) {\n var ctr = Number(code[0]);\n if (ctr === 0 && code.length === 3) {\n return true;\n }\n if (ctr >= 1 && ctr <= 3 && code.length === 7) {\n return true;\n }\n if (ctr >= 4 && ctr <= 7) {\n return true;\n }\n return false;\n }", "function va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Edits a response detail for a particular recipe based on the user inputs
function editResponseDetail(rdid, rrid, ruleorder, target, chain, protocol, source, dest) { var dataObject = { 'rrid': rrid, 'ruleorder': ruleorder, 'target': target, 'chain': chain, 'protocol': protocol, 'source': source, 'destination': dest }; $.ajax({ url: _lcarsAPI + "responsedetails/" + rdid, ...
[ "function updateRecipe(e) {\n const body = getIngredientParams(e.currentTarget);\n const id = e.target.dataset.id;\n const configObj = {\n method: \"PATCH\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify(body),\n };\n\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Setup all the attribute and uniform variables
function setUpAttributesAndUniforms(){ "use strict"; ctx.aVertexPositionId = gl.getAttribLocation(ctx.shaderProgram, "aVertexPosition"); ctx.uColorId = gl.getUniformLocation(ctx.shaderProgram, "uColor"); ctx.uProjectionMatId = gl.getUniformLocation(ctx.shaderProgram, "uProjectionMat"); ctx.uModelMa...
[ "function setUpAttributesAndUniforms(){\n \"use strict\";\n ctx.aVertexPositionId = gl.getAttribLocation(ctx.shaderProgram, \"aVertexPosition\");\n ctx.uColorId = gl.getUniformLocation(ctx.shaderProgram, \"uColor\");\n ctx.uProjectionMatrix = gl.getUniformLocation(ctx.shaderProgram, \"uProjectionMatrix\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
We need to bring the given window to the top. function set_focus();
static set_focus( wnd ) { let oldwnd = WINDOW.#wnd_with_focus; if (!wnd instanceof WINDOW) { return; } if (wnd === oldwnd) { return; } WINDOW.window_set_index(wnd, WINDOW.count); WINDOW.#wnd_with_focus = wnd; wnd.header.style.backg...
[ "SetWindowFocus()\n {\n this.FocusWindow(this.guictx.CurrentWindow);\n }", "function jumpToTop() {\n\n // Window 0,0\n window.scrollTo(0, 0);\n}", "bringWindowToFront() {\n finsembleWindow.isShowing(function (err, isShowing) {\n if (isShowing) {\n finsembleWindow....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Effettua il cambio dei dati della natura, controllando quali ragonamenti debba effettuare lo split/reverse
function cambioNaturaSplitReverse() { var selectedOption = $('option:selected', selectNaturaOnere); var codiceSplitReverseSelezionato = $('option:selected', selectSplitReverse).data('codice'); var divsToHide; if(!selectedOption.length || !selectedOption.val()) { // Nulla da e...
[ "function dibujarGraficoMadrid(datos) {\n // let arrayDatos = datos;\n //muestraDatosVacunaMadridDosPuntoCero(arrayDatos);\n\n //en este caso el csv es un array en el q cada elemento del array es otro array con los datos de cada\n //fila del csv\n let fechas = [];\n let indiceMadridDesdeElFinal = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Queries details of a bulk transfer
async getBulkTransfer(bulkTransferId, sourceFspId) { try { // make a call to the backend to get bulk transfer details const response = await this._backendRequests.getBulkTransfers(bulkTransferId); if (!response) { return 'No response from backend'; ...
[ "function printTransfers(transaction) {\n for (const transfer of transaction.transfers) {\n printTransactionTransfer(transaction, transfer);\n }\n}", "_sendRows(cb) {\n const table = new mssql.Table(this.options.tableName);\n table.create = true;\n const colNames = [];\n // table.columns....
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Quick shallow copy of JSON
function shallowCopy(json) { var retVal = {} for (var k in json) { retVal[k] = json[k] } return retVal }
[ "function _copyJSONObj (json) {\n return JSON.parse( JSON.stringify(json) );\n}", "function deepCopyJson(obj) {\n return JSON.parse(JSON.stringify(obj))\n }", "function shallow_copy(src){if(typeof src==='object'){var dst={};for(var k in src){if(Object.prototype.hasOwnProperty.call(src,k)){dst[k]=src[k];...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates renderer for boolean values.
function boolRenderer() { return function (value) { if (value === true) { return "<img src='" + Application.baseUrl + "/javascript/tau/css/images/icons/yes.gif' />"; } if (value === false) { return "<img src='" + Application.baseUrl + "/javascript/tau/css/images/icons/no.gif' />"; } return "&nbsp;"; }...
[ "function booleanFormatter(value) {\r\n if (value==1) { \r\n \treturn '<img src=\"img/checkedOK.png\" width=\"12\" height=\"12\" />'; \r\n } else { \r\n \treturn '<img src=\"img/checkedKO.png\" width=\"12\" height=\"12\" />'; \r\n }\r\n}", "function BooleanValue() {}", "function booleanFormatter(value) {\r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a "partial" ARN from the secret name. The "full" ARN would include the SecretsManagerprovided suffix.
get partialArn() { return core_1.Stack.of(this).formatArn({ service: 'secretsmanager', resource: 'secret', resourceName: secretName, arnFormat: core_1.ArnFormat.COLON_RESOURCE_NAME, }); }
[ "function parseSecretNameForOwnedSecret(construct, secretArn, secretName) {\n const resourceName = core_1.Stack.of(construct).splitArn(secretArn, core_1.ArnFormat.COLON_RESOURCE_NAME).resourceName;\n if (!resourceName) {\n throw new Error('invalid ARN format; no secret name provided');\n }\n // S...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new tab, navigated to the specified |domain|.
function createTestTab(domain, callback) { var createdTabId = -1; var done = listenForever( chrome.tabs.onUpdated, function(tabId, changeInfo, tab) { if (tabId == createdTabId && changeInfo.status != 'loading') { callback(tab); done(); } }); chrome.tabs.create({url: testUrl(doma...
[ "function newTab(url) {\n chrome.tabs.create({url: url});\n}", "function makeTabWithURL(desiredURL){\n console.log(\"This is what makeTabWithURL recieves\",desiredURL);\n return browser.tabs.create({\n url: desiredURL\n });\n}", "function createNewTabWithURL(desiredURL){\n\tif (desiredU...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Saves the current hds onto a file
function saveHds() { var filename = d3.select("input#filename").attr("value"); var ds = currHds(); var text = JSON.stringify(ds.toJSON()); var blob = new Blob([text], {type: "text/plain;charset=utf-8"}); saveAs(blob, filename); }
[ "function saveToFile() {\r\n if (trk) {\r\n trk.add(getTicks(), JZZ.MIDI.smfEndOfTrack());\r\n // sync so we can write during process exit\r\n fs.writeFileSync(\"./recordings/\" + Date.now() + \".mid\", smf.dump(), 'binary');\r\n } \r\n}", "save(fout) {\n // not implemented\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
These are elements that are in every single project. Even if they are not used they should be place in the project and display should be set to none. This simplifies configuration and some common functions and allows less null checks to be performed overall. If the element does not exist at run time an empty div with t...
function makeElemIfNotExist(id) { var elem; try { elem = document_1.D.id(id); } catch (err) { elem = document_1.D.create('div'); elem.id = id; elem.style.display = 'none'; document.body.append(elem); } return elem; }
[ "function createElement(name){\n\tdiv = document.getElementById(name);\n\tif(div == undefined){\n\t\tdiv = document.createElement('div');\n\t\tdiv.setAttribute('id', name);\n\t\tdiv.setAttribute('style', 'display:none');\n\t\tbody = document.getElementsByTagName('body');\n\t\tbody[0].appendChild(div);\n\t}\n\tretur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The standard sparkles template.
function sparkles(source, options) { var populated = __1.default.util.overrideDefaults({ count: variation.range(10, 20), speed: variation.range(100, 200), size: variation.range(0.8, 1.8), rotation: function () { return new components_1.Vector(0, 0, random.randomRange(0, 360)); }...
[ "generateFunctionalPedalTemplate() {\n let template = \"\";\n template += \"<template>\";\n template += this.generateFunctionalPedalStyle();\n template += this.generateFunctionalPedalHtml();\n template += \"</template>\";\n return template;\n }", "function generateSparklines()\n {\n i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Performs Select all data query in ticket statuses database model and return the data
function fetTicketStatuses(){ return new Promise( async(resolve, reject)=>{ try { const ticket_status_con = await ticket_status_model(); ticket_status_con.find() .then((data) => { resolve(data); }) .catch(err => { ...
[ "activetickets(data) {\n\t\tconst userID = data.userID ? data.userID : false;\n\t\tconst teamID = data.teamID ? data.teamID : false;\n\t\treturn success(require('./queries/tickets')({ userID, teamID }));\n\t}", "function getActiveTickets(){\n if (authorized.user(this.userId)) {\n return Tickets.find(\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
! \brief object which represents an entry in the partial view of the peers. The partial view is totally ordered using the unique identifier of each site. \param uid the unique site identifier of the remote peer \param link the webrtc connection between this peer and the remote peer \param weight the arc weight to set t...
function ViewEntry(uid, link, weight){ this.uid = uid; this.link = link; this.weight = weight; }
[ "updateLinkWeight() {\n var j, len, link, ref, ref1, ref2;\n ref = this.links;\n for (j = 0, len = ref.length; j < len; j++) {\n link = ref[j];\n link.weight = (ref1 = (ref2 = this.data.turns.find((turn) => {\n return turn.participant === link.source;\n })) != null ? ref...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
build html modal confirmation for updating
function notification_modal_confirm_update() { header_style = 'style="background-color: #1DB198; color: #ffffff;"'; var modal = '<div class="modal fade" id="modal_div" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">'; modal += '<div class="modal-dialog">'; modal += '<div...
[ "function updateConfirmation () {\n team_form.setConfirmationMessage(confirmation)\n }", "function getDeleteConfirmationHtml() {\n\n return $('<div class=\"modal hide fade\" id=\"deleteContactDialog\">'\n +'<div class=\"modal-header\">'\n +'<button type=\"button\" class=\"close\" data-dismiss=\"modal\" a...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create a new sunrise object
function Sunrise(name = "Default name", totalSunrises = 365, watched, missed, cloudySunrise, clearSunrise, partiallyCloudy) { this.name = name; this.totalSunrises = totalSunrises; this.watched = watched; this.missed = missed; this.cloudySunrise = cloudySunrise; this.clearSunrise = clearSunrise; ...
[ "function sunrise(obs,twilight) {\n // obs is a reference variable make a copy\n var obscopy=new Object();\n for (var i in obs) obscopy[i] = obs[i];\n var riseset=new Array(\"\",\"\");\n obscopy.hours=12;\n obscopy.minutes=0;\n obscopy.seconds=0;\n lst=local_sidereal(obscopy);\n earth_xyz=helios(planets[2]...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The handleClick function will do the foll: ?1. if user clicked on a number, get that value ?2. if user clicked on palette icon, change the color of all values inside numpad ?3. if user clicked on edit icon, toggle the edit mode state
function handleClick(e) { const cell = e.target.closest(".numpad-item"); const cellID = cell.id.toString(); /** * * set numpad value */ if (cellID.includes("digit")) { let numpadValue = parseInt(cellID.slice(-1)); setNumpadState({ ...numpadState, value: numpadValu...
[ "handleClicks(){\r\n\t\tif(this.value >= 1 && this.value <= 9){\r\n\t\t\tthis.style.color = '#679D64';\r\n\t\t} else {\r\n\t\t\talert(\"Please enter a number between 1 and 9, inclusive\");\r\n\t\t\tthis.value = \"\";\r\n\t\t}\t\t\t\r\n\t}", "onClick() {\n if (globalMode === 'edit') {\n\n // incr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Truncates the string to n characters by removing words and appends an ellipsis (three periods) to the end. If a string is less than n characters long, return the same string. If it is longer, split the string where a space occurs and append an ellipsis to it so that the total length is less than or equal to n. If no sp...
function truncate(n) { let string = this.toString(); if (n > string.length) { return string; } if (n < 4) { return '.'.repeat(n); } if (!string.contains(' ')) { return string.slice(0, n - 3) + '...'...
[ "function truncate(str, n){\n return str?.length > n ? str.substr(0, n - 1) + \"...\" : str;\n }", "function truncate(str, num) {\n\tif(num <= 3){\n\t\treturn str.slice(0, num) + \"...\"\n\t} \n\tif (str.length < num || str.length === num) {\n\t\treturn str;\n\t} else if (str.length > num) {\n\t\treturn s...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sets lazyloading height to track scroll against.
_setLazyloadHeight() { if (this.lazyloadHeight === 0 && this.el) { const fromTop = this.el.getBoundingClientRect().top; this.lazyloadHeight = fromTop - this.lazyloadBuffer; } }
[ "updateHeight_() {\n const estScrollHeight = this.items.length > 0 ?\n this.items.length * this.domItemAverageHeight_() :\n 0;\n this.$.container.style.height = estScrollHeight + 'px';\n }", "function setInfinitePanelHeight(){\n\t\t\tvar viewportH = $(window).height(),\n\t\t\t\theaderHeigh...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates a new binding called 'mark'+name, that creates a new field on the context for child bindings named '$jigsaw'+name; containing the specified mark
function createContextMarkBinding(name, mark) { var bindingName = 'mark' + name, contextKey = '$jigsaw' + name; // create the binging ko.bindingHandlers[bindingName] = { init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) { ...
[ "function createContextMarkBinding(name, mark) {\n var bindingName = 'mark' + name, contextKey = '$jigsaw' + name;\n\n // create the binging\n ko.bindingHandlers[bindingName] = {\n init: function (element, valueAccessor, allBindingsAccessor, viewModel, bindingContext) {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET ECLIPTIC LONGITUDE OF SUN UsinG VSOP THEORY BIG FORMULA ! Reference: Astronomical Algorithms 2nd Edition 1998 by Jean Meeus Page 166, which uses pages 217 219 & Appendix III
function Get_Ecliptic_Longitude(TT_cent) { var tau = TT_cent / 10.0; var L0 = 0 ; var L1 = 0 ; var L2 = 0 ; var L3 = 0 ; var L4 = 0 ; var L5 = 0 ; L0 = 175347046 ; L0 = L0 + 3341656 * Math.cos(4.6692568 + 6283.07585 * tau) ; L0 = L0 + 34894 * Math.cos(4.6261 + 12566.15170 * tau) ; L0 = L0...
[ "function ELP_MAIN_lat(ang) {\n var s = 0;\n s += 0.08950261906476278 * Math.sin(ang.F);\n s += -3.052618492304011e-05 * Math.sin(3*ang.F);\n s += 2.869974021688759e-08 * Math.sin(5*ang.F);\n s += -1.144113610139216e-08 * Math.sin(-5*ang.F + ang.L);\n s += 1.356819664366135e-05 * Math.sin(-3*ang.F + ang...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Initialize the firebase objects and collections
function init() { // connect to the taco database dbRef = firebase.database(); // wire up the taco eaters collection tacoEatersRef = dbRef.ref('tacoEaters'); tacoEatersCollection = $firebaseArray(tacoEatersRef); tacoEatersRef.on('value', function (snapshot) { var eaters = sn...
[ "function init() {\n // connect to the taco database\n dbRef = firebase.database();\n\n // wire up the taco eaters collection\n tacoEatersRef = dbRef.ref('tacoEaters');\n tacoEatersCollection = $firebaseArray(tacoEatersRef);\n tacoEatersRef.on('value', function (snapshot) {\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a sudoku, returns true if the sudoku is solved
function isSolvedSudoku(sudoku) { for (var i=0; i<=8; i++) { if (!isCorrectBlock(i,sudoku) || !isCorrectRow(i,sudoku) || !isCorrectCol(i,sudoku)) { return false; } } return true; }
[ "function isSolvedSudoku(sudoku) {\n for (var i=0; i<=8; i++) {\n if (!isCorrectBlock(i,sudoku) || !isCorrectRow(i,sudoku) || !isCorrectCol(i,sudoku)) {\n return false;\n }\n }\n return true;\n}", "function isSolvedSudoku(sudoku) {\n for (var i = 0; i <= 8; i++) {\n if (!isCorrectBlock(i, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a swallow copy of an array, and append a value to the end of the result.
function copyAndPushArr(array, value) { let result = arr.slice(0, array.length); result.push(value); return result; }
[ "function copyAndExtendArray(arr, newValue) {\n var _context4;\n\n return concat$2(_context4 = []).call(_context4, toConsumableArray(arr), [newValue]);\n}", "function copyAndExtendArray(arr, newValue) {\n var _context2;\n\n return concat$2(_context2 = []).call(_context2, toConsumableArray(arr), [newValue]);\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Determine whether the given properties match those of a `SetVariableProperty`
function CfnDetectorModel_SetVariablePropertyValidator(properties) { if (!cdk.canInspect(properties)) { return cdk.VALIDATION_SUCCESS; } const errors = new cdk.ValidationResults(); if (typeof properties !== 'object') { errors.collect(new cdk.ValidationResult('Expected an object, but rece...
[ "hasProperty(aProperty){\n for(let i = 0; i < this._properties.length; i++){\n let prop = this._properties[i];\n if(aProperty.matches(prop)){\n return true;\n }\n }\n return false;\n }", "function isSetProperty(card1, card2, card3, property) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
detect if browser allows autoplaying audio
function canAutoplay() { // IE11 now returns undefined again for window.chrome // and new Opera 30 outputs true for window.chrome // but needs to check if window.opr is not undefined // and new IE Edge outputs to true now for window.chrome // and if not iOS Chrome chec...
[ "checkBrowserAutoplay() {\n const mp3 =\n 'data:audio/mpeg;base64,/+MYxAAAAANIAUAAAASEEB/jwOFM/0MM/90b/+RhST//w4NFwOjf///PZu////9lns5GFDv//l9GlUIEEIAAAgIg8Ir/JGq3/+MYxDsLIj5QMYcoAP0dv9HIjUcH//yYSg+CIbkGP//8w0bLVjUP///3Z0x5QCAv/yLjwtGKTEFNRTMuOTeqqqqqqqqqqqqq/+MYxEkNmdJkUYc4AKqqqqqqqqqqqqqqqqqqqqqq...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This is to create launcher start script jstart.js
function createJStart(hasj) { var mout; if (hasj) mout = "var jserver = require('jamserver')(true);\n"; else mout = "var jserver = require('jamserver')(false);\n"; mout += "const {Flow, ParallelFlow, PFlow} = require('flows.js')();\n"; mout += "var jamlib = jserver.jamlib;\n"; ...
[ "function launch() {}", "function addtoStart() {\n\n const exeName = path.basename(process.execPath);\n app.setLoginItemSettings({\n openAtLogin: true,\n path: process.execPath,\n args: [\n '--processStart', \"${exeName}\",\n '--process-start-args', \"--hidden\"\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
checking if given locator is found
function check_tx(locator) { if (casper.exists(x(locator))) return true; if (casper.exists(x('//*[contains(@id,"'+locator+'")]'))) return true; if (casper.exists(x('//*[contains(@name,"'+locator+'")]'))) return true; if (casper.exists(x('//*[contains(@class,"'+locator+'")]'))) return true; if (casper.exists(x('//*[cont...
[ "function check_tx(locator) {if (is_xpath_selector(locator))\n{if (chrome.exists(x(locator))) return true; else return false;}\nif (chrome.exists(locator)) return true; // check for css locator\n// first check for exact match then check for containing string\nif (chrome.exists(x('//*[@id=\"'+locator+'\"]'))) return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove timestamps out of the 5 second period.
_trimTimeArray() { const threshold = (new Date()).getTime() / 1000 - 5; // Removing old times until there are none for 5 sec. while (this._times[0] < threshold) { this._times.shift(); } }
[ "_trimTimeArray() {\n let threshold = (new Date()).getTime() / 1000 - 5;\n\n // Removing old times until there are none for 5 sec.\n while (this._times[0] < threshold) {\n this._times.shift();\n }\n }", "function tsToTrunc (i) {\n return Math.floor((i - 1454212801000) ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If we have the datachannel and wish to from this find the DCSO it is attatched to this is our guy
function fetchDCSOByDC(DC) { var ret = null; for (var i = 0; i < window.DataChannels.length; i++) { if (window.DataChannels[i]['dataChannel'] === DC) { ret = window.DataChannels[i]; break; } } // added for debugging only. if (ret === null) { function sleep(miliseconds) { var currentTime ...
[ "gatherRTCDataChannelDetails() {\n const { dataChannel } = this;\n if (dataChannel) {\n const dcKeys = Object.keys(dataChannel);\n\n this.output.connection.dataChannels = {};\n\n dcKeys.forEach((prop) => {\n const channel = dataChannel[prop];\n this.output.connection...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
An offer is valid if it has a city attribute
validateOffer() { if (this[VILLE]) { this.validated = true; } else { this.validated = false; } }
[ "validateCity(city) {\n if (city.name === '') {\n this.errorEl.innerHTML = constants.alertMessageForCity;\n return false;\n }\n if (city.country === '') {\n this.errorEl.innerHTML = constants.alertMessageForCountry;\n return false;\n }\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get cos object url
function getObjectUrl({ cosInstance, bucket: Bucket, region: Region, key: Key, origin = "", }) { const url = cosInstance.getObjectUrl({ Bucket, Region, Key, Sign: false, }); const { protocol, host } = new URL(url); return url.replace(`${protocol}//${host}`, origin); }
[ "getObjectSetupLink(sobjectName) {\r\n return \"https://\" + this.props.sfHost + \"/lightning/setup/ObjectManager/\" + sobjectName + \"/FieldsAndRelationships/view\";\r\n }", "function getS3ObjectUrl(file) {\n return `https://${envs.bucketName}.s3.amazonaws.com/${file.path}`;\n}", "function getUrl() {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function for drawing a horizontal rule.
function drawHorizontalRule() { var stat = getState(cm); _replaceSelection(cm, stat.image, insertTexts.horizontalRule); }
[ "function drawHorizontalRule(editor) {\n\t\t\tvar cm = editor.codemirror;\n\t\t\tvar stat = getState(cm);\n\t\t\tvar options = editor.options;\n\t\t\t_replaceSelection(cm, stat.image, options.insertTexts.horizontalRule);\n\t\t}", "function drawHorizontalRule(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
grey out list sets the background of each color object's div in the array it is given to grey
greyOut(list) { list.forEach((item) => { if ( String(item.color.rgb()) === String(chroma(item.div.style.backgroundColor).rgb()) ) { item.div.style.backgroundColor = chroma( item.div.style.backgroundColor ).darken(2); } }); }
[ "function greyBackground() {\n\t\tfor(i = 0; i <= 9; i++){ \n\t\t\tfor(j = 0; j <= 9; j++){ \n\t\t\t\tif(document.getElementById(\"\"+[i]+\",\" +[j] +\"\").style.backgroundColor != 'rgb(244, 67, 54)'\n\t\t\t\t&& document.getElementById(\"\"+[i]+\",\" +[j] +\"\").style.backgroundColor != 'rgb(219, 60, 48)'\t\t\n\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Labels any emails with no label as "No Label". Removes "No Label" if a label is added.
function autoNoLabel() { // ######## Settings ######## var Label = "No Label" // ##### End Settings ####### var batchSize = 100; // process up to 100 threads at once var threads = GmailApp.search('has:nouserlabels NOT is:chat'); // find threads in inbox for (t = 0; t < threads.length; t...
[ "function hasNoEmptyLabels() {\n const problemLabels = elementData.label\n .filter(label => label.textContent === '')\n .map(label => stringifyElement(label));\n if (problemLabels.length) {\n const item = {\n // description: 'The for attribute of a label must not be empty.',\n details: `Found e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Chartjs Card constructor TODO: Why is this called 36 times on startup ?
constructor() { // Always call super first in constructor // https://github.com/mdn/web-components-examples/blob/master/life-cycle-callbacks/main.js super() // Element functionality written in here this._hass = null this._config = null this.attachShadow({ mode: ...
[ "function initCardChartData(data){\n // console.log(\"initing the card chart data\");\n initCardChart('#cardChart',\"cardoverallChartObj\");\n updateCardChart(data);\n}", "function initCardDetailChartData(card){\n // console.log(\"initing the card chart data\");\n initCardDetailChart('#cardDetail');\n updat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to get of alredy exists the relations between email and opportunity
function searchExistsEmailOpportunity(email, opportunity){ return new Promise((resolve, reject) => { pool.query(`SELECT 1 FROM ebdb.EmailFollowOpportunity WHERE email = ? AND opportunity = ? AND active = 1 `, [email, opportunity], function(error...
[ "async getEligibleJoinCompanies () {\n\t\tthis.email = this.user.get('email');\n\t\tthis.domain = EmailUtilities.parseEmail(this.email).domain.toLowerCase();\n\t\tthis.isWebmail = WebmailCompanies.includes(this.domain);\n\n\t\tconst ignoreDomain = this.isWebmail;\n\t\tconst ignoreInvite = false;\n\n\t\tthis.eligibl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
xGetElementsByTagName, Copyright 20022007 Michael Foster (CrossBrowser.com) Part of X, a CrossBrowser Javascript Library, Distributed under the terms of the GNU LGPL
function xGetElementsByTagName(t,p) { var list = null; t = t || '*'; p = p || document; if (typeof p.getElementsByTagName != 'undefined') { // DOM1 list = p.getElementsByTagName(t); if (t=='*' && (!list || !list.length)) list = p.all; // IE5 '*' bug } else { // IE4 object model if (t==...
[ "function xGetElementsByTagName(t,p)\n{\n var list = null;\n t = t || '*';\n p = p || document;\n if (xIE4 || xIE5) {\n if (t == '*') list = p.all;\n else list = p.all.tags(t);\n }\n else if (p.getElementsByTagName) list = p.getElementsByTagName(t);\n return list || new Array();\n}", "function xGetEl...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a span with inline SVG for the element.
function buildSvgSpan_() { var viewBoxWidth = 400000; // default var label = group.value.label.substr(1); if (_utils2.default.contains(["widehat", "widetilde", "utilde"], label)) { // There are four SVG images available for each function. // Choose a taller image when the...
[ "function buildSvgSpan_() {\n var viewBoxWidth = 400000; // default\n var label = group.value.label.substr(1);\n if (__WEBPACK_IMPORTED_MODULE_4__utils__[\"a\" /* default */].contains([\"widehat\", \"widetilde\", \"utilde\"], label)) {\n // There are four SVG images available for eac...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
save medicin, medicine details
async saveMedicineData( name, medical_type, buy_price, sell_price, c_gst, s_gst, batch, shelf_no, expire_date, mfg_date, company_id, description, in_stock_total, qty_in_strip, medicinedetails ) { await this.checkLogin(); var respons...
[ "function saveItemData() {\n var dia = null;\n\n diaList.forEach(function (dia, i) {\n if (dia.c_id) {\n dia.canvas.forEachObject(function(item) {\n if (!item.c_id)\n return;\n\n var elms = item.c_id.split('-');\n if (elms[2] !== 'item')\n return;\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get options for D3 feature path generation.
getFeaturePathOptions(feature) { // access embedded Backbone model var model = feature._model; // if (model && (model.get('_itemType') === 'us_state') && (model.get('id') === 2)) { // return this.getUsStateProjectionModifiers('2'); // } // if (model && (model.get('_it...
[ "function getOptions() {\n\t\t\tvar opt;\n\t\t\tif (arguments.length == 2) {\n\t\t\t\topt = {\n\t\t\t\t\tvs : arguments[0],\n\t\t\t\t\tfs : arguments[1]\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\topt = arguments[0] || {};\n\t\t\t}\n\t\t\treturn opt;\n\t\t}", "function getOptions() {\n var opt;\n if (arguments.len...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
game field drawing and children hierarchy management
function drawField() { //////////////////////////////////////////////////画田 stage.addChild(bulletContainer); stage.addChild(zombieContainer); stage.addChild(overlayContainer); stage.addChild(sunFlowerContainer); stage.addChild(plantContainer); stage.addChild(deadZombieContainer); stage.addChild(zom...
[ "function render() {\n background.removeAllChildren();\n \n\n // TODO: 2 - Part 2\n // this fills the background with a obnoxious yellow\n // you should modify this to suit your game\n var backgroundFill = draw.rect(canvasWidth, 425, 'DarkSlateGrey')...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
13 Using Filter Create a function called onlyOneWord that accept an array of strings and return only those strings with a single word (no spaces) var strings= [ 'return', 'phrases', 'with one word' ]; Ex: onlyOneWord(strings) => [ 'return', 'phrases' ]
function onlyOneWord (arr) { var output = arr.filter (m => !(m.includes(" ") )) return output }
[ "function onlyOneWord(arr){\nvar result= arr.filter(word=>!(word.includes(\" \")))\n\n\nreturn result;\n}", "function onlyOneWord(strArr){\n\treturn strArr.filter((element,index)=> {\n\t\telement = element.split(\" \");\n\t\tif(element.length == 1){\n\t\t\treturn element;\n\t\t}\n\t});\n}", "function filterByWo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
remove a cup when click remove button
function removeCupFunction(element) { var str = element.parent('p').parent('td').parent('tr'); var cupID = str.attr("name"); // delete cup in Object delete listCup[cupID]; // hide html element str.hide(); // update total price updateTotalPriceFunction(); // checkout button stage if (parseFloat...
[ "function removeUpButton(li){\n let buttonUp = li.querySelector('.up');\n li.removeChild(buttonUp);\n}", "function removeDuelBtn(){\n $(\"#duel-area\").empty();\n $(\"#duel-area\").removeClass(\"duel\");\n }", "function removeAttackButton() {\n $(\"#attack\").remove();\n}", "function r...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Iretatively depth first, this sort of works from the end of the adjecency list
depthFirstiterative(start) { const stack = [start]; const visited = []; const result = []; visited[stack] = true; // initialize the current vertex let currentVertex; while (stack.length) { // mark vertex we are iteratin over currentVertex = stack.pop(); // Push the current ...
[ "depthFirstIterative(start) {\n const stack = [start];\n const result = [];\n const visited = {};\n let currentVertex;\n\n visited[start] = true;\n while (stack.length) {\n currentVertex = stack.pop();\n result.push(currentVertex);\n\n this.adjacencyList[currentVertex].forEach((neig...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This return true if the object is with type Object, but not an array or null/undefined
function isTrueObject(obj) { if (obj && typeof obj === 'object' && !(obj instanceof Array)) { return true; } else { return false; } }
[ "function check(obj) {\n if (Object.prototype.toString.call(obj) === \"[object Array]\") {\n return true;\n } else {\n return false;\n }\n}", "function is_object(a) {\n\t\treturn ( a && (typeof a === 'object') && (!(a instanceof Array)) ) ? true : false;\n\t}", "function object (thing) {\n\t ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
= Description Restores the visibility of the component's main DOM element (and its children). = Return +self+
show() { ELEM.setStyle(this.elemId, 'display', this.displayMode, true); ELEM.setStyle(this.elemId, 'visibility', 'inherit', true); this.isHidden = false; return this; }
[ "hide () {\n if (this.isVisible()) {\n this.getElement().style.visibility = \"hidden\";\n }\n }", "ensureInvisibility() {\n this.nodeVisible = false;\n }", "show () {\n if (!this.isVisible()) {\n this.getElement().style.visibility = \"visible\";\n }...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Xpath for the hockeyapp update window
get hockeyUpdateWindow() { return browser.element("//android.widget.LinearLayout/android.widget.LinearLayout[2]/android.widget.Button[1]");}
[ "get watchLiveButton() {return browser.element(\"//android.widget.TextView[@text='Watch Live'][1]\");}", "function start_updates(){\n update_win = new BrowserWindow({width: 600, height: 400 });\n update_win.loadURL(url.format({\n pathname: path.join(__dirname, 'update.html'),\n protocol: 'file:',\n sla...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
hover in that has custom functionality for mobile
function hoverIn() { if (isMobile > -1) { timeOutManager(false); timeOutManager(true); } intervalManager(false); }
[ "function hover_mobile() {\n \"use strict\";\n if (jQuery(\"div.mobile_tap_hover\").length > 0) {\n jQuery('.taphover').on(\"touchstart\", function(e) {\n var link = jQuery(this); //preselect the link\n if (link.hasClass('hover')) {\n return true;\n } els...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Forceopen the Options page on install, as it might serve as an intro page.
function openOptionsPage() { try { browser.runtime.openOptionsPage(); } catch ( e ) { /** * @todo */ } }
[ "function displaySetup(){\n if (chrome.runtime.openOptionsPage) {\n // New way to open options pages, if supported (Chrome 42+).\n chrome.runtime.openOptionsPage();\n } else {\n // Reasonable fallback to open html options page\n window.open(chrome.runtime.getURL('options.html'));\n }\n}", "function...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Pass additional paremeters caption: Title of the window theWidht: the initial size of the window; canMove: is the window dragable contentSource: Which window startX startY
function CreateDropdownWindow(caption, theWidth, _startX, _startY, canMove, contentSource) { try{ startX = _startX; startY = _startY; //Create a div container var divContainer; //create the div object divContainer = document.createElement("div"); //provide an id for th...
[ "function makeStoryWindow() {\n\t// Create the window html and append it to the page. \n\tvar storyWindow = $(\n\t\t\"<div id='storyWindow' class='ui-widget-content resizable movable'>\" + \n\t\t \"<div id='storyTitleBar' class='movableWindowTitleBar'>\" + \n\t\t \"<div id='storyTitleText' class='movableWindowT...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Spawns the skyux pact command.
function pact(command, argv) { const tsLinter = require('@skyux-sdk/builder/cli/utils/ts-linter'); const skyPagesConfigUtil = require('@skyux-sdk/builder/config/sky-pages/sky-pages.config'); const karmaServer = require('./utils/karma-utils'); const pactServers = require('./utils/pact-servers'); const skyPa...
[ "spawn() {}", "function Spawn () {\n\t// reset the character's speed\n\tmovement.verticalSpeed = 0.0;\n\tmovement.horizontalSpeed = 0.0;\n\tmovement.speed = 0.0;\n\t\n\t// reset the character's position to the spawnPoint\n\ttransform.position = spawnPoint.transform.position;\n\t\n\t// Put the character on the cor...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
validate that the final password includes atleast one from the selected criteria, else rerun the password generation
function validatePassword() { // empty array for the final if statement to check var errors = []; if (confirmLowerCase === true) { if (finalPass.search(/[a-z]/) < 0) { errors.push("lower"); } } if (confirmUpperCase === true) { if (finalPass.search(/[A-Z]/) < 0) { ...
[ "function generatePassword() {\n //Resetting the criterias before new password generation\n\n isSpecialchar = false;\n isUppercasechar = false;\n isLowercasechar = false;\n isNumericChar = false;\n // get user inputs\n getPasswordcriteria();\n\n //selection set based on criterias\n var selectionSet = [];\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Compares given params to params stored in memory, returns true if equal
function paramsEqual(pname, p1) { var p2 = getPluginParams(pname); return _.isEqual(p1, p2); }
[ "function paramsAreEqual(oldParams, newParams) {\n let newParamsArray = Object.getOwnPropertyNames(newParams)\n .filter((prop) => {\n return newParams[prop] !== null && prop !== 'bbox';\n })\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Injects the page reference that describes the current page
@wire(CurrentPageReference) setCurrentPageReference(currentPageReference) { this.currentPageReference = currentPageReference; if (this.connected) { // We need to have the currentPageReference, and to be connected before // we can use NavigationMixin this.generateUrls()...
[ "set_page(state, value){\n state.page = value\n }", "function _page1_page() {\n}", "function setPage(value) {\n currentPage = value;\n}", "function _page1_page() {\r\n}", "activatePage(pageName){return this.injectLocation({pathSegments:[pageName]})}", "goToPage(page) {}", "get page() {\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
SlashingState: state state for knife owner to use. We keep a single instance stored in the knife object, and keep resetting that one and reassigning it. This is because it may be swapped to very frequently, so we won't be allocating for a new object every time.
function SlashingState(subject){ this.subject = subject; this.countdown = 5; }
[ "function GameState() {\n this.players = {};\n this.bullets = {};\n this.timestamp = 0;\n }", "function GameState () {\n\t// Link State's constructor\n\tState.call(this,\"GameState\");\n\n\t// Public variables\n\tthis.testMaterial;\n\tthis.gui;\n\tthis.start = Date.now();\n}", "function State() { }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Populate the statuses map for given codes.
function $kIvU$var$populateStatusesMap(statuses, codes) { var arr = []; Object.keys(codes).forEach(function forEachCode(code) { var message = codes[code]; var status = Number(code); // Populate properties statuses[status] = message; statuses[message] = status; statuses[message.toLowerCase()] = ...
[ "function populateStatusesMap(statuses, codes) {\n var arr = [];\n\n Object.keys(codes).forEach(function forEachCode(code) {\n var message = codes[code];\n var status = Number(code);\n\n // Populate properties\n statuses[status] = message;\n statuses[messag...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The input row with Question N [question][answer][X]
function QuestionRow({ question = "", answer = "", setQuestion = (q) => {}, setAnswer = (a) => {}, prefix = "", questionNum = 0, remove = () => {}, focused = false, readOnlyQuest = false, }) { return ( <div className="field is-horizontal"> <div className="field-label is-normal"> <l...
[ "getQuestion(row, col) {\n return this.readInfo(this.state.csv, 'q' + row)[col];\n }", "function createRow(currentQuestion) {\n tableCount = Number(tableCount) + 1;\n tr = document.createElement(\"tr\");\n th = document.createElement(\"th\");\n th.setAttribute(\"scope\", \"row\");\n th.innerTex...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get status text based on status value
statusText(status) { switch(status) { case 2: return "Approved"; case 1: return "Pending"; case 3: return "Rejected"; default: return "Pending"; } }
[ "function getStatusText(status) {\n return STATUS_CODE_INFO[status].text || 'Unknown Status';\n}", "getStatusClass(status) {\n const statusMap = {\n \"Not Bidding\": \"danger\",\n \"Complete\": \"success\",\n \"Bidding\": \"warning\",\n };\n\n return `text-${statusMap[status]}`;\n }", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set timefield end time
function setTimefieldTimeEnd(time) { if (!continueProcessing) { $('#clipEnd').timefield('option', 'value', time); } }
[ "function setEndTime(time) {\n endTime = time\n }", "function setTimeEnd(uint _timeEnd) external onlyOwner {\r\n TimeEnd = _timeEnd;\r\n TimeEndChanged(\"New Crowdsale End Time is \", _timeEnd);\r\n }", "function updateTimeEnd() {\n document.getElementById(\"Reserve_Timestamp_end_t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
given a webRTC offer, generate an answer for some reason thisPeersName is the name of this peer clientName is the name of the remote peer
function webRtcCreateAnswer(offer,clientName) { if (typeof thisPeersName != "string") { console.log("Please set peer name before calling this function"); return; } console.log("webRtcCreateAnswer", clientName, thisPeersName, webRtcClients); webRtcClients[clientName] = {}; var client = webRt...
[ "generateOffer (offer) {\n return this.client.generateOfferWebRTCEndpoint(this)\n }", "async function handleOffer (msg) {\n //do we know the peer yet?\n if(peers.has(msg.from)) {\n var peer = peers.get(msg.from);\n var pc = peer.conn;\n var pid = msg.from; // the other guy\n await pc.setRemoteDe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function which allow to update the current car
function updateCar(id){ array_brand[id] = document.getElementById('update-brand').value; array_year[id] = document.getElementById('update-year').value; array_model[id] = document.getElementById('update-model').value; array_fuel[id] = document.getElementById('update-fuel').value; array_price[id] = pa...
[ "function updateCarModelAndYear() {\n self.selectedCarModel = BookingDataService.getSelectedCarModel();\n self.selectedCarYear = BookingDataService.getSelectedCarYear();\n }", "updateCars(cars) {\n this.mini_cars = cars;\n if (this.selectedVid...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks the answers submitted in the addition section
function add_check() { var ans = []; var localScore = 0; // console.log(curOperation); // Get answer vals and put in an array $('#'+curOperation+'-quest .answer').each(function (){ ans.push(this.value); }) // Problems here with undefined rs // console.log(probArr.length) if(probArr.length > 0 )...
[ "function checkAnswers() {\n\n}", "function validateInstructionChecks() {\n \n instructionChecks = $('#instr').serializeArray();\n\n var ok = true;\n var allanswers = true;\n if (instructionChecks.length < 2) {\n alert('Please complete all questions.');\n allanswers = false;\n \n \n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion: Para crear una template donde va a mostrar los datos que se ha almacenado en la BD datos como nombre telefono y id o insertarlos dinamicamente se recarga sola la pagina sin recargar e ir a otra
function construirTemplate(nombre, numero, registro_id){ //MANIPULANDO EL DOM para crear un formulario sin necesidad de etiquetas html //crear Nombre de contacto var tdNombre = document.createElement('TD'); var textoNombre = document.createTextNode(nombre); var parrafoNombre = document.createEleme...
[ "function construirTemplate(nombre,telefono,registro_id){\n // crear input nombre de contacto\n var inputNombre = document.createElement('INPUT');\n inputNombre.type = \"text\";\n inputNombre.name = \"contacto_\" + registro_id;\n inputNombre.value = nombre;\n inputNombre.classList.add(\"buscador\",\"for...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Upload page, if unique.
async function uploadUnique(nam, o) { var o = o||{}; if(o.log) console.log('-uploadUnique:', nam); var qry = OPTIONS.youtube.title.replace(/\$\{title\}/g, nam); var ids = await youtubeuploader.lines({title: qry}); if(ids.length) { if(o.log) console.log(' .already exists:', ids); return 2; } try { ...
[ "function Upload() {\n\tif((wgPageName == 'Special:Upload' || wgPageName == 'Special:MultipleUpload') && document.getElementById('wpDestFile').value == '') {\n\t\tdocument.getElementById('wpUploadDescription').value = '{{FileSummary\\r|Type = \\n|Description = \\n|Specs = \\n|Uploader = \\n|Uploadercat = \\n|Infobo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Propagate Update When a node is updated (to solved) then this will propagate the new constraints
propagate_update(index) { let nodes = this.nodes; const node = this.nodes[index]; const value = node.value; if (!node.solved) return; node.row.forEach(index => { if (this.nodes[index].remove_possibility(value) && this.is_valid_solve(this.nodes[index])) { ...
[ "function updatePotentials(){\n\t\tGraph.instance.edges.forEach(function(key,edge){\n\t\t\tstate.edgePrevCost[edge.id] = edge.resources[1];\n\t\t});\n\t\tGraph.instance.nodes.forEach(function(key,node){\n\t\t\tps[node.id] = node.p;\n\t\t\tnode.p = node.p - node.state.distance;\n\t\t});\n\t\tstate.current_step = STE...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets the just added person's ID first then inserts to skills table
function addSkill(name){ db.transaction(tx => { tx.executeSql('SELECT * FROM person_t ORDER BY person_id DESC LIMIT 1', [], (tx, results) => { var id; for (let i = 0; i < results.rows.length; ++i) { id = results.rows.item(i).person_id; insertSkill(id, name); } }); }); }
[ "function insertskill(me){\n var queryString = 'INSERT INTO pickup_skills (id_user) VALUES (' + me.id + ')';\n connection.query(queryString, function(err, rows, fields) {\n if (err) throw err;\n });\n }", "function addSkill(memberId) {\n var skillName = $(\"#addSk...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
removes the last selected block
function destroyBlock(){ document.getElementById("last-selected").remove(); }
[ "function removeVideoBlock() {\n\t\tif (selectedBlock) {\n\t\t\tselectedBlock.$element[0].remove();\n\t\t}\n\t}", "deleteBlock() {\n if (this.activeBlock && this.activeBlock.uid !== 0) {\n this.canvas.removeBlock(this.activeBlock);\n this.canvas.redraw();\n }\n }", "removeBlock () {\r\n this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
pick weapon by id
async pickWeapon(id) { let response = await this.sendRequest("buysomething.php", { "whatneed": "pickweapon", "weaponid": id }); debug("Pick weapon id" + id + "...", response); return response; }
[ "function WPN_pickWeapon(weapon) {\n\n if( getWeapon() != weapon ) {\n setWeapon(weapon);\n }\n}", "function equipWeapon(selection){\n\tplayer.weapon = armory[wList[selection]].weapon;\n}", "function chooseWeapon(num) {\n playerWeapon = weapons[num]\n randomWeapon()\n getStarted()\n}", "weapon...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
One Process function for each major file type Process HTML Files
function processFileHTML(doc){ // parse out into blocks // re-assemble with new paragraph numbering // add style sheet // move assets to the assets folder return doc; }
[ "function myprocess(request, response){\n\tvar filename = request.url;\n\tfilename = filename.substring(1);\t\n\tvar filetype = findOption(filename);\n\t\n\t// If it is an HTML file and the file exists in the corresponding directory\n\tif (filetype == 1 && fs.existsSync(\"./PUBLIC/\" + filename) ){\n\t\topenHTML(re...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
button click for card product 3 button click for card product 4
function buttonProduct4() { var product1 = document.getElementById("product1"); var product2 = document.getElementById("product2"); var product3 = document.getElementById("product3"); var product4 = document.getElementById("product4"); var product5 = document.getElementById("product5"); var product6 = docum...
[ "static clickProduct() {\n // declare slides\n const slides = document.querySelectorAll(\n // eslint-disable-next-line comma-dangle\n '#featured-product-slider .splide__slide'\n );\n // declare cards\n const cards = document.querySelectorAll('.product-card');\n\n // click event for each ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Retrieves the data available for a tab, or creates it if absent and open is true
async getTab(ID, open = false, create = false, visible = null, tabHandleData, index = 0) { // Check if the tab is already opened let tabData = this.state.tabs.find(tab => tab.ID == ID); if (!tabData && open) { if (!create && this.getTabIndex(ID, false) == -1) ret...
[ "function loadTabData() {\n switch($scope.tab) {\n case 'summary':\n loadCurrentCirc();\n loadCircCounts();\n break;\n\n case 'circs':\n loadCurrentCirc(true);\n break;\n\n case 'circ_list':\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Is this Rational Bezier Curve
isRational() { return !!this.weights; }
[ "function getIsCurve()\n{\n return isCurve;\n}", "function is_on_curve(point) {\n if(point.length==null){\n return true\n }\n var x = bigInt(point[0])\n var y = bigInt(point[1])\n result = y.pow(2)\n .subtract(x .pow(3))\n .subtract(x.multiply(curve.a))\n .subtract(cur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
set the left and top attributes of the container in order to center it on the page
function positionContainer() { var container = document.getElementById('container'); var dimensions = getWindowDimensions(); container.style.left = (dimensions.width - CONTAINER_WIDTH)/2 + 'px'; container.style.top = (dimensions.height - CONTAINER_HEIGHT)/2 + 'px'; }
[ "set TopCenter(value) {}", "function centerCanvas() {\n w = (windowWidth - width) / 2;\n h = (windowHeight - height) / 2;\n container.position(w, h);\n}", "function _center() {\n\t\tif (data.isMobile) {\n\t\t\tvar newLeft = 0,\n\t\t\t\tnewTop = 0;\n\t\t} else {\n\t\t\tvar newLeft = ($(window).width() ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
get head from excel file,return array
function get_header_row(sheet) { const headers = []; const range = XLSX.utils.decode_range(sheet['!ref']); let C; const R = range.s.r; /* start in the first row */ for (C = range.s.c; C <= range.e.c; ++C) { /* walk every column in the range */ const cell = sheet[XLSX.utils.encode_cell({c: C, r: R})]; /* f...
[ "function get_header_row(path) {\n let workbook = XLSX.readFile(path, { sheetRows: 1 });\n let sheetsList = workbook.SheetNames\n let sheetData = XLSX.utils.sheet_to_json(workbook.Sheets[sheetsList[0]], {\n header: 1,\n defval: '',\n blankrows: true\n });\n return sheetData;\n}", "function get_heade...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
0, 1, 2, 3, 4, 5, 6 Function that returns a random lowercase letter
function getRandomLower(){ const letters = `abcdefghijklmnopqrstuvwxyz`; // Returning a random letter using a random index in the "letters" string return letters[randomIndex(letters)]; }
[ "function getRandomLowerCaseChar() {\n randomIndex = Math.floor(Math.random() * 27);\n return lowerCase[randomIndex];\n}", "function getRandomLower() {\n return randomLetter();\n}", "function getRandomLowerCase() {\n return String.fromCharCode(Math.floor(Math.random() * 26) + 97);\n}", "function getRa...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
find the point where a line intersects a rectangle. this function assumes the line and rect intersects
function lineRectIntersect2(line, rect) { // check left var leftLine = {start:{x: rect.x, y: rect.y}, end:{x: rect.x, y: rect.y + rect.h}}; var intersectionPoint = intersection.intersect(line,leftLine); if (intersectionPoint.y >= leftLine.start.y && intersectionPoint.y <= leftLine.end.y && line.start.x ...
[ "function intersectPointRect(pointX, pointY, rectX, rectY, rectW, rectH) {\n var s = (pointY - rectY)/(pointX - rectX);\n var x = pointX;\n var y = pointY;\n if(-rectH/2 <= s * rectW/2 && s * rectW/2 <= rectH/2) { // then the line intersects\n if(pointX > rectX) // The right edge\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Get Resource With Params
function getResourceWithParams(endpoint, params, callback, err_call){ var new_resource = $resource(endpoint); var resource_call = new_resource.get(params, function(response) { var data = response.data; callback(data); }, function(error){ ...
[ "get(aResourceName, aParams = {}) {\r\n\t\tlet url = this.getResourceUrl(aResourceName);\r\n\t\treturn this.$http.get(url, {params: aParams});\r\n\t}", "function get(endpointHandle, params, query, options) {\n var deferred = $q.defer();\n var endpoint = endpoints[endpointHandle];\n var headers = {}...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
setup Table for Lessons Database
function setupTableForLessons(tx){ console.log("before execute sql for Lessons Database"); tx.executeSql("CREATE TABLE IF NOT EXISTS lessons(lessonRow_id INTEGER,teacher_id INTEGER,lesson_id INTEGER,exercise_id INTEGER,exercise_title,exercise_detail,\ exercise_voice,exercise_image,PRIMARY KEY(less...
[ "function initLesson(){\n // Opening Lessons Database\n openDataBaseAndCreateTable('lessons');\n}", "function setupTable(tx) {\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS setting(id INTEGER PRIMARY KEY,theme)\");\n tx.executeSql(\"CREATE TABLE IF NOT EXISTS levels(id INTEGER PRIMARY KEY,board_row_siz...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return model by type
function getModelByType(type) { // eslint-disable-next-line default-case switch (type) { case Types.POST: return Post; } }
[ "function getModelByType(type) {\n\tswitch (type) {\n\t\tcase Types.USER:\n\t\t\treturn User;\n\t\tcase Types.TOPIC:\n\t\t\treturn Topic;\n\t\tcase Types.HEALTH:\n\t\t\treturn Health;\n\t\tcase Types.BLOG:\n\t\t\treturn Blog;\n\t\tcase Types.DOCTOR_SPECIALITY:\n\t\t\treturn DoctorSpeciality;\n\t\tcase Types.QUESTIO...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
id: string YT video id returns Item | null
youtubeVideo(id) { return ytRequest('/videos', id) .then(res => { let item = null; if (res.items.length) { item = Item.fromApi(ITEM_TYPE.YOUTUBE, { title: res.items[0].snippet.title, url: `http://youtube.com/watch?v=${id}`, srcId: id, });...
[ "function getVideo(id)\r\n{\r\n\tfor(var i in videos)\r\n\t\tif(videos[i].id == id)\r\n\t\t\treturn videos[i];\r\n\treturn null;\r\n}", "function find(id) {\n\t\tvar result = videos.filter((video) => video.id == id );\n return result? result[0] : null;\n\t}", "getPlaylistItemWithId(id) {\n let that...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Slides the tabs over approximately one page forward.
function nextPage () { var viewportWidth = elements.canvas.clientWidth, totalWidth = viewportWidth + ctrl.offsetLeft, i, tab; for (i = 0; i < elements.tabs.length; i++) { tab = elements.tabs[ i ]; if (tab.offsetLeft + tab.offsetWidth > totalWidth) break; } ctrl.offsetLeft ...
[ "function slideForward() {\n if ($run.activeIndex < ($conf.slides.length - 1)) {\n $run.activeIndex += 1;\n } else if ($conf.cycle) {\n $run.activeIndex = 0;\n }\n\n alignToActiveSlide();\n }", "function goForward() {\n for (let i = 0; i < slides.length; i++...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
create new desk for cards
function createDesk() { let ul = createNewElement('ul', 'deck'); document.getElementsByClassName('container')[0].appendChild(ul); ul.setAttribute('id', 'deck'); }
[ "function setDeskCards()\n {\n var cardCovers = properties.cardCovers.front;\n\n desk.removeCards();\n for (var counter = 0; counter < sizes.menuFan.cardsAmount; counter++)\n {\n desk.push(createCard(cardCovers.popRandom(), false, turnFanCard.bind(this)), {height: sizes.des...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Print informations about the linked glTF file.
print_glTF() { console.log(this.glTF); console.log( `glTF file \n` + `- Version ${this.glTF.version}\n` + `- Default scene name: ${this.defaultScene.name}\n` + `- ${this.glTF.scenes.length} scene(s)\n` + `- ${this.glTF.images.length} i...
[ "function printgoogl() {\r\n \tconsole.log(\"Model for GOOGL created\");\r\n }", "function GLTFData()\n {\n /**\n * The default scene to show first, as defined by GLTF.\n */\n this.defaultScene = new HX.Scene();\n\n /**\n * The loaded scenes.\n */\n t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the summary of the subject
getSummary() { return getSubjectSummary(this._subject, this._school, this._degree, this._course); }
[ "function getSummaryValue(subject, name) {\n var value;\n validateArgs(arguments, \"getSummaryValue\", 2, 2, [null, String]);\n if (!subject || subject.constructor !== Object) {\n log.error('mc.fl.getSummaryValue: Parameter 1 is not a valid subject object');\n } else if (subje...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
invert :: Group g => g > g . . Function wrapper for [`fantasyland/invert`][]. . . ```javascript . invert(Sum(5)) . Sum(5) . ```
function invert(group) { return Group.methods.invert(group)(); }
[ "function invert(group) {\n return Group.methods.invert (group) ();\n }", "invert() {\n return new groupMask_1.GroupMask(this.context, this);\n }", "not() {\n this.invert = true;\n }", "inverse() {\n const tmp = this.copy();\n return tmp.invert();\n }", "invert() {\n this.roo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function sets the sublayers in the array.
setSubLayer(value, status) { let layer_array = this.state.layer_array; let temp_tree = treeData_layer.slice(0); if (temp_tree && temp_tree.length) { temp_tree.map((data) => { if (data.value == '0-21') { if (data.children && data.children.length) { data.children.map((layer) => { if (layer....
[ "get sublayers()\n {\n return [].concat(this._sublayers);\n }", "restack (){\n this._layers.forEach( (layer, key, index) => {\n layer.setDepth(index);\n //layer.objects.forEach(obj => {\n //if (obj.active)\n //obj.depth = inde...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Loops over queued module definitions, if a given module definition has all of its declarations resolved, it dequeues that module definition and sets the scope on its declarations.
function flushModuleScopingQueueAsMuchAsPossible() { if (!flushingModuleQueue) { flushingModuleQueue = true; try { for (var i = moduleQueue.length - 1; i >= 0; i--) { var _moduleQueue$i = moduleQueue[i], moduleType = _moduleQueue$i.moduleType, ...
[ "function flushModuleScopingQueueAsMuchAsPossible() {\n if (!flushingModuleQueue) {\n flushingModuleQueue = true;\n\n try {\n for (var i = moduleQueue.length - 1; i >= 0; i--) {\n var _moduleQueue$i = moduleQueue[i],\n moduleType = _moduleQueue$i.moduleType,\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
\ Function : _dec_to_rgb Description : convert a decimal color value to rgb hexadecimal Usage : var hex = _dec_to_rgb('65535'); // returns FFFF00 Arguments : value dec value \
function _dec_to_rgb(value) { var hex_string = ""; for (var hexpair = 0; hexpair < 3; hexpair++) { var myByte = value & 0xFF; // get low byte value >>= 8; // drop low byte var nybble2 = myByte & 0x0F; // get low nybble (4 bits) var nybble1 = (myByte...
[ "function _dec_to_rgb(value) {\n var hex_string = \"\";\n for (var hexpair = 0; hexpair < 3; hexpair++) {\n var byte = value & 0xFF; // get low byte\n value >>= 8; // drop low byte\n var nybble2 = byte & 0x0F; // get low nybble (4 bits)\n var nybble1 = (byte ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Global Interaction key to relate the SIR with other related transactions
function setGlobalInteractionKey( key ) { this.global_interaction_key = key; }
[ "function signatoryKeyTx (state, tx, context) {\n let {\n signatoryIndex,\n signatoryKey,\n signature\n } = tx\n\n if (!Number.isInteger(signatoryIndex)) {\n throw Error('Invalid signatory index')\n }\n if (!Buffer.isBuffer(signatoryKey)) {\n throw Error('Invalid signatory ke...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If fields already is added and this fields have "index" then replace fields with new data from "fields" argument otherwise add new row and mark index if needed
_pushFields(fields, indexValue, type = 'default') { if (!_.isUndefined(indexValue)) { let index = this._rowsIndex[type][indexValue]; if (_.isUndefined(index)) { this._rowsIndex[type][indexValue] = this._rows[type].length; this._rows[type].push(fields); } else { //this._rows...
[ "exec(rowData, origin, options) {\n\n /**\n * finds the rowIndex for this fieldname\n *\n * this could be cached if it seems to slow, but is more code.....\n *\n * @param fieldname\n * @returns {number|boolean} false if not found\n */\n function findField(fieldname) {\n for (l...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }