query
stringlengths
9
34k
document
stringlengths
8
5.39M
negatives
listlengths
19
20
metadata
dict
Generate a string representing this person's lifespan 0000 0000
function lifespan(person) { var birth = "", death = ""; if (person.getBirthDate()) { birth = person.getBirthDate().substr(0, 4); } if (person.getDeathDate()) { death = person.getDeathDate().substr(0, 4); } var lifespan = ""; if...
[ "function city_turns_to_growth_text(pcity)\n{\n var turns = pcity['granary_turns'];\n\n if (turns == 0) {\n return \"blocked\";\n } else if (turns > 1000000) {\n return \"never\";\n } else if (turns < 0) {\n return \"Starving in \" + Math.abs(turns) + \" turns\";\n } else {\n return turns + \" turn...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getCurrentOnCallUsername will return the username of the user currently on call from the teamOnCallSchedule object.
function getCurrentOnCallUsername() { let user = "" // Get the rotation that has an onCall user. for (let i in this.raw.schedule) { let sched = this.raw.schedule[i] if (sched.onCall) { user = sched.onCall } } // Return Error if no user is on call. if (!user) { return new Error("No user seems to curren...
[ "function getUsername() {\r\n \r\n // get's user email:\r\n var email = Session.getActiveUser().getEmail()\r\n // emails in form <username> @ mail.domain\r\n // split --> parse_emial = ['username','mail.com']\r\n var parse_email = email.split(\"@\")\r\n var username = parse_email[0]\r\n \r\n return user...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function: restoreBSPArray Turns the BSP string stored in suspend_data back into the object the shell needs Parameters: bspString The string of information from shell data Dependencies: Returns: none Change Log: 2013.04.28ALP Initial version
function restoreBSPArray(bspString) { //console.log("restoring " +bspString); var bspArray = bspString.split("&&"); //console.log(bspArray); for (var i=0; i < bspArray.length; i++) { var split1 = bspArray[i].split('='); shell.branchStartPages.BSPArray[split1[0]] = new Array(); shell.branchStartPages.BSPInitAr...
[ "function stringifyBSPArray() {\n\tvar BSPArrayString = '';\n\t//console.log(shell.branchStartPages.BSPArray);\n\tvar num = 0;\n\tfor (key in shell.branchStartPages.BSPArray) {\n\t\tif (num != 0) {\n\t\t\tBSPArrayString += \"&&\";\n\t\t}\n\t\tvar currArray = shell.branchStartPages.BSPArray[key];\n\t\t//console.log(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets data of all Pokemon from PokeAPI to store for later use
function getList() { // URL to access list of all Pokemon names and URLs from PokeAPI const POKEMON_LIST_URL = "https://pokeapi.co/api/v2/pokemon/?offset=0&limit=964"; // Get data getData(POKEMON_LIST_URL); }
[ "async getPokemons() {\n if (!this.store.list) {\n const count = await this.get('pokemon').then((data) => data.count);\n this.store.list = await this.get('pokemon', { limit: count }).then((data) => data.results);\n }\n }", "function getPokemons() {\n return fetch(`${baseUrl}/pokemon/`)\n .the...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a list of all the services registered by a user along with the latest status update of their health check
async listByUserId (userId) { return this.dbConnection .query( `select distinct on (svc.id) svc.id, svc.name, svc.endpoint, svc.description, svc.created_at, svc.updated_at, upd.status, upd.created_at as status_created_at from services svc left join status_updates up...
[ "function serviceHealthStatus(healths, service, usersInterested) {\n const serviceName = service.toLowerCase();\n const healthDoc = _.find(healths, health => health.service === service);\n if (healthDoc && (healthDoc.status === 'DOWN') && (serviceTracker[serviceName] === false)) {\n _.forEach(usersInterested,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Carga imagen desde el disco al canvas.
function cargar_imagen() { let input = document.querySelector('.inp_cargar'); input.onchange = e => { let canvas = document.querySelector("#canvas"); let context = canvas.getContext("2d"); let file = e.target.files[0]; let reader = new FileReader(); reader.readAsDataURL(file); rea...
[ "function cambiarImagenLleno(){\n $(\"#miImagen\").attr(\"src\",\"media/cestaLlena.png\");\n }", "function subir_canvas (canvas_a,img_a) {\n var cactx = canvas_a.getContext('2d');\n \n //Convertir canvas a tamaño de imagen\n canvas_a.width = img_a.width;\n canvas_a.height = img_a.height;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
add the rekeyto field to a transaction not yet having it supply feePerByte to increment fee accordingly
addRekey(reKeyTo, feePerByte = 0) { if (reKeyTo !== undefined) { this.reKeyTo = address.decodeAddress(reKeyTo); } if (feePerByte !== 0) { this.fee += (ALGORAND_TRANSACTION_REKEY_LABEL_LENGTH + ALGORAND_TRANSACTION_ADDRESS_LENGTH) * feePerByte; } }
[ "function countKurtaMwfPlus() {\n\t\t\tinstantObj.noOfKurtaMWF = instantObj.noOfKurtaMWF + 1;\n\t\t\tcountTotalBill();\n\t\t}", "addLease(lease, feePerByte = 0) {\n if (lease !== undefined) {\n if (lease.constructor !== Uint8Array)\n throw Error('lease must be a Uint8Array.');\n if (lease.leng...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returnes a jquery object of the search result given the title of the result and its section in the DOM
function getSearchResult($location, title) { const $searchResults = $location.find(".searchResult"); for (let i = 0; i < $searchResults.length; i++) { if ($searchResults.eq(i).find(".itemTitle").text() === title) { return $searchResults.eq(i); } } return false; }
[ "function searchtoresults()\n{\n\tshowstuff('results');\n\thidestuff('interests');\t\n}", "function handleSearchAlbumsResult(resultData) {\n\tresultData = jQuery.parseJSON(resultData);\n\t\n\t // Populate the search results\n let searchResultsElement = jQuery(\"#search-results\");\n searchResultsElement.empty...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
ScopeStack stores all the environments we encounter while traversing syntax trees. It also keeps track of all variables defined and/or used in these environments. We use linkedlist implementation of a stack. The first element, representing global environment, doesn't have a reference to its parent. runtimeOnly means th...
function ScopeStack() { this.stack = []; this.curid = null; this.runtimeOnly = false; this.push("(global)"); }
[ "function make ( ) {\n\n //\n // Most of these fields and methods are involved in the variable\n // identification algorithm.\n //\n //\n // The basic way this algorithm works is that as a scope is walked,\n // variables are collected into an 'unknown' array.\n //\n // Assigned variables ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Rename table item checkboxes
function renameCheckboxes(formObj, newName){ var els = formObj.getElementsByTagName("input"); for (var i=0;i<els.length;i++){ if ((els[i].type == 'checkbox' || els[i].type == 'radio') && els[i].name != 'all'){ els[i].name=newName; } } }
[ "function addCheckBox(table){\n\tvar rows = table.find('tbody tr');\n\tfor (var i = 0; i < rows.length; i++) {\n\t\tvar current = rows[i];\n\t\tvar temp = \"<td><input type='checkbox' class='selection' /></td>\";\n\t\tvar html = current.innerHTML+temp;\n\t\trows[i].innerHTML = html;\n\t}\n}", "function toggleChe...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
toggle the controls (show, hide)
function toggleControls(){ if(g_temp.isControlsVisible == false) showControls(); else hideControls(); }
[ "function showControls(show) {\n if (show) {\n document.getElementById(\"funnelback-controls\").style.display = \"block\";\n document.getElementById(\"funnelback-not-detected\").style.display = \"none\";\n } else {\n document.getElementById(\"funnelback-controls\").style.display = \"none\";\n document...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This gets the information for the corresponding step, altering the controls available to the user if the step selected is either a synthesiser or a drum step
function getStepSliders(stepSelected) { if(step[stepSelected].instrument == 0) { sliderTag[0].innerHTML = "Velocity"; sliderDisplay[0].innerHTML = step[stepSelected].synthVelocity; sliders[0].max = 100; sliders[0].value = step[stepSelected].synthVelocity; ...
[ "function getSteps() {\r\n return ['Donating Guidelines', 'Donation Details', 'Post Donation']\r\n}", "function getStepContent(step) {\r\n switch (step) {\r\n case 0:\r\n return `Acknowledgement of guidelines for the compliance of food safety and security.`\r\n case 1:\r\n return 'De...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
process complex type for rendering as console
function processComplexTypeAsConsole(diff,showConsoleDiffCode){ diff.forEach(function(part){ // Render as console resulut var color = part.added ? 'green' : part.removed ? 'red' : 'grey'; var colorCode = part.value; colorCode.split("\n").forEach(function(item,index){ if(i...
[ "function show(type) { console.log(type.schema({exportAttrs: true})); }", "function handleComplexType(root, obj, attr){\r\n for(var i in obj.child){\r\n //loop through all the child nodes and recursively parse them\r\n var node=obj.child[i];\r\n if(node.name=='xs:complexContent'){\r\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Add `node` to `parent`s children or to `tokens`. Performs merges where possible.
function add(node, parent) { var children = parent ? parent.children : tokens; var prev = children[children.length - 1]; if ( prev && node.type === prev.type && node.type in MERGEABLE_NODES && mergeable(prev) && mergeable(node) ) { node = MERGEABL...
[ "function add(node, parent) {\n var children = parent ? parent.children : tokens;\n var prev = children[children.length - 1];\n\n if (\n prev &&\n node.type === prev.type &&\n node.type in MERGEABLE_NODES &&\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Try to contact to contact and read data of already known devices
async tryKnownDevices() { try { const knownDevices = await this.getDevicesAsync(); if (!knownDevices) return; // Get basic data of known devices and start reading data for (const i in knownDevices) { this.deviceInfo[knownDevices[i].native.ip] = { ip: knownDevices[i].native.ip, passWord: thi...
[ "deviceDiscovery(){\n\t\ttry {\n\n\t\t\tthis.log.info(`Auto Discovery startet, new devices (or IP changes) will be detected automatically`);\n\t\t\tdiscovery = new Discovery();\n\n\t\t\tdiscovery.on('info', async (message) => {\n\t\t\t\ttry {\n\t\t\t\t\tthis.log.debug(`Discovery message ${JSON.stringify(message)}`)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
If the object has collisions.
hasCollision() { return this.collision != null && this.collision != undefined; }
[ "isCollide(potato) {\n\n\n // Helper Function to see if objects overlap\n const overLap = (objectOne, objectTwo) => {\n\n // Check X-axis if they dont overlap\n if (objectOne.left > objectTwo.right || objectOne.right < objectTwo.left) {\n return false;\n }\n // Check y-axis if they ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Hide or Display Top Button
function topButtonDisplay() { let topBtn = document.getElementById('topBtn') if (document.documentElement.scrollTop > 400) { topBtn.classList.remove('hide') } else { topBtn.classList.add('hide') } }
[ "ensureButtonsHidden() {\n // TODO(fanlan1210)\n }", "function ocultar() {\n document.getElementById(\"bt_ac\").style.display = \"none\";\n document.getElementById(\"bt_low\").style.display = \"none\";\n}", "function hideStartButton() {\n if ($startButton.style.visibility === 'visible') {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Figure out the drop parent, starting at the `mouseComponent` and going up until we find something that can accept the `dragComponents`. Returns `undefined` if no parent found.
getDropParent(mouseComponent) { if (!mouseComponent) return undefined; const { dragComponents } = this.state; let parent = mouseComponent; while (parent) { if (parent.canDrop(dragComponents)) return parent; parent = this.getElement(parent._parent); } }
[ "getContainer(component){\n if (!this.dataObject){\n return null\n }\n while (component && component.$parent){\n if (component.isNestable && component.dndModel && component.dndZone == this && !this.isSubset(component.dndModel,this.dataObject)){\n return...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
processSlowVideo ////////////////////////////// will process the video to slow down the middle and add the into and exit
function processSlowVideo(src, leadTime, slowTime, stretch){ var chunkStates = ['notReady', 'notReady', 'notReady']; var srcName = path.parse(src).name; console.log(srcName + ': Start Processing'); guiLog('Video Processing Started: '+srcName); //convert chunk 0 convertToMP4(src, 'intermediate/'+srcName+'_c...
[ "startEncode() {\n\n var option = indexedApp.getCurrentSelectedExportSizeOption();\n\n var cmdArgs = [];\n cmdArgs.push(\"-y\");\n cmdArgs.push(\"-i\");\n cmdArgs.push(this.file.path);\n if (option.ffmpegArg) {\n cmdArgs.push(\"-s\");\n cmdArgs.push(op...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Copies an asset to the location where the test server reads it, and returns the SHA hash
async function copyAssetToStaticFolder(sourcePath, filename) { await fs.mkdir(STATIC_FOLDER_PATH, { recursive: true }); const destinationPath = path.join(STATIC_FOLDER_PATH, filename); await fs.copyFile(sourcePath, destinationPath); return await shaHash(destinationPath); }
[ "async TransferAsset(ctx, assetName, newOwner) {\n\n let assetAsBytes = await ctx.stub.getState(assetName);\n if (!assetAsBytes || !assetAsBytes.toString()) {\n throw new Error(`Asset ${assetName} does not exist`);\n }\n let assetToTransfer = {};\n try {\n as...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Create a new doc Element based on the level, first keyword and line. Declarations of primary entities should be marked with the unique "id" attribute.
function createLineElement(doc, line) { var gedLineRe = /^([0-9]+)\s+([\-A-Z0-9_@]+)\s?(.*)\r?$/; var matched = line.match(gedLineRe); var newElem; if (matched) { var level = parseInt(matched[1]); if (level == 0 && matched[2].charAt(0) == '@') { newElem = createElement(doc, level, matched[3], matc...
[ "createElement() {\n console.log(this.line);\n this.$line = $('<div></div>')\n .addClass('Hero-graphic__terminal__line');\n\n if (this.line[0] != '') {\n this.$line.append('<span class=\"pre\">'+this.line[0]+'</span>');\n }\n\n this.$line\n .append...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Funcion de acceso al servicio de tiempos para la parada indicada
function cargarTiempos(parada) { guardarPreferencia('paradaInicial') /** * Funcion para gestionar la respuesta del servicio */ function reqListener() { var listaTiempos = new Array(); try{ var a = this.responseXML.documentElement; for (var ii = 0; ii < a.childNodes[0].childNodes[0].childNodes[0].chi...
[ "function transportistaCrtl(transportistaService)\n {\n var vm = this ;\n\n vm.tr_activos = 0 ;\n vm.tr_inactivos = 0\n\n transportistaService.get_countTransp().then(\n function(response){\n console.log(response) ;\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
OUR FIRST EXTENSION A_and_B_doubler extends A_Doubler through inherits.
function A_and_B_doubler() { this.toString = function () { return 'A_and_B_doubler'; } }
[ "function A_B_and_C_doubler(a) {\n this.a = a;\n}", "function ClassB(primerNombre, asunto){\r\n // LLamamos al constructor de la superclase\r\n ClassA.call(this, primerNombre);\r\n // Inicializamos las propiedades específicas de la subclase\r\n this.asunto=asunto;\r\n}", "function task2 () {\n f...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
This function loads the 2D array userBoard with randomly selected tiles. "Demo" is just for showing the class how it works, and is not meant to be played on. It gives the user 80 of the possible 81 tiles. "Easy" gives the user 54 tiles. "Medium" gives the user 27 and "Hard" gives them 18 tiles.
function startUserBoard() { var givenTiles = null; switch(diff) { case "Demo": givenTiles = 80; break; case "Easy": givenTiles = 54; break; case "Medium": givenTiles = 27; break; case "Hard": givenTiles = 18; break; } for (var i = 0 ; i < givenTiles ; i++) { var ra...
[ "randomInitTile() {\n let randX = this.getRandomInt()\n let randY = this.getRandomInt()\n while (this.isOccupied(randX, randY)) {\n randX = this.getRandomInt();\n randY = this.getRandomInt();\n }\n this.board[randY][randX] = 2;\n this.append(randX, ran...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
control advancing to target without drawing, except for the last step including the possibility of recording
function advancingToTarget() { if (advancing) { if (currentFrameNumber < targetFrameNumber) { drawing = (currentFrameNumber === targetFrameNumber - 1); advance(); if (recorder.recording) { const filename = makeFilename(); guiUtils.saveCanva...
[ "once () { this.step(); this.draw() }", "_drawing() {\n //TEST only\n // this.receiveAnswer(\"current\", \"word1\");\n //end test\n console.log(\"drawing\");\n if (this.state !== GameStates.Drawing) {\n return; //error\n }\n\n // on vérifie que le joueur...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
returns recs based on energy (0100), time (560), targets (list of strings)
function getRecs(energy, time, flexibility, targets) { return makePOST(backendURL + '/recs', { energy: energy, time: time, flexibility: flexibility, targets: targets }); }
[ "function calcTarget(duration, interval, vehicles, capacity) {\r\r\n var time = 60 * 60;\r\r\n var runTime = duration + interval;\r\r\n var full = capacity * vehicles;\r\r\n var target = Math.floor(time / runTime * full);\r\r\n return target;\r\r\n}", "removeTargets(t, e, n) {\n let s = 0;\n const i = ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Even Fibonacci Starting with the first two terms of the Fibonacci sequence being 1 and 2, find the sum of the evenvalued terms for the terms in the Fibonacci sequence whose values do not exceed four million. create a function that will find the sum of the evenvalued terms for the terms in the Fibonacci sequence whose v...
function evenValuedFibonacciSum(limit) { var sum = 0; var term1 = 1; var term2 = 2; var temp; // nested recursive helper function function sumNextTerms() { // check if both terms exceed the limit, if so then return if (term2 > limit) { return; } else { // check that term2 does...
[ "function FibonacciSumEven (n) {\n let start = [1, 2];\n let sumOfEven = 2;\n\n for (let i = start.length-1; i < n-2; i++) {\n let nextNumb = start[i] + start[i-1];\n start.push(nextNumb);\n if (nextNumb % 2 === 0) {\n sumOfEven += nextNumb;\n }\n }\n\n return sumOfEven;\n}", "function get_e...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
check if two Cell objects are equal.
function equalCells(cell1, cell2) { return cell1.row === cell2.row && cell1.column === cell2.column; }
[ "function isCellsEqual(cell1, cell2) {\n\t\n\t\tif (!cell1 && !cell2) {\n\t\t\treturn true;\n\t\t}\n\t\n\t\tif (cell1 && cell2) {\n\t\t\treturn cell1.grid === cell2.grid &&\n\t\t\t\tcell1.row === cell2.row &&\n\t\t\t\tcell1.col === cell2.col;\n\t\t}\n\t\n\t\treturn false;\n\t}", "isSingleCell() {\n return th...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns array of ints with table values (0, 1, 2)
function getIntArray() { var intArray = []; $('#week-table td').each(function() { if($(this).hasClass("busy")){ intArray.push(2); } else if($(this).hasClass("free")){ intArray.push(1); } else...
[ "function numarray(n) {\n resultArr = [n];\n for (i = 0; i < n; i++) {\n resultArr[i] = i ;\n }\n console.log(resultArr);\n}", "ddTable () {\n\t\tlet table = [this.output];\n\t\tfor (let i = 0; i < this.output.length - 1; i++) {\n\t\t\ttable.push([]);\n\t\t\tfor ( let j = 0; j < table[i].length...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to add Table Sorter utilizing tablesorter library and Jquery
function addTableSorter() { $('#stats-table').tablesorter({ theme: 'blue', textExtraction: function (node) { // remove thousands separator for ordering correctly return $(node).text().replace(/\./g, ''); } }); // Make table cell focusable // http://css-tricks.com/simple-css-row-column-highlight...
[ "function TableWrapper(table, options) {\n \"use strict\";\n\n var allOptions, opt;\n\n // this tells allows Datatables to sort specially-crafted\n // column values in a special way.\n //\n // The special value is made by taking an arbitrary string,\n // enclosing it in a <span>, and giving that span ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
replace `target` in `arr` with `source` without mutations
function replace(arr, target, source) { return arr.map(function (v) { return v === target ? source : v; }); }
[ "function mutate(input, specArr) {\n var visited = [];\n specArr.forEach(function(newIdx, i) {\n var tmp;\n visited.push(newIdx);\n if (visited.indexOf(i) > 0) {\n tmp = input[i];\n input[i] = input[newIdx];\n input[newIdx] = tmp;\n }\n });\n}", ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Public API /////////////////////////////////////////////////////////// Parse the OpenType file data (as an ArrayBuffer) and return a Font object. If the file could not be parsed (most likely because it contains Postscript outlines) we return an empty Font object with the `supported` flag set to `false`.
function parseBuffer(buffer) { var indexToLocFormat; var hmtxOffset; var glyfOffset; var locaOffset; var cffOffset; var kernOffset; var gposOffset; // OpenType fonts use big endian byte ordering. // We can't rely on typed array view types, because they operate with the endianness of...
[ "AddFontFromMemoryTTF(data, size_pixels, font_cfg = null, glyph_ranges = null) {\r\n return new ImFont(this.native.AddFontFromMemoryTTF(new Uint8Array(data), size_pixels, font_cfg && font_cfg.internal, glyph_ranges));\r\n }", "function fontDetect(content, def){\n if (!content)\n throw ne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
In the instantiation of a Location, the Google Places service is sent a request for information on the location. The following is the callback function that's called after the request completes. The following calls another function that creates a map marker and info window for the location, if the Google Places request...
function callback(results, status) { if (status == google.maps.places.PlacesServiceStatus.OK) { createMapMarkerAndInfoWindow(results); } }
[ "function geocodeAddress(geocoder, address, place_name) {\r\n geocoder.geocode({ address: address }, function(results, status) {\r\n if (status === google.maps.GeocoderStatus.OK) {\r\n var iconBase = \"https://maps.google.com/mapfiles/kml/pushpin/\";\r\n map.setCenter(results[0].geometry.location);\r\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
POP[] POP top stack element 0x21
function POP(state) { if (exports.DEBUG) { console.log(state.step, 'POP[]'); } state.stack.pop(); }
[ "pop() {\n if(this.stack.length == 0) {return null\n }\n\n return this.stack[this.top--];\n }", "pop() {\r\n return this._msgStack.pop()\r\n }", "function knockOffSym(aObj){\r\n\taObj.pop();\r\n}", "popValue() {\n let size = this.stack.pop().size;\n this.write(\"[-]<\".repeat(size));\n }"...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Render a form used to filter the sets displayed on the page
filterForm() { return <div className={'filter-form'}> <Toggle inputLabel={'Show me:'} leftLabel={'Changing sets'} leftValue={this.filterOptions.move} rightLabel={'All sets'} rightValue={this.filterOptions.all} value={this.filterOptions.all}...
[ "function renderFilterChoices() {\n filteredParks = allParks.filter( d => {\n if(filters[0].legend) {\n return d['Overall court grouping'] == filters[0].legend\n }\n else {\n return d\n }\n }).filter( d => {\n if(filters[1].borough) {\n return d['Borough'] == fi...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
1.2 UZDUOTIS sukurti funkcija "printStraipsnis(x)" kuri atspausdina i DOMa (ekrana) "" + x + "" (paduota teksta tarp "p")
function printStraipsnis(x) { document.querySelector("body").innerHTML += "<p>" + x + "</p>"; }
[ "function printTekstas (x) {\n console.log(x);\n}", "function printTekstas(x){\n console.log(x);\n}", "function show_7(s) /* (s : sslice) -> string */ {\n return show_4(string_3(s));\n}", "function print() {\n document.write(\"atspaudintas su f-ja\");\n}", "Print() {\r\n const supbgn = '<sup>';...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
CODING CHALLENGE 806 Create a function that takes a word and returns the new word without including the first character.
function newWord(txt) { return txt.slice(1); }
[ "function encodeConsonantWord(word) {\n\n \n word = word.toLowerCase();\n let firstletter = word[0];\n let cons_phrase = \"-\";\n \n\n while\n (firstletter !== \"a\" || \n firstletter !== \"e\" || \n firstletter !== \"i\" || \n firstletter !== \"o\" || \n firstletter !== \"u\")\n {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to determine if integer is zero/even
function ifevenorzero(n){ if (n == 0){ return 1 } else{ if(n % 2 == 0 ){ return 1; } else{ return 0; } } }
[ "function is_even(num){\n if(num % 2 == 0){\n return true;\n }\n return false;\n}", "function isOdd(n) {if(!isNaN(n)){return n % 2 !== 0}}", "function evenNumbers(numbers) {\n return numbers % 2 == 0;\n\n}", "function evenDigitsOnly(n) {\n const digits = n.toString().split(\"\");\n // console.log...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
updates value fields and hides / unhides loan actions if a loan is taken out
update(){ this.walletBalanceTextElement.innerText = this.payBalance + " Kr" this.bankBalanceTextElement.innerText = this.bankBalance + " Kr" this.loanOutstandingTextElement.innerText = this.bankLoan + " Kr" for(var i = 0; i < loanDivs.length; i++){ if(this.bankLoan > 0){ ...
[ "function payLoan() {\n totalOutstandingLoan -= totalPay;\n totalPay = 0;\n\n updateTotalOutstandingLoan();\n updateTotalPay();\n}", "function checkLoanReq(id)\r\n{\r\n\tvar rc;\r\n\tvar rc1='0';\r\n\tvar temp;\r\n\r\n\trc = showMenuItem('loan');\r\n\tif (rc == '1'){\r\n\t\trc1 = showLoanItem('payment...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
`isValidCSSUnit` Take in a single string / number and check to see if it looks like a CSS unit (see `matchers` above for definition).
function isValidCSSUnit(color) { return !!matchers.CSS_UNIT.exec(color); } // `stringInputToObject`
[ "function is_valid_ucum_unit(unit) {\n if (unitValidityCache[unit] != null) {\n return unitValidityCache[unit];\n } else {\n try {\n ucum.parse(ucum_unit(unit));\n unitValidityCache[unit] = true;\n return true;\n } catch (error) {\n unitValidityCache[unit] = false;\n return false...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
function to validate the creation of an artwork
function validateArt (input) { // creating the dimension schema // creating the pixel schema const pixelSchema = Joi.array().items(Joi.string()); // the real schema for this function const schema = Joi.object({ name: Joi.string() .required() .min(1), pixel:...
[ "function isMetadataValid(item) {\n if ($scope.isList) {\n return true;\n }\n if (!item.metadata) {\n $scope.error = {\n message: \"Resource is missing metadata field.\"\n };\n return false;\n }\n if (!item.metadat...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
The AWS::SecretsManager::Secret resource creates a secret and stores it in Secrets Manager. For more information, see Secret in the AWS Secrets Manager User Guide, and the CreateSecret API in the AWS Secrets Manager API Reference. Documentation:
function Secret(props) { return __assign({ Type: 'AWS::SecretsManager::Secret' }, props); }
[ "static _getSecretValue(client, secretId) {\n return new Promise(resolve => {\n client.getSecretValue({ SecretId: secretId }, (err, data) => {\n // If AWS returns an error, raise it\n if (err) {\n throw err;\n }\n // Grab the secret from the data returned from AWS\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
send a regular(ish) signal while the timeout is active.
sendSignal() { let handler = this.signalHandler; if(!handler) return; // send a signal let signalNumber = this.totalSignalCount - (this.signalCount--); // console.debug('sendSignal in TaskTimer', this.totalSignalCount, this.signalCount); handler(signalNumber); // calculate how long the wai...
[ "continue(){\n\t\tthis.timeout = setTimeout( this.onTimeout.bind( this ), this.timer )\n\t}", "onTimeout(){\n\t\tthis.callback.apply(null, this.args)\n\t\tthis.continue()\n\t}", "function haltOnTimeout(req, res, next) {\n if (!req.timedout) {\n next();\n }\n}", "onTimeOut() {\n if (this.exhausted)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
F I NE F A K E getAppelloDaPrenotare(cdsId,adId) modificato in data 16/05/2019
function getAppelloDaPrenotare(cdsId,adId){ return new Promise(function(resolve, reject) { var appelliDaPrenotare=[]; var rawData=''; getSingoloAppelloDaPrenotare(cdsId,adId).then((body)=>{ //controllo che body sia un array if (Array.isArray(body)){ r...
[ "function DataDeletePrevid(deleteid) {\n\tfor( id in DataNotes ) {\n\t\tif( DataNotes[id].previd == deleteid ) { \n\t\t\tDataNotes[id].previd = DataNotes[deleteid].previd;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function multipleInsurerPremiumCalc(idv) {\n\t\t\t\t\t\tvar details = StorageService.getAll();\n\n\t\t\t\t\t\t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Set Quote To DOM
function setQuoteToDOM(quoteText, quoteAuthor) { const markElement = document.createElement('mark'); markElement.classList.add('quote_mark'); quoteEl.appendChild(markElement); setHslColorToElement(markElement, randomHue + 180, '75%', '50%'); markElement.textContent = `"${quoteText}"`; quoteAuthorEl.textCon...
[ "static selectQuote() {\n const randomNumber = Math.floor(Math.random() * 5);\n const quote = motivationalQuotes[randomNumber].quote;\n const author = motivationalQuotes[randomNumber].author;\n const title = motivationalQuotes[randomNumber].title;\n document.getElementById(\n 'quote'\n ).inne...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Sobel var xKernel = [ [1, 0, 1], [2, 0, 2], [1, 0, 1] ]; var yKernel = [ [1, 2, 1], [0, 0, 0], [1, 2, 1] ];
function apply_sobel_filter(img) { img.loadPixels(); var n = img.width * img.height; var sobel_array = new Uint32Array(n); // compute the gradient in soble_array var index; var x, y; var xk, yk; var xGradient, xMultiplier; var yGradient, yMultiplier; var pixelValue; for (x = 1; x < img.width - 1;...
[ "function makeEyeBag(){\n var eyeBag = makeNoFaceMask(0x000000);\n eyeBag.scale.set(0.1,0.015,0.075);\n return eyeBag;\n}", "function makeKernel(data) {\n let rows = data.length;\n let cols = data[0].length;\n let unrolled = [];\n for (let r = 0; r < rows; ++r) {\n let el = data[r];\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Verifies that the trait is currently in one of the `allowedState`s. If correctly used, the `Trait` type and transition methods prevent illegal transitions from occurring. However, if a reference to the `TraitImpl` instance typed with the previous interface is retained after calling one of its transition methods, it wil...
assertTransitionLegal(allowedState, transitionTo) { if (!(this.state === allowedState)) { throw new Error(`Assertion failure: cannot transition from ${TraitState[this.state]} to ${TraitState[transitionTo]}.`); } }
[ "function canAttack(frame, state, newMove) {\n return canAct(state) ||\n // regular gatling condition\n (state.type === PlayerState.ATTACKING\n && state.connected\n && !isStartupFrames(getAttackFrameType(state.move, frame - state.startFrame + 1))\n && Characters.attackCancelAll...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
createJSON() is the method in charge of in formatting all the information gotten and send it to the server as a JSON object.
function createJSON(){ var itemString = ''; var racersString = ''; var dateTime = document.getElementById("date").value + " " + document.getElementById("time").value; for(var i=0; i<im.getSize(); i++){ var x = im.getElementAt(i); if(x.type == 1){ itemString+='{"location": "' + x.location + '", "type": "' ...
[ "function createJson(grid,deletedArray){\n\tvar deleted=[];\n\tvar updated=[];\n\t\n\tvar recordsInGrid=grid.records;\n\t\n\tfor (i = 0; i < recordsInGrid.length; i++){ \n\t\tif(recordsInGrid[i].recStatus=='C' || recordsInGrid[i].recStatus=='U'){\n\t\t\tupdated.push(recordsInGrid[i]);\t\t\n\t\t};\n\t}\n\t\n\tvar co...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Should return either 1 or 2 (representing coins picked). Uses pseudorandomness to make the choice.
async getNumberOfCoinsPicked() { return Math.random() < 0.5 ? 1 : 2; }
[ "function generateBotChoice () {\n return Math.floor(Math.random() * 3) + 1\n }", "function getCompChoice(){\n cChoice = cChoiceArray[Math.floor(Math.random()* 3)]\n}", "function coin() {\n var coin = Math.floor((Math.random()*2)+1);\n var val = (coin == 1) ? \"Head\" : \"Tail\";\n document.writ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Given a list of keys, return a new unique key that is not in the list.
function createNewUniqueKey(existingKeys: string[]): string { // The base of the key is the current time, in milliseconds since epoch. const base = `${new Date().getTime()}`; if (!existingKeys.includes(base)) { return base; } // But, if the user is a fast-clicker or time-traveler or somethi...
[ "function getUnUsedKeys(allKeys, usedKeys) {\n\t//TODO\n if (Array.isArray(allKeys) && Array.isArray(usedKeys)) {\n let newArr = allKeys.concat(usedKeys),\n unusedKeys = [];\n\n // sort the values, and then remove duplicate values in loop\n newArr.sort();\n for(let i = 0; i < newArr.length; i++)...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Check if either the source or the target contain one of the specified filters. returns true if no filters selected
function hasFilterMatch(source, target, filters) { if (filters.length <= 0) { return true; } const interactionFilters = _union(source.filterTerms, target.filterTerms); return ( _intersection(interactionFilters, filters.map(item => item["name"])) .length === filters.length ); ...
[ "_hasDefinedFilters(filters) {\n return Object.keys(filters)\n .filter(k => filters[k] !== undefined)\n .length > 0;\n }", "isInUse() {\n const { items, filters = {} } = this.props;\n let inUse = false;\n items.forEach(item => {\n if (item.key in filters && Array.isAr...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getAngle :: Point > Number
function getAngle(point) { var x1 = point.lx - point.ax var y1 = point.ly - point.ay var x2 = point.rx - point.ax var y2 = point.ry - point.ay return Math.atan2((y2 * x1) - (x2 * y1), (x2 * x1) + (y2 * y1)) * 180 / Math.PI }
[ "function getAngle(x, y) { \n return Math.atan(y/(x==0?0.01:x))+(x<0?Math.PI:0); \n}", "function getDegreeValue() {\r\n var transformValue = ballStyle.transform;\r\n var values = transformValue.split('(')[1].split(')')[0].split(',');\r\n var a = values[0];\r\n var b = values[1];\r\n va...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the Team with the specified number from the list. If the team isn't found, it is added to the list.
function getTeam(number) { for (var i = 0; i < teams.length; i++) { if (teams[i].number === number) { return teams[i]; } } var newTeam = new Team(number); teams.push(newTeam); return newTeam; }
[ "function Team() {\n this.Team = undefined;\n this.Liga = undefined;\n this.Land = undefined;\n this.LdNr = 0;\n this.LgNr = 0;\n}", "static loadTeam(_id) {\n if (!loadedTeams[_id]) {\n Account.find({_id})\n .then((res, err) => {\n if (res[0].accountType === \"player\") {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
interpolates colors based on progress value. Uses global rgb colors: lowColor, medColor, highColor
function barColor(progress) { var intCol = interpolateColor(lowColor, medColor, progress*2); if(progress > .5){ intCol = interpolateColor(intCol, highColor, (1-progress)*2); } return intCol; }
[ "function color_interp(value, max, min, color_max, color_min, incl_a) {\n incl_a = typeof incl_a !== 'undefined' ? incl_a : false;\n color_max = typeof color_max !== 'undefined' ? color_max : { a: 255, r: 255, g: 0, b: 0 };\n color_min = typeof color_min !== 'undefined' ? color_min : { a: 255, r: 0, g: 0, ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Creates a new AotCompiler based on options and a host.
function createAotCompiler(compilerHost, options, errorCollector) { let translations = options.translations || ''; const urlResolver = createAotUrlResolver(compilerHost); const symbolCache = new StaticSymbolCache(); const summaryResolver = new AotSummaryResolver(compilerHost, symbolCache); const sym...
[ "function makeCompilerParserEngines(dc) {\n const sketch = path.basename(dc.sketch);\n const trigger = ccp.getTriggerForArduinoGcc(sketch);\n const gccParserEngine = new ccp.ParserGcc(trigger);\n return [gccParserEngine];\n}", "function compilerHost(transpileOptions) {\n const inputFileName = trans...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Checks if two focuses point the same cell. Offsets are ignored.
posEquals(focus) { return this.row === focus.row && this.column === focus.column; }
[ "function SameSelection(ss1, ss2)\n{\n\t// NOTE: we'll start at index 1 since index 0 can't be chosen\n\tfor(var i = 1; i < ss1.length; i++) \n\t{\n\t\tif(ss1[i].selected) \n\t\t{\n\t\t\tif (ss2[i].selected) { return true; }\n\t\t}\n\t}\n\treturn false;\n}", "isSingleCell() {\n return this.fromRow == this.to...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Merges multiple props objects together. Event handlers are chained, classNames are combined, and ids are deduplicated. For all other props, the last prop object overrides all previous ones.
function mergeProps() { let result = {}; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } for (let props of args) { for (let key in result) { // Chain events if (/^on[A-Z]/.test(key) && typeof result[key] === 'functi...
[ "function mergeProps(parents){\n\n var mergedProps = {\n private: {},\n prototype: {}\n };\n\n //iterate through arguments and inherit props from each instance object\n for(var parent in parents){\n\n if(parents.hasOwnProperty(parent)){\n\n // generate an instance of the curren...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calls Nutrition API to get nutritional information about recipe with given id. Then makes second required call to get price information using ingredients in recipe. Finally hands off all data to callback function for further action.
function getFoodInfo(meal_id, unirest, callback) { let foodData = {}; foodData["mid"] = meal_id; console.log(`Getting info for ${meal_id}`) unirest.get(`https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/${meal_id}/information?includeNutrition=true`) .header("X-RapidAPI-Key", "62649045...
[ "function getSpoonacularRecipe(recipeID) {\n fetch(\"https://api.spoonacular.com/recipes/\" + recipeID+ \"/information?apiKey=\"+ sapiKey + \"&includeNutrition=false\")\n .then(function(searchResponse){\n return searchResponse.json()\n .then(function(searchData){\n var result = {\n ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Remove a point's override or NIS (Not In Service)
function remove( pointId, callee, success, failure, nisOrOverride) { var url = '/models/1/points/' + pointId + '/' + nisOrOverride rest.delete( url, null, null, function( data) { success.call( callee, data) }, function( ex, statusCode, headers, config){ console....
[ "function removePoint(){\n \t if(currentPt != null){\n \t\t map.removeLayer(currentPt);\n \t\t currentPt = null;\n \t\t recenterMap();\n \t\t resetCurrentLoc();\n \t }\n }", "function remove_poi() {\n\tif (pois.hasLayer(POI)){\n\t\tpois.removeLayer(POI);\n\t}\n}", "situationDeleted(...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Exit a parse tree produced by Java9ParserconstructorDeclaration.
exitConstructorDeclaration(ctx) { }
[ "exitConstructorDeclarator(ctx) {\n\t}", "visitConstructor_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "enterConstructorDeclarator(ctx) {\n\t}", "exitConstructorBody(ctx) {\n\t}", "exitNormalClassDeclaration(ctx) {\n\t}", "exitExplicitConstructorInvocation(ctx) {\n\t}", "exitPrimaryCo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Function to update our fee in the view
function updateFee() { }
[ "static updateFee(pool, feeRate) {\n return makeAdminInstruction(pool, { updateFee: { feeRate } });\n }", "function updateCostPerDay() {\n var listTotal = getTotal();\n var costPerDay = listTotal / Number(amountOfDays.value);\n\n var todosHTML = \"\";\n\n todosHTML += `For your ${Number(amountOfDays...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Declare a function called getLaureates that two inputs: a year number and a category string. It should return an array of laureates for that particular category in that particular year.
function getLaureates(year, category) { let result = []; for (let i = 0; i < nobels.prizes.length; i++) if (nobels.prizes[i].year == year) { if(nobels.prizes[i].category == category) { result = result.concat(nobels.prizes[i].laureates); } } return resu...
[ "function laureatesByYear(year) {\n let result = [];\n // for (let i = 0; i < nobels.prizes.length; i++)\n // if (nobels.prizes[i].year == year) {\n // result = result.concat(nobels.prizes[i].laureates);\n // }\n // return result;\n\n return nobels.prizes.map(function(myObj) {\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds a default rendering function for a component using some base props and allowing to override some for testing.
function getRenderFunction(ReactComponent, baseProps) { return testProps => new ShallowRenderer().render(<ReactComponent {...baseProps} {...testProps} />); }
[ "function computeId(baseId, props) {\n if (!props) {\n return \"jsx-\" + baseId;\n }\n\n var propsToString = String(props);\n var key = baseId + propsToString;\n\n if (!cache[key]) {\n cache[key] = \"jsx-\" + (0, _stringHash[\"default\"])(baseId + \"-\" + propsToString);\n }\n\n return cache[key];\n}",...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
extracts all data from the current view of the table and returns the data in the form of an array
function get_table_data(table) { rows = table.getElementsByTagName('tr'); data = new Array(rows.length); for (i=1; i<rows.length; i++){ if (rows[i].style.display == "none") { continue; } columns ...
[ "function datatables_data_get(table) {\n return table.data().toArray();\n}", "function getTableData( table ){\n\n var rows = table.rows,\n tlen = rows.length,\n i, j, row, rlen,\n labels = undefined, series = [];\n\n for( i = 0; i < tlen; i++ ){\n\n row = Array.from( rows[i].c...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
this modal display all the invoices during the batch period add payments & overpayments
function addPayment() { $batchAllocateModal.modal({ observeChanges: true, selector: { close: ".close.link.icon" }, detachable: false, onVisible: function () { // display all invoices of al...
[ "list(_, since) {\n let found = false;\n console.log(`${rpad('invoice:', 31)} ${rpad('amount:', 7)} ${rpad('status:', 15)} ${rpad('conf:', 10)} pending:`);\n API.iterInvoices(\n since,\n (invoice, state, callback) => {\n found = true;\n consol...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
draw all the birds
function drawAllBirds(context) { for (var i = 0; i < birds.length; i = i + 1) { var bird = birds[i]; drawOneBird(context, bird); } }
[ "draw(){\n\n for(let i=0; i<this.belt.length;i++){\n this.belt[i].draw();\n }\n }", "function drawBricks() {\n for (var c = 0; c < brickColumnCount; c++) {\n for (var r = 0; r < brickRowCount; r++) {\n if (bricks[c][r].status === 1) {\n bricks[c][r].x = (c * (bricks[c][...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Unlike `Ecto.Changeset.cast`, `cast` will take allowed keys and remove unwanted keys off of the changeset. For example, this method can be used to only allow specified changes through prior to saving.
cast(allowed = []) { let changes = get(this, CHANGES); if (isArray(allowed) && allowed.length === 0) { return this; } let changeKeys = keys(changes); let validKeys = emberArray(changeKeys).filter((key) => includes(allowed, key)); le...
[ "cast(value, cast) {\n return cast ? cast(value) : value;\n }", "function convertOldQuotes() {\n\tfor (const room of Rooms.rooms.values()) {\n\t\t// @ts-ignore\n\t\tif (room.settings.quotes) {\n\t\t\t// @ts-ignore\n\t\t\tquotes[room.roomid] = room.settings.quotes;\n\t\t\t// @ts-ignore\n\t\t\tdelete room.setti...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
event handlers ========= MEXQ_BtnPartexClick ================ PR20220112
function MEXQ_BtnPartexClick(mode) { console.log("===== MEXQ_BtnPartexClick ====="); console.log("mode", mode); console.log("mod_MEX_dict", mod_MEX_dict); // values of 'mode' are: "add", "delete", "update", "ok", "cancel" const header_txt = (mode === "add") ? loc.Add_partial_exa...
[ "function SEC_onButtonClick(event){SpinEditControl.onButtonClick(event)}", "function ex(btn){ \n thePlayerManager.showExercise(btn);\n}", "function onProceedClick() {\n setDisplayValue('q1');\n updateLastViewed('q1');\n showHideElements();\n}", "function ModConfirm_PartexCheck_Open() {\n cons...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
IMGUI_API bool DragIntRange2(const char label, int v_current_min, int v_current_max, float v_speed = 1.0f, int v_min = 0, int v_max = 0, const char display_format = "%.0f", const char display_format_max = NULL);
function DragIntRange2(label, v_current_min, v_current_max, v_speed = 1.0, v_min = 0, v_max = 0, format = "%d", format_max = null) { const _v_current_min = import_Scalar(v_current_min); const _v_current_max = import_Scalar(v_current_max); const ret = bind.DragIntRange2(label, _v_current_min, ...
[ "function DragInt(label, v, v_speed = 1.0, v_min = 0, v_max = 0, format = \"%d\") {\r\n const _v = import_Scalar(v);\r\n const ret = bind.DragInt(label, _v, v_speed, v_min, v_max, format);\r\n export_Scalar(_v, v);\r\n return ret;\r\n }", "function SliderInt2(label, v, v_min, v_max,...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Generate random number of time for delay between bacteria spawn
function bacteriaDelay(numBacteria) { for (i = 0; i <= numBacteria; i++) { delayPerBacteria[i] = Math.random() * 3.0 * 1000; } }
[ "function bananaRandomizer()\n{\n var randomSpawnTime = Math.random() * 2500;\n var gameTimeout = setTimeout( function() { spawnBanana(); bananaRandomizer(); }, randomSpawnTime );\n}", "function checkDelay(time, dPBacteria, cBNumber) {\n\t\tif (time - spawnTime >= dPBacteria[cBNumber]) {\n\t\t\tcurrentBacteri...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
How many characters names start with "A"?
function startWithA(characters) { let nameA = []; let count = 0; characters.forEach(function (array) { if (array.name.startsWith("A")) { nameA.push(array.name); count += 1; } }); // console.log(nameA); return count; }
[ "function startWithZ(characters) {\n let nameZ = [];\n let count = 0;\n characters.forEach(function (array) {\n if (array.name.startsWith(\"Z\")) {\n nameZ.push(array.name);\n count += 1;\n }\n });\n // console.log(nameZ);\n return count;\n}", "function aCount...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns a new group which contains all tags defined in all groups in the given array of groups groups: Array(Group)
function collectGroups(groups) { let name = "" let tags = new Set() for (let group of groups) { name += `[${group.name}]+` collect(tags, group.tags) } name = name.substring(0, name.length - 1) return new Group(name, tags) }
[ "function asArraysFactory(groups) {\n return () => {\n return groups.map((g) => g.items);\n };\n}", "groupFields (groupsArray, field, i, fieldsArray) {\n if (field.props.group === 'start') {\n this.openGroup = true\n groupsArray.push([])\n }\n\n if (this.openGroup) {\n groupsA...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
creates a primitive vec3 expression
function pvec3(comp1, comp2, comp3) { return new expr_1.PrimitiveVec3([comp1, comp2, comp3]); }
[ "function createVector3(pos, ll, dotSize, color, dataIndex){\n\t\n\tvar vec3=pos;\n\tvec3.ll=ll;\n\tvec3.color=color;\n\tvec3.pointSize=dotSize;\n\tvec3.dataIndex=dataIndex;\n\treturn vec3;\n\t\n}", "static mxVMult(v,m) {\r\n\t\tvar res = new mVec3(); \r\n\t\tres.x = (v.x * m.M[0]) + (v.y * m.M[4]) + (v.z * m.M[8...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Builds the inner HTML for the long zonal stats
function buildLongStatsHtml(wrapper) { // lint complains otherwise, but due to chaining of functions it's mistaken var innerWrapper = wrapper; // const region = store.getStateItem('region'); innerWrapper.innerHTML = ZonalLong; // eslint-disable-line var inputData = WMSLayers.filter(function (layer) { retu...
[ "function buildEastPane() {\n var l_html = \"<div class=\\\"ui-layout-east\\\">\" +\n \"<div id=\\\"east_title\\\" class=\\\"header ui-widget-header\\\"></div>\" +\n \"<div id=\\\"east_file\\\" class=\\\"file\\\"></div>\" +\n \"<div id=\\\"east_footer\\\" clas...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Calculate the parity for a 24 bit code word.
function parity(cw) { // Calculate the parity bit var p = cw ^ (cw >> 8) ^ (cw >> 16); return ((p>>4)^(p>>2)^(p>>1))&1; }
[ "function calcLaCrosseParityCRC(data) {\n\tlet crc = 0;\n\tlet par = 0;\n\tfor (let i = 0; i < (data.length >> 2) - 1; i++) {\n\t\tlet val = Number(utils.bin2dec(data.slice(i * 4, (i + 1) * 4)));\n\t\tcrc += val;\n\t\tif (i > 4 && i < 8) {\n\t\t\tpar += (val & 0x1) + ((val >> 1) & 0x1)\t+ ((val >> 2) & 0x1) + (val ...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Gets response bodies from documentation config
getResponsesFromConfig(documentationConfig) { const responses = {}; if (documentationConfig.methodResponses) { for (const response of documentationConfig.methodResponses) { const methodResponseConfig = { description: response.responseBody && "description" ...
[ "function apiDoc(req, res) { \n //console.log('GET /api');\n res.json({\n message: 'Welcome to the stashy sheep breed list!',\n documentation_url: 'https://github.com/SpindleMonkey/project-2/api.md',\n base_url: 'http://localhost:3000',\n notes: 'If you search for a breed with more than one word in i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
init object and action related to selected country
function initSelected () { // defined the initial country controller.selectedCountry = CountryData[ controller.configure.control.initCountry ]; // create the visSystem based on the previous creation and settings controller.visSystemHandler.update(); // rotate to the init cou...
[ "function CountryObj(country) {\n this.name = country.name;\n this.region = country.region;\n this.subregion = country.subregion;\n this.capital = country.capital;\n this.langauges = country[\"languages\"][0][\"name\"];\n this.population = country.population;\n this.currencies = country.currencies[0][\"symbo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
a helper function that instantiates a template and displays the results in the content div
function showTemplate(template, data){ var html = template(data); $('#content').html(html); }
[ "function createGamePageTemplate(results) {\r\n let gamePageContainer = createDomElement('div', 'game-page-container');\r\n gamePageContainer.append(getQnaContent(results));\r\n document.body.append(gamePageContainer);\r\n}", "injectTemplate(container, content) {\n container.innerHTML = TEMPLATE;\...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Constructor : BAStatusMsg inherits BAStatusDisplay constructor of 'BA_STATUSMSG' object that will be used as singleton. provide status bar messaging system: constructor of 'BA_STATUSMSG' single object.
function BAStatusMsg() { /** element node not needed. @type BAElement @private */ this.node = window.defaultStatus || ''; /** default message of window.status. @type String @private */ this.msg = ''; /** default message of window.status. @type String @private */ this.defaultMsg =...
[ "function status(msg) {\n if (_common_platform_js__WEBPACK_IMPORTED_MODULE_2__[\"isMacintosh\"]) {\n alert(msg); // VoiceOver does not seem to support status role\n }\n else {\n insertMessage(statusContainer, msg);\n }\n}", "constructor() { \n \n LastStatusInfo.initialize(t...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the data structure associated with this choice (same as `data` attribute passed on input to constructor)
getData() { return PRIVATE.get(this).opt.data; }
[ "function extractData(){\n\n var data = {};\n\n $('select.data-elements option').each( function(){\n obj = { \"val\": $(this).attr('datavalue') };\n if( $(this).attr('datastatus') ) obj.status = $(this).attr('datastatus');\n data[$(this).attr('datakey')] = obj;\n });\n\n return {'da...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Register user with data. Returns new user data.
static async register(data) { const duplicateCheck = await db.query( `SELECT username FROM users WHERE username = $1`, [data.username] ); if (duplicateCheck.rows[0]) { throw new ExpressError( `There already exists a user with username '${data.username}`, ...
[ "function register(data, callback) {\n var usersCollection = data.DbHelper.getCollection(\"Users\");\n\n var now = (new Date()).getTime();\n\n var avatar = data.user.avatar;\n\n data.user.settings.sound = true;\n var newUser = {\n \"facebookUserId\": data.user.thirdParty.id,\n \"faceboo...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
initialize needed narrative closure variables and copy references to narrative instance object for use in state modules camera, stage audio and actions.
initialize() { //console.log(`@@@ narrative.initialize():`); // canvas DOM-singularity, and webgl2-context canvas = document.getElementById(config.renderer.canvas_id); context = canvas.getContext('webgl2', { antialias: true }); // topology _sg = config.topology._sg; ...
[ "init(){\n\t\tthis.calcStats();\n\t\tthis.hpRem = this.getStatValue(Stat.HP);\n\n\t\tthis.poisoned = false;\n\t\tthis.regen = false;\n\t\tthis.shield = false;\n\n this.healableDamage = 0; //damage that can be healed through heart collection\n\n this.eventListenReg.clear();\n\n this.warriorSkill...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
return true if thermometer is to be shown
_showThermometer(pureStrategy, meanMatching) { return !pureStrategy || meanMatching; }
[ "function IsHidden(){\n\treturn !_showGizmo;\n}//IsHidden", "get isDimmable() {\r\n return true; // we know no lightbulbs that aren't dimmable\r\n }", "function is_unit_visible(punit)\n{\n if (punit == null || punit['tile'] == null) return;\n\n var u_tile = index_to_tile(punit['tile']);\n var r = m...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
loop through constructor parameter "indicators" and instantiate the corresponding indicator in "instances", this is done by calling _instantiate
_initIndicators () { if (this.indicatorsList.length <= 0) return for (let i = 0; i < this.indicatorsList.length; i++) { this._instantiate(this.indicatorsList[i]) } console.log(this.instances) }
[ "_instantiate (o) {\n if (this.instances[o] !== undefined) throw new Error(`indicator ${o} already instantiated`)\n this.instances[o] = indicators[o]\n console.log('instantiated', o)\n }", "function createIndicators(container, indicatorAmount) {\n for (let index = 0; index < indicatorAmount; index++) {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Updates the FlixStack links for a video based on whether the video is currently queued.
function update_link(video_id, is_in_stack) { var video = video_map[video_id]; if (typeof video != 'undefined') { video.is_in_stack = is_in_stack; for (var i in video.containers) { $('.flixstack-wrapper', video.containers[i]).remove(); $(video.containers[i]).append(make_link(video_id)); } ...
[ "function create_links() {\n var ids_to_queue = collect_video_info();\n\n // Get the queued status of the videos for the current user.\n flixstack_api.check_queued(ids_to_queue, function(data, textStatus) {\n for (var video_id in data['ids']) {\n var video = video_map[video_id];\n if (typeof video =...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
GET ALL THE ITEM A USER HAS SAID THEY WILL BRING TO A SPECIFIED POTLUCK
async function getItemsUserNeedsToBring(req, res, next) { try { const { id } = req.params; const usersItems = await db.getItemsByUserId(id); if (!usersItems) { return res.status(404).json({ message: "you have not yet selected what you will bring anything to this potluck", }); } res.status(200).json...
[ "function allItemsBought(buyerID) {\n return itemsBought.child(buyerID).once('value')\n .then(data => data.val())\n .then(items => Object.keys(items))\n .catch(err => [])\n}", "function itemsToSell(userID) {\n let itemsToSell = [];\n var logElements = (value, key, map) => {\n if (!value.buy...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Return the PKCS1 RSA encryption of "text" as an evenlength hex string
function RSAEncrypt(text) { var m = pkcs1pad2(text, (this.n.bitLength() + 7) >> 3); if (m == null) return null; var c = this.doPublic(m); if (c == null) return null; var h = c.toString(16); if ((h.length & 1) == 0) return h; else return "0" + h; }
[ "function pkcs1pad2(s,n) {\r\n if(n < s.length + 11) {\r\n alert(\"Message too long for RSA\");\r\n return null;\r\n }\r\n var ba = new Array();\r\n var i = s.length - 1;\r\n while(i >= 0 && n > 0) ba[--n] = s.charCodeAt(i--);\r\n ba[--n] = 0;\r\n var rng = new SecureRandom();\r\n var x = new Array();...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
shows or hides the "move waypoint up" button
function setMoveUpButton(wpIndex, show) { var rootElement = $('#' + wpIndex).get(0); var moveUp = rootElement.querySelector('.moveUpWaypoint'); if (show) { $(moveUp).show(); } else { $(moveUp).hide(); } }
[ "function setMoveDownButton(wpIndex, show) {\n var rootElement = $('#' + wpIndex).get(0);\n var moveDown = rootElement.querySelector('.moveDownWaypoint');\n if (show) {\n $(moveDown).show();\n } else {\n $(moveDown).hide();\n }\n }", "function handleMove...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Wraps this transaction in a proposal_create transaction
propose(proposal_create_options) { if (this.tr_buffer) { throw new Error("already finalized"); } if (!this.operations.length) { throw new Error("add operation first"); } assert(proposal_create_options, "proposal_create_options"); assert( ...
[ "createProposal(parameters = false, issuerAddress = this.tronWeb.defaultAddress.hex, callback = false) {\n if(utils.isFunction(issuerAddress)) {\n callback = issuerAddress;\n issuerAddress = this.tronWeb.defaultAddress.hex;\n }\n\n if(!parameters)\n return callb...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
getVisibility() Returns the visibility to use for dequeuing messages.
getVisibility() { errors.throwNotImplemented("getting visibility (dequeue options)"); }
[ "setVisibility() {\n errors.throwNotImplemented(\"setting visibility (dequeue options)\");\n }", "function Visibility() {\n _classCallCheck(this, Visibility);\n\n Visibility.initialize(this);\n }", "get VisibilityKm() {\n return this.visibilityKm;\n }", "function cpsh_onVisibilityChange() {...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Draws labels and stalks for cytogenetic bands. Band labels are text like "p11.11". Stalks are small lines that visually connect labels to their bands.
drawBandLabels(chromosomes) { var i, chr, chrs, taxid, ideo, chrModel, chrIndex, textOffsets; ideo = this; chrs = []; for (taxid in chromosomes) { for (chr in chromosomes[taxid]) { chrs.push(chromosomes[taxid][chr]); } } textOffsets = {}; chrIndex = 0; for (i = 0...
[ "function GenerateLabels(stations, ChSignalHigh) {\n\tvar container;\n\tfor (var i = 0; i<ChSignalHigh.length; i++) {\n\t\tif (ChSignalHigh[i][3] > -120) {\n\t\t\tvar chassL=\"M\" + GetChannelCenter(ChSignalHigh[i][1])+\",\"+GetHeightFromSignal(ChSignalHigh[i][3])\n\t\t\t\t\t\t+\"l0,\"+(GetHeightFromSignal(-120)-Ge...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
height basketbox and searchbox
function basketAndSearchHeight() { if ($(document).width() <= 992) { $(".black-box").removeAttr("style"); return } var height = $(window).height() - $("#header").height(); $(".black-box").css("height", height); }
[ "function adjustSizes() {\n var selectHeight = poemList.length * 15;\n var newHeight = Math.max(350, selectHeight);\n selectBar.setSize(maxWidth, newHeight);\n $(selectBar.canvas).parent().height(\"350px\");\n $(\"poem\").height(maxHeight);\n}", "function boxMenuHeight() {\n var $a = BODY,\n...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Helper function to calculate the difference in hours of two javascript dates. Adapted from SO answer:
function dateDiffInHours(a, b) { var _MS_PER_HOUR = 1000 * 60 * 60; // Discard the time and time-zone information. var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate()); var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()); return Math.floor((utc2 - utc1) / _MS_PER_HOUR); }
[ "function daydif(cd1,cd2)\n{\n var d1 = new Date(cd2str(cd1));\n var d2 = new Date(cd2str(cd2));\n var dtms = d2.getTime() - d1.getTime();\n return toint(dtms / (3600 * 1000 * 24));\n}", "function DateDiff(dint, thedate1, thedate2, fdow) {\n var vbUseSystemDayOfWeek=0; var vbSunday=1; var vbMonday=2; var v...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Map Controls Show the place's information Notes [1]Go grab the content for this feature (they should all be in wcmcdescriptionsqueue) and move it into this detail box [2] Need to add a bit of delay otherwise the slide doesn't happen [3] Clean up the place detail boxes, need to delay this until after the slide animation...
function showPlace(id){ //DOING FIRST ONE FOR DEBUGGING SHOULD BE A LOOP OVER ALL TAGS ON OBJECT AND IF //ANY ARE IN THE DICTIONARY CALL SHOW ADDITIONAL FEATURE WITH THAT FEATURE var isFeature = false; for (var i = 0; i < s.controls.featuresListLookup[id].tags.length; i++) { for (var j = 0; j < s.uniqueTags....
[ "function animateSpeechDetails(speech) {\n $('#details-' + speech.author).css(\"display\", \"none\").fadeIn(2000);\n }", "repositionDetails() {\n if (this.details && this.ibScapeDetails) {\n // Position the details based on its size.\n let ibScapeDetailsDiv = this.ibScapeDetails.node();\n le...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Returns the attribute manager of this layer
getAttributeManager() { return this.internalState && this.internalState.attributeManager; }
[ "getLayerManager() {\n this._ensureIsInLayeredMode()\n return this._lm\n }", "_getAttributeManager() {\n const context = this.context;\n return new _attribute_attribute_manager__WEBPACK_IMPORTED_MODULE_1__[\"default\"](context.gl, {\n id: this.props.id,\n stats: context.stats,\n timeli...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
processRing works with only LineStringSegment. Does not work with Arc, CircleByCenterPoint and Circle. However, its very rare to find Arc, CircleByCenterPoint and Circle as part of a polygon boundary.
function processRing(ring, holes, crsProperties) { var curveMember = ring.firstElementChild.firstElementChild; var segments = curveMember.firstElementChild.children; var coordinates = []; for (i = 0; i < segments.length; i++) { if (segmengts[i].localName === "LineStringSegmen...
[ "drawRing (vertexArray, color, filled) {\n if (filled) {\n fill(color)\n noStroke()\n }\n else {\n noFill()\n stroke(color)\n strokeWeight(3)\n }\n beginShape()\n for (let vert of vertexArray) {\n vertex(vert.x, vert.y, vert.z)\n }\n vertex(vertexArray[0].x, ver...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Called from the inspector to fetch the libraries that are displayed in the info tab.
getLibraries() { this.sendMessage('libraries', { libraries: Ember.libraries._registry }); }
[ "function renderAvailableLibraries() {\n\t// send the request\n\tvar dataset = getSelectedDatasetName();\n\tif (dataset != null && dataset.replace(/^\\s*/, \"\").replace(/\\s*$/, \"\").length > 0 && dataset != emptyValue) {\n\t\tvar url = HOME + '/query?action=getLibraries' +\n\t\t\t'&study=' + encodeSafeURICompone...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
listTopics Generates generic wrapper and scaffolding elements for the topic assigned to this component and prompts the generation (calls 'cascadeData') of element data based on the specified references (propRefs).
listTopics(propRefs) { let self = this; let delimiter = (letter) => { if (Array.isArray(eval('self.props.topic.' + letter + '.text'))) { return <ul key={new Date().getTime() + Math.random(0, 3)}> // Needs a unique key {self.cascadeData('text', letter, 'no', 'no')} </ul>; } ...
[ "listEvidence(propRefs) {\n let output = [];\n for (let prop = 0; prop < propRefs.length; prop++) {\n output.push(<h4 key={eval('this.props.topic.' + propRefs[prop] + '.key1')}>{propRefs[prop] + \". Evidence\"}</h4>);\n output.push(<ul key={eval('this.props.topic.' + propRefs[prop] + '.key2')}>{this...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
4 Next Problem / Write a function named codeLove that returns the string 'I love code'. Write a second function named codeFriend that accepts the first function as it's first parameter. The second function should return a new third function. Store the third function in a variable, codeEcho which, when invoked, invokes ...
function codeLove() { //function that does exactly what it looks like it does. return "I love code"; }
[ "function AnyFunction4() {\r\n return function FunctionReturnsAfunction() {\r\n console.log(\"function returns another function\");\r\n //this is second funtion that returns another function\r\n };\r\n}", "function dealWithReturnStatements(code)\n{\n\tfor(var i=0; i<code.length; i++)\n\t{\t\n\t\tif(code[...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
Fonction qui affiche la photo du joueur avec qui on communique dans la conv. Ou un icon si il s'agit d'une conversation de groupe.
_renderPhotoConv(conv) { if(conv.photo == undefined) { if(conv.joueur == undefined) { return( <Image source = {require('../../../res/group.png')} style = {styles.image_conv}/> ) } else { ...
[ "function mansaje_con_imagen(titulo, mensaje, imagen){\n swal({ \n title: titulo, \n text: mensaje, \n imageUrl: imagen \n }); \n }", "function marcarComoLeidos(mensajes) {\n for(var i = 0; i < mensajes.length; i...
{ "objective": { "paired": [], "self": [], "triplet": [ [ "query", "document", "negatives" ] ] } }