query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
set class to "Shipment delivered" of the progress bar
setClasstoShipmentDeliveredInTheProgressBar() { if (this.state.currentStatus.state === "DELIVERED") { return "colored"; } else { return "not-colored"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSingleBar($newclass) {\n $('.progress-single .progress-bar').removeClass().addClass('progress-bar').addClass($newclass);\n}", "function controlCharge(status){\n\t\t\t$('.progress-bar').text( status+\"% Loading\" );\n\t\t\t$('.progress-bar').css( \"width\",status+\"%\" );\n\t\t\tif(status == 100...
[ "0.66996664", "0.60813785", "0.6061487", "0.6005965", "0.5949566", "0.58280057", "0.5811602", "0.5805956", "0.5803507", "0.5784113", "0.5760565", "0.575995", "0.57583594", "0.5728736", "0.5679772", "0.56762433", "0.566232", "0.5654458", "0.5632072", "0.56233025", "0.56167495"...
0.754971
0
event listener function to render book to show panel
function setUpShowPanel (book, li) { li.addEventListener('click', () => { showBookInfo(book) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleShowBooks(event) {\n console.log(event.target);\n showBook = !showBook\n const bookList = document.getElementById('books')\n if(showBook) {\n getAllBooks()\n bookList.style.display = \"block\"\n\n const broomList = document.getElementById('brooms')\n broomList.style.display = \"none\...
[ "0.66417253", "0.65468234", "0.6334656", "0.62882197", "0.6279279", "0.6277411", "0.6232219", "0.6195934", "0.61278594", "0.6059939", "0.60500187", "0.6047352", "0.60466063", "0.60195315", "0.601155", "0.60032946", "0.5956256", "0.5954084", "0.59331393", "0.5929936", "0.59244...
0.75087625
0
will use Letter objects to keep track of individual moving letters
function Letter(){ this.x = 0; this.y = random(100,height-40); //creates an array of single letters (from the .split) and returns a random letter from the array this.text = random("abcdefghijklmnopqrstuvwxyz".split("")); this.moveAndShow=function(){ this.x += speed; text(this.text,this.x, this.y); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Letter(x_, y_, letter_) {\n \n // The object knows its original \" home \" location\n this.homex = x_;\n this.homey = y_;\n this.x = x_;\n this.y = y_;\n this.letter = letter_;\n \n // Display the letter\n this.display = function() {\n fill(0);\n noStroke();\n textAlign(LEFT);\n text...
[ "0.7153615", "0.7032797", "0.6919644", "0.69015443", "0.6896346", "0.6885608", "0.6791887", "0.67620164", "0.6699144", "0.6699144", "0.66287833", "0.660466", "0.6581704", "0.6568196", "0.65075076", "0.65014505", "0.6479162", "0.6476391", "0.6469092", "0.6465254", "0.64362395"...
0.7507281
0
return the radius of the center in meter
getRadius() { const center = this.map.getCenter(); // return the lat/lng bounds of the current viewport const bounds = this.map.getBounds(); if (center && bounds) { const ne = bounds.getNorthEast(); const right = new window.google.maps.LatLng(center.lat(), n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calcRadius() {\n return Math.sqrt( Math.pow(this.start[0] - this.center[0], 2) + Math.pow(this.start[1], 2) );\n }", "circumference() {\n return 2 * this.radius * Math.PI;\n }", "get radius() {\n if (this._radius === undefined) {\n this._radius = Math.max(\n Math.abs(th...
[ "0.81176335", "0.77274966", "0.7411732", "0.7395057", "0.7380855", "0.735897", "0.7281031", "0.7246351", "0.7246351", "0.7235589", "0.7235589", "0.7229422", "0.72196656", "0.71843374", "0.71197665", "0.7109691", "0.70938957", "0.7085543", "0.7083015", "0.70379096", "0.7024949...
0.81453735
0
is supplied grade valid?
isValid(grade) { return _credits[grade] !== undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function grading(grade){\n if(grade >= 90){\n console.log('Grade is A')\n }\n else if (grade >= 80 && grade <= 89){\n console.log('Grade is a B')\n }\n else if (grade >= 70 && grade <= 79){\n console.log('Grade is C')\n }\n else if (grade >= 60 && grade <= 69){\n co...
[ "0.7202093", "0.6413885", "0.6401942", "0.63910836", "0.63717043", "0.6337068", "0.63308364", "0.62044", "0.6158196", "0.61158", "0.6090917", "0.60873604", "0.6087054", "0.607913", "0.60496324", "0.5924906", "0.5903831", "0.5895552", "0.5872663", "0.58572", "0.585577", "0.5...
0.79661095
0
promote the numeric credit for the supplied grade (used in GPA calculation).
credit(grade) { return _credits[grade] || 0.0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function currentGrade(student, improvement) {\n // console.log(student, improvement)\n // grade increases by 1\n // multiply gpa by improvement\n student.GPA += improvement\n student.grade += 1\n return student\n}", "function roundGrade(grade) {\r\n if (grade >= 38 && grade % 5 > 2) {\r\n return ...
[ "0.60923105", "0.5789777", "0.575475", "0.5630305", "0.55577284", "0.5516613", "0.55154103", "0.54682505", "0.545131", "0.54412615", "0.5440579", "0.5363259", "0.5339451", "0.5339451", "0.5278631", "0.52774656", "0.52471834", "0.51424915", "0.51365757", "0.51142055", "0.51055...
0.59739196
1
calculate a gpa for the supplied grades (based on a 4.0 scale).
gpa(...grades) { let gpa = 0.0; for (const grade of grades) { gpa += this.credit(grade); } gpa = gpa / grades.length; return gpa; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateClassGPA(letterGrade, weighting) {\n var g = 0.0;\n //console.log(letterGrade)\n var l = [\"A\", \"B\", \"C\", \"D\", \"N\"];\n for (var i=0; i<l.length; i++) {\n if (letterGrade.includes(l[i])) {\n g=4.00-i;\n if (letterGrade.includes(\"+\")) {\n g+=0.333;\n } else i...
[ "0.66652167", "0.6532478", "0.64316493", "0.6296879", "0.6277508", "0.61217433", "0.6088729", "0.6074593", "0.6057183", "0.6043643", "0.6041488", "0.6023786", "0.60134256", "0.6010177", "0.5990578", "0.59736687", "0.59706885", "0.596396", "0.59572417", "0.5951254", "0.5939036...
0.7940062
0
init chosen for live elements
function nb_live_chosen() { jQuery('.lcweb-chosen').each(function() { var w = jQuery(this).css('width'); jQuery(this).chosen({width: w}); }); jQuery(".lcweb-chosen-deselect").chosen({allow_single_deselect:true}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init(){\n\t\t\t// selectEl = $('.selectbox_wrap:not(.ui_complete)');\n\t\t\t// checkEl = $('.input_checkbox:not(.ui_complete)');\n\t\t\t// radioEl = $('.input_radio:not(.ui_complete)');\n\n\t\t\tinitSelect();\n\t\t\tinitCheckbox();\n\t\t\tinitRadio();\n\t\t}", "function initInpElem() {\n\t\t\t\tif ($(el...
[ "0.6564748", "0.6385413", "0.63775545", "0.6349535", "0.6216265", "0.6197663", "0.6025248", "0.6017202", "0.6006746", "0.5993235", "0.59791857", "0.5971929", "0.5965129", "0.5964582", "0.5923512", "0.58819175", "0.58588284", "0.5851976", "0.58511585", "0.5837227", "0.58170694...
0.65117407
1
Examples subsetSum(2, [1, 10, 5, 3]); // false subsetSum(10, [1, 10, 5, 3]); // true subsetSum(9, [1, 10, 5, 3]); // true Bottom Up Approach
function subsetSum(target, array) { let possibleSums = [0]; for (let i = 0; i < array.length; i++) { let possibleSumsCopy = [...possibleSums]; for (let j = 0; j < possibleSumsCopy.length; j++) { let newSum = array[i] + possibleSumsCopy[j]; if (newSum === target) return true; else if (newSu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verify(set, subset, total) {\n var sum = 0;\n for(var i = 0; i < subset.length; i++) {\n if (!set.includes(subset[i])) return false;\n sum += subset[i];\n }\n return sum == total;\n}", "function subsetsum_1(set, sum, n, partial) {\n partial = partial || [];\n if (sum === ...
[ "0.7379174", "0.7363205", "0.7001466", "0.6841158", "0.6829569", "0.67673177", "0.6691918", "0.6614334", "0.65873617", "0.6531154", "0.6401423", "0.6350775", "0.6338847", "0.6318902", "0.63178325", "0.62947994", "0.6254893", "0.62509996", "0.6250272", "0.6234609", "0.62088084...
0.756693
0
This class represent a Robot able to eval commands
constructor (commands) { this.commands = { library: { vector } }; commands = commands || []; for (var command of commands) { console.log(this.evalCommand(command)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.func = \"\";\n}", "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.funct = \"\";\n}", "function ShellCommand() \n{\n /...
[ "0.6127931", "0.60905945", "0.5992088", "0.5948683", "0.58292407", "0.5801484", "0.57940596", "0.5771247", "0.571048", "0.56964463", "0.5672253", "0.56566375", "0.5622302", "0.5610512", "0.5527043", "0.55091953", "0.5503219", "0.54805", "0.54581773", "0.5450145", "0.54319113"...
0.61099476
1
Get the stepProperties of a step
getStepProperties(process, stepId) { const self = this; let stepsProperties = self.getStepsProperties(process); let step = _.find(stepsProperties, (item) => item.id === stepId); return step; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStep(step) {\n return steps[Object.keys(steps)[step]];\n }", "get step() { return this._step; }", "get step() { return this._step; }", "get timeStep() {\n\t\treturn this._timeStep;\n\t}", "function getPageProperties(){\n var properties = {\n region: getRegion(),\n ui_ver...
[ "0.63962185", "0.5846781", "0.5846781", "0.57103753", "0.567032", "0.56326747", "0.5631942", "0.55459636", "0.55220616", "0.54192203", "0.5406893", "0.5397331", "0.53899705", "0.5351335", "0.5328256", "0.52844834", "0.5233157", "0.5224899", "0.5207799", "0.52027273", "0.51886...
0.7804949
0
Stores the value of `total` to `memory`
function totalToMemory(){ addHistoryItem("total to memory",total); memory = total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMemory(){\n console.log('2.js SM: Total->Memory Storing!!','M:',memory,'<= T:',total);\n memory = total;\n }", "function Memory() {\n\tthis._currentSum = 0;\n}", "function addToUserMemory() {\n userMemory = userMemory + Number.parseInt(currentInput);\n}", "function memory(){return...
[ "0.79107285", "0.69707847", "0.6453008", "0.63291", "0.6145295", "0.6117875", "0.6100789", "0.6058274", "0.60514915", "0.5991589", "0.59835863", "0.5962922", "0.59545565", "0.5879151", "0.58607924", "0.5835368", "0.5821895", "0.5821395", "0.5820442", "0.57755107", "0.57340103...
0.83989817
0
Clear the value stored at `memory`
function clearMem(){ addHistoryItem("clearMemory",memory); memory = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearMem() {\n this.memory = undefined;\n }", "function clearMemory()\n{\n\tmemory = [];\n\tiReg = 0;\n\toReg = 0;\n\tpReg = 0;\n\taReg = 0;\n\tbReg = 0;\n\tinReg = 0;\n\toutReg = 0;\n\t\n\tstatusUpdate();\n}", "function clearMemory(){\n screenDisplay.value = 0;\n currentDisplay = \"0\"\n number...
[ "0.8167646", "0.79715", "0.7078123", "0.70698714", "0.6844889", "0.68079513", "0.6566615", "0.63737506", "0.63388795", "0.6318855", "0.6308335", "0.62297255", "0.61728466", "0.6139298", "0.6138999", "0.6118285", "0.6107457", "0.60970646", "0.60970646", "0.60970646", "0.609706...
0.79979956
1
Unloads the program's resources from WebGL. Once this is done, you will no longer be able to use this ShaderProgram.
clean() { this._gl.deleteProgram(this._program); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "dispose() {\n if (this._gl) {\n this._gl.deleteProgram(this._id);\n\n this._fragmentShader.dispose();\n this._vertexShader.dispose();\n\n this._id = InvalidProgramId;\n this._gl = null;\n }\n }", "destroy(gl) {\n if (this.destroyed) {...
[ "0.74829113", "0.70452774", "0.6967171", "0.69362", "0.6846667", "0.6805523", "0.6560255", "0.6513631", "0.6407673", "0.64035505", "0.63636243", "0.6327469", "0.6318122", "0.63034797", "0.6282756", "0.62765586", "0.6190964", "0.61859304", "0.6179031", "0.61600065", "0.6157959...
0.7207496
1
Enables this ShaderProgram and its variables. Please do not invoke this directly. Use ShaderLib.bind instead.
enable() { _.each(this._attributes, attr => { attr.enable(); }); this._gl.useProgram(this._program); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate()\n\t{\n\t\tthis.update();\n\n\t\tthis.gl.useProgram(this.program);\n\n\t\tthis.gl.bindBuffer(this.gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n\n\t\tthis.gl.bindBuffer(this.gl.ARRAY_BUFFER, this.positionBuffer);\n\t\tthis.gl.enableVertexAttribArray(this.positionAttribLocation);\n\t\tthis.gl.vertexAttribP...
[ "0.6446962", "0.63821644", "0.6373405", "0.6242611", "0.6192618", "0.61829513", "0.610248", "0.6031839", "0.597285", "0.58701724", "0.5859852", "0.58553046", "0.5846447", "0.5816787", "0.57900906", "0.5746135", "0.57275474", "0.56904227", "0.5689262", "0.5668108", "0.56428134...
0.802071
0
unhydrate can use for get uid for an object
function unHydrate(object) { return object.uid; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get uid() { return this._uid; }", "hydrate() {\n try {\n const userIds = this.storage.getUserIds();\n this.users = userIds.map(id => User.hydrate(this, id));\n }\n catch (err) {\n // The storage was corrupted\n this.stor...
[ "0.6284702", "0.5805136", "0.5706845", "0.5702008", "0.5581812", "0.53716713", "0.5329755", "0.5316527", "0.528625", "0.52770305", "0.524134", "0.5231183", "0.5227251", "0.51507896", "0.51366544", "0.5133657", "0.51104695", "0.51039803", "0.51036775", "0.5061281", "0.5040356"...
0.84795576
0
lazyload can use for lazy load a table of uid
function lazyLoad(strType, tabUid) { return _.map(tabUid, function(uid) { return hydrate(strType, uid); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async testLazyLoad() {\n this.fvals = {}; \n this.pendread = {}; \n for (const h of this.header) this.lazyLoadCol(h);\n}", "load() {\r\n this.userIdService.invokeWithUserId((userId) => {\r\n if (userId !== OCC_USER_ID_ANONYMOUS) {\r\n this.store.dispatch(new LoadUserDeta...
[ "0.575261", "0.54829603", "0.54738986", "0.5461768", "0.5422624", "0.5422003", "0.5408764", "0.5382982", "0.53682554", "0.52988917", "0.52926564", "0.5290071", "0.52852607", "0.52852607", "0.52850825", "0.52827865", "0.52810174", "0.5248326", "0.5244849", "0.5222403", "0.5205...
0.651587
0
unLazyLoad can use for un lazy load of object
function unLazyLoad(tabobject) { return _.map(tabobject, function(object) { return unHydrate(object); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function lazyload()\n{\n observe();\n \n}", "lazyLoad() {\n if (this.instance.dispatch('contentLazyLoad', { content: this }).defaultPrevented) {\n return;\n }\n\n this.load(true);\n }", "function listToLazy() {\n return fromList(this);\n }", "async testLazyLoad() {\n this.fv...
[ "0.57543284", "0.5737771", "0.5425307", "0.5414093", "0.54059243", "0.5274519", "0.52714074", "0.52714074", "0.5224172", "0.52124095", "0.51815885", "0.5139368", "0.51329964", "0.5129501", "0.5129501", "0.5129501", "0.51181334", "0.51181334", "0.51181334", "0.51181334", "0.51...
0.67233545
0
function that parses latitude and longitude from the nps api
function latLongParser(string) { //set a itemToConvert to the latitude longitude string let itemToConvert = string; //remove "lat:" from itemToConvert itemToConvert = itemToConvert.replace("lat:", ""); //remove " long:" from itemToConvert (there is a space before 'long') itemToConvert = itemToConvert.replac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_extractLocation(project){\n\n let coords = project.location.loc.coordinates;\n let lat = coords[1];\n let lng = coords[0];\n\n return { lng, lat};\n\n }", "function pullLatLong (response) {\n lat = response.coord.lat; \n long = response.coord.lon; \n pullCompData (); \n\n }", ...
[ "0.60425544", "0.6034455", "0.5976474", "0.59192985", "0.5918618", "0.58693975", "0.5842843", "0.5818405", "0.5815767", "0.5790349", "0.5754413", "0.57346857", "0.5705693", "0.5693249", "0.56829756", "0.5660365", "0.5642823", "0.5640892", "0.5632082", "0.5614434", "0.5606001"...
0.6302215
0
Find specific text node that contains a substring and replace its content with text
function changeTextNode(node, substring, text) { for (let i = 0; i < node.childNodes.length; i++) { let currentNode = node.childNodes[i]; if (currentNode.nodeType == Node.TEXT_NODE && currentNode.textContent.indexOf(substring) != -1) { return currentNode.textContent = text; } }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replaceText(rootNode,find,replace) {\n var children = rootNode.childNodes;\n for(var i = 0; i < children.length; i++) {\n var aChild = children[i];\n if(aChild.nodeType == 3) {\n\t\t\tvar storedText = '';\n\t\t\t// If the parent node has an attribute storing the text value, check it to...
[ "0.6813353", "0.6635366", "0.6431535", "0.6419693", "0.6407045", "0.6383267", "0.6179822", "0.6175708", "0.60007036", "0.5962286", "0.59531265", "0.59134644", "0.5887027", "0.587224", "0.5872117", "0.5844656", "0.5831944", "0.5820345", "0.5815302", "0.58001906", "0.57977265",...
0.81137186
0
Check if your browser supports local storage
function supportsLocalStorate() { try { console.log(`Your browser supports the local storage`); return 'localStorage' in window && window['localStorage'] !== null; } catch (e) { console.log(`Your browser doesn't support the local storage`); return []; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supports_local_storage() {\n try {\n return 'localStorage' in window && window['localStorage'] !== null;\n } catch(e){\n return false;\n }\n }", "function supportLocalStorage() {\n try {\n return 'localStorage' in window && window['localStorage'] !== null;\n ...
[ "0.88584596", "0.86007065", "0.8578214", "0.8426523", "0.83968824", "0.83811903", "0.83811903", "0.83811903", "0.83811903", "0.83811903", "0.83811903", "0.83811903", "0.83811903", "0.8355826", "0.8350591", "0.8326709", "0.8318083", "0.82250684", "0.82026625", "0.8199582", "0....
0.8620275
1
Remove speakers from local storage
function removeSpeakers(el) { const getSpeaker = el.firstElementChild.textContent; let speakers = loadFromLocalStorage(speakerList); let confirm = loadFromLocalStorage(confirmSpeaker); clearLocalStorage(speakerList); clearLocalStorage(confirmSpeaker); // If speaker exists, remove it if (spe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static deleteMusics(music) {\n\n const musics = Storing.getMusic();\n \n \n \n // musics.forEach(function(music, index) {\n // if() {\n \n // console.log(`${music.song}`);\n // }\n // });\n\n localStorage.setItem('musics...
[ "0.6857762", "0.6779007", "0.6687677", "0.6633559", "0.6585923", "0.65788233", "0.65638125", "0.652974", "0.6456113", "0.6434386", "0.6428702", "0.64280844", "0.6422723", "0.641311", "0.64096475", "0.6392575", "0.6380421", "0.6372137", "0.6365536", "0.63528764", "0.63007754",...
0.8135173
0
Rename speaker and update local storage
function renameSpeaker(name, newName) { const nameList = loadFromLocalStorage(speakerList); clearLocalStorage(speakerList); if (nameList.indexOf(name) > -1) { const nameIndex = nameList.indexOf(name); nameList[nameIndex] = newName; nameList.forEach(cur => saveInLocalStorage(speakerList, cu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateStorage(name) {\n var data = JSON.parse(window.localStorage.getItem(\"senators\"));\n for (var i in data) {\n if (data[i].name === name) {\n data[i].vote = \"true\";\n }\n }\n storeToLocal(data);\n}", "function removeSpeakers(el) {\n const getSpeaker = el.fi...
[ "0.6069017", "0.5936479", "0.5837196", "0.58157563", "0.58082193", "0.5758147", "0.5746708", "0.5707277", "0.5686706", "0.56518424", "0.5624693", "0.5570688", "0.55519533", "0.5536409", "0.5534225", "0.5514398", "0.54965806", "0.5468591", "0.5455155", "0.5436551", "0.54109687...
0.7725632
0
1 Request XML data from pagsguro API
function api_url2xml_data(post_data, cb) { log(arguments.callee.name); // Object with all the required parameters and optionally the extra parameters specified at the payment API documentation var paymentOptions = querystring.stringify(post_data); // Object with HTTPS request configurations and pa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sequentielPrimeSearch()\n{\n primesXMLRequest('primes/sequentiel');\n}", "function fetchData(cb) {\n request(apiUrl, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n parseXML(body, cb);\n } else {\n cb('Fetch error');\n }\n });\n}", "function c...
[ "0.6004002", "0.59107566", "0.5876813", "0.5858832", "0.5821893", "0.5790291", "0.57069474", "0.56762546", "0.56674063", "0.562832", "0.56235427", "0.56012493", "0.55810344", "0.558101", "0.55511343", "0.5537814", "0.55360615", "0.5525497", "0.5524964", "0.54983544", "0.54855...
0.61604136
0
2 Parse the XML data into JSON
function xml_data2json_data(xml_data, cb) { log(arguments.callee.name); parseString(xml_data, function(err, res) { cb(null, res); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function xml2json(xml) {\n try {\n var obj = {};\n if (xml.children.length > 0) {\n for (var i = 0; i < xml.children.length; i++) {\n var item = xml.children.item(i);\n var nodeName = item.nodeName;\n\n if (typeof (obj[nodeName]) == \"undefin...
[ "0.7027673", "0.6967078", "0.6943287", "0.6892522", "0.6892522", "0.689093", "0.6777318", "0.66886777", "0.66866726", "0.6668001", "0.6623313", "0.6579608", "0.6479996", "0.6475485", "0.64536625", "0.64506114", "0.6431115", "0.6391619", "0.6376328", "0.6365837", "0.63653386",...
0.70802623
0
3 Convert the JSON data into the payment URL
function json_data2payment_url(json_data, cb) { log(arguments.callee.name); var urlRoot = "https://pagseguro.uol.com.br/v2/checkout/payment.html?code="; var print_error = function(code_msg_pair) { var error_code = code_msg_pair.code; var error_msg = code_msg_pair.message; console.log("Error " + error_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jsonToURL(data){\r\n\turl = Object.keys(data).map(function(k) {\r\n\t\t return encodeURIComponent(k) + '=' + encodeURIComponent(data[k])\r\n\t}).join('&');\r\n\t/*from https://stackoverflow.com/questions/14525178/is-there-any-native-function-to-convert-json-to-url-parameters */\r\n\tconsole.log(url);\r...
[ "0.6130502", "0.61023074", "0.59154737", "0.57820666", "0.55187243", "0.5495084", "0.547973", "0.5463659", "0.54200566", "0.5370251", "0.5365886", "0.53482264", "0.5347668", "0.5264073", "0.52433914", "0.52351534", "0.52241105", "0.5222197", "0.5185944", "0.5149092", "0.51482...
0.75973773
0
A helper function to query stats from a PeerConnection.
function getStats(driver, peerConnection) { // Execute getStats on peerconnection named `peerConnection`. driver.manage().timeouts().setScriptTimeout(1000); return driver.executeAsyncScript( 'var callback = arguments[arguments.length - 1];' + peerConnection + '.getStats(null).then(function(report) {' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStats() {\n let cb = this.formatResult.bind(this)\n let { peer, mediaStreamTrack } = this\n // if !peer or peer.signalingState == 'closed' then return;\n if (typeof window.InstallTrigger !== 'undefined') {\n peer.getStats(\n mediaStreamTrack,\n ...
[ "0.6015064", "0.5933607", "0.5797929", "0.5737648", "0.57187355", "0.5709212", "0.5691263", "0.5612553", "0.556147", "0.5428294", "0.53784204", "0.52477425", "0.52138203", "0.5199049", "0.5187865", "0.5186393", "0.51744443", "0.5089822", "0.50628006", "0.50599325", "0.505661"...
0.6645892
0
Provide the webdriver driver and type of logging: Browser console logs: webdriver.logging.Type.BROWSER WebDriver driver logs: webdriver.logging.Type.DRIVER
function printLogs(driver, type) { // https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_Logs.html driver.manage().logs().get(type) .then(function(entries) { entries.forEach(function(entry) { console.log('[%s] %s', entry.level.name, entry.mess...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "log(message, source, type)\n {\n if (this.driver.log)\n {\n this.driver.log(message, source || '', type || 'debug');\n }\n }", "function getLogs(driver, type) {\n // https://seleniumhq.github.io/selenium/docs/api/javascript/module/selenium-webdriver/lib/webdriver_exports_Logs.html\n driver.mana...
[ "0.6947054", "0.6400809", "0.5886885", "0.55908364", "0.54884815", "0.5449189", "0.54055965", "0.5396958", "0.5310579", "0.5293583", "0.5236514", "0.5173895", "0.51487476", "0.51121354", "0.5100828", "0.50612694", "0.5048253", "0.5024903", "0.49889198", "0.49689025", "0.48898...
0.7177968
0
EXERCISE 0 define a function that takes in array of strings with every element converted to uppercase
function convertToUpperCase(array) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uppercaseAll(arrayOfStrings) {\n return map(arrayOfStrings, function(element){ //for this case we use map that takes an array, \n return element.toUpperCase() ; //and for each element of that array will modify it to upper case and will return it in a new array\...
[ "0.79970497", "0.7924191", "0.79062015", "0.786221", "0.7833768", "0.7763876", "0.77509105", "0.77336335", "0.77326715", "0.7622143", "0.7575154", "0.7570621", "0.74215525", "0.7338274", "0.722016", "0.72189164", "0.7206046", "0.71880573", "0.713836", "0.7120625", "0.7118316"...
0.8606884
0
EXERCISE 1 define a function that multiplies all elements in an array by 10
function multiplyBy10(array) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiplyBy10(arr) {\n return arr.map(function (elem,i,arr) {\n return elem * 10;\n })\n}", "function multiplyByTen(){\n\tconst c = [1,2,3]; \n\tconst e = c.map(function(elem, i, array) {\n\t return elem *10;\n\t})\n\treturn e;\n\t}", "function multiplyAll(arr){\n return function(n){\n ...
[ "0.8210757", "0.8200345", "0.7955369", "0.778659", "0.7663296", "0.7582784", "0.7531787", "0.75259084", "0.75124604", "0.7456251", "0.74385417", "0.73921436", "0.7352365", "0.7243651", "0.7242923", "0.7235176", "0.72201425", "0.7202795", "0.7167185", "0.71555513", "0.71487176...
0.8939275
0
EXERCISE 3 define a function that removes any nonvowel character from words in an array
function keepOnlyVowels(array) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeVowels(word) { // helper function\n var vowels = ['a', 'e', 'i', 'o', 'u'];\n var word_sans_vowels = \"\";\n\n for (var i = 0; i < word.length; i += 1) {\n var char = word[i];\n\n if (vowels.indexOf(char) === -1) {\n // if the char is not a vowel\n word_sans_vowels +...
[ "0.8089812", "0.7969404", "0.78700393", "0.7801908", "0.76628125", "0.7583413", "0.75382936", "0.74998474", "0.74977887", "0.7442823", "0.74407256", "0.74274117", "0.7408555", "0.74061275", "0.73792285", "0.73303115", "0.72905916", "0.7288032", "0.7260026", "0.72411764", "0.7...
0.82985514
0
function to remove value from redis cache
function removeValue(key) { return redis.del(key, function (err, result) { if (err) { console.error(err); return undefined; } else { return result; } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "del(key) {\n let value = this[symbol_1.CACHE].get(key);\n (0, del_1.del)(this, value);\n return value;\n }", "removeOldestFromCache() {\n this.cache.delete(\n this.cache.keys().next().value\n )\n }", "removeCachedKey(key){\n myCache.del(key);\n ...
[ "0.7239725", "0.7117921", "0.7076816", "0.69434154", "0.68858683", "0.68787163", "0.67433053", "0.66646135", "0.66127646", "0.65500593", "0.63958997", "0.63764817", "0.63502365", "0.63482547", "0.63463736", "0.63312733", "0.6276426", "0.6264924", "0.622079", "0.6213713", "0.6...
0.74116474
0
This is a OperationDefinitionParameterBinding resource
static get __resourceType() { return 'OperationDefinitionParameterBinding'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get valueParameterDefinition () {\n\t\treturn this._valueParameterDefinition;\n\t}", "function visitParameter(node) {\n if (node.dotDotDotToken) {\n // rest parameters are elided\n return undefined;\n } else if (ts.isBindingPattern(node.name)) {...
[ "0.54654276", "0.5353084", "0.5353084", "0.5322015", "0.5122774", "0.5122774", "0.511557", "0.50163287", "0.4990708", "0.49826285", "0.48491487", "0.483739", "0.47896823", "0.47890583", "0.4767306", "0.46435168", "0.45834884", "0.45690218", "0.4564374", "0.45632237", "0.45533...
0.6895178
0
sort metadata by level
function sortMetadataByLevel(a,b){ return a.level - b.level }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortTree() {\n tree.sort((a, b) => {\n if (a.depth === 3 && b.depth === 3) {\n return b.size - a.size;\n }\n else if (a.depth < 3 && b.depth < 3) {\n return b.name.toLowerCase() < a.name.toLowerCase() ? 1 : -1;\n }\n return 0;\n });\n }", "_sortFields () {\n...
[ "0.5934656", "0.59045076", "0.5877427", "0.5804605", "0.57800114", "0.57128775", "0.5696226", "0.56519186", "0.56308544", "0.56231964", "0.5617912", "0.561404", "0.55920285", "0.55772436", "0.5511893", "0.55014753", "0.5442741", "0.54204124", "0.541171", "0.53594756", "0.5338...
0.8838132
0
Default config = config, args Short config = range, output, extrapolate
static create(config, output, extra) { if (typeof config === 'function') return config;else if (interpolation && config.output && typeof config.output[0] === 'string') return interpolation(config);else if (Array.isArray(config)) return Interpolation.create({ range: config, output, extrapolate: ext...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInterpolation(config) {\n if (config.outputRange && typeof config.outputRange[0] === 'string') {\n return createInterpolationFromStringOutputRange(config);\n }\n\n var outputRange = config.outputRange;\n checkInfiniteRange('outputRange', outputRange);\n\n var inputRange = config.inputRange;\...
[ "0.53330266", "0.5126804", "0.50743765", "0.5060657", "0.50482786", "0.5028303", "0.5020604", "0.50096184", "0.49315268", "0.48760787", "0.4866148", "0.48308107", "0.48066282", "0.47883025", "0.47883025", "0.47811002", "0.47397855", "0.4726255", "0.4691921", "0.4690221", "0.4...
0.6683883
1
Shared adapters that can take the RPC connection as required You must implement these so we know how to deal with your language and server Return an array of the grammar scopes you handle, e.g. [ 'source.js' ]
getGrammarScopes() { throw Error('Must implement getGrammarScopes when extending AutoLanguageClient'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DevAdapter (controller) {\n \n // Define or LEX/Bison grammar to handle device packet\n var grammar = {\n \"lex\": {\n \"rules\" : [ [\"\\\\s+\" , \"/* skip whitespace */\"]\n // Lex rules==> smallest token after big/generic ones ex: 'b,'/'b', [A,C]/[a-Z], etc ...\n ...
[ "0.52502704", "0.51868266", "0.49835065", "0.49449992", "0.4936877", "0.4913719", "0.48522633", "0.48101285", "0.47973445", "0.47600815", "0.4754687", "0.47476783", "0.4735636", "0.4717152", "0.4692567", "0.4674133", "0.46654904", "0.46626434", "0.46625957", "0.46584842", "0....
0.6225797
0
Determine whether to use ipc, stdio or socket to connect to the server
getConnectionType() { const hasSocket = this.socket != null; return hasSocket ? 'socket' : 'stdio'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isServerSocket (socket) {\n\t\tconst token = socket.getAuthToken();\n\t\tif (!token) {\n\t\t\treturn false;\n\t\t}\n\t\treturn token.uid === 'API';\n\t}", "static shouldUseServerMethod(host) {\n if (TcpPortScanner.ForceClientMethod) {\n return false;\n }\n return (!host || (host.t...
[ "0.5973296", "0.58374953", "0.581128", "0.57787824", "0.57358354", "0.57043", "0.5645299", "0.5627063", "0.55950654", "0.5577897", "0.5576187", "0.55276483", "0.55050415", "0.5500548", "0.54935324", "0.5486102", "0.5464092", "0.5423644", "0.5401214", "0.53973305", "0.5392811"...
0.6180563
0
Default implementation of the rest of the AutoLanguageClient Activate does very little for perf reasons hooks in via ServerManager for later 'activation'
activate() { this.name = `${this.getLanguageName()} (${this.getServerName()})`; this.logger = this.getLogger(); this._serverManager = new _serverManager.ServerManager(p => this.startServer(p), this.logger, e => this.shouldStartForEditor(e), path => this.filterChangeWatchedFiles(path)); this._serverManag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "activate() { }", "activate() { }", "activate() { }", "activate() {}", "activate() {\n }", "activate() {\n\n\t\tthis.arbitrate();\n\n\t}", "function activate(context) {\n // The server is implemented in node\n var serverModule = context.asAbsolutePath(path.join('server', 'out', 'cssServerMain.js'...
[ "0.59376013", "0.59376013", "0.59376013", "0.5935423", "0.57098687", "0.56992495", "0.5669111", "0.5668952", "0.5631373", "0.5622665", "0.55826885", "0.5541548", "0.55284613", "0.54980993", "0.5493195", "0.5489482", "0.5488159", "0.5478703", "0.5455565", "0.5429154", "0.53869...
0.703348
0
Creates the RPC connection which can be ipc, socket or stdio
createRpcConnection(process) { let reader, writer; const connectionType = this.getConnectionType(); switch (connectionType) { case 'ipc': reader = new rpc.IPCMessageReader(process); writer = new rpc.IPCMessageWriter(process); break; case 'socket': reader = new rpc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createConnection(){\n // debug(\"init\");\n var sock = require('./'+protocol).init(config);\n // debug(\"init\");\n var options = {};\n if (typeof arguments[0] === 'object') {\n\toptions = arguments[0];\n } else if (typeof arguments[1] === 'object') {\n\toptions = arguments[1...
[ "0.71063274", "0.6195233", "0.61942524", "0.61767256", "0.61203957", "0.6116258", "0.6116258", "0.610722", "0.60179424", "0.58855593", "0.57991153", "0.5724804", "0.5724697", "0.5722301", "0.5695271", "0.56812876", "0.56530577", "0.56523204", "0.5651133", "0.5622322", "0.5551...
0.77707213
0
Start adapters that are not shared between servers
startExclusiveAdapters(server) { _applyEditAdapter2.default.attach(server.connection); _notificationsAdapter2.default.attach(server.connection, this.name); if (_documentSyncAdapter2.default.canAdapt(server.capabilities)) { server.docSyncAdapter = new _documentSyncAdapter2.default(server.connection, s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initAdapter(){\n this.adapter = new (this.server.adapter())(this);\n }", "function init() {\n // @ts-ignore parent is a valid property on module\n if (module.parent) {\n // Export startAdapter in compact mode\n module.exports = startAdapter;\n } else {\n // otherwise start the i...
[ "0.60776126", "0.59752274", "0.59166837", "0.5893749", "0.5691102", "0.56830055", "0.56195676", "0.5606736", "0.55990416", "0.55981886", "0.559205", "0.5522348", "0.546728", "0.5458585", "0.5439954", "0.54039556", "0.53875196", "0.538475", "0.537518", "0.53658324", "0.5326512...
0.6516777
0
Outline View via LS documentSymbol
provideOutlines() { return { name: this.name, grammarScopes: this.getGrammarScopes(), priority: 1, getOutline: this.getOutline.bind(this) }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addOutline(outlineSpec) {\n const outline = JSON.parse(JSON.stringify(outlineSpec));\n\n\n const pageRefs = [];\n this.pdfDoc.catalog.Pages.traverse((kid, ref) => {\n if (kid instanceof PDFLib.PDFPage)\n pageRefs.push(ref);\n });\n const index = this.pdfDoc.index;\n\n const outlineRef...
[ "0.6254465", "0.53594095", "0.5244239", "0.51610434", "0.5121685", "0.5121685", "0.5117714", "0.5098454", "0.50872153", "0.5076747", "0.5057237", "0.5057237", "0.5057237", "0.5057237", "0.50472057", "0.5039504", "0.50236934", "0.5019864", "0.50109184", "0.4992716", "0.4983121...
0.5508011
1
`didChangeWatchedFiles` message filtering, override for custom logic.
filterChangeWatchedFiles(filePath) { return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filesChanged() {\n\t\tlet files = [];\n\n\t\tfor (let i = 0; i < this.m_fileInput.files.length; i++) {\n\n\t\t\tlet item = this.m_fileInput.files[i];\n\n\t\t\tif (!this.fileIsValid(item))\n\t\t\t\tcontinue;\n\n\t\t\tlet file = new Map();\n\t\t\t\tfile.set('file', item);\n\n\t\t\tfiles.push(file);\n\t\t}\n\n\t\tthi...
[ "0.6026129", "0.5753521", "0.5710182", "0.5472275", "0.54188174", "0.5407297", "0.53487283", "0.53096163", "0.52754956", "0.5254068", "0.5248439", "0.52244097", "0.5189822", "0.5174763", "0.5026619", "0.50213957", "0.5015475", "0.49871683", "0.49786487", "0.49701497", "0.4936...
0.78275514
0
A styled version of the Next.js Link component:
function Link(props) { const { href, activeClassName = 'active', className: classNameProps, innerRef, naked, ...other } = props; const router = useRouter(); const pathname = typeof href === 'string' ? href : href.pathname; const className = clsx(classNameProps, { [activeClassName]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Link({\n href,\n activeClassName = 'active',\n className: classNameProps,\n innerRef,\n variant,\n naked,\n componentType = 'link',\n ...other\n}) {\n const router = useRouter();\n const pathname = typeof href === 'string' ? href : href.pathname;\n const className = clsx(c...
[ "0.77548665", "0.7278313", "0.7202082", "0.7052936", "0.6814609", "0.67882806", "0.6712252", "0.6708193", "0.65572554", "0.6405803", "0.63707775", "0.62812924", "0.62287664", "0.61909926", "0.6135682", "0.6120455", "0.61040795", "0.60979724", "0.60884845", "0.60781956", "0.60...
0.77542216
1
Function used to get the array arranged in proper order Deletes all the values which are ranked 1 Function parameters passed array and name Returns the modified array
function getarray(arrayPassed, name) { var j = 0; var k = 0; var array = [{ aID: [], aRank: [], aIndex: [], aSize: [], aURL: [] }]; var completeResponse = arrayPassed; for (j = 0; j < completeResponse.length; j++) { for (k = 0; k < completeResponse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $removeDuplicateElements(arrayName) {\n\tvar newArray = new Array();\n\tlabel: for ( var i = 0; i < arrayName.length; i++) {\n\t\tfor ( var j = 0; j < newArray.length; j++) {\n\t\t\tif (newArray[j] == arrayName[i])\n\t\t\t\tcontinue label;\n\t\t}\n\t\tnewArray[newArray.length] = arrayName[i];\n\t}\n\tretu...
[ "0.6769662", "0.646532", "0.63252866", "0.62365466", "0.6153641", "0.6118148", "0.60909754", "0.6071073", "0.60288566", "0.59981316", "0.59941405", "0.59938455", "0.59869486", "0.5966337", "0.59657997", "0.5953026", "0.594866", "0.5918389", "0.5909662", "0.58874077", "0.58733...
0.71346265
0
Add graph adds a line with the correseponding values or array The jsonResponse contains the values of the passed reference r is the position of the product in the jsonResponse Returns a concatened list of graph elements
function addgraph(array, jsonResponse, r) { var attachment = $("<div>").addClass("rankedproduct-attr-data"); var checker = search(array, jsonResponse[r].productID) - array.length + 50; if (checker > 0) { //only show the top 50 var start = Math.max(0, array.length - 50); //number of...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static drawLinesRelationship(sRelationshipID) {\n\n //get all relations from current relationship\n $.post(\n \"../Interface/Connector.php\",\n {\n function: \"getRelations\",\n id: sRelationshipID,\n },\n function (result) {\n...
[ "0.5827769", "0.57450694", "0.56643593", "0.56115013", "0.5594445", "0.5584798", "0.5542363", "0.54734653", "0.5443204", "0.54008055", "0.5393528", "0.5380779", "0.529768", "0.5291675", "0.5274868", "0.52734137", "0.52477133", "0.5237366", "0.52294546", "0.52193016", "0.52132...
0.6464514
0
The function search performs a linear search of the location of ID in the array based on the key Input paramters : array and the key to be searched Return value : The index if found else 0
function search(array, key) { for (var i = 0; i < array.length; i++) { if (array[i].aID == key) return i; } return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexOf(arr, searchId) {\n var minIndex = 0;\n var maxIndex = arr.length - 1;\n var currentIndex;\n var current;\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0; // tslint:disable-line:no-bitwise\n current = arr[currentIndex];\n var curre...
[ "0.7475252", "0.7475252", "0.7474982", "0.7381442", "0.7322781", "0.73186797", "0.7262422", "0.7134993", "0.7118001", "0.7021264", "0.7008649", "0.7006029", "0.7004793", "0.7003936", "0.69886374", "0.69767916", "0.6970645", "0.69681346", "0.6963263", "0.6963157", "0.69544643"...
0.817769
0
Searches for books by name or author using "Regular Expression"
search(value) { let regex = RegExp(value, 'i'); let matchedBooks = this.list.filter(book => { return regex.test(book.name) || regex.test(book.author); }); return matchedBooks; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchBooks(value) {\n let reg = new RegExp(value, 'i');\n\n let filtered = _books.filter(row => reg.test(row.title));\n bookList.innerHTML = '';\n fillBookList(filtered);\n }", "function searchForBooks(term) {\n // TODO\n}", "function searchBook() {\n\tvar input = docu...
[ "0.72990876", "0.7128597", "0.70867366", "0.69513065", "0.6394754", "0.63684833", "0.624761", "0.6081294", "0.60544354", "0.6031031", "0.5974325", "0.59443665", "0.5868889", "0.57771206", "0.575458", "0.56573904", "0.5617908", "0.55977184", "0.55948937", "0.55763185", "0.5567...
0.75595576
0
Redisplays books after sorting
static redisplayBooks(sortedBooks) { $('#book-table tbody').html(''); this.displayBooks(sortedBooks); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortAlphabetically() {\n // 1. Get list of Books & sort, save the sorted books array inside the library.\n myLibrary.books = myLibrary.sortAlphabetically();\n // 2. Display the result on the page. \n displayResult(myLibrary);\n }", "function displayBoo...
[ "0.7200109", "0.7179106", "0.7056515", "0.6980639", "0.6825664", "0.68168694", "0.6812361", "0.67792195", "0.6731548", "0.6665518", "0.66320235", "0.6586953", "0.6545346", "0.65452695", "0.6435259", "0.6403318", "0.6387537", "0.6358196", "0.6335757", "0.6319061", "0.6313051",...
0.7224615
0
Returns cover in FormData object
getCover() { let formData = new FormData(); formData.append('cover', this.getData().cover); return formData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formData(){\r\n const form = new FormData();\r\n form.append(\"resImg\", document.querySelector('#newRestaurantImg').files[0]);\r\n form.append(\"name\", document.querySelector('#newRestaurantName').value);\r\n form.append(\"phone\", document.querySelector('#newRestaurantPhone').value);\r\n ...
[ "0.68891823", "0.6780032", "0.6768919", "0.66494644", "0.6554524", "0.65120447", "0.64893174", "0.6430713", "0.6296972", "0.6287277", "0.6192218", "0.6185499", "0.61421525", "0.61164063", "0.6090161", "0.6078319", "0.6059378", "0.6052729", "0.60514003", "0.6046235", "0.603795...
0.84779876
0
Checks if inputs are not empty
checkInputs() { for (let item in this.data) { if (this.data[item] == '') { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyCheck(input){\n if( input.length == 0 || input == null || input ==\"\"){\n return true;\n }else{\n return false;\n }\n }", "_checkIfEmpty () {\n if (this.state.returns === '' || this.state.assets === '' || this.state.income === '' || this.state.s...
[ "0.75809264", "0.757829", "0.7485803", "0.7343014", "0.73125744", "0.73080426", "0.7275929", "0.7247512", "0.71583813", "0.7158021", "0.7149905", "0.71356815", "0.71090084", "0.71090084", "0.7037256", "0.70369506", "0.7023579", "0.7017662", "0.69851196", "0.69667274", "0.6947...
0.79661787
0
to print the dialogue using the inquirer package
print(selectedQA) { inquirer .prompt([ { type: "rawlist", name: "answer", message: selectedQA.question, choices: selectedQA.answerOptions.map((option, index) => { const choice = {}; choice.name = option.answer; choice.value = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startProgram() {\n\n inquirer\n .prompt([{\n message: \"You are in Bamazon ! Please, would you like to see our products?\",\n name: \"viewinventory\",\n type: \"confirm\",\n default: true\n\n }]).then(function (view) {\n\n if (view.vi...
[ "0.73241496", "0.68883353", "0.6865064", "0.6847095", "0.68381053", "0.6781048", "0.67790455", "0.6774257", "0.6763258", "0.6757742", "0.6725972", "0.6723354", "0.66738683", "0.66676074", "0.66364896", "0.65632236", "0.6557056", "0.6555435", "0.6551093", "0.65187407", "0.6510...
0.7173465
1
make a new rservejs connection
function new_rserve_connection() { var connection = rserve.create(); console.log('Made new rserve connection'); return connection; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connect() {\n server.init({\n port: 9000,\n server: {\n baseDir: paths.build\n }\n });\n}", "serve(o) {\n\t\t_.connect.server(o)\n\t}", "function webserver() {\n return connect.server({\n name: 'SciELO-Seach-App',\n port: 8000,\n livereload...
[ "0.6217125", "0.61893624", "0.61322963", "0.5933933", "0.5920502", "0.5920502", "0.5915949", "0.589539", "0.58627135", "0.5860067", "0.5845897", "0.5845079", "0.5833894", "0.57835066", "0.57709235", "0.5726928", "0.57240874", "0.5591637", "0.5587358", "0.5562586", "0.55559254...
0.8324817
0
set up RAppArmor on a connection
function setup_rapparmor(user_obj) { user_obj.r_connection.eval('library("RAppArmor");', function(data) {console.log(data);}); user_obj.r_connection.eval('aa_change_profile("r-base");', function(data) {console.log(data);}); user_obj.initialized = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialCommands(){\n var initArm = [\n \"1;1;OPEN=NARCUSR\"\n , \"1;1;PARRLNG\"\n , \"1;1;PDIRTOP\"\n , \"1;1;PPOSF\"\n , \"1;1;PARMEXTL\"\n , \"1;1;KEYWDptest\"\n , \"1;1;SRVON\" \n ...
[ "0.48563972", "0.48144042", "0.46306768", "0.46206945", "0.45369515", "0.4529695", "0.44910136", "0.44855043", "0.44609132", "0.44401684", "0.44142193", "0.44084123", "0.44057468", "0.44055006", "0.43720138", "0.43703628", "0.43663964", "0.4364645", "0.43436012", "0.43393806", ...
0.6670262
0
get the user object from the usermap. return false if it doesn't exist
function get_user_object(user_cookie) { if (!(user_cookie in usermap)) { return false; } return usermap[user_cookie]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser (userInfo) {\r\n for (id in users) {\r\n if (users[id].id == userInfo || users[id].email == userInfo) {\r\n return users[id]\r\n break\r\n }\r\n }\r\n return false\r\n}", "get(user) {\n\t\t\t\n\t\t\tlet uObj = UsersByName[user];\n\t\t\t\n\t\t\tif(uObj) {\n\t\t\t\treturn uObj;\...
[ "0.73227566", "0.72249234", "0.7025919", "0.67639893", "0.6518231", "0.64545023", "0.635128", "0.6322998", "0.62809616", "0.62809205", "0.6274308", "0.62543076", "0.62233514", "0.6217106", "0.6207004", "0.62049633", "0.6201947", "0.6183377", "0.6182927", "0.6180882", "0.61593...
0.73243076
0
test if the usermap has a particular user's cookie
function has_user(user_cookie) { return (user_cookie in usermap); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_user_object(user_cookie) {\n if (!(user_cookie in usermap)) {\n return false;\n }\n return usermap[user_cookie];\n}", "function checkUserExistence(cookie) {\n for (let key in users) {\n if (cookie === users[key].id) {\n return true;\n }\n }\n}", "function checkCookie()...
[ "0.7566554", "0.7294021", "0.71056145", "0.70554787", "0.70299065", "0.7029518", "0.7006483", "0.69531137", "0.6686388", "0.66553897", "0.6605048", "0.65987366", "0.6567567", "0.65471995", "0.6498685", "0.64791834", "0.6314643", "0.62658435", "0.62650436", "0.6252935", "0.625...
0.8254737
0
set a user object in the usermap
function set_user_object(user_cookie, user_object) { usermap[user_cookie] = user_object; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setUser (user) {\n this.user = {\n id: user.id,\n name: `${user.first_name} ${user.last_name}`,\n email: user.email,\n role: user.role,\n keys: user.keys\n }\n }", "SET_USER(state, user){\r\n state.user = user;\r\n }", "UPDATE_USER (state, data) {\n state.user[d...
[ "0.70879376", "0.70022905", "0.6961957", "0.6912143", "0.68525547", "0.68021387", "0.6797914", "0.6791187", "0.6720489", "0.6710967", "0.6662633", "0.6625833", "0.65946776", "0.65615094", "0.65351194", "0.6533308", "0.6495122", "0.64632547", "0.6458258", "0.6410342", "0.63977...
0.78939825
0
wrap a help command with the necessary peripherals to capture output
function wrap_help_cmd(expr) { return "out<-capture.output(tools:::Rd2txt(utils:::.getHelpFile(as.character(" + expr + ")))); outp = paste(out, collapse='\n'); outp"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "outputHelp() {\n if (this.matchedCommand) {\n this.matchedCommand.outputHelp();\n }\n else {\n this.globalCommand.outputHelp();\n }\n }", "function cmd_Help() {\n\t\t\n\t}", "function commandHelp() {\r\n const commands = gameServer.commandLine.commands;\r\n...
[ "0.75030327", "0.74636656", "0.74033713", "0.73616433", "0.7217018", "0.72019446", "0.7069477", "0.6968679", "0.69552284", "0.69346505", "0.6934618", "0.69284517", "0.68945867", "0.6876635", "0.6857593", "0.68482006", "0.6842786", "0.68021715", "0.676872", "0.67640007", "0.67...
0.7467097
1
wrap a plot command to capture output
function wrap_plot_cmd(expr) { // need to wrap the expr in error handling. var cmd = 'filename <- tempfile("plot", fileext=".svg"); ' + 'svg(filename); ' + //wrap_capture(expr) + ' ' + expr + '; ' + 'dev.off(); ' + 'text <- readLines(filename, encoding="UTF-8"); ' + 'paste(text, collapse="\n")'; retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wrap_capture(expr) {\n // A BETTER OPTION\n // out=capture.output(tryCatch(eval(parse(text=\"plot(\")), error=function(e) e$message));\n return \"out=capture.output(eval(try(parse(text='\" + expr + \"'), silent=TRUE))); outp = paste(out, collapse='\\n'); outp\";\n}", "function quickPlot(data, a...
[ "0.6653048", "0.5959067", "0.5951338", "0.57247263", "0.5397263", "0.53702694", "0.5314652", "0.5312048", "0.52788174", "0.5264392", "0.5261019", "0.52538013", "0.52399814", "0.5207763", "0.51943904", "0.5174884", "0.51602983", "0.5141366", "0.51272476", "0.5104232", "0.51032...
0.77528405
0
The content that is selected gets removed in the backend via the removeContentSuperuser action (Superuser > ContentList > ContentDetail)
removeContent() { /* Get the token from the cookie for superuser authorization */ const token = this.props.cookies.token; /* Call the removeContentSuperuser action via props */ this.props.removeContentSuperuser(this.state.content.id, token) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeContent_() {\n const children = Array.from(this.children);\n\n children.forEach((el) => {\n if (!el.classList.contains(cssClass.PRIVACY_TYPE)) {\n this.removeChild(el);\n }\n });\n }", "static deleteContent(req, res) {\n let id = req.params.id;\n let removeChildren ...
[ "0.6120769", "0.5787158", "0.5781829", "0.57430315", "0.56881064", "0.56629974", "0.55963314", "0.5576942", "0.55380934", "0.5523532", "0.5515141", "0.54861784", "0.5446793", "0.5421662", "0.54209864", "0.53635955", "0.53396857", "0.5338853", "0.53354406", "0.53351563", "0.53...
0.793864
0
Extracts the file name from the given path
static getFileName(path) { if (path.indexOf('gist.githubusercontent.com') !== -1) { const splitted = path.split('/') path = splitted[splitted.length - 1] } const matches = /(?:.*\/)?(.*)(\.(graphmlz?)?(xml)?(dot)?(gv)?(bpmn)?)/i.exec( path ) let extractedName = path if (matche...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFileName(path) {\n\t var split = path.split('/');\n\t return split[split.length - 1];\n\t}", "function getFileNameFromPath(path) {\n var index = path.lastIndexOf('/');\n var extIndex = path.lastIndexOf('.');\n return path.substring(index , extIndex);\n }", "function getFileNameFromP...
[ "0.8457888", "0.8341628", "0.8153898", "0.8121533", "0.81118137", "0.78156614", "0.77179027", "0.7461286", "0.7431892", "0.74172086", "0.74172086", "0.7410899", "0.73678845", "0.73678845", "0.7275275", "0.72497106", "0.72481614", "0.72088444", "0.7132191", "0.7115136", "0.711...
0.84822166
0
/ Append search to Slicknav
function gliu_appendSearch() { if ( $('.top-search').html() != 'undefined' && $('.top-search').html() != undefined && $('.top-search').html() != '' ) { $('#touch-menu .slicknav_menu').append( '<div class="top-search-touch"><i class="fas fa-search"></i>' + $('.top-search').html() + '</div>' ); $('.top-search-tou...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeSearch() {\n // TODO\n }", "function searchAndDisplayResults () {\n\n $state.go('root.search', {\n query: utils.slugify(vm.searchPhrase, '+'),\n showCaptionMatches: vm.showCaptionMatches\n });\n }", "function...
[ "0.6632806", "0.65055764", "0.649738", "0.64817876", "0.63817185", "0.63690615", "0.62970454", "0.62913907", "0.62884784", "0.6255645", "0.624908", "0.62353176", "0.6211709", "0.6209909", "0.61959845", "0.6190551", "0.61903226", "0.618913", "0.61854994", "0.6182286", "0.61611...
0.7330573
0
/ Instagram Media Effect
function gliu_apply_instagram_effect() { if ( $( '.instagram-media' )[0] ) { var random_instagram_num = 0; var random_instagram_id = ''; $( '.instagram-media' ).each( function( index, element ) { random_instagram_num = 9999 + Math.floor(Math.random() * 9999); random_instagram_id = 'gliu_instagram_'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function embedInstagram() {\n\t\tvar instagrams = replacementArea.querySelectorAll('.postcontent a[href*=\"instagr.am/p\"],.postcontent a[href*=\"instagram.com/p\"]');\n\t\tif (instagrams.length > 0) {\n\t\t\tinstagrams.forEach(function eachInstagramLink(instagramLink) {\n\t\t\t\tvar url = instagramLink.getA('href...
[ "0.6093055", "0.6070965", "0.6063542", "0.5911117", "0.5858411", "0.5847202", "0.58084804", "0.58084804", "0.5801877", "0.5739926", "0.57265663", "0.5708988", "0.56267416", "0.56228304", "0.56179965", "0.55798304", "0.55787843", "0.55236393", "0.5521235", "0.5516439", "0.5509...
0.74872005
0
Init states array to state textures
function loadSpriteSheetStates() { // 16 animation frames are 64x64 // second row let spriteSheet = PIXI.BaseTexture.fromImage("images/us_states.png"); let width = 64; let height = 64; let statesPerRow = 9; // Skip the first images since img 1 is the USA and img 2 is the blank let s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initTextures() {\n this.textures = this.graph.textures; // Map that stores textures by ID\n this.textureStack = [null]; // Stack used to apply the textures when traversing the graph for display\n }", "_initTextures() {\n\n\t}", "#loadImages(){\n const state0 = new Image();\n stat...
[ "0.7066653", "0.6746915", "0.66428477", "0.6641193", "0.6600927", "0.6549861", "0.6429224", "0.64071804", "0.6373002", "0.62942946", "0.62706524", "0.62595", "0.6249062", "0.6221542", "0.62136465", "0.6200351", "0.617545", "0.61699647", "0.6157689", "0.61557406", "0.61532974"...
0.69614935
1
Use this to set a jerks removed, exhausted and loaded
function manipulateJerk(array,loaded,exhausted,removed) { var j = state.jerkPile; for (var a = 0; a < array.length; a++) { for (var i = 0; i < j.length; i++) { if (array[a] == j[i].ID) { if (loaded) { if (j[i].loaded) { j[i].loaded = false; } else { j[i].loaded = true; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expand() {\n let oldBuckets = this.buckets;\n this.bucketCount *= 2;\n this.bucketsUsed = 0;\n this.buckets = [];\n\n oldBuckets.forEach(bucket => {\n bucket.forEach(entry => this.set.apply(this, entry));\n });\n }", "function Kj(a,b){this.a=[];this.k=b||k}", "function updJ(){\r\n\tif(j...
[ "0.46920866", "0.46517435", "0.46213454", "0.4590743", "0.45553944", "0.455359", "0.45341644", "0.45309502", "0.45309308", "0.4524071", "0.45063573", "0.44832832", "0.44785383", "0.4450679", "0.44398665", "0.44380388", "0.44185925", "0.44037792", "0.4401219", "0.438597", "0.4...
0.548026
0
Do this before entering the dungeon
function startDungeon() { console.log("startDungeon"); //curBurgulonLevel = 0; var j = state.jerkPile; for (var i = 0; i < j.length; i++) { // if (!j[i].removed) { // j[i].loaded = false; // j[i].exhausted = false; // } j[i].loaded = false; j[i].exhausted = false; } updateState('jerkPile', j); jerk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUpRunCurrentLevel() {\n cleanUpPrevLevelState();\n updatePlayerScoreTiles();\n createNewTiles();\n pickRandomCorrectTiles();\n flashTargetTiles(1500,\n rotateTiles.bind(null, 500, () => {\n allowClick = true;\n })\n );\n ...
[ "0.6326279", "0.6231327", "0.6173659", "0.60080934", "0.5982163", "0.5954596", "0.5947324", "0.594033", "0.5909676", "0.5892638", "0.588591", "0.5877259", "0.58748525", "0.58731526", "0.58673877", "0.58647984", "0.58634037", "0.58612984", "0.5847157", "0.58393383", "0.5838377...
0.6454908
0
We load and fetch asynchronously the list of POIs by wrapping the fetching inside componentDidMount() we load the list of Pois also in filteredPois so this second list contains by default all locations and the map shows up everything when the user first enter the app TODO: KEEP WORKING ON FETCHING VENUE DETAILS FOR EVE...
componentDidMount() { DataAPI.fetchPois().then( pois => { this.setState({ pois: pois, filteredPois: pois }) }).catch(error => { window.alert("Error loading Data from FourSquare API: ", error) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async loadPois() {\n const poiURL = `poi/${this.x}-${this.y}.json`\n\n console.log(\"Loading \" + poiURL)\n const features = await fetch(poiURL).then((response) => response.json())\n console.log(\"Loaded \" + poiURL)\n console.log(\"Storing pois from \" + poiURL)\n features.forEach((feature) => {...
[ "0.66457707", "0.650599", "0.6312633", "0.6280643", "0.62522495", "0.62207574", "0.61963034", "0.61802125", "0.61800987", "0.61638534", "0.6109858", "0.60956544", "0.6086267", "0.6054983", "0.6052279", "0.6036471", "0.60235274", "0.60016775", "0.599825", "0.59877485", "0.5986...
0.6909994
0
Ensure that SpotifyService has a valid access token. If token doesn't exist or is expired, fetch a new one. If a valid token already exists, do nothing. This method should be called before making any API requests.
function ensureAccessToken() { const tokenConfig = {}; //Fetch new token if one doesn't exist or it has expired. Spotify doesn't provide a refresh token. if (!accessToken || accessToken.expired()) { return oauth2.clientCredentials.getToken(tokenConfig).then((result) => { accessToken = oa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async ensureValidAccessToken(token) {\n let accessToken = this.oauth2.accessToken.create(token);\n\n if (accessToken.expired()) {\n return await accessToken.refresh();\n }\n\n return accessToken;\n }", "async function checkExpiry() {\r\n if(tokenExpired()) {\r\n const new_token = awai...
[ "0.7167498", "0.6743247", "0.65425485", "0.6531087", "0.6526682", "0.6367992", "0.63607323", "0.6339695", "0.63085884", "0.6292492", "0.6273755", "0.6246777", "0.6237547", "0.6230739", "0.6229778", "0.6196968", "0.6171954", "0.61581534", "0.6150072", "0.6123746", "0.60650367"...
0.77302825
0
Things for the project portion of the drawer
function handleClick(project){ setCurrentProject(project); toggleDrawer(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function projectSelection(project){\n activeProject = project;\n\n\n}", "handleEvents () {\n this.disposables.add(\n atom.commands.add('atom-workspace', {\n 'project-viewer-plus:open-database-file': () => {\n this.database.openFile();\n },\n 'project-viewer-plus:open-editor...
[ "0.60685295", "0.59640664", "0.5964033", "0.5915401", "0.5907922", "0.5894863", "0.58882385", "0.5873246", "0.5853828", "0.582418", "0.58033234", "0.57988733", "0.57862836", "0.5781485", "0.57749987", "0.5760134", "0.5707212", "0.5701075", "0.5663521", "0.5616792", "0.5614351...
0.60921675
0
Get the PNG bytes from the included map.
getImage() { // there are many opportunities for the map to // disappear "out of order" and this makes sure all // of the DOM elements required still exists. const p = document.getElementById(this.state.mapId); if(p) { const canvas = p.getElementsByTagName('canvas')...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assembleBitmap() {\n if (this.checkMTI()) {\n let upper = this.hasSpecialFields ? 193 : 128;\n let _map = new Uint8Array(upper);\n let fields = Object.keys(this.Msg);\n\n _map[0] = 1;\n // construct 128 bit mask\n for (let i = 0; i < fields.length; i++) {\n let field = parseInt(fie...
[ "0.5570955", "0.5449444", "0.5386489", "0.53176004", "0.53019357", "0.5132284", "0.5107904", "0.5091611", "0.5088434", "0.50791526", "0.50791526", "0.50720876", "0.50605994", "0.50589794", "0.5056206", "0.5026166", "0.50187767", "0.5007845", "0.5005019", "0.49917877", "0.4989...
0.5908572
0
When the map renders, update the image in the reducer.
mapRendered() { const print_image_action = printImage(this.getImage()); this.props.store.dispatch(print_image_action); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n image(this.pic, this.col * tileSize, this.row * tileSize, this.size, this.size);\n\n }", "function updateMap(){\n\t$map.dataProvider.areas = [];\n\tfor(var $x in $states) {\n\t\t$map.dataProvider.areas.push({ id: \"US-\" + $states[$x], groupId: \"US-\" + $states[$x], selectable: true, valu...
[ "0.68369466", "0.6582987", "0.6552593", "0.6406487", "0.63786125", "0.62216824", "0.62119013", "0.6161248", "0.608317", "0.605475", "0.60371447", "0.59950036", "0.59950036", "0.5983948", "0.59624124", "0.5957232", "0.5943351", "0.59430504", "0.5931267", "0.59122616", "0.59019...
0.7217422
0
the comparison function can be any function that returns true or false to determine the order of the items in the array
function compare(item1, item2){ return item1 <= item2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isSorted (array) {\n\n}", "function _fnArrayCmp( aArray1, aArray2 )\n\t\t{\n\t\t\tif ( aArray1.length != aArray2.length )\n\t\t\t{\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\t\n\t\t\tfor ( var i=0 ; i<aArray1.length ; i++ )\n\t\t\t{\n\t\t\t\tif ( aArray1[i] != aArray2[i] )\n\t\t\t\t{\n\t\t\t\t\treturn 2;\n\t\t\t...
[ "0.68990785", "0.68503547", "0.68503547", "0.68503547", "0.6821846", "0.6716108", "0.6705923", "0.66876966", "0.66846377", "0.66846377", "0.66846377", "0.6682068", "0.66719884", "0.66656524", "0.6647912", "0.6601371", "0.6601371", "0.65972567", "0.6586588", "0.6522207", "0.64...
0.72527677
0
Find the index of the largest value of totalDistance This requires the following helper function:
function indexOfLargest(a) { var largest = 0; for (var i = 1; i < a.length; i++) { if (a[i] > a[largest]) largest = i; } return largest; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAbsoluteMaxIndex (array) {\n\tvar absMax = Math.max.apply(Math, array),\n\t\tindexMax = array.indexOf(absMax);\n\treturn indexMax;\n}", "function calculateMaxValue(maximum) {\n var distance = ($attrs.distance || '2.5%').trim();\n var isPercent = distance.indexOf('%') !== -1;\n return isPerce...
[ "0.64083683", "0.62030846", "0.62014765", "0.6182781", "0.6169876", "0.6162516", "0.6135733", "0.6118436", "0.6106907", "0.6087591", "0.60705626", "0.607053", "0.6016185", "0.59824157", "0.59519076", "0.59449786", "0.59261453", "0.5923992", "0.5911916", "0.58887565", "0.58723...
0.63619447
1
call method to send character info to database Submits a new character and brings user to main page upon completion
function submitCharacter(newCharacter) { console.log(newCharacter); $.ajax({ method: "POST", url: "/api/character", data: newCharacter }).then(function () { window.location.href = "/main"; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function characterCreate(){\n\tcrName = creationName.value;\n\tcrRace = creationRace.value;\n\tif((crName.trim() != \"\") && (crRace.trim() != \"\") && (totalPoints < 1)){\n\t\tif(confirm(\"Ready to begin as \" + crName + \"?\")){\n\t\t\tcheckSpecialRace();\n\t\t\tlocalStorage.setItem(\"crName\", crName);\n\t\t\tl...
[ "0.6663598", "0.6287924", "0.61746055", "0.5957618", "0.59049857", "0.5869224", "0.58673054", "0.5858738", "0.5845552", "0.58419293", "0.58253306", "0.58231205", "0.58043724", "0.5803928", "0.5797743", "0.57939386", "0.5788566", "0.5779784", "0.57560146", "0.5740976", "0.5737...
0.7499595
0
call method to send campaign info to database Submits a new character and brings user to main page upon completion
function submitCampaign(newCampaign) { console.log(newCampaign); $.ajax({ method: "POST", url: "/api/campaigns", data: newCampaign }).then(function () { window.location.href = "/main"; }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitCharacter(newCharacter) {\n console.log(newCharacter);\n $.ajax({\n method: \"POST\",\n url: \"/api/character\",\n data: newCharacter\n }).then(function () {\n window.location.href = \"/main\";\n });\n }", "function characterCrea...
[ "0.66301996", "0.61044186", "0.59508437", "0.5925953", "0.591878", "0.5832156", "0.58192265", "0.5799589", "0.5707288", "0.5705337", "0.5689148", "0.56679964", "0.56240374", "0.56234235", "0.5587875", "0.55709475", "0.5499094", "0.5470797", "0.5467754", "0.54498667", "0.54246...
0.6602939
1
Update a campaign, bring user to the main page when done
function updateCampaign(campaign, campaignId) { $.ajax({ method: "PUT", url: "/api/campaigns/" + campaignId, data: campaign }).then(function () { location.reload(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function submitCampaign(newCampaign) {\n console.log(newCampaign);\n $.ajax({\n method: \"POST\",\n url: \"/api/campaigns\",\n data: newCampaign\n }).then(function () {\n window.location.href = \"/main\";\n });\n }", "setCampaign(campaign) {\n ...
[ "0.69576097", "0.66600776", "0.6312871", "0.6009065", "0.57391536", "0.57310385", "0.5724972", "0.5543719", "0.54943293", "0.54514176", "0.54260385", "0.5425081", "0.5409042", "0.5385779", "0.53388447", "0.52966714", "0.52608263", "0.5219853", "0.5213566", "0.51615876", "0.51...
0.75723386
0
method to get the campaign info we want to edit
function getCampaignById(campId) { console.log(campId); console.log(updatingCamp); updatingCamp = true; $.ajax({ method: "GET", url: "/api/campaigns/" + campId, function(data) { if (data) { console.log(data.body); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCampaign() {\n\n api = new MailChimpAPI(API_KEY, {version: '1.3', secure: false});\n\n // get the specified campaign\n api.campaigns({filters: {title: 'parse-ec-mail'}, limit: 1}, function(error, data) {\n if (error) {\n console.log(error.message);\n } else {\n campaignId = data.dat...
[ "0.73668903", "0.644813", "0.6358151", "0.62599987", "0.61266965", "0.5836737", "0.5809566", "0.5763092", "0.5738485", "0.5664967", "0.5553569", "0.55519825", "0.5478699", "0.5444448", "0.5440859", "0.5432018", "0.53842497", "0.5381389", "0.53454375", "0.52937317", "0.5288155...
0.68237
1
retrieve a list of character classes from the open5e api
function classList() { $.ajax({ method: "GET", url: "https://api.open5e.com/classes/" }).then(function (data) { var classes = []; console.log(data.results); for (i = 0; i < data.results.length; i++) { classes.push(data.results[i].name); } renderClassDropdown(cla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAll () {\n\tconst charactersEndpoint = createCharactersEndpoint();\n\tconst characters = await fetch(charactersEndpoint);\n\treturn characters;\n}", "function getCaseTypes() {\n\treturn retrieveCaseTypes(\"/api/openesdh/casetypes\");\n}", "function getEmojiList() {\n request(`https://slack.c...
[ "0.57230055", "0.5613089", "0.54976636", "0.5455927", "0.5446117", "0.5328531", "0.5303025", "0.5303025", "0.5303025", "0.5303025", "0.5303025", "0.5238285", "0.5209722", "0.5174836", "0.5171758", "0.50895596", "0.5063281", "0.50420666", "0.5036625", "0.50254446", "0.4986947"...
0.5960845
0
retrieve a list of character races from the open5e api
function raceList() { $.ajax({ method: "GET", url: "https://api.open5e.com/races/" }).then(function (data) { var races = []; console.log(data.results); for (i = 0; i < data.results.length; i++) { races.push(data.results[i].name); } renderRaceDropdown(races); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCharacters(callback){\n \n $.ajax({\n\t\ttype: \"GET\",\n\t\tasync: true,\n\t\turl: \"https://api.guildwars2.com/v2/characters?access_token=\" + account.apiKey,\n\t\tcache: false,\n\t\tdataType: 'text',\n\t\t\n\t\t\tsuccess: function(){},\n\t\t\terror: function(){\n showError(\"Could ...
[ "0.60132104", "0.5978593", "0.59609914", "0.59033275", "0.583091", "0.5810662", "0.5759355", "0.5757606", "0.5734796", "0.5659931", "0.5658277", "0.5650737", "0.5561057", "0.55408376", "0.55040234", "0.5484802", "0.5483872", "0.5473163", "0.54573965", "0.5448592", "0.5444511"...
0.7363772
0
create html for a multiselect list of all characters
function renderCharacterDropdown(characters) { var characterSelect = $("select.characters"); for (i = 0; i < characters.length; i++) { var option = $( "<option value=" + characters[i] + ">" + characters[i] + "</option>" ); characterSelect.append(option); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "multipleSelectedItem(options) {\n const extraClass = options.highlighted ? \" highlighted\" : \"\";\n return `<span class=\"selectivity-multiple-selected-item${extraClass}\" data-item-id=\"${escape(\n options.id,\n )}\">${options.removable\n ? '<a class=\"selectivity-mult...
[ "0.6481446", "0.63774794", "0.6172272", "0.6159512", "0.60663456", "0.60193604", "0.5975167", "0.59659135", "0.59256244", "0.58977973", "0.58975875", "0.58706975", "0.5849099", "0.5834682", "0.58342475", "0.5763444", "0.57305545", "0.57062244", "0.57011276", "0.5693161", "0.5...
0.6443179
1
Calls the TexttoSpeech API to create audio data that can be played as an alarm sound.
async function createAlarmSound() { // SSML, or "Speech Synthesis Markup Language", is a way of specifying how text should // be converted to speech. Here, we use it to include a bugle sound along with // a spoken message ("It's time to wake up...") const ssml = ` <speak> <audio src="https:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createAudioFromText(data) {\n return Restangular.all('campaigns/create-audio-from-text').post(data);\n }", "function textToSpeech(accessToken, text) {\n // Create the SSML request.\n let xml_body = xmlbuilder.create('speak')\n .att('version', '1.0')\n .att('xml:lang', 'en-us')\n .ele(...
[ "0.73647577", "0.6778072", "0.65433025", "0.6345131", "0.63156897", "0.62645054", "0.61913097", "0.61743456", "0.6131075", "0.608265", "0.60550207", "0.5975888", "0.5972365", "0.5964863", "0.59394336", "0.59381497", "0.59064", "0.58926", "0.5840088", "0.5838902", "0.58065915"...
0.71803296
1
Set an alarm to ring at time specified in timeString. dfStream gives this function access to the speaker. alarmSound should be audio data that can be played through the speaker at alarm time.
function setCronAlarm(timeString, dfStream, alarmSound) { console.log("Setting an alarm for " + timeString); // Set an alarm to ring every day at the specified time currentAlarmMoment = moment(timeString); currentAlarm = cron.schedule(`${currentAlarmMoment.second()} ${currentAlarmMoment.minute()} ${curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTimer(intent, session, callback) {\n var cardTitle = intent.name;\n var alarmTimeSlot = intent.slots.Time.value;\n var repromptText = \"\";\n var sessionAttributes = {};\n var shouldEndSession = false;\n var speechOutput = \"\";\n\n // TODO: check if valid time provided\n if (ty...
[ "0.561013", "0.55403495", "0.5515668", "0.5477894", "0.5339906", "0.5254199", "0.5252913", "0.5201925", "0.5198365", "0.51739097", "0.5123829", "0.5122908", "0.50753224", "0.5032694", "0.50197875", "0.49958828", "0.49922612", "0.49765947", "0.4969186", "0.49400762", "0.490457...
0.74063903
0
Given ssml ( calls the TexttoSpeech API and returns an audio data response.
async function tts(ssml) { const ttsClient = new textToSpeech.TextToSpeechClient(); // Construct the request const request = { input: { ssml: ssml }, voice: { languageCode: 'en-US', name: "en-US-Wavenet-D" }, audioConfig: { audioEncoding: 'LINEAR16', sample_rate_hertz: 24000}, };...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textToSpeech(accessToken, text) {\n // Create the SSML request.\n let xml_body = xmlbuilder.create('speak')\n .att('version', '1.0')\n .att('xml:lang', 'en-us')\n .ele('voice')\n .att('xml:lang', 'en-us')\n // .att('name', 'en-US-Guy24kRUS') // Short name for 'Microsoft Server Speech ...
[ "0.7248292", "0.6536193", "0.629547", "0.6255779", "0.61366624", "0.61196816", "0.5816748", "0.5796958", "0.5754705", "0.5752413", "0.57351464", "0.56987184", "0.56743217", "0.56650335", "0.565707", "0.5635198", "0.5625682", "0.56157964", "0.56101865", "0.5581425", "0.5579968...
0.8221459
0
send a query to api.ai to obtain the relevant features of the recognized text
function apiAiQuery(recognizedText, newContext) { myLog("ApiAiQuery new context: "+newContext); var text = recognizedText; if(newContext == ""){ $.ajax({ type: "POST", url: baseUrl + "query?v=20150910", contentType: "application/json; charset=utf-8", dataType: "json", headers: { "Authorization":...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exampleEntityExtraction() {\n var text =\n \"The patient was given some hydrocodone for control of her pain.\" +\n \"The patient suffers from bulimia and eating disorder, bipolar disorder,\" +\n \" and severe hypokalemia. She thinks her potassium might again be low.\";\n var data = { ...
[ "0.6503495", "0.6330574", "0.6272727", "0.6268165", "0.6224705", "0.6175092", "0.61230826", "0.60931647", "0.6091298", "0.60868824", "0.5951851", "0.5921861", "0.59164095", "0.5884615", "0.5814108", "0.5799499", "0.5788845", "0.5784826", "0.5775191", "0.5759694", "0.57296723"...
0.65955263
0
This will call the fetch post function and the setPosts function
componentDidMount(){ this.fetchPosts().then(this.setPosts); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getInitialPosts() {\r\n // code goes here\r\n try {\r\n const response = await fetch(this.url, this.options);\r\n const jsonData = await response.json();\r\n console.log('Retrieved posts from API');\r\n this._posts = jsonData.data;\r\n } catch (error) {\r\n console.log('Erro...
[ "0.7286802", "0.70044833", "0.6947792", "0.6859938", "0.6766951", "0.674193", "0.6719584", "0.6700516", "0.6613416", "0.66027445", "0.6574788", "0.6562635", "0.65510446", "0.653163", "0.6497183", "0.64915013", "0.64915013", "0.647832", "0.64754075", "0.6445721", "0.6445721", ...
0.7113221
1
Move the footer below the switch
function bauhausMoveFooterDiv(){ if ( jQuery( '#switch' ).length ) { var footerDiv = jQuery( '.footer' ).detach(); jQuery( '#switch' ).after( footerDiv ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maybeAddFooterSwitcher() {\n if (!mw.config.get('wgIsArticle')) return;\n\n const enable = !controller.isTalkPage();\n const url = new URL(location.href);\n url.searchParams.set('cdtalkpage', enable ? '1' : '0');\n const $li = $('<li>').attr('id', 'footer-places-togglecd');\n const $a = $('<a>')\n ...
[ "0.6818382", "0.6779771", "0.6332498", "0.6302639", "0.62650275", "0.62195826", "0.6159164", "0.6144509", "0.6100225", "0.6073704", "0.6065424", "0.604481", "0.6025833", "0.59987617", "0.5990571", "0.59802854", "0.5925729", "0.5903401", "0.58706135", "0.5855071", "0.58477676"...
0.76560694
0
In WebApp Mode, dynamically ensure that the Menu height is correct and scrollable
function bauhausWebAppMenu(){ if ( navigator.standalone ) { jQuery( window ).resize( function() { var windowHeight = jQuery( window ).height() - 74; if ( jQuery( 'body.web-app-mode.ios7.smartphone.portrait' ).length ) { jQuery( '#menu' ).css( 'max-height', windowHeight ); } if ( jQuery( 'body.web-app...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SetCatalogMenuHeight(){\n\tvar offset = $('.header_bottom_block').offset();\n\tvar catalog_height = $('.catalog_hidden_block').innerHeight();\n\tvar window_height = $(window).height();\n\t//alert(catalog_height+offset.top+$('.header_bottom_block').innerHeight());\n\t//alert(window_height);\n\t\n\tif(windo...
[ "0.6830051", "0.67203933", "0.67039156", "0.66781414", "0.66268235", "0.6586642", "0.6567203", "0.6476745", "0.6398219", "0.6376728", "0.6348679", "0.63449824", "0.63343906", "0.63250047", "0.6298598", "0.6267792", "0.6218235", "0.6218235", "0.6208742", "0.6180687", "0.617797...
0.69748676
0
Unwrap video & photo from p tags, allows fullwidth display
function bauhausVideoUnwrap(){ var pTags = jQuery( '.fluid-width-video-wrapper, iframe, video' ); if ( pTags.parent().is( 'p' ) ) { pTags.unwrap(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeImagesInParagraphs (tree) {\n tree.match({ tag: 'p' }, (node) => {\n\n const img = node.content.flat().find(({ tag }) => tag === 'img');\n const contentIsOnlyTextAndImg = node.content.flat().every((child) => {\n return (typeof child === 'string')\n ? child.trim() === ''\n ...
[ "0.5848775", "0.57339627", "0.5555663", "0.52672535", "0.5257435", "0.5257159", "0.5241105", "0.5213333", "0.5171075", "0.5171075", "0.51658654", "0.51657265", "0.51657265", "0.512714", "0.5120599", "0.5097624", "0.506956", "0.50241274", "0.50241274", "0.5018614", "0.49727666...
0.74623483
0
to let the user know that registration was successful, this page is displayed. after a short timeout, the user is redirected to the login page.
function RegisterSuccess() { const history = useHistory() setTimeout(() => history.push('/login'), 3000); return ( <div className={"message-container"}> <h1>You are successfully signed up</h1> <h3>In a few seconds you will be redirected to the login page</h3> </div> ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function func_return_singin_status(data) {\n if (data == false) {\n document.getElementById(\"error_field_sing\").style.visibility='visible';\n document.getElementById(\"error_field_sing\").innerText=\"Wrong username of password\"\n setTimeout(function (){\n ...
[ "0.6726065", "0.6664378", "0.66444", "0.66110593", "0.65344626", "0.64834136", "0.64834136", "0.6436506", "0.6419583", "0.636771", "0.6345158", "0.63320744", "0.62937224", "0.62885803", "0.62323314", "0.6227981", "0.6163275", "0.6129173", "0.6120807", "0.6115318", "0.61025965...
0.6895149
0
Last modified on ================================================================================================== File name: viewcountries.js uses editcountries.js ==================================================================================================
function CountriesView(params){ return new jGrid($.extend(params, { paintParams: { css: "countries", toolbar: {theme: "svg"} }, editForm: function(id, container, dialog) { CountriesEdit({ code: id, container: container, dialog: dialog }) }, init: function(grid, callback) { grid....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCountries(){\n\tobjCountries.form.ace('save');\n}", "function countriesDropdown(container) {\n var countries = {\n AFG: \"Afghanistan\",\n ALB: \"Albania\",\n ALG: \"Algeria\",\n AND: \"Andorra\",\n ANG: \"Angola\",\n ANT: \"Antigua and Barbuda\",\n ...
[ "0.6244539", "0.61136705", "0.6103936", "0.6054183", "0.5987126", "0.59521836", "0.59235644", "0.5910736", "0.586709", "0.5854456", "0.5851459", "0.58495796", "0.57895696", "0.57749623", "0.5749084", "0.574859", "0.5726656", "0.5726493", "0.5717156", "0.5698007", "0.56954277"...
0.64812994
0
Initiates a factory reset and restarts ChromeOS.
requestFactoryResetRestart() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async reset () {\n log.debug('Resetting app mid-session');\n log.debug('Running generic full reset');\n\n // preserving state\n let currentConfig = {};\n for (let property of ['implicitWaitMs', 'newCommandTimeoutMs', 'sessionId', 'resetOnUnexpectedShutdown']) {\n currentConfig[property] = this[...
[ "0.6614318", "0.6570746", "0.62994796", "0.62283635", "0.6224687", "0.62036335", "0.6174817", "0.61267453", "0.6112163", "0.61054635", "0.61054635", "0.61054635", "0.61054635", "0.60459507", "0.60092175", "0.60092175", "0.5997785", "0.59890467", "0.5984106", "0.59364146", "0....
0.69937736
0
Function changes the current board to the next one.
function board_further(){ //next board var r=confirm("Do you really want to change board? \nBy doing it you will loose everything you have done already!"); if (r==true){ number_board++; if (number_board > 10){ number_board = 0; } akt_board = boarde[number_board]; document.getEle...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToNextLevel() {\n const nextSize = gameState.size + 1;\n gameState.level = gameState.level + 1;\n gameState.board = boardingFactory.build(nextSize);\n gameState.size = nextSize;\n }", "function updateBoard(element, index){\n if (board[index] !== 0){\n return false;...
[ "0.6607248", "0.6601885", "0.65933084", "0.6592001", "0.65831774", "0.64932084", "0.6489916", "0.6454086", "0.64514464", "0.644932", "0.64489424", "0.6440468", "0.6433057", "0.6379489", "0.63528407", "0.633276", "0.63317746", "0.6318407", "0.62889993", "0.6287582", "0.6286762...
0.73038846
0
Function changes the current board to the previous one.
function board_back(){ //former board var r=confirm("Are you sure you want to change the boards? \ n You will lose everything you did so far."); if (r==true){ number_board--; if (number_board < 0){ number_board = 10; } akt_board = boarde[number_board]; document.getElementById('n...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetBoard() {\r\n // Reset the first premise of the board for subsequent clicks\r\n [hasFlippedCard, lockBoard] = [false, false]\r\n [firstCard, secondCard] = [null, null]\r\n}", "function undoMove(currentBoard, move) {\r\n currentBoard[move] = NOT_OCCUPIED;//cell gets empty\r\n changeTu...
[ "0.74627686", "0.7337351", "0.72528636", "0.7252522", "0.7154774", "0.71381104", "0.7074662", "0.7074662", "0.7008443", "0.70028317", "0.7002008", "0.6987401", "0.69703704", "0.695415", "0.69116145", "0.6862552", "0.6852004", "0.68062425", "0.6783992", "0.67695993", "0.674519...
0.748436
0
Creates a grid on page load and randomly colors each cell using randomColor()
function randomGrid() { let canvas = $("#pixelCanvas"); var baseGrid; for(let i = 0; i < 31; i++) { baseGrid += "<tr>"; for(let j = 0; j < 31; j++) { baseGrid += "<td></td>"; } baseGrid +="</tr>"; } canvas.append(baseGrid); for(let b = 0, cell; b < canvas.cells.length; b++)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randomColorGrid() {\n // Your code here\n}", "function makeGrid(rows, columns) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', columns);\n for (let i = 0; i < (rows * columns); i++) {\n let gridDiv = document.createElement('div');\n ...
[ "0.73102", "0.7197206", "0.71614295", "0.71437585", "0.7022426", "0.70109034", "0.7009509", "0.69927", "0.6969856", "0.6965035", "0.6906171", "0.6887224", "0.6877352", "0.6863343", "0.68548304", "0.6848688", "0.6841143", "0.68344116", "0.6825287", "0.6795431", "0.67712903", ...
0.80769104
0
Function to close fullscreen mode
function closeFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { window.to...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeFullscreen() {\n if (document.exitFullscreen) {\n document.exitFullscreen();\n } else if (document.mozCancelFullScreen) { /* Firefox */\n document.mozCancelFullScreen();\n } else if (document.webkitExitFullscreen) { /* Chrome, Safari and Opera */\n document.webkitExitFullscreen();\n } el...
[ "0.8291322", "0.8275054", "0.8272649", "0.8202585", "0.80673474", "0.80501986", "0.799431", "0.7974644", "0.7942057", "0.79363644", "0.79115176", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.78400713", "0.7...
0.82898915
1
Import `file` and return Block node.
function importFile(node, file, literal) { var importStack = this.importStack , Parser = require('../parser') , stat; // Handling the `require` if (node.once) { if (this.requireHistory[file]) return nodes.null; this.requireHistory[file] = true; if (literal && !this.includeCSS) { return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _nodeLoadFile(file) {\n\t\t\tvar self = this;\n\t\t\treturn new Promise(function (resolve, reject) {\n\t\t\t\t// Load the file.\n\t\t\t\treturn self._node.fs.readFile(file, (err, data) => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\treject(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Parse it!\n\t\t\t\t\t...
[ "0.614684", "0.60269016", "0.57624876", "0.55876964", "0.5475334", "0.54241", "0.5396468", "0.5311128", "0.52807987", "0.5251156", "0.5247719", "0.5141561", "0.51408947", "0.5123441", "0.51168424", "0.50716466", "0.5055581", "0.5041277", "0.5041277", "0.5041277", "0.5041277",...
0.6637213
0
entry point for deep copy. source is the object to be deep copied. maxDepth is an optional recursion limit. Defaults to 256.
function deepCopy(source, maxDepth) { var deepCopyAlgorithm = new DeepCopyAlgorithm(); if (maxDepth) { deepCopyAlgorithm.maxDepth = maxDepth; } return deepCopyAlgorithm.deepCopy(source); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deepCopy(source, maxDepth) {\n\t\tvar deepCopyAlgorithm = new DeepCopyAlgorithm();\n\t\tif ( maxDepth ) deepCopyAlgorithm.maxDepth = maxDepth;\n\t\treturn deepCopyAlgorithm.deepCopy(source);\n\t}", "function deepCopy(source, maxDepth) {\n var deepCopyAlgorithm = new DeepCopyAlgorithm();\n ...
[ "0.7842029", "0.77454656", "0.67117447", "0.66105187", "0.64963835", "0.64583087", "0.6391465", "0.6374495", "0.6374394", "0.63686913", "0.63443816", "0.6249107", "0.6177611", "0.6069049", "0.6061596", "0.59774226", "0.5964492", "0.59311765", "0.5879493", "0.584393", "0.58176...
0.7763034
1
reloads the urls list
function reload(){ // clear old list items urlList.removeAllElements(); // loop through all urls in array for (var i=0; i<arrurls.length; i++) { if (arrurls[i] != "") { // if url "" then it is deleted // add each url to list item = urlList.appendElement("<item name='"+i+"'></item>"); item.appendE...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getResetNewUrls() {\n setListOfUrls(getServerUrls().map((url) => { return { url: url, test: 'untested', textColor: '', btnOnPress: '' } }));\n }", "function flushCacheUrls() {\n this.get(PAGELIST_URLS)\n .then(array => {\n array.forEach(url => {\n this.del(url);\n });\n thi...
[ "0.7447494", "0.66081643", "0.6572662", "0.6483585", "0.6392141", "0.62311447", "0.6224411", "0.62175584", "0.62084645", "0.6193922", "0.61827695", "0.60976696", "0.60776716", "0.60642207", "0.60139406", "0.6002191", "0.59898806", "0.59156287", "0.59156287", "0.591022", "0.58...
0.73961246
1
private isConsented: boolean = false;
constructor() { // this.isConsented = this.getCookie(COOKIE_CONSENT) === '1'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserConsent() {\n if (confirm('Are you sure?')) {\n return true;\n }\n else {\n return false;\n }\n}", "onConsentDialog(on) {}", "canBypassConsent() {\n\t\treturn this.config.apps.every(\n\t\t\t({optOut = false, required = false}) => optOut || required\n\t\t);\n\t}", "fu...
[ "0.7063438", "0.70181906", "0.679759", "0.6763437", "0.6707601", "0.66988534", "0.62524796", "0.62220746", "0.61879915", "0.6161694", "0.61470497", "0.6136071", "0.6124341", "0.6111746", "0.6110154", "0.6047649", "0.6043901", "0.6038651", "0.60076356", "0.59655", "0.5963205",...
0.7668146
0
Construct new session document
function constructSessionDocument(sessionID) { // Promise callback var promise_cb = function(resolve) { // Return session document return resolve(new SessionDocument(sessionID)); }; // Return a promise return new Promise...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newDoc(sessionName) {\r\n\t//TODO. save automatically??\r\n\t//save();\r\n\tSTATE.init();\r\n\tSTATE.fillEmptyStage();\r\n\tpostRequest(setSessionPath, sessionName, function() {\r\n\t\tsave();\r\n\t});\r\n}", "function constructSessionDocument(user) {\n\n // Promise callback\n var...
[ "0.73990476", "0.6907973", "0.6817487", "0.6117042", "0.61144006", "0.6065256", "0.60085416", "0.5874495", "0.58709484", "0.5859198", "0.5852126", "0.5808306", "0.57946306", "0.5734869", "0.56486213", "0.56481653", "0.56196165", "0.5564685", "0.55284405", "0.5519052", "0.5514...
0.71928924
1
Function: ifTokenSetUser Middleware that checks if there is an authorization header, if there is it: Extracts the token Verifies the token Sets the req.user object to the extracted user Calls next() to proceed to the next middleware If anything fails or there is no authorization set it calls next()
function ifTokenSetUser(req, res, next) { const authHeader = req.get("authorization"); if (authHeader) { if (!process.env.TEST) console.log(`Authheader: ${authHeader}`); const token = authHeader.split(" ")[1]; if (token) { jwt.verify(token, process.env.SECRET, (error, user) => { if (error)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async authenticationMiddleware(req, res, next) {\n req.headers.authorization = req.headers.authorization || `Bearer ${req.query.access_token}`;\n try {\n const user = await jwt.verify(req.headers.authorization.replace('Bearer ', ''), this._config.secretAuthToken);\n req.user = user;\n req.next...
[ "0.78180087", "0.771399", "0.75242287", "0.74551105", "0.74403775", "0.73999536", "0.7392008", "0.7356601", "0.7308665", "0.73016715", "0.72981817", "0.7297766", "0.7278095", "0.7264001", "0.7256654", "0.7249199", "0.72446805", "0.72355896", "0.72355896", "0.72355896", "0.723...
0.83360624
0