Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Return an informative window of a game for when the marker is clicked
createInfoWindowContent(game) { return ( '<div id="content">' + '<div id="siteNotice" />' + '<h1 id="firstHeading" class="firstHeading">' + game.sport + '</h1>' + '<div id="bodyContent">' + '<div>Name: ' + game.name + '</div>' +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showInfoWindow() { \n currentmarker = this;\n infoWindow.open(map, currentmarker);\n buildIWContent();\n\n}", "function showInfoWindow(marker)\n {\n google.maps.event.trigger(markers[marker], 'click');\n }", "onMarkerClick(props, marker, e) {\n this.setState({\n s...
[ "0.6857713", "0.68271863", "0.6769627", "0.6733751", "0.6694183", "0.64951986", "0.6476939", "0.64315325", "0.63748634", "0.6353913", "0.63149524", "0.6295933", "0.62912464", "0.6288711", "0.6281382", "0.6276283", "0.6273798", "0.626335", "0.6254926", "0.6252514", "0.6243387"...
0.0
-1
Reload the map and alert the parent that a new game has been created
reload() { if (this.onNewGame != undefined) { this.onNewGame(); } this.retrieveNearbyGames(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newGame() {\n location.reload();\n }", "function newGame() {\n location.reload();\n}", "function newGame() {\n location.reload();\n}", "function newGame() {\n location.reload();\n}", "function newGame(){\r\n location.reload();\r\n}", "function newGame()\r\n{\r\n location.reload();\r\n}", "...
[ "0.7132644", "0.7082004", "0.7033768", "0.7033768", "0.70167524", "0.70111394", "0.6719635", "0.67142916", "0.66456354", "0.65942943", "0.65789735", "0.6560348", "0.6536099", "0.651395", "0.6506516", "0.6497099", "0.64936984", "0.6463811", "0.64620024", "0.6461185", "0.643693...
0.72910124
0
Display the map and CurrentGames object
render() { if (navigator.geolocation) { return ( <div> <NavBar user={this.props.user}/> <div className="Map"> <h1>Games near you</h1> <div ref="mapContainer" style={{width: "30%", float: "left"}}> <div ref="map" sty...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n debugMap(map, 10, 20);\n }", "function displayJSONwithMap() {\n\tbio.display();\n\twork.display();\n\tprojects.display();\n\teducation.display();\n\t\n\t// insert the Google may that was provided by Cameron and James.\n\t$(\"#mapDiv\").append(googleMap);\n\t\n\t// insert a class n...
[ "0.6607605", "0.65627825", "0.651884", "0.65092885", "0.6495533", "0.6488505", "0.6446976", "0.64194345", "0.6366308", "0.63648635", "0.6339315", "0.63120675", "0.62752634", "0.6264683", "0.6230671", "0.6223179", "0.62162787", "0.61842006", "0.61079824", "0.60931885", "0.6084...
0.0
-1
Building the list of items
function start() { connection.query("SELECT * FROM products", function(err, res) { if (err) throw err; console.log( "--------------------------------------------------------------------------------" ); for (var i = 0; i < res.length; i++) { console.log( "ID: " + res[i].it...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _buildItems($ps, data) {\n if (data.settings.options && data.settings.options.criterias) {\n\n _.each(data.settings.options.criterias, function(option, i) {\n var $item = _.template(data.templates.li, {criteria:option.criteria, text:option.label});\n\n $ps.find(\"ul.criterias_inner\"...
[ "0.71129686", "0.68306327", "0.67280704", "0.669374", "0.65081304", "0.6479037", "0.6444025", "0.6440364", "0.635603", "0.6348302", "0.63302", "0.63158035", "0.62985647", "0.62828845", "0.6240098", "0.62330556", "0.6219383", "0.6202833", "0.6180788", "0.61670816", "0.6164484"...
0.0
-1
Function to update SQL table
function updateTable(updatedStock, ID){ connection.query( "UPDATE products SET ? WHERE ?", [ { stock_quantity: updatedStock }, { item_id: ID } ], function(error, res) { if (error) throw err; } ); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateData(modSql, modSqlParams){\n connection.query('UPDATE ' + modSql, modSqlParams,function (err, result) {\n if(err){\n console.log('[UPDATE ERROR] - ',err.message);\n return;\n } \n console.log('--------------------------UPDATE-------------------------...
[ "0.7141549", "0.70385206", "0.69740677", "0.676522", "0.6728852", "0.6700226", "0.6689858", "0.6689858", "0.6689858", "0.6650248", "0.661211", "0.6570662", "0.6551963", "0.6542869", "0.6509765", "0.65020764", "0.64542574", "0.6444299", "0.64438957", "0.6418475", "0.63874066",...
0.657636
11
show an emoji in the bottom detail screen
function showDetail(item) { detailLogo.style.backgroundPosition = item.pos; detailInput.value = ":" + item.name + ":"; if (unicodeInput) { unicodeInput.value = item.unicode || ""; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayEmoji(e) {\n chatInput.value += e.id;\n}", "show(message){\n this.alphyEl.innerText = message.emoji;\n if (message.chat){\n this.chatEl.innerText = message.chat;\n this.chatEl.classList.remove(\"hidden\");\n this.chatEl.classList.add(\"visible\");\n...
[ "0.66435784", "0.6587116", "0.63955927", "0.62315804", "0.60993564", "0.6008597", "0.5999663", "0.5991433", "0.5957687", "0.5868798", "0.58443654", "0.5835135", "0.5802434", "0.57963365", "0.57896644", "0.575049", "0.572524", "0.57224035", "0.5714566", "0.5672091", "0.5671455...
0.5811747
12
let Texto = localStorage.setItem("key", Guardar); document.getElementById("mensagem").innerHTML+= localStorage.getItem("key");
function buttontweet (){ let prinText = document.createElement("div"); prinText.setAttribute("class", "printE") let dateString = new Date().toTimeString().substring(0,5); let textEnters = message.value.replace(/\n/g, "<br>"); prinText.innerHTML = "["+ dateString +"] " + textEnters; print.appendChild(prinTex...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gravarLS(key,valor){\n localStorage.setItem(key, valor)\n}", "function guardarBusqueda(busqueda){\n localStorage.setItem(\"busqueda\", busqueda);\n}", "function guardar(){\n\t//valoracion de los imput\n\tvar nombre = document.getElementById('clave').value;\n\tvar comentario =document.getElementByI...
[ "0.79360056", "0.7801065", "0.76976436", "0.7654075", "0.76143116", "0.7563947", "0.75064564", "0.74858624", "0.73588645", "0.7358599", "0.7324112", "0.7295568", "0.729329", "0.72564465", "0.7248908", "0.72485924", "0.7196809", "0.71913093", "0.7181909", "0.7115681", "0.71039...
0.0
-1
Open when someone clicks on the span element
function openNav() { document.getElementById("myNav").style.width = "100%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spanClick(div) {\n\t\tvar modal = document.getElementById(div);\n\t \tmodal.style.display = \"none\";\n\t}", "function spanClick(div) {\n\t\tvar modal = document.getElementById(div);\n\t \tmodal.style.display = \"none\";\n\t}", "'click #tokens-open'(event, instance) {\n Session.set(\"area\", ...
[ "0.6646812", "0.6646812", "0.63436633", "0.63436633", "0.6302182", "0.62496305", "0.61304283", "0.61161166", "0.6082419", "0.60144335", "0.5998361", "0.59939873", "0.59562993", "0.594434", "0.5881817", "0.5873154", "0.5872516", "0.5865183", "0.58481604", "0.5819441", "0.58132...
0.0
-1
Close when someone clicks on the "x" symbol inside the overlay
function closeNav() { document.getElementById("myNav").style.width = "0%"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onBackdropClick() {\n close();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function closeOv...
[ "0.7338072", "0.70023185", "0.680466", "0.6782097", "0.6752424", "0.67230165", "0.663092", "0.6580008", "0.65752465", "0.6574593", "0.65369684", "0.64968246", "0.64679635", "0.6422672", "0.6419538", "0.6408808", "0.64086914", "0.63674015", "0.6355738", "0.6352517", "0.6348658...
0.0
-1
Problem Diberikan sebuah function balikKata(kata) yang menerima satu parameter berupa string. Function akan mereturn kata yang dibalik. Contoh, jika kata adalah "John Doe", function akan mereturn "eoD nhoJ". Code
function balikKata(kata) { // you can only write your code here! var kata2 = ''; for (i = kata.length - 1 ; i >= 0 ; i -- ){ kata2 = kata2.concat(kata[i]); } return kata2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buatKalimat(nama, umur, alamat, hobi) {\n // Code kamu mulai dari sini\n var kalimat = \"Nama saya \" + nama + \", Umur \" + umur + \" Bertempat tinggal di \" + alamat + \", hobi saya \" + hobi;\n // Tampilkan dengan cara document.getElementById(\"jawaban3\").innerHTML sep...
[ "0.67882615", "0.6708919", "0.6487007", "0.63923216", "0.6219293", "0.61930835", "0.6190398", "0.60620725", "0.5867152", "0.5744447", "0.57339936", "0.5731598", "0.5708554", "0.56876755", "0.56639534", "0.5654002", "0.5611153", "0.56007123", "0.5574224", "0.5550721", "0.55407...
0.5713683
12
infinite loop to find a random number which if is not already used goes through and assigns the object to variables and pushes the random number to the usedquotes array and loggs in console and breaks the loop. If the random number is already in the usedquotes itll run again. If the usedquotes has every quote > reset.
function getRandomQuote () { while (true) { var randomNum = Math.floor(Math.random() * numOfQuotes); if (usedQuotes.indexOf(randomNum) === -1) { quote = quotes[randomNum].quote; source = quotes[randomNum].source; citation = quotes[randomNum].citation; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRandomQuote() {\n\n var same = true;\n var randomNum = Math.floor(Math.random() * quotes.length);\n \n //checks if the quote have been used before or not\n do {\n var count = 0;\n //goes through all the usedQuotes and if they are the same\n //it generates a new numbe...
[ "0.8049178", "0.7718391", "0.76900965", "0.76088077", "0.743577", "0.7338328", "0.7318728", "0.7310012", "0.7266861", "0.71970236", "0.71482575", "0.7113918", "0.71025956", "0.70929", "0.7074055", "0.70404774", "0.7037597", "0.7018345", "0.6953012", "0.6855072", "0.6801296", ...
0.7962169
1
print the quote by creating different html codes depending on if a citation and date is present or not.
function printQuote () { getRandomQuote(); if (citation !== "" && date !== "") { fullQuote = '<p class="quote">' + quote + '</p><p class="source">' + source + '<span class="citation">' + citation + '</span><span class="year">' + date + '</span></p><p class="source">' + tags + ', Rated: ' + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printQuote() {\n var getQuoteFromFunction = getRandomQuote(quotes);\n var stringQuote = getQuoteFromFunction.quote;\n var stringSource = getQuoteFromFunction.source;\n var stringCitation = getQuoteFromFunction.citation;\n var stringYear = getQuoteFromFunction.year;\n \n var outputString = `<p class...
[ "0.74421006", "0.74250215", "0.7358958", "0.7319541", "0.729139", "0.72890085", "0.7219944", "0.7213007", "0.72060627", "0.7203821", "0.7196949", "0.7189944", "0.7181665", "0.71807307", "0.71415615", "0.71371263", "0.7134937", "0.71102136", "0.70989245", "0.70792943", "0.7077...
0.697893
32
ES6 / ================================================================== Utils ================================================================== Calculates date string
function getLogDate(date) { let year = date.getFullYear(); let month = date.getMonth() + 1; let day = date.getDate(); month = (month < 10 ? "0" : "") + month; day = (day < 10 ? "0" : "") + day; return year + "-" + month + "-" + day; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDateString() {\n // Initializing variables for date, month and year\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear() - 2000;\n \n let strDate = month.toString() + \"/\" + day.toString() + \"/\" + year.toString();\n return strDate\n }", ...
[ "0.7844391", "0.7505251", "0.74683356", "0.74127096", "0.7384315", "0.7355674", "0.735169", "0.73399484", "0.72946644", "0.7270721", "0.7255835", "0.72352386", "0.722508", "0.7185935", "0.7181879", "0.7162461", "0.7161581", "0.7152716", "0.71465296", "0.71433765", "0.71388745...
0.0
-1
Converts time to milliseconds
function hrtimeToMs(hrtime) { return parseInt(1000*hrtime[0] + (hrtime[1]/1000000)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function secToMs(time) {\n return time * 1000;\n}", "function secToMs(time) {\n return time * 1000;\n}", "static timeToMilli(/*String*/ time) {\n let sign = 1;\n time = time.trim();\n if (time.startsWith('-')) {\n sign = -1;\n time = time.substring(1);\n }\...
[ "0.7758653", "0.7748129", "0.7626874", "0.74779826", "0.7471751", "0.7438419", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", "0.7433748", ...
0.0
-1
Empties the list associated with the object of all key/value pairs, if there are any.
clear() { this._clear(); this._clearPlus(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearEmpties(obj) {\n for (var key in obj) {\n if (!obj[key] || typeof obj[key] !== 'object') {\n continue;\n }\n\n clearEmpties(obj[key]);\n if (Object.keys(obj[key]).length === 0) {\n delete obj[key];\n }\n }\n return obj;\n}", "reset() {\n\t\tthis.#keyslist.length = 0;\n\t...
[ "0.70533454", "0.67402875", "0.66769886", "0.65498966", "0.6451349", "0.6400198", "0.63880396", "0.6374477", "0.63632655", "0.6298811", "0.6298811", "0.6298811", "0.6298811", "0.62497884", "0.62338686", "0.62085193", "0.62085193", "0.62085193", "0.62085193", "0.62085193", "0....
0.0
-1
Returns the name of the nth key in the list, or null if n is greater than or equal to the number of key/value pairs in the object.
key(index) { return this._key(index) || this._keyPlus(index) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_first_n(obj, n) {\n return Object.keys(obj) // get the keys out\n .slice(0, n) // get the first N\n .reduce(function(memo, current) { // generate a new object out of them\n memo[current] = obj[current]\n return memo;\n }, [])\n }", "function nth(list, n) ...
[ "0.6310231", "0.62062436", "0.6198794", "0.6107749", "0.59333736", "0.5899318", "0.5891622", "0.58896345", "0.57631505", "0.5658627", "0.5624641", "0.5540013", "0.55393034", "0.55183667", "0.544173", "0.5440574", "0.5436989", "0.5427298", "0.5374865", "0.535699", "0.53545994"...
0.46870595
95
A call tree for a thread. This is essentially a linkage between all frames of all samples into a single tree structure, with additional information on each node, like the time spent (in milliseconds) and samples count.
function ThreadNode(thread, options = {}) { if (options.endTime == void 0 || options.startTime == void 0) { throw new Error("ThreadNode requires both `startTime` and `endTime`."); } this.samples = 0; this.sampleTimes = []; this.youngestFrameSamples = 0; this.calls = []; this.duration = options.endTime...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeCallTreeCountsAndTimings(thread, callNodeInfo, interval, invertCallstack) {\n const sampleCallNodes = getSampleCallNodes(\n thread.samples,\n callNodeInfo.stackIndexToCallNodeIndex\n );\n // Inverted trees need a different method for computing the timing.\n const { callNodeSelfTime, callN...
[ "0.677274", "0.65899724", "0.61756414", "0.5455636", "0.54080576", "0.5396586", "0.5320337", "0.52011025", "0.51808417", "0.51416135", "0.5109439", "0.5093737", "0.50084966", "0.49900332", "0.498727", "0.49847698", "0.49612898", "0.49043962", "0.48980764", "0.4887391", "0.488...
0.6357928
2
A function call node in a tree. Represents a function call with a unique context, resulting in each FrameNode having its own row in the corresponding tree view. Take samples: A()>B()>C() A()>B() Q()>B() In inverted tree, A()>B()>C() would have one frame node, and A()>B() and Q()>B() would share a frame node. In an unin...
function FrameNode(frameKey, { location, line, category, isContent }, isMetaCategory) { this.key = frameKey; this.location = location; this.line = line; this.youngestFrameSamples = 0; this.samples = 0; this.calls = []; this.isContent = !!isContent; this._optimizations = null; this._tierData = []; th...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionCall() {\n AST.call(this, \"FUNCALL\");\n this.variableName = \"\";\n this.funName = \"\";\n this.args = [];\n}", "CallExpression (path, { file }) {\n /* determine types of parameters */\n const pp = []\n const np = []\n p...
[ "0.562947", "0.5482518", "0.54629505", "0.5445961", "0.5413263", "0.5389375", "0.53718305", "0.5300686", "0.5290993", "0.5290993", "0.51945615", "0.51880246", "0.51458335", "0.5139141", "0.5123952", "0.5119454", "0.5119454", "0.5047597", "0.5025191", "0.5007989", "0.50022244"...
0.5272552
10
This function is called when the node is in execution
function Update () : Status { return Status.Success; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "started() {\r\n\r\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "started() {\n\n\t}", "run () {\n }", "started () {}", "started() {\n\t}", "function onEnterNode(ci, userId, ...
[ "0.64016664", "0.62676257", "0.62676257", "0.62676257", "0.62676257", "0.62676257", "0.62676257", "0.62676257", "0.62676257", "0.62310266", "0.6223211", "0.62230754", "0.61667305", "0.6088173", "0.60820234", "0.60820234", "0.60820234", "0.6080933", "0.60648096", "0.60648096", ...
0.0
-1
string > (string, string) Returns a tuple of [directory, filename]
static getDirAndFilenameFromURI(uri) { let directory = ""; let filename = ""; // const regexMatch = this.uri.match(/(.*\/)([^\/]*)$/); const regexMatch = uri.match(/(.*\/)?([^\/]*)$/); if (regexMatch !== null) { // files on root directoy will lead to first match to be...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exampleDir(str) {\n return str;\n}", "function splitPath(path)\n{\n var parts = path.split(\"/\");\n var idx = -1;\n for (var i = parts.length - 2; i >= 0; --i)\n {\n var lcpath = parts[i].toLowerCase();\n if (lcpath.endsWith(\".zip\") ||\n lcpath.endsWith(\".tgz\")...
[ "0.5616839", "0.55961585", "0.54837966", "0.53817815", "0.5308519", "0.5308147", "0.5279617", "0.5255185", "0.5233201", "0.5209629", "0.5207849", "0.5190188", "0.5168914", "0.51671046", "0.5088563", "0.50728977", "0.50363296", "0.5026908", "0.5025265", "0.5018175", "0.5017586...
0.64181054
0
[string, string] > string Returns the write out path for a given (dir, filename) tuple
static getWriteOutPath(dirAndFilename) { const writeOutPath = Page_1.default.writeOutDir + `/` + dirAndFilename[0] + dirAndFilename[1]; return writeOutPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pathJoin( dirname, filename ) { return dirname + '/' + filename }", "function getOutPath(path, info) {\n let outPath = info.mapInOutPaths.get(path);\n if (!outPath) {\n // get file name without extensions\n const fileName = Path.basename(path).replace(FSHARP_EXT, \"\").replace(JAVASC...
[ "0.60416985", "0.5928824", "0.59110534", "0.5876371", "0.5767048", "0.57579356", "0.5747962", "0.56874454", "0.56431985", "0.56122494", "0.5609663", "0.55562913", "0.5520325", "0.5492121", "0.5441839", "0.54352355", "0.5408744", "0.53787726", "0.53419244", "0.53233844", "0.52...
0.7587178
0
prefixed function name with underscore because delete is a reserved word in javascript
function _delete(id) { const requestOptions = { method: 'DELETE', headers: authHeader(), }; return fetch(urlAppender('/stocks/' + id), requestOptions).then(handleResponse); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DELETE(){\n\n}", "delete() {\n\n }", "deleteTattoo () {\n\n }", "delete() {}", "function _() { undefined; }", "deleteAction() {}", "function cleanFunctionName(functionName) {\n var ignoredPrefix = 'non-virtual thunk to ';\n if (functionName.startsWith(ignoredPrefix)) {\n return function...
[ "0.7140815", "0.653689", "0.6407715", "0.6401066", "0.63770455", "0.6141918", "0.6132344", "0.6053368", "0.6048261", "0.604322", "0.6016163", "0.6016163", "0.6016163", "0.6016163", "0.6016163", "0.5993813", "0.59336513", "0.5909784", "0.59093606", "0.58880943", "0.5881641", ...
0.0
-1
draws the baddie, called in game.draw, as long as baddie is not ded
updateDrawing(context) { if(!this.ded){ context.drawImage(this.img, this.width * this.frameX, this.height * this.frameY, this.width, this.height, this.x, this.y, 50, 50) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\r\n\t\r\n\t// draws updated time/bombs left\r\n\ttextSize(50);\r\n\r\n\tstrokeWeight(7);\r\n\tstroke(0);\r\n\tfill(0);\r\n\trect(0,480,900,200);\r\n\r\n\tif(!gameOver){\r\n\t\tif(currentSecond != second()) {\r\n\t\t\tcurrentSecond = second();\r\n\t\t\ttime ++;\r\n\t\t}\r\n\t}\r\n\r\n\t// draws ti...
[ "0.741478", "0.73664", "0.7365089", "0.72108066", "0.7209545", "0.71727484", "0.71365744", "0.70973766", "0.70749694", "0.6980696", "0.6956837", "0.69466853", "0.69373715", "0.69279003", "0.69279003", "0.69183433", "0.69062096", "0.6905916", "0.69007283", "0.6900554", "0.6888...
0.0
-1
updates which frame to use for painting in order to animate
handlePlayerFrame(){ if(this.speedY < 0){ this.frameY = 3 }else{ this.frameY = 0 } if (this.frameX < 3){ this.frameX++ } else { this.frameX = 0 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateFrame() {\n this._drawFrame();\n }", "function updateFrame() {\n // TODO: INSERT CODE TO UPDATE ANY OTHER DATA USED IN DRAWING A FRAME\n y += 0.3;\n if (y > 60) {\n y = -50;\n }\n frameNumber++;\n}", "update() {\r\n this.paint();\r\n }", "function animate() {\n\tr...
[ "0.7728649", "0.7181052", "0.711877", "0.69787425", "0.6957445", "0.6946526", "0.6908627", "0.69055367", "0.68148065", "0.6795775", "0.6774331", "0.6764572", "0.67271847", "0.6706364", "0.66855323", "0.6663517", "0.66098726", "0.6608807", "0.6601153", "0.6571277", "0.65471035...
0.0
-1
updates location for baddie to be drawn based on speed and direction
updateMovement(){ if(this.y < 1){ this.speedY += this.maxSpeed }else if(this.y > 500){ this.speedY -= this.maxSpeed } //collision detection, if hit a block, turn around if(this.x % 50===0 && this.y % 50 === 0){ this.arrayLocation = (this.x/50 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\r\n this.x += this.xspeed;\r\n this.y += this.yspeed;\r\n }", "update()\n\t{\n\t\tthis.x += this.xspeed;\n\t\tthis.y += this.yspeed;\n\t}", "update() {\n this.pos1 = Math.floor(this.y);\n this.pos2 = Math.floor(this.x);\n this.speed = mappedImage[this.pos1][this.pos2]...
[ "0.7379908", "0.7314137", "0.7048321", "0.70409966", "0.7039395", "0.69102925", "0.6827686", "0.6824174", "0.68151504", "0.6779528", "0.6763983", "0.673672", "0.67089695", "0.6704999", "0.66846573", "0.66778964", "0.66623026", "0.66522884", "0.6513878", "0.6511906", "0.649679...
0.6787818
9
Toggle visibility of an element
function toggle_visibility(id) { if (document.getElementById(id).style.display == '') document.getElementById(id).style.display = 'none'; else document.getElementById(id).style.display = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggleVisible() {\n if (this.visible) {\n this.visible = false;\n // this.element.setAttribute('style', 'display: none;');\n this.element.style.display = 'none';\n } else {\n this.visible = true;\n this.element.style.display = 'block';\n }\n }", "function togg...
[ "0.8236405", "0.80771583", "0.8066228", "0.7857467", "0.78425044", "0.7818835", "0.78060925", "0.78060925", "0.77392125", "0.76898825", "0.76560104", "0.7637954", "0.7632523", "0.76264125", "0.7619413", "0.7614121", "0.7587552", "0.7568946", "0.7508249", "0.7488227", "0.74693...
0.6962866
57
Toggle visibility of questions of a certain entry id
function toggle_questions(entry_id,expand_icon,collapse_icon) { var element = document.getElementById(entry_id); var rows = document.getElementsByTagName("tr"); var expr = new RegExp(element.id +"question-entry:([0-9]*):$"); for (i=0;i<rows.length;i++) { if (!(rows[i].id == "")) { if(rows[i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TOGGLE_ANSWER_VISIBILITY(state, id) {\n const question = state.questions.find(q => q.id === id);\n question.isAnswerVisible = !question.isAnswerVisible;\n }", "function toggle_faq(id) \n\t{\n\t\tvar faqAnswer = document.getElementById(id);\n\t\tif(faqAnswer.style.display == 'none')\n\t\t\t{\n\t\t\t ...
[ "0.76756096", "0.7012355", "0.69496214", "0.6671684", "0.6614541", "0.64441437", "0.64384013", "0.641154", "0.64028805", "0.62678796", "0.6263273", "0.62543166", "0.6252853", "0.62120485", "0.6207845", "0.61927056", "0.6179991", "0.6168601", "0.61510396", "0.6145517", "0.6141...
0.75289094
1
Used in questions list
function init_questions_toggle(expand_icon_id,collapse_icon_id,entry_id) { var expand_icon = document.getElementById(expand_icon_id); var collapse_icon = document.getElementById(collapse_icon_id); expand_icon.onclick = function() { toggle_questions(entry_id,expand_icon,collapse_icon);}; collapse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateQuestionList() {\n myQuestions = [\n {\n exemple: true,\n question: \"Voici un ensemble de figures géométriques abstraites. Pour trouver la figure manquante (A jusqu'à H), \\\n il faut essayer de <mark>déduire des relations entre les figures</mark>. En partant de la prem...
[ "0.6895921", "0.66990554", "0.6653793", "0.6649772", "0.65063184", "0.6484027", "0.6473174", "0.64514554", "0.6390943", "0.6376966", "0.6364585", "0.6360727", "0.634434", "0.63422734", "0.63191193", "0.6315399", "0.6315399", "0.63030106", "0.6296865", "0.6289092", "0.6281602"...
0.0
-1
View select on question list screen
function init_view_select(select_id, form_id, options_size, current_selected) { var select = document.getElementById(select_id); var form = document.getElementById(form_id); select.onchange = function () { change_view(select,form,current_selected);}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSelectedQuestion(question) {\r\n // console.log(question);\r\n showQuery(question);\r\n showResponse(question);\r\n showExplanations(question);\r\n }", "function selectAnswer() {\n\n}", "function displayListOptions() {\n inquirer.prompt([\n {\n t...
[ "0.6798087", "0.63826436", "0.6354249", "0.63361096", "0.6298128", "0.6293341", "0.62606215", "0.6229083", "0.6136561", "0.61285317", "0.6086681", "0.60590106", "0.60531706", "0.60450345", "0.6035582", "0.6021501", "0.6008075", "0.5997903", "0.5992061", "0.5982665", "0.597921...
0.0
-1
Add an answer in answers screen
function init_add_answer_toggle(link_id,icon_id,div_id) { var link = document.getElementById(link_id); link.href= "#"; link.onclick = function() { toggle_add_answer(link_id,icon_id,div_id);}; var icon = document.getElementById(icon_id); icon.onclick = function() { toggle_add_answer(link_id...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAnswer() {\n collectAnswer();\n surveyStorage.insert(self.answer);\n resetForm();\n }", "function addQuestion() {\n clearEditor();\n setShowQuestion(true);\n\n setQuizPtr(0);\n\n setQuiz(oldQuiz => {\n return {\n ...oldQuiz,\n pro...
[ "0.8038511", "0.7446104", "0.74154574", "0.73973125", "0.73557484", "0.7173272", "0.67666465", "0.67647606", "0.67052937", "0.66774666", "0.6665466", "0.6647881", "0.6642161", "0.6635749", "0.66347045", "0.66123307", "0.65950274", "0.65832645", "0.6569331", "0.6556912", "0.65...
0.0
-1
Used to make links perform like submit button
function make_link_call_command(link_id,command_id) { var link = document.getElementById(link_id); var command = document.getElementById(command_id); link.onclick = function() {command.click(); return false;}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleLinkButtonPressed(){\n let q = $$('question');\n q.innerText = 'Your average reading speed is ' + (parseFloat(global_wpm)).toFixed(1) +\n ' words per minute.\\n\\nPaste the link to the article you would like to read below and press submit.\\n' +\n 'If you also have text to paste,...
[ "0.65880203", "0.64794433", "0.6262259", "0.6085794", "0.60814625", "0.60660625", "0.60515356", "0.6037957", "0.60255265", "0.59667367", "0.5957448", "0.59149283", "0.5910808", "0.5907456", "0.5870684", "0.58652973", "0.58634144", "0.5816361", "0.58001703", "0.5797853", "0.57...
0.5519198
94
Makes a button call a link
function make_button_call_link(button_id, link_id) { var button = document.getElementById(button_id); var link = document.getElementById(link_id); button.onclick = function() { window.location.href = link.href;}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onClickUrl(urlLink) {\n //Alert.alert(\"clicked\");\n Linking.openURL(\"http://\"+urlLink);\n \n }", "function onClick(link){\n \n}", "click(e){\r\n if ( this.url ){\r\n bbn.fn.link(this.url);\r\n }\r\n else{\r\n this.$emit('click', e);\r\n }\r\n }...
[ "0.7086985", "0.7040877", "0.6759865", "0.6702379", "0.6567712", "0.6489685", "0.6407117", "0.6382163", "0.6370436", "0.6347903", "0.6334213", "0.6320811", "0.62831485", "0.6263445", "0.6238558", "0.62365675", "0.62359464", "0.61993325", "0.6175331", "0.61703527", "0.6139853"...
0.77181065
0
Updates the pie charts of the ticket statuses each second.
function refreshPie() { var partners = ["piston", "plumgrid"]; for (var i = 0; i < partners.length; i++) { getData(partners[i]) } setTimeout(refreshPie, 1000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updatePerfChart() {\n if (isNaN(perf.avgPerf)) {\n //keep previous chart\n } else {\n //update chart\n let status;\n if (perf.avgPerf >= 60) {\n status = \"good\";\n } else if (perf.avgPerf <= 30) {\n status = \"bad\";\n } else if (perf.avgPerf > 30 && perf.avgPerf < 60) {\n ...
[ "0.6383563", "0.6165271", "0.5872433", "0.58722097", "0.5844551", "0.5745208", "0.57420135", "0.57394964", "0.57297266", "0.5649566", "0.56083196", "0.55969787", "0.5594092", "0.55888194", "0.5580743", "0.5550428", "0.55308926", "0.5521129", "0.55180055", "0.54788554", "0.545...
0.58131
5
A custom formatter used for the labels on the pie charts.
function labelFormatter(label, series) { return "<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>" + label + "<br/>" + Math.round(series.percent) + "%</div>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function labelFormatter(label, series) {\n return \"<div class='chart-label'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n }", "function formatPieChartLabels() {\n\t\tif (Math.round(this.point.percentage) < 5) {\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\treturn '<span style=\"...
[ "0.7340569", "0.7310741", "0.72895956", "0.7280283", "0.72293824", "0.65798265", "0.6415788", "0.6032184", "0.589851", "0.5837788", "0.5828613", "0.56469536", "0.5627558", "0.56149393", "0.5596715", "0.5593851", "0.5590705", "0.55809695", "0.55599904", "0.5475323", "0.5386804...
0.7176206
5
livelinks compatiblity JQUERY calls the function on each messagecontainer in a document, including ones added by livelinks
function livelinks(func,extraParams){ if(extraParams==undefined) extraParams=null; //run the function on the message-containers currently on the page $('#u0_1 .message-container').each(function(i,container){ func(container,extraParams); }); //run it on any message-containers added in the future $('#u0...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function livelinks(func){\r\n\tdocument.addEventListener(\r\n\t\t'DOMNodeInserted',\r\n\t\tfunction(e){if(e.target.firstChild&&e.target.firstChild.className=='message-container')func(e.target);},\r\n\t\tfalse\r\n\t);\r\n\tfunc(document);\r\n}", "function initMessages(){\n\t\"use strict\";\n\t\n\tif($j('.q_messag...
[ "0.74260706", "0.64363676", "0.63605845", "0.6212219", "0.6201294", "0.61194146", "0.60820764", "0.60800433", "0.5968736", "0.59354866", "0.5931685", "0.5928494", "0.5926699", "0.59079194", "0.59042245", "0.58842814", "0.58517724", "0.5848667", "0.58486116", "0.5848515", "0.5...
0.78743064
0
adds a style to a document and returns the style object JQUERY css is a string, id is an optional string that determines the object's id
function addStyle(css,id){ //create a style var style=$('<style type="text/css">'); //add the css data to it style.html(css); if(id){ //remove any style that has our id $('#'+id).remove(); //give our style the id after removing the other stuff. idk if it matters, but i'm too lazy to find out style...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_style(argument, idName) {\n\n if (document.querySelector('#'+idName) != null) {\n document.querySelector('#'+idName).remove();\n }\n let css = argument,\n head = document.head || document.getElementsByTagName('head')[0],\n style = document.createElement('s...
[ "0.7532026", "0.7489603", "0.7256783", "0.7022528", "0.6922433", "0.6894556", "0.6865485", "0.68048275", "0.6743579", "0.6742593", "0.6715223", "0.6697876", "0.6623739", "0.66225255", "0.66184217", "0.6562199", "0.6502089", "0.6496466", "0.6495162", "0.64945257", "0.64945257"...
0.8085426
0
puts the message body of any quotedmessage in its own message div like normal messages for easier styling(hiding) livelinks ready JQUERY
function rearrangeQuotes(container){ //this is a for loop or something $(container).find('.quoted-message').each(function(i,quote){ var quote=$(quote); //create message div for quote var quoteBody=$('<div class="message">'); //add everything but the message-top to the message div quote.contents().eac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function prepareMessage(message) {\n var html = '';\n html += '<div class=\"mssgIn\">';\n html += '<p class=\"from\">'+jid+'</p>';\n html += '<p class=\"body\">'+message+'</div>';\n html += '</div>'; \n }", "function update_message(m, clear)\n{\n if (clear) {\n $('#message'...
[ "0.6713728", "0.6445159", "0.64174575", "0.6410447", "0.6397891", "0.6392381", "0.63091433", "0.6305069", "0.62842935", "0.6201261", "0.61919546", "0.61652344", "0.61645424", "0.6156682", "0.6150129", "0.6133974", "0.6128403", "0.6113777", "0.6113437", "0.6099461", "0.609369"...
0.65871084
1
draw the current tetromino
function draw() { current.forEach((index) => { squares[currentPosition + index].classList.add("tetromino"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {\n currentTetromino.forEach(index=> {\n //render each cell in the tetromino by adding class 'tetromino' which contains styling\n squares[currentPosition + index].classList.add('tetromino');\n //change tetromino color\n squares[currentPosition +ind...
[ "0.77618766", "0.73035884", "0.71834725", "0.7158219", "0.70302224", "0.700134", "0.67095095", "0.6616822", "0.6608945", "0.6571356", "0.65621686", "0.65394384", "0.65394384", "0.65394384", "0.6526731", "0.6502341", "0.6457991", "0.64388746", "0.64388746", "0.64388746", "0.64...
0.7014748
5
undraw or remove the current tetromimo
function undraw() { current.forEach((index) => { squares[currentPosition + index].classList.remove("tetromino"); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "undoStitch(){\n // console.log('undoStitch')\n this.content.css('left',0)\n this.getItems().slice(ITEM_ART_COUNT).remove()\n this.stitchedContent = undefined\n }", "static EliminarTweetDOM(event){\n\n if(event.target.tagName !== \"SPAN\") return;\n const Liborrado = event.target.parentEl...
[ "0.65085775", "0.6442524", "0.63558483", "0.62252575", "0.6164337", "0.6160283", "0.61500937", "0.61276966", "0.6075741", "0.60344994", "0.60092926", "0.6001262", "0.5966361", "0.5911281", "0.5883411", "0.58672947", "0.5812667", "0.5793558", "0.57793534", "0.5774371", "0.5760...
0.6026082
10
keyCode functions for moving tetrominos keycode.info
function control(e) { if (e.keyCode === 37) { moveLeft(); } else if (e.keyCode === 38) { rotate(); } else if (e.keyCode === 39) { moveRight(); } else if (e.keyCode === 40) { moveDown(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onKeyDown(event){\n \n //keyboard events\n switch(event.keyCode){\n case 48:\n case 96:\n lookUp = true;\n break;\n case 38: //up\n case 87: //w\n console.log('w');\n moveForward = true;\n break;\n case 37: ...
[ "0.7268206", "0.7150665", "0.70917666", "0.70767075", "0.70321405", "0.70183563", "0.70183563", "0.6987915", "0.6979032", "0.69550616", "0.6954615", "0.69528705", "0.695111", "0.69497794", "0.6944717", "0.6933478", "0.69266313", "0.692532", "0.6919726", "0.690261", "0.6880868...
0.65518373
75
move tetromino left unless is is at the edge or there is another tetrominoe in that space
function moveLeft() { undraw(); // current position+index divided by width has no remainder const isAtLeftEdge = current.some( //condition is at left hand side is true (index) => (currentPosition + index) % width === 0 ); if (!isAtLeftEdge) currentPosition -= 1; if ( current.so...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveLeft() {\n undraw()\n const reachedLeftEdge = curT.some(index => (curPos + index) % width === 0)\n if (!reachedLeftEdge) curPos -= 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another fi...
[ "0.7828024", "0.7647114", "0.72377294", "0.6918763", "0.68745613", "0.68490815", "0.68395215", "0.6827977", "0.6808505", "0.6797486", "0.6792939", "0.67879033", "0.67754763", "0.6713664", "0.66646004", "0.6590409", "0.6520075", "0.65192425", "0.6449305", "0.6421486", "0.63588...
0.6793253
10
move tetromino right unless is is at the edge or there is another tetrominoe in that space
function moveRight() { undraw(); // current position+index divided by width has no remainder const isAtRightEdge = current.some( //condition is at right hand side is true (index) => (currentPosition + index) % width === width - 1 ); if (!isAtRightEdge) currentPosition += 1; if ( ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveRight() {\n undraw();\n //check if any of the tetromino's cells are on the right edge\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % width === width-1);\n //move tetromino to the right if none of its cells is at the left edge\n if(...
[ "0.8237163", "0.80748636", "0.769699", "0.7619687", "0.71630955", "0.7153558", "0.71489877", "0.71013147", "0.70992774", "0.70794666", "0.70639384", "0.7018709", "0.6951907", "0.6792714", "0.67319036", "0.6723216", "0.672319", "0.66844267", "0.6681014", "0.6645987", "0.663483...
0.71244
7
Generates a placeholder SVG image of the given size.
function offlineImage(name, width, height) { return `<?xml version="1.0"?> <svg width="${width}" height="${height}" viewBox="0 0 ${width} ${height}" xmlns="http://www.w3.org/2000/svg" version="1.1"> <g fill="none" fill-rule="evenodd"><path fill="#F8BBD0" d="M0 0h${width}v${height}H0z"/></g> <text text-anchor="midd...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupSVG(svg, width, height) {\n //Remove children of svg to eventually tiles from the previous image\n svg.innerHTML = '';\n\n //Give to svg the same size as the image\n svg.setAttribute('viewBox', '0 0 '+width+' '+height);\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\...
[ "0.63348025", "0.6087449", "0.5742268", "0.57023907", "0.5695691", "0.5695691", "0.5681478", "0.5676199", "0.5640712", "0.56305856", "0.5625087", "0.5595728", "0.55770135", "0.55320543", "0.5518261", "0.5506163", "0.5496018", "0.5483608", "0.5445818", "0.5445726", "0.5439025"...
0.52852553
25
Returns true if the Accept header contains the given content type string.
function requestAccepts(request, contentType) { return request.headers.get('Accept').indexOf(contentType) != -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function requestAccepts(request, contentType) {\n return request.headers.get('Accept').indexOf(contentType) != -1;\n}", "function requestAccepts(request, contentType) {\n return request.headers.get('Accept').indexOf(contentType) != -1;\n}", "function validContentType(ct) {\n return ct.match(/^(?:text\\/html...
[ "0.73726404", "0.73726404", "0.63008994", "0.6232391", "0.6226276", "0.62155783", "0.6152573", "0.5971316", "0.5887439", "0.57654756", "0.5676152", "0.55910105", "0.5546996", "0.5528372", "0.55023694", "0.54921645", "0.54906154", "0.5427095", "0.5410789", "0.5382292", "0.5374...
0.73576474
2
ampbyexample.com fetch handler: onebehind caching shows offline page generates placeholder image for unavailable images
function ampByExampleHandler(request, values) { /* for samples show offline page if offline and samples are not cached */ if (requestAccepts(request, 'text/html')) { return toolbox.fastest(request, values).catch(function () { return toolbox.cacheOnly(new Request(config.offlinePage), values); }); } /* always ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ampByExampleHandler(request, values) {\n if (shouldNotCache(request)) {\n return toolbox.networkOnly(request, values);\n }\n // for samples show offline page if offline and samples are not cached\n if (requestAccepts(request, 'text/html')) {\n // never use cached version for AMP CORS requests (e...
[ "0.70154846", "0.7007755", "0.6056896", "0.6056555", "0.6041056", "0.5986498", "0.59673196", "0.5937888", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", "0.5925089", ...
0.6799867
2
assign a color square to each student based on their scores compared to the benchmarks
getColorForScore(sortBy, student, benchmark){ if(sortBy === ""){ return "blankSquare" } const propertyName = this.scoreInfo[sortBy].propertyName; const index = this.scoreInfo[sortBy].index; // const { propertyName, index } = this.scoreInfo[sortBy]; // same as above, b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scorecolor() {\r\n\t\tfor (var i = 1; i < allScores.length - 1; i++) {\r\n\t\t\tif (strokesDisp[i] - (TOTAL_PAR[i] - TOTAL_PAR[i - 1]) > 0) {\r\n\t\t\t\tallScores[i].addColor('#228B22', 0);\r\n\t\t\t} else if (strokesDisp[i] - (TOTAL_PAR[i] - TOTAL_PAR[i - 1]) == 0) {\r\n\t\t\t\tallScores[i].addColor('#00...
[ "0.70392746", "0.6788749", "0.6735826", "0.6537461", "0.651056", "0.6506923", "0.6470441", "0.6375669", "0.6358255", "0.6346504", "0.6332441", "0.6319586", "0.62476194", "0.6243418", "0.6240493", "0.6220946", "0.6175089", "0.61364245", "0.6126168", "0.6120929", "0.6109909", ...
0.67720175
2
The player selects a cell and we check to see if the cell has been played yet. If not we update the state of the cell to the player, which causes the cell to be rerendered with an X and pop the cell from the array and update the turn to computer in the parent component
playMove() { if (typeof this.props.cellState !== 'string') { return } else { this.props.updateCellState(this.props.id, 0) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCellPlayed(clickedCell, clickedCellIndex) {\n\n gameState[clickedCellIndex] = currentPlayer;\n clickedCell.innerHTML = currentPlayer;\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\n}", "function handleClick(e) { \n \n const currentCell = Number(e.target.id) // * change ...
[ "0.7315004", "0.7250309", "0.72127134", "0.7027706", "0.6945275", "0.69301564", "0.6870048", "0.68449754", "0.6826804", "0.6822496", "0.6705686", "0.66304743", "0.66107917", "0.6596623", "0.65908587", "0.6567167", "0.65538293", "0.65493417", "0.6531729", "0.6511834", "0.64811...
0.6718578
10
Conditional rendering of the cell based on the cell's state
renderCell() { if (this.props.cellState === 0) { return ( <PlayerCell /> ) } else if (this.props.cellState === 1) { return ( <CompCell /> ) } else { return ( <div className="box" onClick={this.playMove}> </div> ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderCompStatus() {\r\n const { Cell } = Table;\r\n const { companies } = this.props;\r\n if (companies.status === \"2\" || companies.status === 2) {\r\n return (\r\n <Cell textAlign=\"center\" singleLine style={{ color: 'red' }}>In Active</Cell>\r\n );\r\...
[ "0.69516987", "0.63299084", "0.62199324", "0.6198492", "0.6187435", "0.6124072", "0.61214405", "0.61078566", "0.6078052", "0.60768276", "0.6054346", "0.60220575", "0.60170954", "0.5980882", "0.59519446", "0.5949281", "0.59042567", "0.58851594", "0.58829045", "0.58644146", "0....
0.6619662
1
odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns N. For example: [2, 4, 0, 100, 4, 11, 2602, 36] Should return: 11 [160, 3, 1719, 19, 11, 13, 21] Should return: 160
function findOutlier(integers){ var oddArray = []; var evenArray = []; integers.forEach(function(elem){ if (elem % 2 ==0) { return evenArray.push(elem); } return oddArray.push(elem); }); if (oddArray.length === 1) { return oddArray[0]; } else if (evenArray.length === 1) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleOddNumbers(arr) {}", "function findOdd(arr) {\n let n = 0;\n\n for (let i = 0; i < arr.length; i++) {\n let num = arr[i];\n n ^= num;\n }\n\n return n;\n}", "function oddNumbers(array) {\n var array = [];\n for(var i = 1; i < array.length; i++){\n if(i % 2 !== 0){\n array.pus...
[ "0.7443532", "0.74169564", "0.7286288", "0.7250205", "0.7223825", "0.7214952", "0.7211732", "0.71710795", "0.71440583", "0.7102782", "0.7072134", "0.7010597", "0.70096534", "0.7004228", "0.6981271", "0.6974176", "0.6970745", "0.6959864", "0.69584084", "0.6958384", "0.69482887...
0.0
-1
generate a checkbox list from a list of products it makes each product name as the label for the checkbos
function populateListProductChoices(slct1, slct2) { var s1 = document.getElementById(slct1); var s2 = document.getElementById(slct2); // s2 represents the <div> in the Products tab, which shows the product list, so we first set it empty // check if s2 is empty or not // s2 represents the <div> in the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateListProductChoices(slct1, slct2) {\n var s1 = document.getElementById(slct1);\n\n var s2 = document.getElementById(slct2);\n\t\n\t// s2 represents the <div> in the Products tab, which shows the product list, so we first set it empty\n s2.innerHTML = \"\";\n\t\t\n\t// obtain a reduced list...
[ "0.71246225", "0.6874474", "0.6842789", "0.6840604", "0.6720325", "0.6618387", "0.6571415", "0.65393275", "0.6503009", "0.6397317", "0.63825434", "0.6339238", "0.633716", "0.6296806", "0.62786996", "0.62265736", "0.6225296", "0.6194306", "0.61915064", "0.6171871", "0.61375266...
0.70033556
1
what this method function does is grab from ADDFORM component and takes the method, event, data thats given by user, and takes in ID. we want to fetch the url then method will be replaced with POST and the information that the user inputs will be stringified and repacked into a JSON.stringified and lastley the new info...
landmarkSubmit(method, event, data, id) { event.preventDefault(); fetch(`/api/landmarks/${id || ''}`, { method, headers: { 'Content-Type': 'application/json', }, body: JSON.stringify(data), }) .then(res => res.json()) .then((res) => { this.getLandmarksFrom...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleSubmit(event) {\n var obj = {\n creatorName: this.state.host,\n eventName: this.state.event,\n cost: this.state.cost,\n des: this.state.description,\n url: this.state.photo,\n availableSeats: this.state.sets,\n date: this.state.date,\n eventLocation: [this.state.loc...
[ "0.58578384", "0.5703946", "0.5701993", "0.57017815", "0.56754065", "0.5664717", "0.5664183", "0.5659144", "0.5642709", "0.56346405", "0.56287426", "0.5606566", "0.55676115", "0.5520646", "0.5512278", "0.5489109", "0.5485601", "0.5477349", "0.5470067", "0.5460866", "0.5443791...
0.68165106
0
Now we want to create a method called SHOWADDFORM() I got this idea from ICECREAM APP but theres a difference from this versus what we are doing. We are using Switch and Routes in our rendering. Therefore Things will be passed to our components differently. But i reccommend we should def keep routes because look at it,...
showAddForm() { this.setState({ shouldShowAddForm: true, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n function Links() {\n let { path, url } = useRouteMatch();\n\n return (\n <>\n <ul>\n <li className=\"top-link\">\n <Link to={`${url}`}>Machines</Link>\n </li>\n ...
[ "0.63928866", "0.6376025", "0.5950081", "0.5916502", "0.5865574", "0.5861276", "0.57855153", "0.5770199", "0.572769", "0.56810486", "0.56451356", "0.56442326", "0.56342244", "0.5626696", "0.56105536", "0.56022024", "0.5599115", "0.5564286", "0.55581", "0.5552959", "0.5539983"...
0.5208746
95
This section is for gathering existing trade data / Main function that scans for trades on the page, then looks up and saves all cards involved in the trades
async function findTradeCards() { // Indicate to the user that the extension is saving document.body.style.cursor = "wait"; inCards = []; outCards = []; totalRequests = 0; // Selects all links associated with trades to extract the trade ids var tradesList = document.querySelectorAll("ul.user-status--list li.nm-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function build_trades(papers, panelDesc) {\n\n if (papers && papers.length > 0) {\n\n // Break the papers down into entries\n console.log('breaking papers into individual entries');\n var entries = [];\n for (var paper in papers) {\n var broken_up = paper_to_entries(papers...
[ "0.646829", "0.6069407", "0.60420847", "0.59870356", "0.5958898", "0.57329905", "0.57131094", "0.5703832", "0.56871426", "0.56670195", "0.56535685", "0.56398743", "0.56382525", "0.56328714", "0.56256694", "0.5589725", "0.55876464", "0.5578448", "0.5569662", "0.55670154", "0.5...
0.7318642
0
Makes an Http request to a url specified, then executes a callback function when successful
function httpGetAsync(theUrl, callback, expectedLength) { var xmlHttp = new XMLHttpRequest(); xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 && xmlHttp.status == 200) callback(xmlHttp.responseText, expectedLength); } xmlHttp.open("GET", theUrl, true); // true for asynchronous xmlHttp....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get(url, callback) {}", "function get_request(url,callback)\n{\n var xhttp = new XMLHttpRequest();\n // executed every time the status of the XMLHttpRequest object changes\n xhttp.onreadystatechange = function () {\n // readyState 4 == DONE\n // status 200 == successful_request\n ...
[ "0.76242584", "0.7490287", "0.74708056", "0.73318833", "0.7304962", "0.7283486", "0.7280176", "0.726901", "0.72688425", "0.7263184", "0.7235264", "0.7230143", "0.7215143", "0.7207673", "0.7196973", "0.7188179", "0.71822745", "0.71815157", "0.71730405", "0.71571255", "0.715186...
0.678804
45
Handles data returned from the request and constructs the objects to store it Is also passed the expected number of requests to make in order to save data properly
function requestSuccess(response, expectedLength) { var bidder = JSON.parse(response).bidder.id; var bidderOffer = JSON.parse(response).bidder_offer.prints; var responderOffer = JSON.parse(response).responder_offer.prints; var outData; var inData; // Uses current user id recorded on page load to // determine w...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getData() {\n //use the number of records info from the first API call\n return rp(getNum)\n .then(function(ret) {\n // console.log(\"**from keys.js * totalSize = \" + ret.totalSize);\n //determine the number of API calls needed\n size = ret.totalSize;\n callNumber = Math.ceil(siz...
[ "0.60887367", "0.59721553", "0.5859482", "0.57655895", "0.5759339", "0.5759339", "0.57486266", "0.5744052", "0.5678976", "0.56709886", "0.56426185", "0.56237125", "0.5604839", "0.56029004", "0.55827945", "0.5580371", "0.5579772", "0.55739814", "0.5566672", "0.55607873", "0.55...
0.5475494
28
This section is for displaying icons on the page / Uses the mutation library to call a function on all elements that match a DOM selector under rootNode
function forAllElements(rootNode, selector, callback) { rootNode.querySelectorAll(selector).forEach(callback); new MutationSummary({ rootNode, queries: [{element: selector}], callback: (summaries) => summaries[0].added.forEach((elem) => callback(elem)), }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNodes(dataInstance){\n currentDisplay.innerHTML +=\n `<i class=\"fab fa-first-order-alt selector\" data-id = ${dataInstance.id} style=\"position:\n fixed;top:${dataInstance.position_top}%;left:${dataInstance.position_left}%;\n font-size: 1.5em; \"></i>`\n}", "async function addIcons(wind...
[ "0.6560823", "0.5994458", "0.59285414", "0.5916752", "0.58872354", "0.5873857", "0.587078", "0.573656", "0.572934", "0.5721508", "0.5656449", "0.55689055", "0.55681646", "0.5565301", "0.5535146", "0.5470154", "0.5466609", "0.5461499", "0.5461499", "0.546112", "0.5454089", "...
0.5420137
26
Uses the mutation library to wait for a specific selector to be added under rootNode
function waitForElement(rootNode, selector) { const element = rootNode.querySelector(selector); if(element) return Promise.resolve(element); return new Promise((resolve) => { const observer = new MutationSummary({ rootNode, queries: [{element: selector}], callback: (summaries) => { observer.disconnec...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function forAllElements(rootNode, selector, callback) {\n\trootNode.querySelectorAll(selector).forEach(callback);\n\tnew MutationSummary({\n\t\trootNode,\n\t\tqueries: [{element: selector}],\n\t\tcallback: (summaries) => summaries[0].added.forEach((elem) => callback(elem)),\n\t});\n}", "function elementReady(sel...
[ "0.59880036", "0.58252716", "0.5633069", "0.54813623", "0.54803956", "0.5432244", "0.53989816", "0.539236", "0.5366009", "0.5310565", "0.5281461", "0.52807075", "0.5273832", "0.52671903", "0.5236332", "0.5222774", "0.5157151", "0.5157151", "0.5149063", "0.51227915", "0.512075...
0.71734023
0
Waits for a card container to be added to the page, then calls for icons to be added to the container
async function waitToAddIcons(window) { var itemContainerSelector; var itemSelector; // TODO: Add cases here // Decide what to look for on the page given the global container (window) passed in if(window.className.includes("nm-set-window")) { itemContainerSelector = "div.columns.loaded"; itemSelector = ".print...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function addIcons(window, result, itemSelector) {\n\t// Parses saved data back into inbound and outbound card sets\n\tvar savedInCards = result[\"cards\"][\"inCards\"];\n\tvar savedOutCards = result[\"cards\"][\"outCards\"];\n\t// Attempt to add an icon to every \"card\" on the page\n\tforAllElements(window,...
[ "0.6521831", "0.6241635", "0.61992043", "0.6159541", "0.6130004", "0.61138844", "0.60448545", "0.6043436", "0.60308015", "0.5966249", "0.5963802", "0.59287304", "0.5888893", "0.58799195", "0.5871561", "0.5844916", "0.58388424", "0.58345723", "0.5834294", "0.58285844", "0.5828...
0.7217188
0
Main handler for adding icons to the page
async function addIcons(window, result, itemSelector) { // Parses saved data back into inbound and outbound card sets var savedInCards = result["cards"]["inCards"]; var savedOutCards = result["cards"]["outCards"]; // Attempt to add an icon to every "card" on the page forAllElements(window, itemSelector, (card) => ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderIcons() {\r\n\t\te.renderIcon('#logo', 'logo');\r\n\t\t//e.renderIcon('#loading_msglogo','logo');\r\n\t\te.renderIcon('.menu_icon', 'user_management');\r\n\t\te.renderIcon('.menu_click', 'user_management');\r\n\t\te.renderIcon('.notification', 'notification');\r\n\t\te.renderIcon('header .analysis_s...
[ "0.7138861", "0.7092909", "0.7047727", "0.6610192", "0.65498656", "0.6544633", "0.65070385", "0.6439365", "0.63485575", "0.6337614", "0.63353556", "0.6308777", "0.6299933", "0.6276419", "0.6272447", "0.62593573", "0.62593573", "0.6253813", "0.6220312", "0.6189249", "0.6156343...
0.6187883
20
Wait for the trades list to come up, then gather trade data
async function waitForTrades(window) { await waitForElement(window, "ul.user-status--list"); findTradeCards(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getTrades() {\n\t\t\tconst web3 = props.drizzle.web3;\n\t\t\tconst contract = props.drizzle.contracts[\"CelebrityExchange\"];\n\t\t\tconst yourContractWeb3 = new web3.eth.Contract(\n\t\t\t\tcontract.abi,\n\t\t\t\tcontract.address\n\t\t\t);\n\t\t\tlet completedBuyOrders = [];\n\t\t\tlet completedSell...
[ "0.7341072", "0.728656", "0.6555259", "0.64377975", "0.62048787", "0.6163464", "0.6020685", "0.59281445", "0.5904611", "0.5895422", "0.5893393", "0.5848979", "0.5835227", "0.58061475", "0.57983834", "0.57532114", "0.5718959", "0.5641245", "0.56080085", "0.5593692", "0.553103"...
0.70175594
2
pure function that returns true or false if two segments overlap
_isOverlap (segA, segB) { var _isBefore = (segA.end >= segB.start && segA.start <= segB.end + 1); var _isAfter = (segA.start <= segB.end + 1 && segA.end >= segB.start); var _isSame = (segA === segB); return ((_isBefore || _isAfter) && (!_isSame)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overlap(a, b) {\n if (a.start <= b.start && a.end > b.start) {\n return true;\n } else if (a.start >= b.start && a.start < b.end) {\n return true;\n } else {\n return false;\n }\n }", "function segmentsOverlap(segment1, segment2) {\n return (\n (\n se...
[ "0.80662113", "0.7990633", "0.7636323", "0.7483671", "0.74678844", "0.74678844", "0.7467572", "0.74339706", "0.7420032", "0.7400611", "0.7397597", "0.71979684", "0.7189475", "0.7088217", "0.7069992", "0.6994911", "0.6973008", "0.6948697", "0.69230247", "0.69230247", "0.690000...
0.8123759
0
from start and end of aligned sequence, return reference coordinates (currently always S288C)
getReferenceCoordinatesFromAlignedCoordinates (alignedStart, alignedEnd, isProtein) { var _attr = this.attributes; var _seqs = isProtein ? _attr.alignedProteinSequences : _attr.alignedDnaSequences; var referenceSequence = _.findWhere(_seqs, { name: _attr.referenceName }).sequence; var refDomain = referenceSeque...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function alignCoordinates(xss,alignTo){var alignToVals=_.values(alignTo),alignToMin=_.min(alignToVals),alignToMax=_.max(alignToVals);_.forEach([\"u\",\"d\"],function(vert){_.forEach([\"l\",\"r\"],function(horiz){var alignment=vert+horiz,xs=xss[alignment],delta;if(xs===alignTo)return;var xsVals=_.values(xs);delta=h...
[ "0.5937736", "0.5890219", "0.5787893", "0.57340616", "0.55674094", "0.55109346", "0.5503222", "0.5489265", "0.54662913", "0.54354", "0.5434452", "0.5409278", "0.53897554", "0.5378828", "0.5361867", "0.5330416", "0.53289104", "0.52833337", "0.5261894", "0.52590615", "0.5255644...
0.7364795
0
from raw variant data, produce segments as expected by multi_alignment_viewer
formatSegments (isProtein) { var variants = isProtein ? this.attributes.variantDataProtein : this.attributes.variantDataDna; var sequences = isProtein ? this.attributes.alignedProteinSequences : this.attributes.alignedDnaSequences; // make sure they're sorted by start variants = _.sortBy(variants, d => { ret...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sam2sv(samfile) {\n var sam = new SR(fs.createReadStream(samfile));\n\n sam.on('alignment', function(aln) {\n /**\n * get the original breakpoint which generated this clipped sequence\n **/\n var bp = BPInfo.parse(aln.name);\n\n var rev = aln.flags.reversed;\n var unmapped = aln...
[ "0.5987203", "0.5788677", "0.5491443", "0.53030837", "0.5205476", "0.5188011", "0.5137837", "0.513732", "0.5128321", "0.51190627", "0.506107", "0.5061051", "0.50336665", "0.50140744", "0.4959664", "0.49200237", "0.4914757", "0.4856907", "0.4856907", "0.48145384", "0.4783391",...
0.6967459
0
region Init/Reinit endregion region DOM/Angular events
function isPrintableHeaderNeeded() { var tempArr = _.filter(vm.question.controlList, function (control) { return customQuestionsSvc.getCustomQuestionAnswer(control, vm.subject).boolVal; }); return tempArr.length > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n setDomEvents();\n }", "function initEventListener() {\n $scope.$on(vm.controllerId + '.save', function (e, v) {\n console.log(vm.controllerId + '.save');\n save();\n });\n\n $scope.$on(vm.controllerId + '.edit', function...
[ "0.7277462", "0.6768505", "0.67626494", "0.67224544", "0.6645266", "0.65778136", "0.6534539", "0.6518162", "0.64756036", "0.6459709", "0.6459639", "0.64302903", "0.6429419", "0.6421393", "0.64084417", "0.63846767", "0.63824826", "0.6373268", "0.63667035", "0.6344528", "0.6339...
0.0
-1
endregion region Helpers/Angular Filters
function isRequiredErrorVisible() { if (vm.question.config && vm.question.config.rules.isRequired) { var result = true; vm.requiredValidation = true; _.each(vm.question.controlList, function (control) { if (customQuestionsSvc.getCustomQuest...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter() {\n\t}", "filter() {\n\t}", "get filters(){\n\t\treturn [controllerFilter];\n\t}", "filterParameter() {\n return this.resourceName + '_filter'\n }", "filterParameter() {\n return this.resourceName + '_filter'\n }", "function filter() {\n \n}", "get filter() { return this._fi...
[ "0.6704101", "0.6704101", "0.654166", "0.64358735", "0.64358735", "0.619583", "0.61952275", "0.60988855", "0.6008364", "0.5942438", "0.5942438", "0.58992386", "0.58889014", "0.58411115", "0.58244056", "0.5798536", "0.57784414", "0.57737726", "0.5766193", "0.5759401", "0.57203...
0.0
-1
var r; var g; var b;
function turnOn() { navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia; if (navigator.getUserMedia) { navigator.getUserMedia({video: true}, handleVideo, videoError); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fillConstants(){\n g.a = (27/64)*((g.R**2)*(g.Tc**2))/g.Pc\n g.b = (g.R*g.Tc)/(8*g.Pc);\n g.Vc = 0.359*(g.R*g.Tc)/g.Pc;\n}", "constructor(r, g, b, a) {\n if (a == null) a = 1;\n this.r = r;\n this.g = g;\n this.b = b;\n this.a = a;\n }", "function rgb(r, g, b) {\n \n}", "fu...
[ "0.6814319", "0.6674402", "0.6130325", "0.6054435", "0.60432404", "0.60312414", "0.60014135", "0.59713465", "0.59520483", "0.5936918", "0.59249496", "0.59161067", "0.5914432", "0.5888479", "0.5864623", "0.5849782", "0.58487916", "0.5847923", "0.58437145", "0.5820513", "0.5806...
0.0
-1
Creates the counter for the localStorage for saving
function createSave() { if(typeof(Storage) !== "undefined") { var dataSet = new RGBConstructor(rgb); //alert("dataSet = " + JSON.stringify(dataSet)); if(localStorage.saveCount == undefined) { localStorage.setItem('saveCount', 0) } var saveSize...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addCount(){\n\tlocalStorage.setItem(\"count\", getCount()+1);\n}", "function add_count() {\n var count = parseInt(localStorage[\"count\"]);\n count++;\n localStorage[\"count\"] = count;\n}", "function createId() {\n var id = $localStorage.booksId;\n $localStorage...
[ "0.78113794", "0.77281475", "0.7157771", "0.7111017", "0.7075987", "0.6923743", "0.684095", "0.6834001", "0.6818187", "0.6798348", "0.6788726", "0.6781665", "0.6745123", "0.6687739", "0.6670746", "0.665656", "0.6630898", "0.6616478", "0.6595599", "0.6595599", "0.65795386", ...
0.6339555
34
Saves the the object in the localStorage
function commitToStorage(objectCount, newObject) { var item = getFileName(); localStorage.setItem('saveCount', objectCount); localStorage.setItem(item, JSON.stringify(newObject)); alert("Saved " + item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "function save(key, obj) {\n localStorage.setItem(key, JSON.stringify(obj));\n}", "function store(obj) {\n var json = JSON.stringify(obj);\n return local...
[ "0.8302367", "0.8242346", "0.82111007", "0.813226", "0.798929", "0.79853743", "0.7910986", "0.79094386", "0.78801215", "0.7842334", "0.781302", "0.7804475", "0.77510935", "0.7745646", "0.7727643", "0.7705066", "0.7675263", "0.7619929", "0.76153475", "0.76104873", "0.7590561",...
0.0
-1
Function generates an object for rgb parameters
function RGBConstructor(rgb) { this.rgb = rgb; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeColor(r, g, b) {\n\tconst color = {}; //This function creates an object which takes keys from function arguments\n\tcolor.r = r;\n\tcolor.g = g;\n\tcolor.b = b;\n\tcolor.rgb = function() { //Then we add function to THIS object\n\t\tconst { r, g, b } = this;\n\t\treturn `rg...
[ "0.69373655", "0.6887223", "0.6887223", "0.68749285", "0.6842997", "0.6842997", "0.6842997", "0.6842997", "0.68419635", "0.68419635", "0.68419635", "0.68180066", "0.6773979", "0.6691854", "0.6618957", "0.66113675", "0.65827954", "0.65577596", "0.6557354", "0.6538944", "0.6468...
0.6953037
0
Get function for the fileName
function getFileName() { var fileName = document.getElementById('txt_save').value; return fileName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_functionNameResolve(filePath)\n\t\t{\n\t\t\tlet fileData = S.utils.readFileSync(filePath);\n\t\t\treturn fileData.name;\n\t\t}", "function FileName() { }", "function getFN(str) {\r\n\t\treturn str.split('\\\\').pop().split('/').pop()\r\n\t}", "function functionName(fn)\r\n\t\t\t{\r\n\t\t\t\tvar name = /\\W*...
[ "0.73270345", "0.70121443", "0.65924764", "0.65773755", "0.6522549", "0.62804884", "0.6264694", "0.6167304", "0.614599", "0.60581255", "0.60452676", "0.6044233", "0.59813195", "0.5965843", "0.5948726", "0.5918841", "0.59166026", "0.59166026", "0.59166026", "0.5891488", "0.588...
0.0
-1
Function reloads the saved RGB values into the chart
function savedTable(save) { // Write the result to table. var pixelTable = document.getElementById('pixel_table'); var row; //alert("in savedTable " + JSON.stringify(save.rgb)); row = pixelTable.deleteRow(-1); row = pixelTable.insertRow(-1); row.insertCell(-1).innerHTML = getFileName(); row.insertCell(-1)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSave(hsva, instance) {\n var hex = hsva.toHEX().toString();\n State.Colors.image = hex;\n manipulateImage();\n }", "function saveAndPostRGBs() {\n saveSliderValues(slrRedBody,slrGreenBody,slrBlueBody,slrRedHeader,slrGreenHeader,slrBlueHeader);\n postRGB(statusRGBBody,statusRGBHeader);\n...
[ "0.6726233", "0.6613414", "0.65119314", "0.632375", "0.6198962", "0.6078711", "0.60567796", "0.5977039", "0.5955045", "0.59103996", "0.589885", "0.5883396", "0.58459383", "0.5832006", "0.5802667", "0.5793108", "0.5781827", "0.57405", "0.5720602", "0.5716863", "0.5702367", "...
0.5543999
33
Writes the RGB values to the chart
function writeTable(rgb) { // Write the result to table. var pixelTable = document.getElementById('pixel_table'); var row; row = pixelTable.deleteRow(-1); row = pixelTable.insertRow(-1); row.insertCell(-1).innerHTML = getFileName(); row.insertCell(-1).innerHTML = rgb.r; row.insertCell(-1).innerHTML = rgb....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveAndPostRGBs() {\n saveSliderValues(slrRedBody,slrGreenBody,slrBlueBody,slrRedHeader,slrGreenHeader,slrBlueHeader);\n postRGB(statusRGBBody,statusRGBHeader);\n }", "function showOutput() {\n const color = rgbArr.join('')\n outputRGBPanel.textContent = `#${color}`\n rangeContainer.style.back...
[ "0.6277094", "0.62681925", "0.62614083", "0.59014684", "0.5876104", "0.5840369", "0.5835715", "0.5825547", "0.58133554", "0.57710534", "0.57465637", "0.5666415", "0.56655866", "0.5597261", "0.5594521", "0.5566493", "0.55648583", "0.55489165", "0.55480295", "0.5529685", "0.542...
0.61153424
3
1: Erro de servidor 1: Sucesso
function getCartoes(id){ if(cartoes == 0){ var req = { method: 'GET', url: servidor+'/webservice/cards/particular', params:{ user: id } } $http(req). then(function (sucesso) { console.log(sucesso); cartoes = sucesso; r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function connexionFailed(data) {\n console.log(data);\n}", "function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien se ah conectado\");\n respuesta.writeHead(200,{\"Content-Type\":\"text/html\"}); // le digo que le enviare informacion de tipo html al servidor\n respuesta.write(\"<h1>E...
[ "0.63506734", "0.61873186", "0.6058337", "0.6058337", "0.6023575", "0.5927766", "0.58880514", "0.5869359", "0.5866897", "0.5866897", "0.58224285", "0.58097774", "0.58063996", "0.57746845", "0.57599187", "0.57552797", "0.5743125", "0.57392937", "0.57148695", "0.57117224", "0.5...
0.0
-1
Creates html to add into the template and passes the store state to the client app Denpending on the type of req notify redux that req state
function renderHtml(res, newStore, renderProps) { let markup; if (renderProps) { markup = renderToString(<Provider store={newStore}><RouterContext { ...renderProps} /></Provider>); } return res.render(Constants.INDEX_FILE, { html: markup, state: JSON.stringify(newStore.getState()) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n let bigString;\n console.log('render fxn ran')\n if (store.view === 'landing') {\n bigString = generateTitleTemplate(store);\n\n }\n else if (store.view === 'question') {\n bigString = generateQuestionTemplate(store);\n\n }\n else if (store.view === 'feedback') {\n bigString =...
[ "0.6435103", "0.63760495", "0.6345436", "0.61951226", "0.61410433", "0.5979083", "0.5810329", "0.579705", "0.57465583", "0.5732886", "0.5646603", "0.559582", "0.55494845", "0.5549255", "0.5524665", "0.55053306", "0.5490186", "0.54898745", "0.5463988", "0.5444774", "0.5437675"...
0.5766893
8
The constructor is a method used to create objects. This constructor for example will create objects of type Person.
constructor() { // Data / properites / state // The difference between the properties and regular // variables is that the properies are encapsulated variables. this.name = null; this.age = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Constructor() {}", "function Constructor() {}", "function Constructor() {}", "constructur() {}", "function Ctor() {}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "function Ctor() {\r\n }", ...
[ "0.80458677", "0.80458677", "0.80458677", "0.7447099", "0.7415256", "0.736716", "0.736716", "0.736716", "0.736716", "0.736716", "0.736716", "0.736716", "0.73663324", "0.73524606", "0.7340916", "0.7311507", "0.7239292", "0.7239292", "0.7239292", "0.7239292", "0.7239292", "0....
0.0
-1
Methods: The difference between methods and functions is that the functions are defined in the global scope. But methods are encapsulated functions.
greet() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExportedMethods () {\n}", "function ExportedMethods () {\n}", "method(){}", "function fn() {\n this.name = 'fn';\n this.method = function () {\n return 'I am a normal function!';\n }\n}", "myBestMethod(){\n\n }", "function TestMethods() {}", "static method(){}", "function fun() { }"...
[ "0.6855535", "0.6855535", "0.6828872", "0.6781982", "0.67536163", "0.6727315", "0.66389173", "0.66038436", "0.65857667", "0.65739423", "0.6570947", "0.6557917", "0.6557917", "0.6557917", "0.6557441", "0.65529144", "0.65529144", "0.65529144", "0.65529144", "0.65529144", "0.655...
0.0
-1
====================== Generic game functions ======================
function setDifficulty(val) { if (difficulty !== val) { difficulty = val; score = 0; lives = 2; resetGame(); // these functions are defined in HighScore.js removeHighScoreTable(); defineCollection(); renderHighScoreTable(collection); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGame () {}", "function ClassicGame(){}", "launchGame() {\n this.grid.generate()\n this.grid.generateWalls()\n this.grid.generateWeapon('axe', this.grid.giveRandomCase())\n this.grid.generateWeapon('pickaxe', this.grid.giveRandomCase())\n this.grid.generateWeapo...
[ "0.7117278", "0.6892261", "0.6742801", "0.6687508", "0.6634363", "0.6630817", "0.66250986", "0.6617433", "0.66131693", "0.65716296", "0.65437293", "0.65256935", "0.6517818", "0.6503486", "0.6499432", "0.64866537", "0.64569193", "0.6442794", "0.6437264", "0.64258826", "0.64235...
0.0
-1
this function stops the player spamming reset until they get favourable wires yet still allows to retain their score pressing reset after picking the correct wire
function resetScore() { if (lethal) { score = 0; lives = 2; } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reset() {\n\tupdateWins();\n\tremaining();\n\tanswer();\n}", "function reset(){\n roy.health = roy.maxHealth;\n incineroar.health = incineroar.maxHealth;\n ridley.health = ridley.maxHealth;\n cloud.health = cloud.maxHealth;\n cloud.limit = 0;\n $(\"#cpu-health\").html();\n ...
[ "0.68715715", "0.6769505", "0.66951156", "0.65966547", "0.65632546", "0.65628946", "0.65409523", "0.6531265", "0.6482162", "0.6462076", "0.6457372", "0.6445878", "0.6442588", "0.640723", "0.64014095", "0.63924235", "0.6391997", "0.639139", "0.63902754", "0.6388187", "0.637777...
0.0
-1
================================ Background Colour functionality ================================
function pickedBackgroundColor() { document.querySelector("body").style.backgroundColor = pickedColor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bgcolor(fn){\n\t// body.style.background = \"rgb(\"+r+\",\"+g+\",\"+b+\")\"; //Single color\n\tbody.style.background=fn();\n\tif(r===225 && g<225){\n\t\tif(b!=0)b--;\n\t\telse g++;\n\t}else if(g===225 && b<225)\t{\n\t\tif(r!=0)r--;\n\t\telse b++;\n\t}else if(b===225 && r<225){\n\t\tif(g!=0)g--;\n\t\telse ...
[ "0.7347613", "0.73214805", "0.7317034", "0.7293984", "0.72240704", "0.71767277", "0.71481675", "0.71449536", "0.71245396", "0.7123499", "0.71229637", "0.7114902", "0.70799464", "0.70624906", "0.7032358", "0.70295614", "0.7017988", "0.70175886", "0.6996358", "0.69764864", "0.6...
0.0
-1
======================== LCD screen interactivity ========================
function displayContentUpdate() { display.textContent = displayContent.join(''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayToScreen() {\n\n\n\t}", "_onUpdateDisplay() {}", "function screenOn() {\n clearTimeout(screenOff);\n lcd.bgColor(\"ffffff\");\n screenOff = setTimeout(function() {\n lcd.bgColor(\"000000\");\n }, 10000);\n }", "onActiveScreenChanged_() {}", "function Screen() {...
[ "0.699578", "0.6942073", "0.6738211", "0.6452166", "0.64355946", "0.63307405", "0.6314407", "0.6282255", "0.62195116", "0.62128365", "0.62075245", "0.6205533", "0.6180004", "0.6165773", "0.6138639", "0.61291784", "0.6110044", "0.60821986", "0.60744315", "0.60742044", "0.60508...
0.0
-1
bomb keypad button interactivity
function enableButtons() { for (let i = 0; i < 10; i++) { bombNumber[i].addEventListener("click", numButton); }; clearDisplay.addEventListener("click", resetDisplay); backspace.addEventListener("click", backspaceButton); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function crosswordKeyHandler(event) {\n pencilToggle(event, '.Icon-pencil--1cTxu', 'Icon-pencil-active--1lOAS');\n pauseToggle(event, '.Timer-button--Jg5pv>button', '.buttons-modalButton--1REsR', '.buttons-modalButton--1REsR');\n }", "function btnPress(e) {\n // If space bar is pressed.\n if (...
[ "0.6800392", "0.6768763", "0.6644195", "0.6476426", "0.6463309", "0.6416351", "0.64146787", "0.6383515", "0.6373206", "0.63682127", "0.636564", "0.63535166", "0.6326022", "0.63160634", "0.6306353", "0.629481", "0.6275831", "0.6271521", "0.6270723", "0.62542236", "0.62497866",...
0.0
-1
=========== game states ===========
function defusal() { LED.classList.remove("LED-idle", "LED-incorrect") LEDarmed.classList.remove("armed"); LED.classList.add("LED-correct"); //disables countdown and detonation timedFunctionClear(); display.textContent = "defused"; //make reset button flash document.querySelector("#reset...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function GameState() {\n}", "function getStates(game) {\n\n}", "stateManager() {\n switch (this.state) {\n case 0:\n this.findPlayer(this.scene.player);\n break;\n\n case 1:\n this.attackPlayer(this.scene.player);\n break;\n }\n }", "addGameStates() {\n thi...
[ "0.78888685", "0.77223074", "0.7532794", "0.74331146", "0.73965085", "0.7391749", "0.73202634", "0.72626424", "0.7217636", "0.70809716", "0.7072044", "0.70281625", "0.701702", "0.6967058", "0.6956152", "0.695075", "0.69309986", "0.69309986", "0.6921838", "0.69034994", "0.6903...
0.0
-1
============================================== scaling bomb size based on client width/height ==============================================
function bombScale() { if (isMobileViewport) { return; } const bomb = document.querySelector(".bomb"); let docHeight = document.querySelector("*").clientHeight; let docWidth = document.querySelector("*").clientWidth; let wrapperHeight = document.querySelector("#wrapper").clientHeight * ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setScale() {\n document.body.style.width = `${this.w}px`;\n document.body.style.height = `${this.h}px`;\n // style used on html els and not for canvas, since canvas css doesn't determine actual available coords -- actual obj size defaults to 300x150 n if only css is changed it just scales from that ...
[ "0.6842961", "0.6826168", "0.6759841", "0.6728491", "0.66878694", "0.66182774", "0.66021323", "0.65808153", "0.6567436", "0.65549296", "0.6550597", "0.65030754", "0.6493792", "0.6481689", "0.64362293", "0.6426497", "0.6392458", "0.6391679", "0.6368091", "0.63652205", "0.63630...
0.78353524
0
create an array of any type ============================================ Functions
function absoluteValue(x) { var y; if (x < 0 || x >= 0) { this.y = Math.abs(x); } return y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertArray( array, type, forceClone ) {\n\n\tif ( ! array || // let 'undefined' and 'null' pass\n\t\t! forceClone && array.constructor === type ) return array;\n\n\tif ( typeof type.BYTES_PER_ELEMENT === 'number' ) {\n\n\t\treturn new type( array ); // create typed array\n\n\t}\n\n\treturn Array.prototy...
[ "0.704778", "0.70410204", "0.70064336", "0.6782506", "0.6782506", "0.67356926", "0.659253", "0.6568366", "0.65589505", "0.65589505", "0.65589505", "0.65571", "0.65560037", "0.6555272", "0.6524636", "0.65096134", "0.65089923", "0.65083075", "0.6507379", "0.6487609", "0.6481422...
0.0
-1
set (or if val is null, __delete__)
function __set_cookie(name, val, raw_mode) { if (name == "pw") { alert('cookie_field.js: pw should not be saved as a cookie') return } if (always_raw[name]) { raw_mode = true } if (!raw_mode) { name = userID + "." + name } //console.log('__set_c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOrUnset(obj, key, value) {\n\t\t\t\tif (value === undefined)\n\t\t\t\t\tdelete obj[key];\n\t\t\t\telse\n\t\t\t\t\tobj[key] = value;\n\t\t\t}", "function setOrUnset(obj, key, value) {\n if (value === undefined)\n delete obj[key];\n else\n obj[key] = value;\n }", "function setOrUnset...
[ "0.68356675", "0.680266", "0.680266", "0.67777896", "0.67766505", "0.65567887", "0.65567887", "0.65567887", "0.65567887", "0.6526122", "0.6513739", "0.63096166", "0.62181246", "0.61233723", "0.6116332", "0.6112353", "0.60406715", "0.5949046", "0.5867012", "0.5777007", "0.5768...
0.0
-1
save name/val as cookie
function __retrieve_from_cookie(field_name) { var cookie_val = __get_cookie(field_name) var val = null if (cookie_val) { val = cookie_val } else { var default_val = __get_cookie(field_name + DEFAULT_SUFFIX) if (default_val) { val = default_val ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveCookie(c_name,value){\n\tdocument.cookie = c_name+'='+value;\n}", "function setValue(name, value) {\n if (value) {\n var expirationDate = new Date();\n expirationDate.setMonth(expirationDate.getMonth() + 12);\n document.cookie = name + '=' + encodeURIComponent(value) + '; domain=.ultipro.c...
[ "0.79123104", "0.7863324", "0.7788864", "0.7742724", "0.7676634", "0.7534981", "0.7521322", "0.7446535", "0.7430818", "0.73821527", "0.732105", "0.73078763", "0.7303646", "0.7275149", "0.7269982", "0.7239529", "0.722634", "0.72049856", "0.7190326", "0.7177378", "0.7171852", ...
0.0
-1
get escaped value for an exerciseretrieving URL from: 1.) field 2.) cookie (if it exists) 3.) default If the source is a field, remember that value in a cookie.
function __retrieve1_for_url(field_name) { var val var fld = get_fld(field_name) if (fld) { val = forms_get_fld_val(fld) __set_cookie(field_name, val) } else { val = __retrieve_from_cookie(field_name) } if (val) { return field_name + "=" + escape(v...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __retrieve_from_cookie(field_name)\n{\n var cookie_val = __get_cookie(field_name)\n var val = null\n if (cookie_val)\n {\n val = cookie_val\n }\n else\n {\n var default_val = __get_cookie(field_name + DEFAULT_SUFFIX)\n if (default_val)\n {\n val ...
[ "0.6240799", "0.562057", "0.5543041", "0.5493699", "0.5383121", "0.5372914", "0.534565", "0.53027076", "0.52908975", "0.52600956", "0.5255581", "0.52336663", "0.5212541", "0.5191439", "0.5190787", "0.518039", "0.51797175", "0.51725805", "0.51619923", "0.5157572", "0.5148359",...
0.6870378
0
________________________________________________________ Breaks gameObject() into 2 arrays home & away
function arrayOfTeams() { return Object.values(gameObject()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createObjects() {\n\t\tgame.level_frame = 0;\n\t\tlet l = window.app.level.split( '|' ).map( ( a ) => {\n\t\t\treturn a.split( ',' );\n\t\t} );\n\t\tterrain.set();\n\t\tlet obj = {\n\t\t\tw: ( arr ) => { //wait\n\t\t\t\tlet s = new GameControl( pInt( arr[ 1 ] ) );\n\t\t\t\ts.loc = arr[ 5 ];\n\t\t\t\ts.wait = arr[ ...
[ "0.601048", "0.5972606", "0.58998275", "0.58913404", "0.58532226", "0.58386165", "0.5773142", "0.57514757", "0.57045346", "0.5700425", "0.5651333", "0.5644206", "0.561477", "0.5590228", "0.5571915", "0.5554505", "0.5550372", "0.5535546", "0.5517335", "0.55167806", "0.55117595...
0.526049
68
Makes a copy of the gameObject() at the player level
function players() { return Object.assign({}, homeTeam().players, awayTeam().players); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "copy(){\r\n let copy = new Enemy(this.name, true);\r\n return super.copy(copy);\r\n }", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "clone() {\n var clone = new Player(true);\n clone.brain = this.brain.clone();\n clone.fitness = this.fitness...
[ "0.6880153", "0.6692025", "0.6692025", "0.6692025", "0.6692025", "0.6356673", "0.6225029", "0.6225029", "0.6225029", "0.6225029", "0.62195957", "0.62122035", "0.6168831", "0.6095447", "0.60606945", "0.60187", "0.60160065", "0.5990446", "0.5957732", "0.5942513", "0.5918744", ...
0.0
-1
Returns the number of points a player has scored
function numPointsScored(playerInput) { for (const playerName in players()) { if (playerName === playerInput) { let points = players()[playerName].points; return `${playerInput} scored ${points} points.`; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "points() {\n var total = 0\n // NOTE a for..in loop does not guarantee property ordering. This is fine for points()\n for(var name in this.games) {\n total += this.games[name].points()\n }\n return total\n }", "getNumberOfVotedCards() {\n var total = 0\n ...
[ "0.7144184", "0.7003646", "0.699993", "0.69876564", "0.6981984", "0.6965923", "0.6906569", "0.67992926", "0.6783016", "0.6687833", "0.66497916", "0.6645326", "0.66393876", "0.6610605", "0.6562722", "0.65565634", "0.6550393", "0.65279007", "0.65233475", "0.6510832", "0.6486932...
0.79632455
0
Returns a string stating the player's shoe size
function shoeSize(playerInput) { const shoe = players()[playerInput].shoe; return `${playerInput} has size ${shoe} shoes.` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shelfSize()\n {\n return this.values.size * this.values.quantity;\n }", "static get PLAYER_SIZE() {\n return 10;\n }", "getDrawSize () {\r\n return Math.ceil(this.calories / this.gestation * 10)\r\n }", "function sizeCost(){\n if(this.size=s){\n return \"7.99\";\n }\n if(this.size=...
[ "0.6741626", "0.6631362", "0.6314216", "0.6310961", "0.62722", "0.6206745", "0.6192933", "0.6184269", "0.60899436", "0.60379916", "0.60345817", "0.6025872", "0.59556496", "0.5943416", "0.59293544", "0.5911216", "0.5892356", "0.5859451", "0.58330756", "0.58298117", "0.57988733...
0.8721674
0
Returns a team's colors
function teamColors(team) { if (team === homeTeam().teamName) { return homeTeam().colors; } else if (team === awayTeam().teamName) { return awayTeam().colors; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTeamColors(team){\n //Set default color palette\n var returnColors = ['#013369','#D50A0A','#008000','#FFA500','#FFFF00'];\n var teamColors,nflColors;\n\n //Had to replace #FFFFFF with #DCDCDC to make white visible\n if(team) {\n teamColors = {\n 'ARI': ['#97233F', '#FFB...
[ "0.8368425", "0.78921735", "0.7821611", "0.7708702", "0.6998364", "0.69117904", "0.65215933", "0.6450126", "0.64260733", "0.64182734", "0.6402767", "0.6369281", "0.63602424", "0.63569385", "0.633857", "0.63079655", "0.6288124", "0.62877405", "0.62077165", "0.6205735", "0.6199...
0.8476377
0
Returns a list of team names
function teamNames() { return [homeTeam().teamName, awayTeam().teamName]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTeamList() {\n return Team.find({}, \"team_name\").exec();\n}", "getTeams () {\n let result = `TEAMS ${View.NEWLINE()}`\n result += `Premiership Division ${View.NEWLINE()}`\n\n for (let aTeam of this.allPDTeams) {\n result += aTeam + `${View.NEWLINE()}`\n }\n result += `Champions...
[ "0.82568204", "0.7384594", "0.7294814", "0.70426226", "0.688136", "0.683964", "0.6776307", "0.6677421", "0.66732824", "0.65669423", "0.6564693", "0.6443753", "0.64214283", "0.63775384", "0.63585854", "0.63285977", "0.63034236", "0.6286994", "0.624469", "0.62021536", "0.618098...
0.8550278
0
Returns an array of player numbers depending on which team is inputted
function playerNumbers(teamName) { let arrayOfNumbers = []; if (teamName === homeTeam().teamName) { let teamPlayers = homeTeam().players; let teamValues = Object.values(teamPlayers); for (let player of teamValues) { arrayOfNumbers.push(player.number); } } else if (teamName === awayTeam().tea...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlayers(player, team) {\n console.log(player + \": \" + team);\n}", "function getTeamPlayers(match, teamId) {\n // since the participantIdentities portion doesn't track teamId\n // we determine it by looking at participants to find out the teamId\n // NOTE: it looks like participants is always ...
[ "0.69608676", "0.6762298", "0.67574656", "0.6505717", "0.650196", "0.6500435", "0.6500435", "0.6465336", "0.6298418", "0.62699115", "0.62552553", "0.62461245", "0.62461245", "0.6224262", "0.61670554", "0.6162367", "0.60942507", "0.60909003", "0.6047112", "0.604082", "0.603128...
0.80949354
0
Returns an object with the inputted player's stats
function playerStats(playerInput) { for (const playerName in players()) { if (playerName === playerInput) { return players()[playerName]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlayerStats(pobj) {\n var stats = {kills : pobj['stats']['kills'],\n deaths : pobj['stats']['deaths'],\n assists : pobj['stats']['assists'],\n minions : pobj['stats']['totalMinionsKilled'] + pobj['stats']['neutralMinionsKilled']}; \n stats['kda'] = (stats['de...
[ "0.72927684", "0.7165658", "0.6958433", "0.69053894", "0.68771285", "0.6772758", "0.6687818", "0.665749", "0.65954524", "0.65820694", "0.6578913", "0.6549825", "0.65158534", "0.6496207", "0.6491558", "0.64836776", "0.64787793", "0.64165026", "0.6387239", "0.6374117", "0.63716...
0.74524224
0
Returns the number of rebounds associated with the player that has the largest shoe size
function bigShoeRebounds() { let arr = Object.values(players()); let shoeBox = [] for (let val of arr) { let shoe = val.shoe; shoeBox.push(shoe); } let biggestShoe = Math.max(...shoeBox); for (let val of arr) { let shoe = val.shoe; if (shoe === biggestShoe) { return val.rebounds; }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shoeSize(playerInput) {\n const shoe = players()[playerInput].shoe;\n return `${playerInput} has size ${shoe} shoes.`\n}", "function getMaxScore()\r\n{\r\n\tmaxScore = 0;\r\n\tfor(var i = 0; i < worms.length; i++)\r\n\t{\r\n\t\tif(players[i] && worms[i].score > maxScore)\r\n\t\t{\r\n\t\t\tmaxScore = w...
[ "0.6331264", "0.6133299", "0.60174876", "0.6011141", "0.5864384", "0.5863355", "0.5810833", "0.57772857", "0.57098705", "0.56539786", "0.56117076", "0.55762315", "0.55522496", "0.55393684", "0.5498117", "0.548547", "0.544859", "0.54471004", "0.5443521", "0.5438094", "0.543570...
0.81472224
0
Which player has the most points?
function mostPointsScored() { let arr = Object.values(players()); let pointsArr = []; for (let val of arr) { let points = val.points; pointsArr.push(points); } let mostPoints = Math.max(...pointsArr); for (let players of playersArray()) { console.log(players[0]) if (players[1].points === mos...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function WhoDrankMost() {\n\t\tvar players = Session.get(\"players\");\n\t\tvar mostDrinks = 0;\n\n\t\t$.each(players, function(i, player){\n\t\t\tif (player.numDrinks > mostDrinks) {\n\t\t\t\tmostDrinks = player.numDrinks;\n\t\t\t\tSession.set(\"playerMostDrinks\", player.playerName);\n\t\t\t\tSession.set(\"playe...
[ "0.67672276", "0.66209215", "0.6515005", "0.65126544", "0.6475943", "0.6406427", "0.63727725", "0.6281341", "0.6275112", "0.6269298", "0.62640387", "0.6262158", "0.623915", "0.617556", "0.617406", "0.6166632", "0.61509585", "0.61495215", "0.6140836", "0.612687", "0.60954773",...
0.82574964
0
Required: Override this to use Pts' player `animate` callback See guide:
animate(time, ftime) { if (!this.form || !this.space) return; this.form.point(this.space.pointer, 20, 'circle'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\n if (PLAY_STATUS != PlayStatus.PLAYING) {\n return;\n } else {\n stepAndAnimate()\n }\n}", "function startAnimation() {\n\n\tmain_play_image.src = \"images/pause.png\";\n\tif (playerElem.duration)\n\t\tseekAnimation = setInterval(moveSeekOverTime, (playerElem.duration * 1000) / sli...
[ "0.66266334", "0.6611268", "0.6545718", "0.6527483", "0.6463353", "0.64513165", "0.6385803", "0.6380321", "0.6331497", "0.62863743", "0.6260216", "0.6203271", "0.619865", "0.6170362", "0.61630416", "0.61544055", "0.6153819", "0.6140962", "0.61309886", "0.61306715", "0.6114891...
0.0
-1
Optional: Override this to use Pts' player `start` callback
start(bound, space) { console.log('Start callback'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onStart() {\n starttime = Date.now();\n const notice = song.lengthSeconds * 1000 * 0.95;\n song.timeout = setTimeout(() => {\n const {name: commandName} = require('./next');\n const command = message.client.commands.get(commandName);\n command.execute(message, {serverQueue, args: [...
[ "0.73850536", "0.7329588", "0.73243004", "0.7153945", "0.7127388", "0.71073264", "0.70660573", "0.7039059", "0.7033513", "0.6978501", "0.69448733", "0.69440234", "0.687844", "0.6873006", "0.6839535", "0.68138623", "0.6807217", "0.6802767", "0.6771623", "0.6768045", "0.6750366...
0.0
-1
Optional: Override this to use Pts' player `resize` callback
resize(size, evt) { console.log('Resize callback'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resize() {\r\n newPlayer.width = window.innerWidth;\r\n newPlayer.height = window.innerHeight;\r\n canvas.width = window.innerWidth;\r\n canvas.height = window.innerHeight - 180;\r\n newPlayer.movePlayer();\r\n}", "addResizeHandler () {\r\n window.addEventListener('resize', () =>\r\n ...
[ "0.7642551", "0.7619223", "0.7419886", "0.7393451", "0.73191535", "0.72006667", "0.71668625", "0.7156529", "0.71187466", "0.71184224", "0.7105098", "0.7085698", "0.7054345", "0.70004946", "0.69889814", "0.69843924", "0.6982009", "0.6962113", "0.6951296", "0.6938793", "0.69254...
0.68152887
29