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
End Helper functions Infinite Scroll functions toggle the infinite scroll function
function toggleInfiniteScroll() { var nav = $i("pagenav"); infiniteEnabled = !infiniteEnabled; if (infiniteEnabled) { infinitePage = PAGENUM; infiniteMode = MODE; nav.className = "bottom-nav hidden-nav"; toggleInfinite.style.display = "none"; } else { nav.className = "bottom-nav"; toggleInfini...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reEnableInfiniteScroll() {\n clearTimeout(scrollNs.infiniteScrollTimeout);\n scrollNs.isLoading = false;\n }", "function infiniteScroll(e) {\r\n let scrollHeight = Math.max(\r\n document.body.scrollHeight, document.documentElement.scrollHeight,\r\n d...
[ "0.73268545", "0.7084456", "0.7037242", "0.69617355", "0.69391793", "0.69391793", "0.686625", "0.67211133", "0.67128897", "0.6695153", "0.6691815", "0.6689691", "0.6669999", "0.6607768", "0.65506095", "0.6519374", "0.64880216", "0.64764166", "0.63914746", "0.63893414", "0.638...
0.84608597
0
On posts http ready
function onPostsHttpReady() { if (httpReq.readyState == 4) { if ( httpReq.status == 200 ) { addPage(httpReq.responseText); requesting = false; } //if it returns a 204, stop because we've loaded everything else if (httpReq.status == 204 ) { addPage("<p class=\"text-center\"><b>No More Posts</b>...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function HttpSentEvent() { }", "function HttpSentEvent() { }", "function postData() {}", "function getPosts() {\r\n socket.emit('request posts', 3);\r\n }", "postInitialization(server) {}", "bind() {\n // TODO: This might use some optimization not to call every request (settings.url?)\n ...
[ "0.62219334", "0.62219334", "0.61553127", "0.6131036", "0.609521", "0.60724014", "0.6034085", "0.6024875", "0.60193986", "0.59994274", "0.5960395", "0.5960395", "0.5958962", "0.59257364", "0.59257364", "0.59257364", "0.58902127", "0.587561", "0.5811248", "0.5783944", "0.57678...
0.6824962
0
Set the loading spinner
function setLoading() { var loading = $i("infiniLoading"); loading.className = "text-center"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static startLoading() {\r\n if (document.getElementById(\"loadingSpinner\")) return;\r\n // Edited to help plugins alter loading spinner appending behaviors\r\n this._appendLoadingSpinner();\r\n //\r\n }", "function setLoading(isLoading) {\n if (isLoading) {\n // Disable the bu...
[ "0.8024023", "0.7927943", "0.7728847", "0.7502049", "0.7477707", "0.7439347", "0.74308825", "0.7416879", "0.7387378", "0.7327311", "0.7306119", "0.7264046", "0.7228354", "0.72075474", "0.71796167", "0.7177301", "0.71584445", "0.7154846", "0.71366966", "0.71196586", "0.7054791...
0.8116341
0
Clear the loading spinner
function clearLoading() { var loading = $i("infiniLoading"); loading.className = "text-center hidden"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n if (!this._hasSpinner || !this._spinner.isSpinning) {\n return;\n }\n\n this._inturrupt();\n this._destroyCurrentSpinner();\n }", "static _removeLoadingSpinner() {\r\n document.body.removeChild(this._loadingSpinner);\r\n }", "function clearSpinner...
[ "0.80734307", "0.7993248", "0.79337436", "0.7747604", "0.75922185", "0.7553391", "0.7540911", "0.7536846", "0.7425508", "0.7413642", "0.731721", "0.7304436", "0.7275548", "0.7265735", "0.711944", "0.7115822", "0.7114816", "0.7102621", "0.69862473", "0.6968594", "0.696685", ...
0.86292344
0
Fade the title on scroll
function fadeOnScroll(top) { var text = []; text.push( "top:", Math.max((-top / 5),-100), "px;", "opacity:", Math.max(0,(1-(top / 100))) ); head.style.cssText = text.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nameAndTagFade() {\n\n// mouseover needs to change to fade loop\n\ttitle = document.getElementsByTagName(\"title\")[0].innerHTML;\n\tlog(title);\n\tlog(\"this is going on\");\n\t}", "function flashTitle() {\n $(\"h1\").fadeOut(100).fadeIn(100).fadeOut(100).fadeIn(100);\n}", "function showScrolledTit...
[ "0.6868153", "0.6689561", "0.6622698", "0.66020554", "0.6586752", "0.6533652", "0.6470337", "0.6459346", "0.64237356", "0.6417647", "0.6287679", "0.6267885", "0.6217006", "0.6190586", "0.61711437", "0.6150922", "0.61346877", "0.6109777", "0.61084044", "0.61027", "0.6086425", ...
0.69934577
0
Get all notanimated articles
function getUnanimatedArticles(){ //Make articles animate in one at a time var articles = document.getElementsByTagName("article"); //Convert the articles into an array object var anim = []; for (var i = 0; i < articles.length; i++) { var article = articles[i]; var attr = article.getAttribute("anim"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadUnpublishedArticles() {\n \n db.collection('article').where('status', '==', 'not_published').get().then((snapshot)=>{\n snapshot.docs.forEach(doc=>{\n renderContent(doc);\n });\n });\n}", "getNewsfeed() {\n\t \tlet followed_stories = JSON.parse(localStorage.getItem...
[ "0.6564754", "0.6266092", "0.60874474", "0.60699", "0.6067536", "0.6055366", "0.6014165", "0.5956607", "0.59325075", "0.59281087", "0.5921259", "0.58907354", "0.5853596", "0.58289987", "0.5763125", "0.57534605", "0.57502186", "0.5747912", "0.57177776", "0.5707096", "0.5685617...
0.7957512
0
Animate 'anim' number of articles
function animate(anim){ if (anim > 0 && unanimatedArticles.length > 0){ article = unanimatedArticles[0]; unanimatedArticles.shift(); article.setAttribute("anim","0"); article.style.opacity = "1"; article.className += " animate"; anim --; clearTimeout(timers); timers = []; timers.push(setTim...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function count() {\r\n\t$(\"#isaac-count, #wilhelm-count\").each(function () {\r\n\t\t$(this)\r\n\t\t\t.prop(\"Counter\", 0)\r\n\t\t\t.animate(\r\n\t\t\t\t{\r\n\t\t\t\t\tCounter: $(this).text(),\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\tduration: 4000,\r\n\t\t\t\t\teasing: \"swing\",\r\n\t\t\t\t\tstep: function (now...
[ "0.6229735", "0.6104312", "0.610417", "0.5955821", "0.595353", "0.58758193", "0.5863154", "0.58095586", "0.5779726", "0.57662696", "0.57569534", "0.5754398", "0.57536995", "0.5751061", "0.5750155", "0.57403064", "0.5735726", "0.57295996", "0.57106555", "0.5707447", "0.5693756...
0.67797214
0
Sum of grid with specified top left coordinate, and width
function gridSum(points, x, y, size) { let sum = 0; for(let i = x; i < x + size; i++) { for(let j = y; j < y + size; j++) { sum += points[i][j]; } } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function totalCells() {\n let y = GRID.length;\n let firstColumn = GRID[0];\n let x = firstColumn.length;\n let total = x * y;\n return total;\n}", "function totalCells() {\n let total = 0;\n for (i = 0; i < GRID.length; i++) {\n for (j = 0; j < GRID[i].length; j++) {\n total += 1;\n...
[ "0.71564204", "0.6682477", "0.668074", "0.6471489", "0.6293361", "0.6232528", "0.6113726", "0.6103763", "0.60781485", "0.6054887", "0.60515654", "0.60337746", "0.6005185", "0.58941394", "0.58869547", "0.5757746", "0.57122976", "0.570726", "0.56936187", "0.5686943", "0.5686180...
0.7311784
0
repo is the object thst knows how to insert a game into the database (or wherever)
create(user) { logger.info("Create game"); var game = new Game(); game.created = Date.now(); game.ownerID = user._id; // this will create a new player game.addPlayer(Player.fromUser(user)); game.state = Game.STATES.SETUP; game.updated = Date....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addOneNewEntry() {\n let test = {\n pin: 0,\n groupName: \"test\",\n status: \"waiting\",\n maxPlayers: 2,\n activePlayers: 1,\n positions: [\"Crafter\", \"Distributer\"]\n };\n let Game = mongoose.model('Game', game_1.GameSchem...
[ "0.5912778", "0.5750207", "0.5747769", "0.5700356", "0.55849355", "0.5561158", "0.5534049", "0.5482328", "0.5481717", "0.5467576", "0.5467144", "0.5462311", "0.5457142", "0.5438271", "0.54282314", "0.5405847", "0.53806406", "0.53714377", "0.5369981", "0.5362391", "0.53556865"...
0.58738774
1
Retry the transaction by running the original "runFn" after a pre determined delay.
retry_(delay) { const self = this; this.begin(function(err) { if (err) { self.runFn_(err); return; } self.queuedMutations_ = []; setTimeout(function() { self.runFn_(null, self); }, delay); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "retryLater(count, fn) {\n var timeout = this._timeout(count);\n\n if (this.retryTimer) clearTimeout(this.retryTimer);\n this.retryTimer = Meteor.setTimeout(fn, timeout);\n return timeout;\n }", "function repeat() {\n timeoutId = ...
[ "0.61952496", "0.6176696", "0.6150531", "0.6090561", "0.5998817", "0.5929848", "0.58981514", "0.5614816", "0.5567715", "0.552611", "0.5379523", "0.5329587", "0.5319263", "0.5285336", "0.5279828", "0.52611774", "0.52208483", "0.5217013", "0.5206767", "0.51937586", "0.5189267",...
0.7423707
0
Change navbar color on mount or on navigation
componentDidMount() { MediaModule.changeNavBarColor("white") this.navListener = this.props.navigation.addListener('focus', (e) => { MediaModule.changeNavBarColor("white") }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderNavbarColor() {\n if (this.props.theme === \"landing\") {\n return styles.lightBlueNavbar;\n }\n\n return styles.lightGreyNavbar;\n }", "function changeColor(){\n $('nav.menu').css({'background-color':'red'});\n }", "function enableNavbarColorToggle() {\n const hero = document.g...
[ "0.7141866", "0.69913214", "0.68977505", "0.6838544", "0.6741776", "0.67013794", "0.67007387", "0.66474277", "0.6577436", "0.6485268", "0.6484385", "0.645803", "0.64417714", "0.63842255", "0.63105977", "0.62866837", "0.62522", "0.6241073", "0.6230055", "0.62204325", "0.619112...
0.7010595
1
this method prints out the list of books in library.shelf with their corresponding authors
getBooks() { if (this.shelf.length > 0) { for (var i = 0; i < this.shelf.length; i++) { console.log(this.shelf[i].bookTitle); console.log('by - ' + this.shelf[i].author + '\n'); } } else { console.log('Library empty'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static displayBooks() {\n\t\tconst books = Store.getBooks();\n\n\t\t// loop through books in StoredBooks, call addBooks\n\t\tbooks.forEach((book) => UI.addBookToList(book));\n\t}", "function displayBooks(){\n\tvar books = getBooks();\n\tbooks.forEach(function(book){\n\t\taddBookToList(book);\n\t});\n}", "stati...
[ "0.74585587", "0.7456687", "0.7427537", "0.7293859", "0.72432923", "0.70228106", "0.6837044", "0.66362965", "0.6606694", "0.65741026", "0.6572327", "0.6570591", "0.65456146", "0.65150404", "0.65102726", "0.6427163", "0.63940996", "0.63924664", "0.63272035", "0.63069296", "0.6...
0.80818146
0
5.Calculate a remainder (given a numerator and denominator)
function findRemainder_Kata5(numerator, denominator) { var output = numerator % denominator; console.log("Remainder of ", numerator, "/" + denominator + " is ", output); return output; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function division(no1, no2) {\n let result = 30 % 7;\n console.log(result + \" is remainder\");\n}", "function getRemainder(numerator,denominator){\n let quotient = Math.floor(numerator/denominator);\n let remainder = (numerator-(Math.floor(numerator/denominator))*denominator);\n return remainder;\n}"...
[ "0.7841911", "0.77719927", "0.76360005", "0.7626338", "0.7566327", "0.7525684", "0.74612284", "0.74408555", "0.74306107", "0.7301061", "0.730104", "0.7299771", "0.723308", "0.723308", "0.723308", "0.717963", "0.717963", "0.717963", "0.7173473", "0.7169372", "0.71621084", "0...
0.8104367
0
6.Return distinct values from a list including duplicates (i.e. "1 3 5 3 7 3 1 1 5" > "1 3 5 7")
function showDistinctValList_Kata6(input) { var output = ""; var inputArr = input.split(" "); inputArr = inputArr.map(Number); inputArr.sort(function (a, b) { return a - b }); for (let i = 0; i < inputArr.length; i++) { if (inputArr.indexOf(inputArr[i]) == i) { output += inputArr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function unique(list){\n\t\t\t\t\t\tvar result = [];\n\t\t\t\t\t\t$.each(list, function(i, e){\n\t\t\t\t\t\t\tif ($.inArray(e, result) == -1) result.push(e);\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}", "function removeDuplicates(list){\n\tvar result = [];\n o:for(var i=0, n = list.length; i < n;...
[ "0.72807014", "0.72747785", "0.71698344", "0.71698344", "0.6997746", "0.69530237", "0.69206613", "0.6867247", "0.6810774", "0.67872816", "0.6757853", "0.6610862", "0.65977085", "0.65696704", "0.6527348", "0.6459932", "0.6454861", "0.64460284", "0.6444276", "0.6430592", "0.642...
0.8044173
0
7.Return distinct values and their counts (i.e. the list above becomes "1(3) 3(3) 5(2) 7(1)")
function showDistinctValAndCount_Kata7(input) { var count = {}; var output = ""; var inputArr = input.split(" "); for (let i = 0; i < inputArr.length; i++) { if (count[inputArr[i]] != null) { count[inputArr[i]] += 1; } else { count[inputArr[i]] = 1; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test_showDistinctValAndCount_Kata7() {\n result = showDistinctValAndCount_Kata7(\"1 3 5 8 7 3 1 1 5 1 3 5 9 7 3 1 9 5\");\n console.assert(result === \"1(5) 3(4) 5(4) 7(2) 8(1) 9(2)\", {\n message: 'Return distinct values from a list including duplicates failed',\n input: \"1 3 5 8 7 3...
[ "0.6755572", "0.65006953", "0.6485111", "0.64100647", "0.6321155", "0.6280346", "0.61007315", "0.6018745", "0.5984741", "0.594029", "0.5930932", "0.592802", "0.5903345", "0.58896524", "0.58846366", "0.5857999", "0.5824359", "0.5824285", "0.5823008", "0.5803493", "0.57555085",...
0.7341661
0
Test 7.Return distinct values and their counts (i.e. the list above becomes "1(3) 3(3) 5(2) 7(1)")
function test_showDistinctValAndCount_Kata7() { result = showDistinctValAndCount_Kata7("1 3 5 8 7 3 1 1 5 1 3 5 9 7 3 1 9 5"); console.assert(result === "1(5) 3(4) 5(4) 7(2) 8(1) 9(2)", { message: 'Return distinct values from a list including duplicates failed', input: "1 3 5 8 7 3 1 1 5 1 3 5 9...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showDistinctValAndCount_Kata7(input) {\n var count = {};\n var output = \"\";\n var inputArr = input.split(\" \");\n for (let i = 0; i < inputArr.length; i++) {\n if (count[inputArr[i]] != null) {\n count[inputArr[i]] += 1;\n }\n else {\n count[inputA...
[ "0.7370392", "0.65726984", "0.6562518", "0.6528455", "0.6503908", "0.6275564", "0.6223365", "0.60939324", "0.60437894", "0.600083", "0.5981587", "0.5922325", "0.5900196", "0.5891227", "0.58542275", "0.5825123", "0.5819134", "0.5801629", "0.57595277", "0.5753469", "0.57508945"...
0.7265898
1
Check the entity structure of an import config
function verifyStructure(importConfig) { if (!importConfig.importConfigMapping) { importConfig.importConfigMapping = spEntity.fromJSON({ typeId: 'apiResourceMapping', mappedType: jsonLookup(), importMergeExisting: true, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImportConfig(model) {\n var json = {\n name: jsonString(),\n typeId: 'importConfig',\n importConfigMapping: jsonLookup(),\n importFileType: jsonLookup()\n };\n\n var importConfig = spEntity.fromJSON(json);\n...
[ "0.6038312", "0.5774683", "0.564505", "0.5264171", "0.51517165", "0.5035242", "0.50268215", "0.49593973", "0.49479285", "0.49289492", "0.49275687", "0.49017677", "0.4863934", "0.485991", "0.4858101", "0.48048508", "0.48035347", "0.4783023", "0.47390106", "0.47249806", "0.4704...
0.74432504
0
Create a new empty import config entity
function createImportConfig(model) { var json = { name: jsonString(), typeId: 'importConfig', importConfigMapping: jsonLookup(), importFileType: jsonLookup() }; var importConfig = spEntity.fromJSON(json); ve...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verifyStructure(importConfig) {\n if (!importConfig.importConfigMapping) {\n importConfig.importConfigMapping = spEntity.fromJSON({\n typeId: 'apiResourceMapping',\n mappedType: jsonLookup(),\n importMergeExisting: true,\n ...
[ "0.6314207", "0.6275315", "0.6162589", "0.57187974", "0.54009557", "0.5386938", "0.53197193", "0.5127115", "0.50816935", "0.50577503", "0.5034587", "0.5024622", "0.5023851", "0.49567795", "0.49511302", "0.49343878", "0.491424", "0.49004588", "0.49004588", "0.48859942", "0.487...
0.77511656
0
Load an importconfig from the server into the model
function loadImportConfig(model, importConfigId) { var handle = getHandle(model); return spImportFileWebService.loadImportConfig(importConfigId).then(function (importConfig) { if (!checkHandle(model, handle)) return; verifyStructure(importConfig); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImportConfig(model) {\n var json = {\n name: jsonString(),\n typeId: 'importConfig',\n importConfigMapping: jsonLookup(),\n importFileType: jsonLookup()\n };\n\n var importConfig = spEntity.fromJSON(json);\n...
[ "0.7342882", "0.6050568", "0.5896045", "0.58446205", "0.5785443", "0.5718141", "0.5717004", "0.56903833", "0.5652021", "0.5643763", "0.5635936", "0.56347847", "0.5562033", "0.55613405", "0.5505759", "0.54614276", "0.54255855", "0.5412483", "0.54047734", "0.5387608", "0.536350...
0.72281057
1
Save an importconfig to the server
function saveImportConfig(model) { var importConfig = model.importConfig; if (!importConfig) return $q.when(); var handle = getHandle(model); setValuesIntoImportConfig(model); return spEntityService.putEntity(importConfig).then(function (imp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveConfig() {\n fs.writeFile(ConfigFile, JSON.stringify(config), (err) => {\n if (err) {\n throw err;\n }\n });\n}", "function saveConfig() {\n fs.writeFile('config.json', JSON.stringify(config), function(err){\n if(err) console.error(err);\n });\n}", "SaveAndReimport() {}", "_save() ...
[ "0.64638585", "0.64441705", "0.63719064", "0.63272154", "0.6146821", "0.6125021", "0.6116674", "0.5998422", "0.5960521", "0.59194267", "0.5892099", "0.5883122", "0.5833793", "0.5747405", "0.57229465", "0.5696526", "0.5678439", "0.5677677", "0.56651163", "0.56217366", "0.55654...
0.71411127
0
Load a sample sheet
function loadSheetSample(model) { var handle = getHandle(model); model.sampleDataTable = null; var headingRow = model.noHeadingRow ? 0 : model.headingRow; spImportFileWebService.getSampleTable(model.file.fileId, headingRow, model.dataRow, model.lastRow, model.file.fileFor...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSheet(name, source) {\n\t\t$.ajax({\n\t\t\ttype: \"GET\",\n\t\t\tdataType: \"text\",\n\t\t\turl: source,\n\t\t\tsuccess: handleLoad,\n\t\t\tcache: false,\n\t\t\tcontext: {\n\t\t\t\tname: name,\n\t\t\t\tsource: source\n\t\t\t}\n\t\t});\n\t}", "async _loadFromSheet() {\n const SHEET = '1aY4yl-sgD4K...
[ "0.6630435", "0.6594903", "0.6268438", "0.6180413", "0.61142796", "0.58279735", "0.5826538", "0.57729805", "0.56135076", "0.561301", "0.5589841", "0.5583707", "0.55646014", "0.5471728", "0.5442722", "0.54133207", "0.54002106", "0.5303302", "0.5297005", "0.5291704", "0.5290835...
0.7646391
0
Format a field name if mandatory
function formatFieldName(f) { var name = f.getName(); if (f.isRequired()) { name += '*'; } return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prefixFieldName(prefix, fieldName) {\n\t if (prefix === undefined || prefix === \"\") {\n\t return fieldName;\n\t }\n\n\t return prefix + capitalize(fieldName);\n\t }", "validate_name(value) {\n if (!this.cleanStringField(value)) return t(\"Name does not specified\");\n retu...
[ "0.64311874", "0.6249833", "0.6249833", "0.62063056", "0.6187208", "0.617638", "0.617638", "0.617286", "0.617286", "0.61409026", "0.6136596", "0.6123484", "0.6109795", "0.61049503", "0.6101128", "0.60831463", "0.60831463", "0.60567516", "0.6054814", "0.60462135", "0.6027496",...
0.78283244
0
Create new mapping instances when column names match
function createDefaultMappings(model) { var mappings = sp.result(model, 'importConfig.importConfigMapping.resourceMemberMappings'); var availableCols = getAvailableSourceColumns(model); var availableMembersByName = _.reduce(model.targetMembers, function (acc, targetMember) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function constructMapping(oldData, newData) {\n const mapping = {};\n\n Object.keys(oldData).forEach((field) => {\n logger.info(`Mapping field: ${field}`);\n if (!newData[field]) {\n return;\n }\n\n if (!mapping[field]) {\n mapping[field] = {};\n }\n\n // field objects ...\n const ...
[ "0.58392847", "0.580139", "0.580139", "0.580139", "0.5771131", "0.5756419", "0.5753758", "0.5753758", "0.5753758", "0.57388836", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", "0.567201", ...
0.6343833
0
Find the member target instance that corresponds to a particular mapping.
function findTargetForMapping(model, mapping) { if (!mapping) return null; var targetMembers = model.targetMembers; var target = _.find(targetMembers, function (member) { return spResourceEndpointService.mappingRefersToMember(mapping, member.memberInfo); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMappingForTarget(model, target) {\n if (!target) return null;\n var mappings = model.importConfig.importConfigMapping.resourceMemberMappings;\n var mapping = _.find(mappings, function (mapping) {\n return spResourceEndpointService.mappingRefersToMember(m...
[ "0.70467407", "0.6570622", "0.60442156", "0.59958416", "0.588484", "0.56652987", "0.5638157", "0.5627034", "0.5575815", "0.5419892", "0.5418104", "0.5341997", "0.53221726", "0.52969897", "0.52713203", "0.5256807", "0.52214193", "0.52095366", "0.52029175", "0.5159924", "0.5142...
0.76934546
0
Find the mapping that corresponds to a particular target instance.
function findMappingForTarget(model, target) { if (!target) return null; var mappings = model.importConfig.importConfigMapping.resourceMemberMappings; var mapping = _.find(mappings, function (mapping) { return spResourceEndpointService.mappingRefersToMember(mapping, t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findTargetForMapping(model, mapping) {\n if (!mapping) return null;\n var targetMembers = model.targetMembers;\n var target = _.find(targetMembers, function (member) {\n return spResourceEndpointService.mappingRefersToMember(mapping, member.memberInfo);\n ...
[ "0.69588464", "0.6357901", "0.61718386", "0.6107001", "0.6048235", "0.57041395", "0.5675894", "0.5557832", "0.5528007", "0.5494049", "0.5492968", "0.5371661", "0.5364761", "0.5292737", "0.52825165", "0.52654094", "0.52458483", "0.52423054", "0.50863385", "0.506328", "0.504651...
0.75724494
0
Show the options dialog for a mapping row
function showMappingOptions(model, mappingRow) { var defaults = { templateUrl: 'importFile/controllers/spMemberMappingOptions.tpl.html', controller: 'spMemberMappingOptionsController', resolve: { mappingRow: function () { return mappingRow;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowLinkOnColumnClick1(tableName, row, e) {\n try {\n\n $('#' + tableName + '_CCE_Dialog').dialog({\n title: 'Select',\n position: [e.clientX, e.clientY],\n width: '200px',\n height: 'auto',\n show: {\n effect: \"blind\",\n ...
[ "0.6103279", "0.5963405", "0.5916747", "0.5891514", "0.569612", "0.5622572", "0.5621181", "0.5505985", "0.5494871", "0.5482802", "0.5478361", "0.5408211", "0.54068434", "0.53937244", "0.53937244", "0.5383165", "0.53505147", "0.53453094", "0.5340213", "0.53260934", "0.52886766...
0.7788442
0
Get list of columns that are available as data sources
function getAvailableSourceColumns(model) { var sample = model.sampleDataTable; if (!sample) return []; var res = _.map(sample.columns, function(col, index) { return { colId: col.colId, colHeading: col.colName, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get columns() {\n return this.knexQuery['_statements']\n .filter(({ grouping }) => grouping === 'columns')\n .reduce((result, { value }) => {\n result = result.concat(value);\n return result;\n }, []);\n }", "get columns() {\n let allColumns = [...
[ "0.66394067", "0.6362189", "0.62132514", "0.61501354", "0.61059195", "0.6093217", "0.60118335", "0.59781325", "0.59737647", "0.59693164", "0.5958517", "0.59468013", "0.5935371", "0.5872385", "0.5864666", "0.57459867", "0.5730572", "0.5720032", "0.56503826", "0.56359184", "0.5...
0.71461135
0
Return a sample value from the sample table
function getSampleValue(sampleTable, rowNum, columnNum) { if (sampleTable.rows[rowNum]) { var row = sampleTable.rows[rowNum]; return row.vals[columnNum]; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get valueSampledData () {\n\t\treturn this._valueSampledData;\n\t}", "readSample() {\n return 0;\n }", "function sample(i, P_mat) {\n // if (i >= P_mat.length) {\n // console.log(i);\n // console.log(P_mat.length);\n // console.log(\"bad news\");\n // } else {\n // c...
[ "0.6105007", "0.56883156", "0.56730366", "0.56297386", "0.55205435", "0.54843307", "0.54641944", "0.54423684", "0.5422982", "0.53708434", "0.5315471", "0.5310656", "0.53024995", "0.53024995", "0.53024995", "0.52998763", "0.5299284", "0.5287452", "0.5281049", "0.52204096", "0....
0.7445752
0
Checks to see if this user has already joined, but has a stale socket associated with the player. This could happen if the browser tab was reloaded after having established a connection.
function maybeReconnect(message, client, gameRoom) { gameRoom.getPlayers().forEach(function(player, index) { if (player && player.name === message.player_name) { player.socket = client; return true; } }); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canStartGame() {\n return Object.keys(this.player_sockets).length == 2;\n }", "function connected() {\n return _socket !== undefined;\n }", "function checkWebsocketConnection() {\n if(ws != null) {\n if(ws.readystate != 1) {\n /* Connection isn't in CONNECTED state, trying to resta...
[ "0.58628017", "0.58017623", "0.5781327", "0.57795775", "0.57582784", "0.57501984", "0.5705616", "0.5703331", "0.5680472", "0.5666316", "0.56291026", "0.5565674", "0.55517197", "0.5544365", "0.55310124", "0.54647964", "0.54589957", "0.54337186", "0.5421936", "0.5414195", "0.54...
0.58938706
0
A GameRoom represents the whole page that hosts a particular game. This includes the Game board itself as well as other parts such info about the Players, whose turn it is, etc..
function GameRoom(name, game) { this.name = name; this.gameState = new GameState(); this.game = game; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Room () {\n\tthis.active = false;\n\tthis.tutors = {};\n\tvar defaultGroup = new Group ('default');\n\tthis.count = 1;\n\tthis.groups = {};\n\tthis.groups[defaultGroup.groupId] = defaultGroup;\n}", "function Game(playerObjects, game_room)\n{\n\t// Keeps track of the players in the game\n\tthis.players =...
[ "0.6685111", "0.66469854", "0.6500724", "0.63613147", "0.63492745", "0.6299169", "0.6273966", "0.6260525", "0.62270516", "0.6220691", "0.62057525", "0.6200987", "0.6174017", "0.61168057", "0.6094366", "0.6048495", "0.6036063", "0.6028819", "0.60194874", "0.6011752", "0.595660...
0.7375744
0
Local helper functions: Parameters in the options struct: chromeSearchFunction: the chrome.bluetoothLowEnergy function that searches for children. parentChromeId: the instance ID or address of the chromeside parent object. uuids: an Array listing the uuids of children to return. |undefined| means to return all children...
function getChildren(options) { if (typeof options.uuids === 'string') { options.uuids = [options.uuids]; } return callChromeFunction(options.chromeSearchFunction, options.parentChromeId ).then(function(args) { var chromeInstances = args[0]; if (options.uuids !== undefined) { chromeInstances =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildPage() {\n this.parentElement.innerHTML = \"\";\n\n // Exchange Divs\n const exchangeContainer = document.createElement(\"div\");\n exchangeContainer.id = \"exchangeContainer\";\n this.parentElement.appendChild(exchangeContainer);\n this.buildExchangeDiv(\"coinbasePro\", exchangeContainer);\...
[ "0.44371644", "0.44350517", "0.43862548", "0.43444562", "0.43274328", "0.4218751", "0.42054412", "0.4196158", "0.41880593", "0.4158498", "0.41535825", "0.41507483", "0.41420153", "0.41355157", "0.40956372", "0.40927893", "0.4082995", "0.40794888", "0.40718567", "0.40663236", ...
0.70175457
0
Determine if kind is acceptable, considering compatible kinds
function isKindAcceptable(kind, acceptKinds) { if (acceptKinds == null) { return true; } else { for (const item of acceptKinds) { if (item == kind) { return true; } if (exports.kind2CompatibleKinds[item] != null) { const com...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isValidKindName(kind) {\n return this.availableProtocols()\n .get(this.name, immutable.List())\n .includes(kind)\n }", "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "function isKind(val, kind){\n return kindOf(val) === kind;\n }", "function isKind(val, ki...
[ "0.6621554", "0.65762764", "0.65762764", "0.65762764", "0.65743995", "0.64856243", "0.64778644", "0.6445952", "0.5825086", "0.5685894", "0.55325925", "0.542", "0.53877705", "0.5303426", "0.5291764", "0.5267888", "0.5267888", "0.5265598", "0.52628744", "0.52628744", "0.5260839...
0.7558511
0
Given an array from maqawGetNodeHierarchy returns the specified node in the dom
function maqawGetNodeFromHierarchy(doc, hierarchy){ var i, length = hierarchy.length, node = doc.body; for(i = 0; i < length; i++){ node = node.children[hierarchy[i]]; } return node; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNode(element) {\n\t\t\treturn angular.isArray(element) ? element[0] : element;\n\t\t}", "function maqawGetNodeHierarchy(doc, node) {\n var index = [];\n while (node !== doc.body) {\n index.unshift(Array.prototype.indexOf.call(node.parentElement.children, node));\n node = node.pare...
[ "0.59428847", "0.58491904", "0.57097846", "0.54712653", "0.54712653", "0.54561675", "0.5435727", "0.5435727", "0.53815305", "0.5328857", "0.53235435", "0.5306688", "0.528501", "0.52554685", "0.5242179", "0.52411175", "0.52090406", "0.52031285", "0.51994497", "0.51944643", "0....
0.6795964
0
Whether the sound is paused. this._audioNode only exists when sound is playing; otherwise AudioPlayer is considered paused.
get paused() { return this._audioNode === null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get isPaused() {\n return this._playingState === AUDIO_STATES.PAUSED;\n }", "get paused() {\n return this.player && !this.player.isPlaying();\n }", "function isPaused() {\n\n\t\treturn dom.wrapper.classList.contains( 'paused' );\n\n\t}", "function isPaused() {\n\n\t\treturn dom.wrapper....
[ "0.7745801", "0.6948346", "0.6915703", "0.6915703", "0.6896161", "0.6896161", "0.6856734", "0.6856734", "0.68537617", "0.6828344", "0.68142366", "0.6812819", "0.6802137", "0.67338705", "0.6729051", "0.6688827", "0.66178507", "0.65861857", "0.65627235", "0.65424114", "0.652570...
0.8609681
0
The srcObject of the HTMLMediaElement
get srcObject() { return this._audioElement.srcObject; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get src() {\n return this._src;\n }", "function srcObject(value) { return new Attr(\"srcObject\", value, false, \"audio\", \"video\"); }", "get src() {\n return this._src;\n }", "getSource() {\n return this.getAttribute('src');\n }", "get src() {\n this._logger.de...
[ "0.74283963", "0.73964953", "0.7186108", "0.7025506", "0.68336797", "0.6571705", "0.65480965", "0.63717735", "0.63717735", "0.6331059", "0.62907946", "0.6231256", "0.6221128", "0.5931564", "0.5919453", "0.5903925", "0.5903925", "0.5903925", "0.5880526", "0.5840772", "0.584015...
0.8716042
0
Pause the audio coming from this AudioPlayer. This will reject any pending play Promises.
pause() { if (this.paused) { return; } this._audioElement.pause(); this._audioNode.stop(); this._audioNode.disconnect(this._gainNode); this._audioNode = null; this._rejectPlayDeferreds(new Error('The play() request was interrupted by a call to pause()....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "pause() {\r\n if (this._audioSrc && this._media) {\r\n this._updateMediaState(MediaStatus.MEDIA_PAUSED);\r\n this._media.pause();\r\n }\r\n }", "pause() {\n logger.log('NativePlayer.pause()');\n clearInterval(this.interval);\n this.media.pause();\n this.state = ...
[ "0.7585514", "0.689129", "0.6860476", "0.68319637", "0.68319637", "0.6793416", "0.676427", "0.6757753", "0.6749732", "0.6530559", "0.64897025", "0.64782554", "0.6472108", "0.6458554", "0.64238244", "0.6414449", "0.64090264", "0.6345807", "0.63210714", "0.63026357", "0.6288709...
0.7719206
0
Play the sound. If the buffer hasn't loaded yet, wait for the buffer to load. If the source URL is not set yet, this Promise will remain pending until a source URL is set.
play() { return __awaiter(this, void 0, void 0, function* () { if (!this.paused) { yield this._bufferPromise; if (!this.paused) { return; } throw new Error('The play() request was interrupted by a call to pause().');...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_load(src) {\n if (this._src && this._src !== src) {\n this.pause();\n }\n this._src = src;\n this._bufferPromise = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n if (!src) {\n return this._createPlayDeferred().prom...
[ "0.74919015", "0.6599482", "0.65536034", "0.6385921", "0.63824975", "0.6362763", "0.6305861", "0.6256635", "0.6231745", "0.62308645", "0.62085086", "0.61472243", "0.61363375", "0.60912466", "0.6059432", "0.6042843", "0.60308754", "0.6020139", "0.5982678", "0.5960676", "0.5946...
0.706567
1
Create a Deferred for a Promise that will be resolved when .src is set or rejected when .pause is called.
_createPlayDeferred() { const deferred = new Deferred_1.default(); this._pendingPlayDeferreds.push(deferred); return deferred; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Deferred(){\n this._promise = new Promise();\n }", "_load(src) {\n if (this._src && this._src !== src) {\n this.pause();\n }\n this._src = src;\n this._bufferPromise = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {\n ...
[ "0.57601887", "0.5688959", "0.56298697", "0.56083345", "0.5522605", "0.55224866", "0.55224866", "0.55224866", "0.55224866", "0.5520765", "0.5508106", "0.5508106", "0.5434942", "0.5260193", "0.5228523", "0.5211415", "0.51952356", "0.5188898", "0.51241267", "0.5088273", "0.5071...
0.6006144
0
Reject all deferreds for the Play promise.
_rejectPlayDeferreds(reason) { const deferreds = this._pendingPlayDeferreds; deferreds.splice(0, deferreds.length).forEach(({ reject }) => reject(reason)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_reject() {\n deferred.reject()\n }", "function fail(){\n\t\t\tdeferred.reject();\n\t\t}", "reject() {\n\t\t\tthis.reject(...arguments);\n\t\t}", "rejectAll(reason) {\n if (reason) {\n for (let i = 0; i < buffer.length; ++i) {\n buffer[i].deferred.reject(reaso...
[ "0.7746965", "0.7121886", "0.69587845", "0.68975955", "0.6871662", "0.6682617", "0.6682617", "0.6585191", "0.64797074", "0.6474938", "0.6440926", "0.6440926", "0.6440926", "0.6440926", "0.6440926", "0.6440926", "0.6440926", "0.63839823", "0.6371648", "0.632751", "0.61809534",...
0.76564366
1
Resolve all deferreds for the Play promise.
_resolvePlayDeferreds(result) { const deferreds = this._pendingPlayDeferreds; deferreds.splice(0, deferreds.length).forEach(({ resolve }) => resolve(result)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveAll() {\n this.requests.forEach((request) => request.resolve());\n return Ember.RSVP.Promise.all(this.requests);\n }", "_resolve() {\n deferred.resolve()\n }", "function resolveAll(response) {\n self.deferred.resolve(response);\n }", "function resolveAll(response) {\n ...
[ "0.71249074", "0.6909384", "0.66847384", "0.66847384", "0.66847384", "0.66847384", "0.66847384", "0.66847384", "0.66847384", "0.6661822", "0.6620611", "0.64904374", "0.6462067", "0.6462067", "0.6462067", "0.6462067", "0.6447405", "0.6358683", "0.6188124", "0.61148745", "0.606...
0.73728615
0
Filters is in reportView.reportViewDatasets, but to subReportView, filter is in reportView.filters Need push reportView.filters into reportView.reportViewDatasets to submit to api
function _buildCustomFilters() { reportViewUtil._buildCustomFilters($scope.reportView.filters, $scope.reportView.reportViewDataSets); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFilters() {}", "function setFil...
[ "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205", "0.64161205"...
0.7298403
0
Fix bug: some metrics ticked wrong by default
function _unTickWrongMetrics(correctFields) { _.each($scope.dimensions, function (dimension) { var fieldName = dimension.name; if(!_.contains(correctFields, fieldName)) { dimension.ticked = false; } }); _.each($sco...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gatherRealMetrics() {\n var falseTargets = 0;\n for (var i=0; i<metrics.length; i++) {\n if (metrics[i].target === false) {\n falseTargets++;\n } else {\n realMetrics[i - falseTargets] = metrics[i];\n }\n }\n}", "function workoutNewScale(){\n // Start at 2 decimals places\n ...
[ "0.6512908", "0.57641894", "0.57452637", "0.5735902", "0.57017475", "0.56769544", "0.56528723", "0.5639295", "0.5620065", "0.5596773", "0.553455", "0.5457367", "0.54200417", "0.5414361", "0.53812087", "0.5374689", "0.5350312", "0.5286329", "0.52666897", "0.5244383", "0.523742...
0.59827876
1
handler to save the flight prediction
function savePredictionHandler (handler) { var retObj = new Object(); retObj.filename = "flightPred.pred"; retObj.data = JSON.stringify(currentPrediction, null, " "); return retObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveHandler() {\n data = {\"words\": words, \"comeAfter\": comeAfter, \"comeBefore\": comeBefore};\n saveDataToServer(\"http://127.0.0.1:9000/save\", data, saveCallBack);\n}", "function save(){\n \n }", "function saveStatesInterpreter(){\n\tif ($(\"#tName\").val().length>0 && $(\"#...
[ "0.64178354", "0.639417", "0.6313061", "0.626066", "0.6217143", "0.62079805", "0.62079805", "0.61992157", "0.61600965", "0.61179507", "0.6047386", "0.60106075", "0.59959835", "0.59883046", "0.595561", "0.59533054", "0.59496427", "0.59079283", "0.58788663", "0.58764833", "0.58...
0.8035428
0
this function processes the data returned from the worker (process prediction)
function processWorkerReturn (data) { switch (data.status) { case 0: break; case 1: $('#windFileLoading').show(); // show the loading message $('#PIGeneratePred').jqxButton({disabled: true }); $('#currentState').text('calculati...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPredictResult(data, callback) {\n console.log(\"6. Get predict result\");\n for (var i = 0; i < targets.length; i++) {\n targets[i].push(data.data.res[2][i]);\n }\n callback();\n }", "async function run() {\n const startTime = Date.now();\n await model.fit(trainingData, output...
[ "0.66687435", "0.65439206", "0.65371084", "0.6485308", "0.61407524", "0.61407524", "0.61309093", "0.60327786", "0.5977489", "0.597392", "0.59534115", "0.59103554", "0.59092456", "0.58972615", "0.58805513", "0.5875875", "0.58743787", "0.5867371", "0.58415425", "0.5803235", "0....
0.681119
0
Send play ping to users with group_id
function sendPlayPingToUsers(id) { var token = readCookie('token'); var httpRequest = new XMLHttpRequest(); if(!httpRequest) return false; httpRequest.onreadystatechange = validate; httpRequest.open('GET','controller.php?function=playPing&token='+token+'&group_id='+id); httpRequest.send(); function valid...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ping(greet){\n emitter.publish({\n key: 'LoD3PKxDVsNrruAGdnwbZVH4E8ZPqrJN',\n channel: 'user-ping/v1/',\n message: JSON.stringify({\n token: getPersistentVisitorId(),\n greet: greet\n })\n });\n}", "function broadcastToGroup(groupId, json) {\n\t\t/...
[ "0.615417", "0.60739625", "0.59250045", "0.5811555", "0.5657683", "0.5624903", "0.5612384", "0.55366623", "0.546486", "0.5394522", "0.53664404", "0.536174", "0.5355232", "0.535485", "0.5338739", "0.5309661", "0.5291376", "0.5286627", "0.52662873", "0.5248135", "0.5241184", ...
0.76723504
0
Check if admin by validating token
function checkAdmin(token) { var httpRequest = new XMLHttpRequest(); var answer_return; if(!httpRequest) return false; httpRequest.onreadystatechange = validate; httpRequest.open('GET','controller.php?function=validateAdmin&token='+token); httpRequest.send(); document.getElementById("admin_code_title").i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateAdmin(token) {\n\t\tvar httpRequest = new XMLHttpRequest();\n\t\tvar answer_return;\n\t\tif(!httpRequest) return false;\n\t\thttpRequest.onreadystatechange = validate;\n\t\thttpRequest.open('GET','controller.php?function=validateAdmin&token='+token);\n\t\thttpRequest.send();\n\n\t\tfunction valida...
[ "0.75869364", "0.74854636", "0.743525", "0.7411874", "0.7278245", "0.72613525", "0.7236885", "0.71426594", "0.70916146", "0.70381594", "0.70333976", "0.6872245", "0.68722093", "0.6828346", "0.6818878", "0.6813752", "0.6787536", "0.6781821", "0.6734238", "0.673159", "0.6725744...
0.7599392
0
Check if admin by validating token and get groups
function validateAdmin(token) { var httpRequest = new XMLHttpRequest(); var answer_return; if(!httpRequest) return false; httpRequest.onreadystatechange = validate; httpRequest.open('GET','controller.php?function=validateAdmin&token='+token); httpRequest.send(); function validate() { if (httpRequest.r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function ensureIsGroupMod(req, res, next) {\n\tconsole.log('Middleware - ensureIsGroupMod - Start');\n\ttry {\n\t\tconst tokenStr = req.body._token || req.query._token;\n\n\t\tlet result = await verifyToken(tokenStr);\n\n\t\tif (result instanceof Error) {\n\t\t\tthrow result;\n\t\t}\n\n\t\tconst groupMods = ...
[ "0.69237405", "0.64714026", "0.6418717", "0.6324437", "0.63097626", "0.62753236", "0.6235239", "0.62332493", "0.6230777", "0.6210489", "0.62036604", "0.6187369", "0.6127711", "0.6012165", "0.5967929", "0.5961778", "0.587084", "0.586687", "0.584409", "0.5830531", "0.5826101", ...
0.7173229
0
Kick user by user_id and check if admin
function kickUser(id) { var token = readCookie('token'); var httpRequest = new XMLHttpRequest(); if(!httpRequest) return false; httpRequest.onreadystatechange = validate; httpRequest.open('GET','controller.php?function=kickUser&token='+token+'&user_id='+id); httpRequest.send(); function validate() { i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "execute(client, message, args, Discord){\n const user = message.mentions.users.first();\n if(user){\n const userTarget = message.guild.members.cache.get(user.id);\n userTarget.kick();\n message.channel.send('user was kicked')\n } else {\n message.cha...
[ "0.7118753", "0.6839888", "0.6790108", "0.67271256", "0.6567856", "0.63981986", "0.63111037", "0.62180316", "0.6117077", "0.6066161", "0.603639", "0.5950143", "0.5938112", "0.5932202", "0.5885476", "0.5882279", "0.58805996", "0.58448696", "0.5843906", "0.5832902", "0.5805208"...
0.71190834
0
Empty question and answers container
function emptyQuestionAnswers() { document.getElementsByClassName("question")[0].innerHTML = ""; for(var i = 0; i < 4; i++) { document.getElementsByClassName("answers_"+i)[0].innerHTML = ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearAnswers() {\n $(`#answers`).html(``);\n }", "function answerClear() {\n for (var i = 0; i < 4; i++) {\n $('#answer-' + i).html('');\n }\n hide('.answer');\n }", "function answerTrack() {\n for (let i=0; i<questions.length; i++) {\n const div ...
[ "0.65518135", "0.6501497", "0.64579034", "0.6451993", "0.64106023", "0.64106023", "0.63909817", "0.6372682", "0.63584846", "0.63366765", "0.62323505", "0.6189774", "0.61792964", "0.61769474", "0.61568385", "0.6149938", "0.61283726", "0.6100763", "0.60988", "0.60612506", "0.60...
0.7156446
0
Back to admin scores
function backToAdminScores() { document.getElementsByClassName("inner_pos_score")[0].style.display="block"; document.getElementsByClassName("user_answers_container")[0].style.display="none"; document.getElementById("back_to_scores").style.display="none"; document.getElementById("back_to_admin").style.display="b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goBack() {\n console.log(\"retry button pressed\");\n init();\n $(\".set\").attr(\"style\", \"display: block\");\n $(\".gameset\").attr(\"style\", \"display: block\");\n $(\"#retry\").attr(\"style\", \"display: none\");\n $(\"#scoreCount\").attr(\"style\", \"display: block\")...
[ "0.6640194", "0.6621013", "0.6609565", "0.65812266", "0.6579861", "0.6503582", "0.6395073", "0.63649255", "0.63537484", "0.63507223", "0.6337552", "0.6328983", "0.63069063", "0.62848854", "0.6260268", "0.62462056", "0.6239722", "0.6237012", "0.6208458", "0.62052125", "0.61814...
0.7882503
0
Show admin scores, all users in group
function showAdminScores(amount_of_questions) { stopRequestingLobbyEndScores = 0; var admin_token = readCookie('token'); var group_id = glob_group_id; var httpRequest = new XMLHttpRequest(); if (!httpRequest) return false; httpRequest.onreadystatechange = validate; httpRequest.open('GET','controller.php?g...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ListSubjectiveScores({ connection, user, onlyMe }) {\n // subjectiveScores = me any my team\n let subjectiveScores = connection.subjectiveScores || [];\n\n // otherScores = scores shared with me through groups\n let otherScores = getOtherScores({ connection });\n\n // Get all scores combined\n let a...
[ "0.6038304", "0.5814435", "0.57951534", "0.5760746", "0.5705673", "0.56890446", "0.56619334", "0.56390893", "0.56057656", "0.5535705", "0.5520881", "0.5504706", "0.54260564", "0.54065436", "0.5402975", "0.540241", "0.53942466", "0.5360806", "0.53584903", "0.5348605", "0.53461...
0.6601377
0
Show the category popup before a question starts
function categoryPrompt(category) { document.getElementsByClassName("question_container")[0].style.display = "none"; var timer = 2750; document.getElementsByClassName("category_prompt_overlay")[0].style.display = "block"; document.getElementsByClassName("category_prompt_overlay_inner")[0].classList.remove("sli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function categoryComputerScience() {\n document.getElementById(\"introPage\").style.display='none';\n document.getElementById(\"qPromptCS\").style.display='block';\n document.getElementById(\"chatPage\").style.display='block';\n }", "function startQuiz(category) {\r\n interval = setInterval(setTimer...
[ "0.70404446", "0.65684634", "0.64442664", "0.64342207", "0.64104456", "0.6373051", "0.6365684", "0.6351542", "0.63507545", "0.6270751", "0.62660766", "0.621351", "0.6208785", "0.6187852", "0.61467063", "0.6123438", "0.6077583", "0.6053954", "0.6052899", "0.6024726", "0.600002...
0.7048835
0
Configure the expanded state appearance.
function _setExpandedState() { _dom.classList.add( BASE_CLASS + '__expanded' ); _content.setAttribute( 'aria-expanded', 'true' ); _target.setAttribute( 'aria-pressed', 'true' ); _setStateTo( EXPANDED ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expand() {\n setExpanded(true);\n }", "function set_state(expanded){\n if(expanded){\n section.addClass(\"expanded\").removeClass(\"collapsed\");\n section.children().show();\n }else{\n section.addClass(\"collapsed\").removeClass(\"expanded\");\n section.c...
[ "0.65636015", "0.63391376", "0.6228577", "0.6172896", "0.60429657", "0.59737855", "0.58320296", "0.58156", "0.5812338", "0.58017814", "0.57733977", "0.5655641", "0.56379175", "0.5636354", "0.561943", "0.5615373", "0.559958", "0.5550042", "0.5530835", "0.5520551", "0.55135894"...
0.6565753
0
Configure the collapsed state appearance.
function _setCollapsedState() { _dom.classList.remove( BASE_CLASS + '__expanded' ); _content.setAttribute( 'aria-expanded', 'false' ); _target.setAttribute( 'aria-pressed', 'false' ); _setStateTo( COLLAPSED ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onCollapse() {\n this.setState({\n borderColor: this.props.disabledColor,\n color: LOWEST_VALUE_THUMB_COLOR,\n });\n }", "collapse() {\n this._collapsed = true;\n }", "function setCollapsed(collapsed, maximized) {\n updateCollapsedClass(collapsed);\n\n ...
[ "0.63146925", "0.57854146", "0.5683697", "0.5484749", "0.5484749", "0.5466433", "0.54574996", "0.54082155", "0.5388323", "0.53731155", "0.5360998", "0.5358326", "0.53419113", "0.53389364", "0.53228265", "0.5295823", "0.5287536", "0.5265947", "0.52550143", "0.52401286", "0.524...
0.5971165
1
Expand animation has completed.
function _expandComplete() { _content.removeEventListener( _transitionEndEvent, _expandComplete ); _setExpandedState(); _that.dispatchEvent( 'endExpand', { target: _that } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "expandAnimationDone($event) {\n if ($event.toState === COLLAPSED_STATE) {\n this.expanded = false;\n }\n }", "function animcompleted() {\r\n\t\t\t\t\t\t}", "function _expandEnd() {\n _isAnimating = false;\n _isExpanded = true;\n if ( _expandTransition ) {\n _expandTran...
[ "0.7948724", "0.7540065", "0.71571714", "0.7112693", "0.6889715", "0.6643004", "0.6481167", "0.6451353", "0.6446318", "0.6403694", "0.64021415", "0.6395408", "0.63505363", "0.6321892", "0.6307217", "0.62489337", "0.6236154", "0.6205302", "0.61524886", "0.61310387", "0.6111124...
0.7851193
1
Collapse animation has completed.
function _collapseComplete() { _content.removeEventListener( _transitionEndEvent, _collapseComplete ); _setCollapsedState(); _that.dispatchEvent( 'endCollapse', { target: _that } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _collapseEnd() {\n _isAnimating = false;\n if ( _collapseTransition ) {\n _collapseTransition.removeEventListener(\n BaseTransition.END_EVENT,\n _collapseEndBinded\n );\n }\n this.dispatchEvent( 'collapseEnd', { target: this, type: 'collapseEnd' } );\n }", "function ...
[ "0.7405395", "0.7350132", "0.7191527", "0.71487993", "0.7129101", "0.69591725", "0.68671006", "0.6710237", "0.66620034", "0.66490275", "0.66440105", "0.66260725", "0.6617517", "0.6617517", "0.66053927", "0.6594908", "0.6585342", "0.65697765", "0.6569262", "0.65599835", "0.653...
0.75983536
0
Handle click of the Expandable target.
function _handleClick() { // Bubble click event outside of the Expandable. _that.dispatchEvent( 'click', { target: _that } ); if ( _isCollapsed() || _isExpanded() ) { _that.toggle(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function expandableClickHandler() {\n this.transition.toggleExpandable();\n this.toggleTargetState( this.ui.target );\n\n if ( this.isAccordionGroup ) {\n if ( this.activeAccordion ) {\n this.activeAccordion = false;\n } else {\n Events.trigger( 'accordionActivated', { target: this } );\n t...
[ "0.76004034", "0.7583129", "0.7339679", "0.69815934", "0.6914435", "0.6612558", "0.65879744", "0.6548188", "0.6546306", "0.6545617", "0.6499138", "0.646178", "0.64534366", "0.64331925", "0.64318967", "0.6428584", "0.6389404", "0.6369375", "0.63276976", "0.63267297", "0.631095...
0.77219176
0
Refresh calculated height of content area.
function _calcHeight() { _contentHeight = _contentAnimated.offsetHeight; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _refreshHeight() {\n if ( _isExpanded() ) {\n _setMaxHeight();\n } else {\n _setMinHeight();\n }\n }", "function updateHeight() {\n\t\t\t\tensureSafeCSS();\n\n\t\t\t\tparent.height(0);\n\t\t\t\tvar height = element[0].scrollHeight;\n\n\t\t\t\tif (height >= initialHeight) ...
[ "0.7374691", "0.72302073", "0.7204299", "0.71705526", "0.68483573", "0.6700464", "0.6686903", "0.6619815", "0.6607083", "0.6605253", "0.65430415", "0.6496274", "0.6496274", "0.6473024", "0.6471744", "0.645", "0.6416585", "0.6366386", "0.6348029", "0.63307476", "0.6278319", ...
0.74233407
0
Reset the height of the Expandables, when e.g. resizing the window.
function _refreshHeight() { if ( _isExpanded() ) { _setMaxHeight(); } else { _setMinHeight(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetHeight()\n\t{\n\t\tthis.height = this.layer.naturalHeight;\n\t\tif(!this.isFullSize())\n\t\t{\n\t\t\tthis.layer.style.height = this.height + \"px\";\n\t\t}\n\t}", "_setPanelHeight() {\n this.calculateAllPanelsHeight();\n }", "update() {\n // Find any already open expandables.\n const openE...
[ "0.710184", "0.68191165", "0.6692742", "0.666153", "0.66231644", "0.64921474", "0.6481762", "0.64654964", "0.6418164", "0.639826", "0.6347407", "0.6328769", "0.6326571", "0.63148475", "0.62642825", "0.62578505", "0.6246488", "0.6242451", "0.6229036", "0.61923355", "0.61846215...
0.7856197
0
Handler for when the mega menu begins expansion. Collapse the global search.
function _megaMenuExpandBegin() { _globalSearch.collapse(); _overlay.classList.remove( 'u-hidden' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _searchExpandBegin() {\n _megaMenu.collapse();\n }", "function collapseDefault() {\n\t\t\t\tif (settings.search == '') {\n\t\t\t\t\tvar id = self.attr('id');\n\n\t\t\t\t\t$(\"#\" + id + \" ul li:has(ul) > div.collapse\").trigger(\n\t\t\t\t\t\t\t'click');\n\t\t\t\t\t$(\"#\" + id + \" ul li:has(ul...
[ "0.8382927", "0.65685815", "0.63542444", "0.63514555", "0.6350291", "0.6229476", "0.60805786", "0.60770524", "0.60170734", "0.59998727", "0.5996291", "0.5995574", "0.59511787", "0.59501165", "0.5946964", "0.59218305", "0.58815825", "0.58467567", "0.58405036", "0.58299094", "0...
0.79135877
1
Handler for when the mega menu ends collapsing. Show an overlay.
function _megaMenuCollapseEnd() { _overlay.classList.add( 'u-hidden' ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseEndHandler() {\n this.ui.content.classList.add( 'u-hidden' );\n}", "onCollapsePopup(event) {\n\t\tif (event.detail == this.collapseSender)\n\t\t\treturn;\n\t\telse\n\t\t\tthis.hideMenu();\n\t}", "function collapse_network_menu(callback){\n\t$('#network-panel-body').addClass('panel-closing');\...
[ "0.6759357", "0.6714397", "0.6621348", "0.65184784", "0.64769834", "0.6467913", "0.64506304", "0.63152343", "0.6311358", "0.6287193", "0.6273284", "0.62363803", "0.62209994", "0.621957", "0.61858165", "0.6181986", "0.61548805", "0.61414653", "0.6135952", "0.61244994", "0.6066...
0.7947804
0
Event handler for when FlyoutMenu expand transition begins. Use this to perform postexpandBegin actions.
function _handleExpandBegin() { this.dispatchEvent( 'expandBegin', { target: this } ); // If it's the desktop view, hide the "Search" button. if ( _isInDesktop() ) { _triggerDom.classList.add( 'u-hidden' ); } _contentDom.classList.remove( 'u-invisible' ); _searchInputDom.select(); d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _handleExpandBegin() {\n this.dispatchEvent( 'expandBegin', { target: this } );\n\n // Set keyboard focus on first menu item link.\n var activeMenuDom = _activeMenu.getDom().content;\n activeMenuDom.classList.remove( 'u-invisible' );\n // TODO: Remove or uncomment when keyboard na...
[ "0.75738066", "0.67198783", "0.6637086", "0.65987575", "0.65571934", "0.6417025", "0.64083415", "0.64026535", "0.6353796", "0.6326423", "0.6307777", "0.62738717", "0.6129074", "0.6114762", "0.61107224", "0.6104255", "0.607783", "0.6055267", "0.6038951", "0.59899783", "0.59344...
0.67237943
1
Event handler for when FlyoutMenu collapse transition begins. Use this to perform postcollapseBegin actions.
function _handleCollapseBegin() { _triggerDom.classList.remove( 'u-hidden' ); document.body.removeEventListener( 'mousedown', _handleBodyClick ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapseEndHandler() {\n this.ui.content.classList.add( 'u-hidden' );\n}", "onCollapse() {}", "function _handleCollapseEnd() {\n // TODO: When tabbing is used to collapse the search flyout\n // it will not animate with the below line.\n // Investigate why this is the case f...
[ "0.6311208", "0.6111821", "0.6082857", "0.5984116", "0.59622157", "0.58585304", "0.5832303", "0.57759565", "0.5764525", "0.5759021", "0.5744498", "0.5698535", "0.5669898", "0.565508", "0.5607311", "0.5553453", "0.5547204", "0.5538398", "0.55121243", "0.54756975", "0.54601634"...
0.6332103
0
Add an event listener to the transition, or call the transition complete handler immediately if transition not supported.
function _addEventListener() { // If transition is not supported, call handler directly (IE9/OperaMini). if ( _transitionEndEvent ) { _dom.addEventListener( _transitionEndEvent, _transitionCompleteBinded ); this.dispatchEvent( BaseTransition.BEGIN_EV...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _addEventListener() {\n // If transition is not supported, call handler directly (IE9/OperaMini).\n if ( _transitionEndEvent ) {\n _dom.addEventListener( _transitionEndEvent,\n _transitionCompleteBinded );\n this.dispatchEvent( BaseTransition.BEGIN_EV...
[ "0.72027713", "0.6305932", "0.62090176", "0.62090176", "0.62090176", "0.61808175", "0.61808175", "0.61808175", "0.61808175", "0.6147155", "0.6015499", "0.6015499", "0.6015499", "0.6015499", "0.57928044", "0.5766942", "0.5703476", "0.56915414", "0.56691694", "0.5631523", "0.53...
0.7181224
1
Remove an event listener to the transition.
function _removeEventListener() { _dom.removeEventListener( _transitionEndEvent, _transitionCompleteBinded ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _removeEventListener() {\n _dom.removeEventListener( _transitionEndEvent, _transitionCompleteBinded );\n }", "removeChangeListener(listener) {\n this.removeListener(EVENT_CHANGE, listener);\n }", "function removeTransition(event) {\n event.target.style.transition = null;\n}", "function remo...
[ "0.7838953", "0.74047256", "0.72499186", "0.7213842", "0.7072367", "0.7072367", "0.7072367", "0.7072367", "0.7072367", "0.7009292", "0.7009292", "0.7009292", "0.7009292", "0.7006524", "0.69288373", "0.6901751", "0.68768233", "0.67834204", "0.6780263", "0.6768174", "0.6762141"...
0.7823485
1
Handle the end of a transition.
function _transitionComplete() { _removeEventListener(); this.dispatchEvent( BaseTransition.END_EVENT, { target: this } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _transitionComplete() {\n this.dispatchEvent( BaseTransition.END_EVENT, { target: this } );\n }", "function _transitionComplete() {\n _removeEventListener();\n this.dispatchEvent( BaseTransition.END_EVENT, { target: this } );\n }", "transitionCompleted() {\n // Implement if n...
[ "0.78884625", "0.7532352", "0.7529183", "0.7508275", "0.73918307", "0.7374426", "0.7374426", "0.7374426", "0.7352981", "0.7350636", "0.7350636", "0.7350636", "0.7257454", "0.7225494", "0.70468175", "0.70418435", "0.70418435", "0.6989723", "0.6981671", "0.696578", "0.696578", ...
0.75350046
1
Empty function that will do nothing. A usecase is when an object has empty functions used for callbacks, which are meant to be overridden with functionality, but if not, noopFunct will fire and do nothing instead. e.g. callback.onComplete = standardType.noopFunct;
function noopFunct() { // Placeholder function meant to be overridden. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emptyCallback(){}", "function noCallback() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction() {}", "function emptyFunction...
[ "0.7665035", "0.7324956", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", "0.72813547", ...
0.73580647
1
Handle the end of a transition.
function _transitionComplete() { this.dispatchEvent( BaseTransition.END_EVENT, { target: this } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _transitionComplete() {\n _removeEventListener();\n this.dispatchEvent( BaseTransition.END_EVENT, { target: this } );\n }", "function _transitionComplete() {\n _removeEventListener();\n this.dispatchEvent( BaseTransition.END_EVENT, { target: this } );\n }", "transitionCompleted() {...
[ "0.75350046", "0.7532352", "0.7529183", "0.7508275", "0.73918307", "0.7374426", "0.7374426", "0.7374426", "0.7352981", "0.7350636", "0.7350636", "0.7350636", "0.7257454", "0.7225494", "0.70468175", "0.70418435", "0.70418435", "0.6989723", "0.6981671", "0.696578", "0.696578", ...
0.78884625
0
Handle resizing of the window, suspends or resumes the mobile or desktop menu behaviors.
function _resizeHandler() { if ( _isInDesktop() ) { _mobileNav.suspend(); _desktopNav.resume(); } else { _desktopNav.suspend(); _mobileNav.resume(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _handleWindowResize() {\n _gameController.handleResize();\n }", "function handleResizing() {\n opts.resizeFn = function() {\n positionMenu(element, opts);\n };\n angular.element($window).on('resize', opts.resizeFn);\n angular.element($window).on('orientationchang...
[ "0.7364216", "0.73630893", "0.72081345", "0.711151", "0.711151", "0.70662796", "0.6997716", "0.6988849", "0.6968893", "0.6958704", "0.69357765", "0.6934651", "0.6934651", "0.6934651", "0.6934651", "0.6934651", "0.6934651", "0.6934651", "0.69226134", "0.6919287", "0.69179684",...
0.8583127
0
Event handler for when root menu expand transition begins.
function _handleRootExpandBegin() { this.dispatchEvent( 'rootExpandBegin', { target: this } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _handleExpandBegin() {\n this.dispatchEvent( 'expandBegin', { target: this } );\n\n // Set keyboard focus on first menu item link.\n var activeMenuDom = _activeMenu.getDom().content;\n activeMenuDom.classList.remove( 'u-invisible' );\n // TODO: Remove or uncomment when keyboard na...
[ "0.74288595", "0.6754719", "0.67374533", "0.6681151", "0.6597242", "0.65809155", "0.65760165", "0.64859563", "0.64595485", "0.6452797", "0.63690215", "0.6314298", "0.62971246", "0.6278303", "0.62314695", "0.6229371", "0.62188524", "0.62145025", "0.6213008", "0.62087107", "0.6...
0.7837585
0
Event handler for when root menu collapse transition ends.
function _handleRootCollapseEnd() { this.dispatchEvent( 'rootCollapseEnd', { target: this } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _collapseEnd() {\n _isAnimating = false;\n if ( _collapseTransition ) {\n _collapseTransition\n .removeEventListener( BaseTransition.END_EVENT, _collapseEndBinded );\n }\n this.dispatchEvent( 'collapseEnd', { target: this, type: 'collapseEnd' } );\n }", "function _...
[ "0.7135188", "0.71292114", "0.6942815", "0.6911009", "0.67611295", "0.6724756", "0.65748554", "0.626375", "0.6214326", "0.618737", "0.61710775", "0.6159928", "0.61594737", "0.61367315", "0.6104656", "0.6086173", "0.6086173", "0.6077235", "0.6070026", "0.6042674", "0.5974751",...
0.7690333
0
Event handler for when FlyoutMenu expand transition begins. Use this to perform postexpandBegin actions.
function _handleExpandBegin() { this.dispatchEvent( 'expandBegin', { target: this } ); // Set keyboard focus on first menu item link. var activeMenuDom = _activeMenu.getDom().content; activeMenuDom.classList.remove( 'u-invisible' ); // TODO: Remove or uncomment when keyboard navigation is...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _handleExpandBegin() {\n this.dispatchEvent( 'expandBegin', { target: this } );\n // If it's the desktop view, hide the \"Search\" button.\n if ( _isInDesktop() ) { _triggerDom.classList.add( 'u-hidden' ); }\n _contentDom.classList.remove( 'u-invisible' );\n _searchInputDom.select...
[ "0.67237943", "0.67198783", "0.6637086", "0.65987575", "0.65571934", "0.6417025", "0.64083415", "0.64026535", "0.6353796", "0.6326423", "0.6307777", "0.62738717", "0.6129074", "0.6114762", "0.61107224", "0.6104255", "0.607783", "0.6055267", "0.6038951", "0.59899783", "0.59344...
0.75738066
0
For each champion, load each spell into an array and analyze it
function processData(){ for (var i=0; i<$scope.champions.length; i++){ for (var j=0; j<$scope.champions[i].spells.length; j++){ var spell = $scope.champions[i].spells[j]; ratios(spell); effects(spell); evaluate(spell); spell.champ = $scope.champions[i].name; $scope.spells.push(spell); } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initSpells() {\n\tvar i, x, b, n, t, p, j, Spells,\n\t\tgetSpellObj = function() {\n\t\t\treturn {\n\t\t\t\twords: [], exp: [], exph: [], ihash: [], img: [], imgn: [], name: [], theme: [], tmax: [],\n\t\t\t\tsage: false, notxt: false, noimg: false, trip: false\n\t\t\t};\n\t\t};\n\tpSpells = getSpellObj();...
[ "0.5992819", "0.5516566", "0.54862237", "0.5397386", "0.539652", "0.53915554", "0.53867376", "0.53226304", "0.5299576", "0.5269253", "0.52328944", "0.521493", "0.5180256", "0.5172261", "0.5147351", "0.5144757", "0.51213044", "0.5120668", "0.5104609", "0.50940746", "0.5093468"...
0.6287388
0
Assign the AD/AP/etc ratios of spells
function ratios(spell){ spell.ad = 0; spell.ap = 0; spell.bonusAd = 0; spell.mana = 0; var result = ""; var existingRatios = []; if (spell.vars){ for (var i=0; i<spell.vars.length; i++){ parseRatio(spell.vars[i].link, spell.vars[i].coeff[0], spell); } if (spell.ad > 0) result += "(+ " + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function evaluate(spell){\n\t\t// API provides some wrong ranges\n\t\tif (spell.name == \"Wild Cards\")\n\t\t\tspell.range = 1450;\n\t\tif (spell.name == \"Decimating Smash\")\n\t\t\tspell.range = 800;\n\n\t\tspell.base = 0;\n\t\tvar multiplier = 0;\n\t\tvar val = 0;\n\t\tvar range = spell.range[0];\n\t\tvar cd;\n...
[ "0.61668396", "0.5856655", "0.56808674", "0.56548315", "0.55808127", "0.55572474", "0.55416805", "0.5503528", "0.54962164", "0.5486324", "0.546705", "0.5457883", "0.5439035", "0.543588", "0.5406429", "0.53982246", "0.5397517", "0.5396032", "0.53623366", "0.5359937", "0.535379...
0.6990761
0
Assign the correct type of ratio to a spell
function parseRatio(str, coeff, spell){ switch(str){ case "spelldamage": spell.ap = coeff; break; case "attackdamage": spell.ad = coeff; break; case "bonusattackdamage": spell.bonusAd = coeff; break; case "mana": spell.mana = coeff; break; default: return false; } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ratios(spell){\n\t\tspell.ad = 0;\n\t\tspell.ap = 0;\n\t\tspell.bonusAd = 0;\n\t\tspell.mana = 0;\n\t\tvar result = \"\";\n\t\tvar existingRatios = [];\n\t\tif (spell.vars){\n\t\t\tfor (var i=0; i<spell.vars.length; i++){\n\t\t\t\tparseRatio(spell.vars[i].link, spell.vars[i].coeff[0], spell);\n\t\t\t}\n\n...
[ "0.6548937", "0.5669409", "0.557548", "0.557356", "0.5433251", "0.5431281", "0.5347682", "0.5296638", "0.5254722", "0.5221374", "0.5219749", "0.51495475", "0.51430357", "0.51422167", "0.5129112", "0.51081157", "0.50912803", "0.5076699", "0.5067715", "0.5062495", "0.5062254", ...
0.6627541
0
Assign a spell its effects based on given effect labels Categories are damage, heal, shield, and crowd control It was difficult to properly assign every single effect for every spell because effects were index in different patterns for various spells The most common pattern was the effect label (in spell.leveltip.label...
function effects(spell){ var dmgLabels = ["Damage" , "Damage ", "Bonus Damage", "Base Damage", "Current Health %", "Bonus Magic Damage", "Magic Damage", "Bite Damage", "Percent Maximum Health Damage", "Minimum Damage", "Primary Damage", "True Damage", "Total Damage", "Explosion Damage", "Damage per Second", "Damage P...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EffectsManager(data,element){var effects=data.ef||[];this.effectElements=[];var i;var len=effects.length;var effectItem;for(i=0;i<len;i+=1){effectItem=new GroupEffect(effects[i],element);this.effectElements.push(effectItem);}}", "_createEffectController() {\n const { effects } = this.props;\n this...
[ "0.5882863", "0.58318454", "0.57796884", "0.5776214", "0.5776214", "0.57316667", "0.5665173", "0.5475766", "0.5453181", "0.54524106", "0.54456335", "0.54371524", "0.5430868", "0.5419879", "0.54112107", "0.54089284", "0.540635", "0.540635", "0.540635", "0.540635", "0.540635", ...
0.8036112
0
Calculate the efficiency rating of a spell
function evaluate(spell){ // API provides some wrong ranges if (spell.name == "Wild Cards") spell.range = 1450; if (spell.name == "Decimating Smash") spell.range = 800; spell.base = 0; var multiplier = 0; var val = 0; var range = spell.range[0]; var cd; var cost; // Get base values for effec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ratios(spell){\n\t\tspell.ad = 0;\n\t\tspell.ap = 0;\n\t\tspell.bonusAd = 0;\n\t\tspell.mana = 0;\n\t\tvar result = \"\";\n\t\tvar existingRatios = [];\n\t\tif (spell.vars){\n\t\t\tfor (var i=0; i<spell.vars.length; i++){\n\t\t\t\tparseRatio(spell.vars[i].link, spell.vars[i].coeff[0], spell);\n\t\t\t}\n\n...
[ "0.6679916", "0.639298", "0.6325458", "0.61893266", "0.60917455", "0.60837454", "0.6057195", "0.6057195", "0.5978523", "0.59360147", "0.591627", "0.5912947", "0.5910208", "0.5880944", "0.586103", "0.5838555", "0.5823059", "0.57411253", "0.57399404", "0.5729699", "0.5727764", ...
0.7165167
0
generate_crypto: crypto.randomBytes() used to be slow ~50 MB/sec BUT it is no longer so... The speed of this mode is ~2000 MB/sec.
generate_crypto(size) { return crypto.randomBytes(size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateCryptoKey() {\n rbuff = rbytes.randomBytes(16);\n return rbuff.toHex().toString();\n}", "function makesalt(){\n return crypto.randomBytes(16).toString('base64');\n}", "generateKey () {\n return crypto.randomBytes(NONCE_LENGTH).toString('base64');\n }", "function getRandomFromCry...
[ "0.75375307", "0.7342403", "0.71352965", "0.7091861", "0.69698894", "0.6911986", "0.69073737", "0.68796736", "0.68796736", "0.68796736", "0.68796736", "0.68796736", "0.6856902", "0.6782083", "0.67674947", "0.67227054", "0.67208356", "0.6703648", "0.6697747", "0.6697747", "0.6...
0.8384928
0
generate_fake: we randomize one big buffer and use it multiple times by picking random offsets inside it and slice bytes from that offset. fake_factor limits the bytes a random buffer yields before being regenerated. The larger it gets the less resistent it is against dedup. The overall expected speed can be calculated...
generate_fake(size) { if (!this.fake_buf || this.fake_bytes > this.fake_limit) { // The length of the slices returned are fixed and quite small. // Setting to small KB to avoid dedup in the scale of 256 KB. // The smaller it gets the more impact it imposes on // t...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bufsize() { return rnd(ARRAY_SIZE) * Random.index(smallPowersOfTwo); }", "function bufsize() { return rnd(ARRAY_SIZE) * Random.index(smallPowersOfTwo); }", "function bufsize() { return rnd(ARRAY_SIZE) * Random.index(smallPowersOfTwo); }", "function bufsize() { return rnd(ARRAY_SIZE) * Random.index(s...
[ "0.6292264", "0.6292264", "0.6292264", "0.6292264", "0.6292264", "0.6126526", "0.6126526", "0.6126526", "0.6082258", "0.6042177", "0.600682", "0.5910724", "0.58246154", "0.5809522", "0.5793603", "0.57888764", "0.57743084", "0.5761736", "0.5761736", "0.5761736", "0.5761736", ...
0.83061177
0
generate_zeros: The speed of this mode is ~7000 MB/sec.
generate_zeros(size) { return Buffer.alloc(size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zeros(n) {\n return repeatit(n,0);\n}", "function zerobug() {\n return Math.floor(10000000 + Math.random() * 90000000);\n }", "function zeros(x) { var r = new Array(x); for (var i = 0; i < x; ++i) { r[i] = 0; } return r; }", "function generate_zero_based(ones, zeros) {\n\n if (zero...
[ "0.7147532", "0.66752493", "0.66685295", "0.6662886", "0.65458035", "0.6481633", "0.6421485", "0.6386138", "0.63550115", "0.6340238", "0.6221028", "0.61931884", "0.612083", "0.60807973", "0.60111403", "0.6006996", "0.5989392", "0.58937025", "0.5892341", "0.5892341", "0.589234...
0.7543247
0
generate_fill: The speed of this mode is ~7000 MB/sec.
generate_fill(size) { return Buffer.alloc(size, crypto.randomInt(0, 256)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillScreen() {\n var x = canvas.width - GRID_SIZE;\n var y = canvas.height - GRID_SIZE;\n var fill = setInterval(function() {\n while (x >= -GRID_SIZE) {\n switch (Math.floor(Math.random() * 7)) {\n case 0: ctx.drawImage(rodImg, x, y); break;\n case 1: ctx.drawImage(squareImg, ...
[ "0.62977487", "0.6283768", "0.6177048", "0.6177048", "0.616902", "0.61601955", "0.61373335", "0.61155957", "0.6064388", "0.5994436", "0.59875757", "0.59711444", "0.59655195", "0.59270513", "0.58534604", "0.58416504", "0.5796823", "0.5731003", "0.5720372", "0.57050294", "0.569...
0.66821426
0
generate_noinit: Just allocates memory, no initialization. Do not use if your process memory might contain sensitive data. The speed of this mode is ~100,000 MB/sec.
generate_noinit(size) { return Buffer.allocUnsafe(size); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cw_generationZero() {\n\n generationState = manageRound.generationZero(generationConfig());\n}", "generate_zeros(size) {\n return Buffer.alloc(size);\n }", "generate() {}", "function genInitialize() {\n return Promise.resolve();\n}", "function init() {\n //no-op\n}", "function init(...
[ "0.6127078", "0.5970919", "0.58055943", "0.57464236", "0.5730457", "0.5730457", "0.5730457", "0.568777", "0.55714595", "0.5519625", "0.5367798", "0.5329582", "0.529018", "0.52768844", "0.52649313", "0.52649313", "0.5247055", "0.52177763", "0.5215961", "0.52120155", "0.5194241...
0.7064778
0
method to set transition time and imagewrapper width
setCss() { //! GIVING WIDTH TO IMAGE WRAPPER var width = this.imageLength * this.imageWidth + 'px'; this.domElements.imageWrapper.style.width = width; this.domElements.imageWrapper.style.transition = `all ${this.transitionTime}s ease-in`; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set fadeTransitionWidth(value) {}", "function dzoomImg() {\n img.style.width='500px';\n}", "function resizeImage(x,y){\n\n // var imgdom= document.getElementById(x.id);\n // imgdom.style.width=\"700px\";\n // imgdom.style.width=\"700px\"; \n\n var imgdom=document.getElementById(...
[ "0.67600113", "0.6569919", "0.6463916", "0.64402187", "0.64161164", "0.6322847", "0.6210425", "0.62099475", "0.6168195", "0.60974294", "0.6088723", "0.6084724", "0.6076519", "0.6044826", "0.6032476", "0.59755695", "0.5974462", "0.5967632", "0.596407", "0.59621245", "0.5960427...
0.75108975
0
methods for increasing / decreasing flag values
flagIncrement(flag) { if (flag == 'slideShowFlag') { this.slideShowFlag = (this.slideShowFlag + 1) % this.imageLength; } if (flag == 'buttonFlag') { this.buttonFlag = (this.buttonFlag + 1) % this.imageLength; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeBy(val){\r\n \r\n counterValue=counterValue+val;\r\n }", "function countUpAndDown () {}", "function increment(val) {return val + 1;}", "static get flagStates() {\n return { auto: 0, up: 1, down: 2 };\n }", "_keyIncrementDecrement(action, preValue) {\n ...
[ "0.6127148", "0.61157817", "0.59748846", "0.59653056", "0.5763982", "0.5723411", "0.5682249", "0.5677011", "0.5655023", "0.56464714", "0.56363404", "0.5588341", "0.55800265", "0.5565012", "0.5525786", "0.5515328", "0.5497942", "0.54929316", "0.5490941", "0.5481215", "0.546388...
0.6565989
0
radix works by sorting elements of an array in a bucket of their place values
function radixSort(arr){ // figure out how many digit the largest number has // Loop from k= o upto this largest // For each iteration of the loop // create buckets for each digit(0 to 9) // place each number in the corresponding buckets based on its kth digit // Replace out existin...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function radixSort(arr) {\n // Get the largest number of digits in the array\n const radix = mostDigits(arr);\n // Start a loop according to the largest number of digits\n for(let n = 0; n < radix; n++) {\n console.log(`Pass #${n + 1}`);\n // Create a bucket for each digit (0 to 9)\n const buckets ...
[ "0.7855322", "0.78091156", "0.779924", "0.77312183", "0.772155", "0.7640911", "0.76380694", "0.7608295", "0.7540699", "0.7536394", "0.75157547", "0.7456152", "0.7395316", "0.7309503", "0.7269923", "0.7251019", "0.7246882", "0.7235121", "0.7234225", "0.7200838", "0.7135596", ...
0.78561085
0
function only adds class="unsunken" if the ship has not been hit
function revealShips(id) { //selects element with ID and checks to see if it has been sunken if($("#" + id).attr("class") != "hit") { //adds class of unsunken to reveal after user loses $("#" + id).addClass("unsunken"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showShips(arr) {\n //for all the items in the list add it to the board\n for (let i = 0; i < arr.length; i++) {\n $(\"#game-board-right #\" + arr[i]).addClass('occupied');\n }\n\n //for all the other squares show the miss for stimulating an ocean (blue)\n let selector = \"#game-board...
[ "0.6843529", "0.6607992", "0.6567227", "0.604425", "0.60324943", "0.5959725", "0.58999425", "0.58697474", "0.5864147", "0.57733095", "0.57730985", "0.57453364", "0.571126", "0.5691849", "0.5678397", "0.56769043", "0.5645925", "0.56199926", "0.5599974", "0.5584205", "0.5583483...
0.66187847
1
end of function Purpose: checks to see if there is a ship left or right of a location Signature: receives rowIndex and columnIndex;returns true if there is adjacent
function checkHorizontally(rowIndex, columnIndex) { //if column index is 1-8 if(columnIndex > 0 && columnIndex < 9) { //check left or right has a ship // alert("board[rowIndex][columnIndex + 1]:" + rowIndex + " " + (columnIndex + 1) + " "+ board[rowIndex][columnIndex + 1]); // alert("board[rowIndex][col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkDiagonally(rowIndex,columnIndex) {\n //if row index is 1-8\n if(rowIndex > 0 && rowIndex < 9 && columnIndex > 0 && columnIndex < 9) {\n //check above or below has a ship\n if(board[rowIndex - 1][columnIndex - 1] === 0 || board[rowIndex + 1][columnIndex - 1 ] === 0 || board[rowIndex - 1][colum...
[ "0.7829235", "0.7105348", "0.70368207", "0.70063895", "0.6959137", "0.69564474", "0.6880707", "0.68394035", "0.6821", "0.676792", "0.6750688", "0.6664933", "0.6633885", "0.65898484", "0.65796334", "0.6559979", "0.6556346", "0.65231043", "0.6519045", "0.6518005", "0.6515924", ...
0.77203655
1
Purpose: creates coordinates of entire ship Signature: receives a number that represents ship length, returns array of coordinates that represent the ship
function createShip(lengthOfShip) { // var shipCoordinates = []; var c, d; var orientation = isHorizontal(); console.log("isHorizontal: " + orientation); do { //generates the coordinates of ship c = Math.floor(Math.random()*10); d = Math.floor(Math.random()*10); console.log("ship at: " + c + d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createInitialShips() {\n\n entityManager.generateShip({\n cx : 300,\n cy : 550\n });\n \n}", "function shipReport() {\n\tlet shipArray = [];\n\tlet alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n\tlet westColumn = GRID.length/2 - 1;\n\tlet eastColumn = GRID.length/2;\n\tf...
[ "0.6073797", "0.6014596", "0.5970196", "0.58730966", "0.58699495", "0.5842005", "0.5833652", "0.57756424", "0.56868804", "0.5672399", "0.5668653", "0.5666368", "0.5640814", "0.5635491", "0.560249", "0.5578574", "0.5573196", "0.55212593", "0.55042356", "0.5494627", "0.54935354...
0.70091766
0
Go through the array of newsapps using a scraper that uses the apps id to retrive reviews from the play store website
function iterateAppReviews() { appIdArray.forEach(function(appId) { var results = googlePlayScraper.reviews({ appId: appId.id, page:0, sort: googlePlayScraper.sort.NEWEST }) .then(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrapePlayStoreAppReviews(play_store_apps, num_pages_to_retrieve){\n\n for (let i = 0; i < play_store_apps.length; i++) {\n \n const app = play_store_apps[i];\n var promises = [];\n console.log(app);\n\n // All the promises for a single app\n for (let page = 0;...
[ "0.70167214", "0.68868655", "0.68091124", "0.62622225", "0.61681646", "0.61598027", "0.60108757", "0.5884752", "0.58741033", "0.58253723", "0.56703097", "0.5657182", "0.5644205", "0.56332237", "0.5629762", "0.5629001", "0.5604295", "0.5596551", "0.55577505", "0.55325615", "0....
0.7172901
0
green for good reviews , yellow for meh review, red for bad reviews
function getReviewColor(score) { var parsedScore = parseInt(score); switch (parsedScore) { case 5: case 4: return '#2ECC71'; break; case 3: return '#FFFF33'; case 2: case 1: return '#BB1919'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function colour(text, isGood) {\n return '<span class=\"' + ((isGood)? 'correct':'incorrect') + '\">' + text + '</span>';\n}", "get color() {\n if (this.flagged) {\n return \"commented\"\n } else if (this._color) {\n return this._color\n } else if (!this._title) {\n return \"blank\"\n ...
[ "0.6893624", "0.67448443", "0.660533", "0.6406765", "0.63565964", "0.63418376", "0.63376", "0.63321614", "0.62662876", "0.62592626", "0.6253826", "0.6225364", "0.617208", "0.6168814", "0.61657", "0.61488587", "0.6129388", "0.60749274", "0.6063393", "0.6055986", "0.6046566", ...
0.68803704
1
Close connection to blockchain and remove any related callbacks
closeConnectionToBlockchain() { Apis.close(); // Increment the index for the next connection attempt this.blockchainUrlIndex++; // Reset the index if we've gone past the end. if (this.blockchainUrlIndex >= this.blockchainUrls.length) { this.blockchainUrlIndex = 0; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_cleanup() {\n if (this.connections) {\n for (let peer of Object.keys(this.connections)) {\n this._cleanupPeer(peer);\n }\n }\n this.emit(Peer.EVENTS.close.key);\n }", "close (callback = () => {}) {\n debug('Closing connection', this.id)\n if (this._openRequests > 0) {\n set...
[ "0.7331053", "0.71342975", "0.7102415", "0.7091125", "0.70220715", "0.69850737", "0.6885539", "0.6856896", "0.6815346", "0.6750334", "0.6708656", "0.6669394", "0.6668861", "0.6658551", "0.6651256", "0.6630589", "0.66274166", "0.6570696", "0.65317976", "0.65212953", "0.6516695...
0.7350439
0
Takes canvas context and array of objects containing x and y properties as point coordinates shape parm sets fill color. Use shapeType object properties If optional 4th parm (newShape) is true, the shape will be saved to the shapeArr so it will be redrawn during animation
function shapeFromPoints(context, ptArr, shape, newShape) { context.beginPath(); context.moveTo(ptArr[0].x, ptArr[0].y); for (i=0; i<ptArr.length; i++){ //console.log(ptArr[i]); context.lineTo(ptArr[i].x, ptArr[i].y); context.strokeStyle = jackOLantern.colors.inside; context.stroke(); } conte...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawshape(context, shape, fill) {\n context.fillStyle = fill;\n \n context.fillRect(shape.x,shape.y,shape.w,shape.h);\n}", "function addShape(baseX, baseY) {\r\n var shape = shapeSelect.options[shapeSelect.selectedIndex].value;\r\n\tvar colour = colourSelect.options[colourSelect.selectedIndex].val...
[ "0.673886", "0.6412948", "0.63945705", "0.63191557", "0.6311577", "0.6285085", "0.6281616", "0.62697756", "0.6236851", "0.6228568", "0.6214453", "0.62048256", "0.6183096", "0.6133711", "0.5973481", "0.596884", "0.5948361", "0.58975303", "0.5825051", "0.5814895", "0.5795004", ...
0.64605445
1
functions for invoicedetails.jsp For Listing Cart Items
function list_cart_items() { var location_id = CheckNumeric(document.getElementById("txt_location_id").value); var status = document.getElementById("txt_status").value; var cart_session_id = CheckNumeric(document.getElementById("txt_session_id").value); // From po,git,grn To git,grn,pr var vouch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list_cart_items() {\r\n\tvar location_id = CheckNumeric(document.getElementById(\"txt_location_id\").value);\r\n\tvar status = document.getElementById(\"txt_status\").value;\r\n\tvar cart_session_id = CheckNumeric(document .getElementById(\"txt_session_id\").value);\r\n\t// From po,git,grn To git,grn,pr\r...
[ "0.7129839", "0.6577732", "0.652439", "0.6411314", "0.6337768", "0.62951654", "0.6265207", "0.6256584", "0.6242257", "0.6237886", "0.6205591", "0.6185577", "0.61799353", "0.6167478", "0.6148176", "0.6148084", "0.6124477", "0.61060154", "0.60864246", "0.60786694", "0.6071028",...
0.72497416
0
price should'nt be less than the base price
function CheckBasePrice() { var para = 1; var base_price = parseFloat(document.getElementById("txt_item_baseprice").value); // alert("base_price=="+base_price); var uom_ratio = parseFloat(document.getElementById("uom_ratio").value); var alt_qty = parseInt(CheckNumeric(document.getElementById('txt_item_qty').v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function baseCheck(){\n\tif (basePrice > 0) {\n\t\tbasePrice = 0;\n\t}\n}", "function priceExceed() {\n if (priceInput > 1) {\n alert(\"Price must be from 0 to 1.\");\n } else {\n return;\n }\n }", "function CheckBasePrice() {\r\n\tvar para = 1;\r\n\tvar base_price =...
[ "0.7608884", "0.647147", "0.64678526", "0.63261116", "0.628063", "0.6255992", "0.6250851", "0.6247142", "0.62372386", "0.62358797", "0.62083906", "0.62021655", "0.6165537", "0.6150861", "0.6121945", "0.61172223", "0.6102855", "0.6083386", "0.60729146", "0.6063552", "0.6031533...
0.6477634
1
readFull returns a Promise that resolves to the contents of the entire stream.
function readFull(stream) { return new Promise((resolve, reject) => { var content = ''; stream.on('data', (buf) => { content += buf.toString(); }); stream.on('end', () => { resolve(content) }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "readAll(): Promise\n\t{\n\t\treturn this.#readService.readAll();\n\t}", "async readFromStream(buffer, offset, length) {\r\n const readBuffer = this.s.read(length);\r\n if (readBuffer) {\r\n buffer.set(readBuffer, offset);\r\n return readBuffer.length;\r\n }\r\n e...
[ "0.61276156", "0.5974687", "0.59083295", "0.5838321", "0.57267284", "0.56652886", "0.5645529", "0.56058437", "0.5595905", "0.5595905", "0.558473", "0.5563637", "0.5555947", "0.5531033", "0.5499479", "0.54916096", "0.54879475", "0.5480009", "0.54793644", "0.54576874", "0.54305...
0.7968649
0
Adds a username and password pair to nsILoginManager for the YouSendIt provider instance to retrieve. This may fail if a password already exists for aUserrname.
function remember_ysi_credentials(aUsername, aPassword) { let loginInfo = Cc["@mozilla.org/login-manager/loginInfo;1"] .createInstance(Ci.nsILoginInfo); loginInfo.init(kServerURL, null, kServerURL, aUsername, aPassword, "", ""); Services.logins.addLogin(loginInfo); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPasswordImpl(hostname, username, password, formSubmitURL, usernameField, passwordField) {\r\n if (\"@mozilla.org/passwordmanager;1\" in Components.classes) {\r\n return PasswordManager.addEntry(hostname, username, password, formSubmitURL, usernameField, passwordField);\r\n }\r\n else if (\"@mozil...
[ "0.5263855", "0.5099546", "0.50862294", "0.507098", "0.5052425", "0.5003372", "0.49975902", "0.49820107", "0.49695066", "0.49492517", "0.4907481", "0.4855335", "0.48447466", "0.48256287", "0.48120442", "0.4809588", "0.48074573", "0.4796326", "0.4768562", "0.47582096", "0.4752...
0.53602767
0
Given the object, if there's any property that is an array perform a cleanup
function cleanupObj(inputObj) { if (typeof inputObj != 'object') { return; } for (var objProp in inputObj) { if (inputObj.hasOwnProperty(objProp)) { var varObj = inputObj[objProp]; if (varObj != null) { // Don't do anything if object is nul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static cleanup(obj, exclude) {\n if (obj) {\n if (Array.isArray(obj)) {\n let i = obj.length - 1;\n while (i >= 0) {\n if (obj[i] === null\n || obj[i] === undefined\n || (typeof obj[i] === 'string' && obj[i].trim().length === 0)\n || (Array.isAr...
[ "0.7187125", "0.66895336", "0.6664698", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.6528889", "0.65001523", "0.61990815", "0.60335577", "0.60142994", "0.5994083", "0.5904172", "0.5861113"...
0.7139173
1
e.g. input: inputStr="aName_29" output: return "29"
function getArrayIndex(inputStr) { var splitPos = inputStr.indexOf("_"); return inputStr.substring(splitPos + 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeIdentifier(str) {\n var parts = str.split(/\\W+/).filter(Boolean);\n // filter(Boolean) removes empty parts\n var initial = parts[0];\n if (/[0-9]/.test(initial.charAt(0))) initial = \"_\" + initial;\n var res = [ initial.toLowerCase() ];\n return [ lowerize(initial) ].concat(parts.slice(1).ma...
[ "0.65471727", "0.6536534", "0.6440434", "0.6357335", "0.6346239", "0.6306601", "0.6265214", "0.62536615", "0.61978894", "0.61978894", "0.61978894", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592", "0.6179592"...
0.6699823
0
Get the index number from a 'Grid Field'. A grid field is field with an annotation in such format: exp='sample.obj_29.myValue' or exp='obj_29.myValue' If it's an invalid exp, it returns null. e.g.1, input: inputStr="sample.obj_29.myValue", valid format output: return "29" e.g.2, input: inputStr="sample.obj_.myValue", i...
function getIndexFromGridField(inputStr) { var indexNumber = 0; if (inputStr == null) { return null; } var splitPos = inputStr.indexOf("_"); if (splitPos < 0) { return null; } // There's a _ in the bind name // Now find the . after the _ var dotPos = in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function indexToId(num) {\n var fieldId;\n if (num === 0) {\n fieldId = 'top-left';\n } else if (num === 1) {\n fieldId = 'top-mid';\n } else if (num === 2) {\n fieldId = 'top-right';\n } else if (num === 3) {\n fieldId = 'mid-left';\n ...
[ "0.5863212", "0.5798662", "0.5776061", "0.566569", "0.5418491", "0.53529036", "0.5326788", "0.53153396", "0.5309575", "0.5288018", "0.5269725", "0.5188708", "0.5123712", "0.50850904", "0.5076247", "0.50565284", "0.5007946", "0.50015604", "0.49870202", "0.49670964", "0.4917031...
0.78936094
0
get a element all attributes and add header "elemAttr" for converting to static element
function getAttrForStatic(elem) { var attrs = obtainAttr(elem); return "elemAttr=\"" + attrs + "\""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAttr(ele = targetelement){\n let temp = {};\n let arr = [];\n let attrlist = ele.attributes;\n for(var i=0; i< attrlist.length; i++){\n if(attrlist[i].name != 'href' && attrlist[i].name.match('ng-') == null && attrlist[i].name != 'labelkey' &&...
[ "0.66680765", "0.629124", "0.6285939", "0.62328887", "0.61365366", "0.61113334", "0.59798914", "0.59716636", "0.5950769", "0.5892194", "0.58857536", "0.5885066", "0.5875427", "0.5871607", "0.58542", "0.58282083", "0.58282083", "0.58282083", "0.58282083", "0.58282083", "0.5828...
0.68289757
0